query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
list
label_sequence
list
Imprecise assert
ganeti/ganeti/test/py/cmdlib/cluster_unittest.py
[ { "content": " @patchPathutils(\"cluster\")\n def testNonMasterFails(self, pathutils):\n self._InitPathutils(pathutils)\n\n # create a few non-master, online nodes\n num_nodes = 3\n for _ in range(num_nodes):\n self.cfg.AddNewNode()\n nodes = self.cfg.GetAllNodesInfo()\n\n # pick one node as the failing one\n master_uuid = self.cfg.GetMasterNode()\n self._failed_node = [node_uuid for node_uuid in nodes\n if node_uuid != master_uuid][1]\n self.rpc.call_node_crypto_tokens = self._partiallyFailingRpc\n\n op = opcodes.OpClusterRenewCrypto(node_certificates=True)\n self.ExecOpCode(op)\n\n self._AssertCertFiles(pathutils)\n\n # Check if we have the correct digests in the configuration\n cluster = self.cfg.GetClusterInfo()\n # There should be one digest missing.\n self.assertEqual(num_nodes, len(cluster.candidate_certs))\n nodes = self.cfg.GetAllNodesInfo()\n for (node_uuid, _) in nodes.items():\n if node_uuid == self._failed_node:\n self.assertTrue(node_uuid not in cluster.candidate_certs)\n else:\n self.assertTrue(node_uuid in cluster.candidate_certs)", "metadata": "root.TestLUClusterRenewCrypto.testNonMasterFails", "header": "['class', 'TestLUClusterRenewCrypto', '(', 'CmdlibTestCase', ')', ':', '___EOS___']", "index": 2433 }, { "content": " @patchPathutils(\"cluster\")\n def testOfflineNodes(self, pathutils):\n self._InitPathutils(pathutils)\n\n # create a few non-master, online nodes\n num_nodes = 3\n offline_index = 1\n for i in range(num_nodes):\n # Pick one node to be offline.\n self.cfg.AddNewNode(offline=(i==offline_index))\n self.rpc.call_node_crypto_tokens = self._CompletelySuccessfulRpc\n\n op = opcodes.OpClusterRenewCrypto(node_certificates=True)\n self.ExecOpCode(op)\n\n self._AssertCertFiles(pathutils)\n\n # Check if we have the correct digests in the configuration\n cluster = self.cfg.GetClusterInfo()\n # There should be one digest missing.\n self.assertEqual(num_nodes, len(cluster.candidate_certs))\n nodes = self.cfg.GetAllNodesInfo()\n for (node_uuid, node_info) in nodes.items():\n if node_info.offline == True:\n self.assertTrue(node_uuid not in cluster.candidate_certs)\n else:\n self.assertTrue(node_uuid in cluster.candidate_certs)", "metadata": "root.TestLUClusterRenewCrypto.testOfflineNodes", "header": "['class', 'TestLUClusterRenewCrypto', '(', 'CmdlibTestCase', ')', ':', '___EOS___']", "index": 2465 }, { "content": " @patchPathutils(\"cluster\")\n def testNonMasterRetriesFail(self, pathutils):\n cluster = self._NonMasterRetries(pathutils, 5)\n\n # Only the master digest should be in the cert list\n self.assertEqual(1, len(cluster.candidate_certs.values()))\n self.assertTrue(self._master_uuid in cluster.candidate_certs)", "metadata": "root.TestLUClusterRenewCrypto.testNonMasterRetriesFail", "header": "['class', 'TestLUClusterRenewCrypto', '(', 'CmdlibTestCase', ')', ':', '___EOS___']", "index": 2536 } ]
[ { "span": "self.assertTrue(node_uuid not in cluster.candidate_certs)", "start_line": 2461, "start_column": 8, "end_line": 2461, "end_column": 65 }, { "span": "self.assertTrue(node_uuid in cluster.candidate_certs)", "start_line": 2463, "start_column": 8, "end_line": 2463, "end_column": 61 }, { "span": "self.assertTrue(node_uuid not in cluster.candidate_certs)", "start_line": 2489, "start_column": 8, "end_line": 2489, "end_column": 65 }, { "span": "self.assertTrue(node_uuid in cluster.candidate_certs)", "start_line": 2491, "start_column": 8, "end_line": 2491, "end_column": 61 }, { "span": "self.assertTrue(self._master_uuid in cluster.candidate_certs)", "start_line": 2542, "start_column": 4, "end_line": 2542, "end_column": 65 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "LUC", "luster", "Ren", "ew", "Crypto_", "(_", "Cmd", "lib", "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_", "@_", "patch", "Path", "utils_", "(_", "\"", "cluster", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test", "Non", "Master", "Fail", "s_", "(_", "self_", ",_", "path", "utils_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Ini", "t", "Path", "utils_", "(_", "path", "utils_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "few", " ", "non", "-", "master", ",", " ", "onli", "ne", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "nodes_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u_", "in_", "range_", "(_", "num", "\\u", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cfg_", "._", "Add", "New", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nodes_", "=_", "self_", "._", "cfg_", "._", "Get", "All", "Node", "s", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pick", " ", "one", " ", "node", " ", "as", " ", "the", " ", "faili", "ng", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "uuid_", "=_", "self_", "._", "cfg_", "._", "Get", "Master", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "fail", "ed", "\\u", "node_", "=_", "[_", "node", "\\u", "uuid_", "for_", "node", "\\u", "uuid_", "in_", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "node", "\\u", "uuid_", "!=_", "master", "\\u", "uuid_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rpc_", "._", "call", "\\u", "node", "\\u", "crypto", "\\u", "tokens_", "=_", "self_", "._", "\\u", "partial", "ly", "Fail", "ing", "Rp", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "op_", "=_", "opcodes_", "._", "Op", "Cluster", "Ren", "ew", "Crypto_", "(_", "node", "\\u", "certificates", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Exe", "c", "Op", "Code_", "(_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "Assert", "Cert", "Files_", "(_", "path", "utils_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "we", " ", "have", " ", "the", " ", "correct", " ", "digest", "s", " ", "in", " ", "the", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "cluster_", "=_", "self_", "._", "cfg_", "._", "Get", "Cluster", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "There", " ", "shou", "ld", " ", "be", " ", "one", " ", "digest", " ", "missi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "num", "\\u", "nodes_", ",_", "len_", "(_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "=_", "self_", "._", "cfg_", "._", "Get", "All", "Node", "s", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "node", "\\u", "uuid_", ",_", "\\u_", ")_", "in_", "nodes_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "node", "\\u", "uuid_", "==_", "self_", "._", "\\u", "fail", "ed", "\\u", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "node", "\\u", "uuid_", "not_", "in_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "node", "\\u", "uuid_", "in_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "LUC", "luster", "Ren", "ew", "Crypto_", "(_", "Cmd", "lib", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch", "Path", "utils_", "(_", "\"", "cluster", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test", "Off", "line", "Nodes_", "(_", "self_", ",_", "path", "utils_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "Ini", "t", "Path", "utils_", "(_", "path", "utils_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "few", " ", "non", "-", "master", ",", " ", "onli", "ne", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "nodes_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offline", "\\u", "index_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "\\u", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pick", " ", "one", " ", "node", " ", "to", " ", "be", " ", "offline", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cfg_", "._", "Add", "New", "Node_", "(_", "offline_", "=_", "(_", "i_", "==_", "offline", "\\u", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rpc_", "._", "call", "\\u", "node", "\\u", "crypto", "\\u", "tokens_", "=_", "self_", "._", "\\u", "Complete", "ly", "Success", "ful", "Rp", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "op_", "=_", "opcodes_", "._", "Op", "Cluster", "Ren", "ew", "Crypto_", "(_", "node", "\\u", "certificates", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Exe", "c", "Op", "Code_", "(_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "Assert", "Cert", "Files_", "(_", "path", "utils_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "we", " ", "have", " ", "the", " ", "correct", " ", "digest", "s", " ", "in", " ", "the", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "cluster_", "=_", "self_", "._", "cfg_", "._", "Get", "Cluster", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "There", " ", "shou", "ld", " ", "be", " ", "one", " ", "digest", " ", "missi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "num", "\\u", "nodes_", ",_", "len_", "(_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "=_", "self_", "._", "cfg_", "._", "Get", "All", "Node", "s", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "node", "\\u", "uuid_", ",_", "node", "\\u", "info_", ")_", "in_", "nodes_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "node", "\\u", "info_", "._", "offline_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "node", "\\u", "uuid_", "not_", "in_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "node", "\\u", "uuid_", "in_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "LUC", "luster", "Ren", "ew", "Crypto_", "(_", "Cmd", "lib", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch", "Path", "utils_", "(_", "\"", "cluster", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test", "Non", "Master", "Retri", "es", "Fail_", "(_", "self_", ",_", "path", "utils_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "self_", "._", "\\u", "Non", "Master", "Retri", "es_", "(_", "path", "utils_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "the", " ", "master", " ", "digest", " ", "shou", "ld", " ", "be", " ", "in", " ", "the", " ", "cert", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "len_", "(_", "cluster_", "._", "candidate", "\\u", "certs_", "._", "values_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "\\u", "master", "\\u", "uuid_", "in_", "cluster_", "._", "candidate", "\\u", "certs_", ")_", "\\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,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'var * {x: int, y: int, z: int}')\n\n assert raises(Exception, lambda: t[t['x'] > 0][t.sort()[t['y' > 0]]])", "metadata": "root.test_improper_selection", "header": "['module', '___EOS___']", "index": 680 } ]
[ { "span": "'y' > 0]", "start_line": 683, "start_column": 62, "end_line": 683, "end_column": 69 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "constants_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "impro", "per", "\\u", "selection_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Symbol_", "(_", "'", "t", "'_", ",_", "'", "var", " ", "*", " ", "{", "x", ":", " ", "int", ",", " ", "y", ":", " ", "int", ",", " ", "z", ":", " ", "int", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "raises_", "(_", "Exception_", ",_", "lambda_", ":_", "t_", "[_", "t_", "[_", "'", "x", "'_", "]_", ">_", "0_", "]_", "[_", "t_", "._", "sort_", "(_", ")_", "[_", "t_", "[_", "'", "y", "'_", ">_", "0_", "]_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 ]
Redundant assignment
cloudify-cosmo/packman/packman/fpm.py
[ { "content": " def __init__(self, name, input_type, output_type, source):\n self.name = name\n output_type = 'tar' if output_type.startswith('tar') \\\n else output_type\n input_type = input_type\n self.source = source\n self.command = sh.fpm.bake(n=name, s=input_type, t=output_type)", "metadata": "root.Handler.__init__", "header": "['class', 'Handler', '(', 'utils', '.', 'Handler', ')', ':', '___EOS___']", "index": 11 } ]
[ { "span": "input_type = input_type", "start_line": 15, "start_column": 8, "end_line": 15, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "assignment_", "[SEP]_", "class_", "Handler_", "(_", "utils_", "._", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "input", "\\u", "type_", ",_", "output", "\\u", "type_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "type_", "=_", "'", "tar", "'_", "if_", "output", "\\u", "type_", "._", "startswith_", "(_", "'", "tar", "'_", ")_", "else_", "output", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "type_", "=_", "input", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "=_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command_", "=_", "sh_", "._", "fp", "m_", "._", "bake", "_", "(_", "n_", "=_", "name_", ",_", "s_", "=_", "input", "\\u", "type_", ",_", "t_", "=_", "output", "\\u", "type_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
apache/climate/ocw/data_source/local.py
[ { "content": "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied. See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nimport calendar\nfrom datetime import timedelta ,datetime\nfrom time import strptime\nfrom glob import glob\nimport re\nimport string\nimport os\n\nfrom ocw.dataset import Dataset\nimport ocw.utils as utils\n\nimport netCDF4\nimport h5py\nimport numpy\nimport numpy.ma as ma\n\nLAT_NAMES = ['y', 'rlat', 'rlats', 'lat', 'lats', 'latitude', 'latitudes']\nLON_NAMES = ['x', 'rlon', 'rlons', 'lon', 'lons', 'longitude', 'longitudes']\nTIME_NAMES = ['time', 'times', 'date', 'dates', 'julian']\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _get_netcdf_variable_name(valid_var_names, netcdf, netcdf_var):\n ''' Determine if one of a set of variable names are in a NetCDF Dataset. \n\n Looks for an occurrence of a valid_var_name in the NetCDF variable data.\n This is useful for automatically determining the names of the lat, lon,\n and time variable names inside of a dataset object.\n\n :param valid_var_names: The possible variable names to search for in \n the netCDF object.\n :type valid_var_names: List of Strings\n :param netcdf: The netCDF Dataset object in which to check for\n valid_var_names.\n :type netcdf: netcdf4.Dataset\n :param netcdf_var: The relevant variable name to search over in the \n netcdf object. This is used to narrow down the search for valid\n variable names by first checking the desired variable's dimension\n values for one or more of the valid variable names.\n\n :returns: The variable from valid_var_names that it locates in \n the netCDF object.\n\n :raises ValueError: When unable to locate a single matching variable\n name in the NetCDF Dataset from the supplied list of valid variable\n names.\n '''\n\n # Check for valid variable names in netCDF variable dimensions\n dimensions = netcdf.variables[netcdf_var].dimensions\n dims_lower = [dim.encode().lower() for dim in dimensions]\n\n intersect = set(valid_var_names).intersection(dims_lower)\n\n if len(intersect) == 1:\n # Retrieve the name of the dimension where we found the matching\n # variable name\n index = dims_lower.index(intersect.pop())\n dimension_name = dimensions[index].encode()\n\n # Locate all of the variables that share the dimension that we matched\n # earlier. If the dimension's name matches then that variable is\n # potentially what we want to return to the user.\n possible_vars = []\n for var in netcdf.variables.keys():\n var_dimensions = netcdf.variables[var].dimensions\n\n # Skip any dimensions are > 1D\n if len(var_dimensions) != 1:\n continue\n\n if var_dimensions[0].encode() == dimension_name:\n possible_vars.append(var)\n\n # If there are multiple variables with matching dimension names then we\n # aren't able to determining the correct variable name using the\n # variable dimensions. We need to try a different approach. Otherwise,\n # we're done!\n if len(possible_vars) == 1:\n return possible_vars[0]\n\n # Check for valid variable names in netCDF variable names\n variables = netcdf.variables.keys()\n vars_lower = [var.encode().lower() for var in variables]\n\n intersect = set(valid_var_names).intersection(vars_lower)\n\n if len(intersect) == 1:\n index = vars_lower.index(intersect.pop())\n return variables[index]\n\n # If we couldn't locate a single matching valid variable then we're unable\n # to automatically determine the variable names for the user.\n error = (\n \"Unable to locate a single matching variable name from the \"\n \"supplied list of valid variable names. \"\n )\n raise ValueError(error)", "metadata": "root._get_netcdf_variable_name", "header": "['module', '___EOS___']", "index": 38 }, { "content": "def load_WRF_2d_files(file_path=None,\n filename_pattern=None,\n filelist=None,\n variable_name='T2',\n name=''):\n ''' Load multiple WRF (or nuWRF) original output files containing 2D \\\n fields such as precipitation and surface variables into a Dataset. \\\n The dataset can be spatially subset.\n\n :param file_path: Directory to the NetCDF file to load.\n :type file_path: :mod:`string`\n\n :param filename_pattern: Path to the NetCDF file to load.\n :type filename_pattern: :mod:`string`\n\n :param filelist: A list of filenames\n :type filelist: :mod:`string`\n\n :param variable_name: The variable name to load from the NetCDF file.\n :type variable_name: :mod:`string`\n\n :param name: (Optional) A name for the loaded dataset.\n :type name: :mod:`string`\n\n :returns: An OCW Dataset object with the requested variable's data from \\\n the NetCDF file.\n :rtype: :class:`dataset.Dataset`\n\n :raises ValueError:\n '''\n\n if not filelist:\n WRF_files = []\n for pattern in filename_pattern:\n WRF_files.extend(glob(file_path + pattern))\n else:\n WRF_files = [line.rstrip('\\n') for line in open(filelist)]\n\n WRF_files.sort()\n\n file_object_first = netCDF4.Dataset(WRF_files[0])\n lats = file_object_first.variables['XLAT'][0,:]\n lons = file_object_first.variables['XLONG'][0,:]\n\n times = []\n nfile = len(WRF_files)\n for ifile, file in enumerate(WRF_files):\n print 'Reading file '+str(ifile+1)+'/'+str(nfile), file\n file_object = netCDF4.Dataset(file)\n time_struct_parsed = strptime(file[-19:],\"%Y-%m-%d_%H:%M:%S\") \n for ihour in numpy.arange(24):\n times.append(datetime(*time_struct_parsed[:6]) + timedelta(hours=ihour))\n values0= file_object.variables[variable_name][:]\n if ifile == 0:\n values = values0 \n variable_unit = file_object.variables[variable_name].units\n else:\n values = numpy.concatenate((values, values0)) \n file_object.close()\n times = numpy.array(times)\n return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name)", "metadata": "root.load_WRF_2d_files", "header": "['module', '___EOS___']", "index": 115 }, { "content": "def load_file(file_path,\n variable_name,\n variable_unit = None,\n elevation_index=0,\n name='',\n lat_name=None,\n lon_name=None,\n time_name=None):\n ''' Load a NetCDF file into a Dataset.\n\n :param file_path: Path to the NetCDF file to load.\n :type file_path: :mod:`string`\n\n :param variable_name: The variable name to load from the NetCDF file.\n :type variable_name: :mod:`string`\n\n :param variable_unit: (Optional) The variable unit to load from the NetCDF file.\n :type variable_unit: :mod:`string`\n\n :param elevation_index: (Optional) The elevation index for which data should\n be returned. Climate data is often times 4 dimensional data. Some\n datasets will have readins at different height/elevation levels. OCW\n expects 3D data so a single layer needs to be stripped out when loading.\n By default, the first elevation layer is used. If desired you may\n specify the elevation value to use.\n :type elevation_index: :class:`int`\n\n :param name: (Optional) A name for the loaded dataset.\n :type name: :mod:`string`\n\n :param lat_name: (Optional) The latitude variable name to extract from the\n dataset.\n :type lat_name: :mod:`string`\n\n :param lon_name: (Optional) The longitude variable name to extract from the\n dataset.\n :type lon_name: :mod:`string`\n\n :param time_name: (Optional) The time variable name to extract from the\n dataset.\n :type time_name: :mod:`string`\n\n :returns: An OCW Dataset object with the requested variable's data from\n the NetCDF file.\n :rtype: :class:`dataset.Dataset`\n\n :raises ValueError: When the specified file path cannot be loaded by ndfCDF4\n or when the lat/lon/time variable name cannot be determined\n automatically.\n '''\n\n try:\n netcdf = netCDF4.Dataset(file_path, mode='r')\n except RuntimeError:\n err = \"Dataset filepath is invalid. Please ensure it is correct.\"\n raise ValueError(err)\n except:\n err = (\n \"The given file cannot be loaded. Please ensure that it is a valid \"\n \"NetCDF file. If problems persist, report them to the project's \"\n \"mailing list.\"\n )\n raise ValueError(err)\n\n if not lat_name:\n lat_name = _get_netcdf_variable_name(LAT_NAMES, netcdf, variable_name)\n if not lon_name:\n lon_name = _get_netcdf_variable_name(LON_NAMES, netcdf, variable_name)\n if not time_name:\n time_name = _get_netcdf_variable_name(TIME_NAMES, netcdf, variable_name)\n\n lats = netcdf.variables[lat_name][:] \n lons = netcdf.variables[lon_name][:]\n time_raw_values = netcdf.variables[time_name][:]\n times = utils.decode_time_values(netcdf, time_name)\n times = numpy.array(times)\n values = ma.array(netcdf.variables[variable_name][:])\n variable_unit = netcdf.variables[variable_name].units\n\n # If the values are 4D then we need to strip out the elevation index\n if len(values.shape) == 4:\n # Determine the set of possible elevation dimension names excluding\n # the list of names that are used for the lat, lon, and time values.\n dims = netcdf.variables[variable_name].dimensions\n dimension_names = [dim_name.encode() for dim_name in dims]\n lat_lon_time_var_names = [lat_name, lon_name, time_name]\n\n elev_names = set(dimension_names) - set(lat_lon_time_var_names)\n\n # Grab the index value for the elevation values\n #level_index = dimension_names.index(elev_names.pop())\n level_index = 1\n\n # Strip out the elevation values so we're left with a 3D array.\n if level_index == 0:\n values = values [elevation_index,:,:,:]\n elif level_index == 1:\n values = values [:,elevation_index,:,:]\n elif level_index == 2:\n values = values [:,:,elevation_index,:]\n else:\n values = values [:,:,:,elevation_index]\n\n origin = {\n 'source': 'local',\n 'path': file_path,\n 'lat_name': lat_name,\n 'lon_name': lon_name,\n 'time_name': time_name\n }\n if elevation_index != 0: origin['elevation_index'] = elevation_index\n\n return Dataset(lats, lons, times, values, variable=variable_name,\n units=variable_unit, name=name, origin=origin)", "metadata": "root.load_file", "header": "['module', '___EOS___']", "index": 177 }, { "content": "def load_multiple_files(file_path,\n variable_name,\n dataset_name='model',\n variable_unit=None,\n lat_name=None,\n lon_name=None,\n time_name=None):\n ''' load multiple netcdf files with common filename pattern and return an array of OCW datasets\n\n :param file_path: directory name and common file name patterns where the NetCDF files to load are stored.\n :type file_path: :mod:`string`\n :param dataset_name: a name of dataset when reading a single file \n :type dataset_name: :mod:'string'\n :param variable_name: The variable name to load from the NetCDF file.\n :type variable_name: :mod:`string`\n :param variable_unit: (Optional) The variable unit to load from the NetCDF file.\n :type variable_unit: :mod:`string`\n :param elevation_index: (Optional) The elevation index for which data should\n be returned. Climate data is often times 4 dimensional data. Some\n datasets will have readins at different height/elevation levels. OCW\n expects 3D data so a single layer needs to be stripped out when loading.\n By default, the first elevation layer is used. If desired you may\n specify the elevation value to use.\n :param lat_name: (Optional) The latitude variable name to extract from the\n dataset.\n :type lat_name: :mod:`string`\n :param lon_name: (Optional) The longitude variable name to extract from the\n dataset.\n :type lon_name: :mod:`string`\n :param time_name: (Optional) The time variable name to extract from the\n dataset.\n :type time_name: :mod:`string`\n :returns: An array of OCW Dataset objects, an array of dataset names\n :rtype: :class:`list`\n '''\n\n data_filenames = []\n data_filenames.extend(glob(file_path))\n data_filenames.sort()\n\n # number of files\n ndata = len(data_filenames)\n if ndata == 1:\n data_name = [dataset_name]\n else:\n data_name = []\n data_filenames_reversed = []\n for element in data_filenames:\n data_filenames_reversed.append(element[::-1])\n prefix = os.path.commonprefix(data_filenames)\n postfix = os.path.commonprefix(data_filenames_reversed)[::-1]\n for element in data_filenames:\n data_name.append(element.replace(prefix,'').replace(postfix,''))\n\n datasets = []\n for ifile,filename in enumerate(data_filenames):\n datasets.append(load_file(filename, variable_name, variable_unit, name=data_name[ifile],\n lat_name=lat_name, lon_name=lon_name, time_name=time_name))\n \n return datasets, data_name", "metadata": "root.load_multiple_files", "header": "['module', '___EOS___']", "index": 292 }, { "content": "def load_WRF_2d_files_RAIN(file_path=None,\n filename_pattern=None,\n filelist=None,\n name=''):\n ''' Load multiple WRF (or nuWRF) original output files containing 2D \\\n fields such as precipitation and surface variables into a Dataset. \\\n The dataset can be spatially subset.\n\n :param file_path: Directory to the NetCDF file to load.\n :type file_path: :mod:`string`\n\n :param filename_pattern: Path to the NetCDF file to load.\n :type filename_pattern: :mod:`string`\n\n :param name: (Optional) A name for the loaded dataset.\n :type name: :mod:`string`\n\n :returns: An OCW Dataset object with the requested variable's data from \\\n the NetCDF file.\n :rtype: :class:`dataset.Dataset`\n\n :raises ValueError:\n '''\n\n if not filelist:\n WRF_files = []\n for pattern in filename_pattern:\n WRF_files.extend(glob(file_path + pattern))\n WRF_files.sort()\n else:\n WRF_files=[line.rstrip('\\n') for line in open(filelist)]\n\n file_object_first = netCDF4.Dataset(WRF_files[0])\n lats = file_object_first.variables['XLAT'][0,:]\n lons = file_object_first.variables['XLONG'][0,:]\n\n times = []\n nfile = len(WRF_files)\n for ifile, file in enumerate(WRF_files):\n print 'Reading file '+str(ifile+1)+'/'+str(nfile), file\n file_object = netCDF4.Dataset(file)\n time_struct_parsed = strptime(file[-19:],\"%Y-%m-%d_%H:%M:%S\")\n for ihour in range(24):\n times.append(datetime(*time_struct_parsed[:6]) + timedelta(hours=ihour))\n if ifile == 0:\n values0= file_object.variables['RAINC'][:]+file_object.variables['RAINNC'][:]\n else:\n values0= numpy.concatenate((values0, file_object.variables['RAINC'][:]+file_object.variables['RAINNC'][:]))\n file_object.close()\n times= numpy.array(times)\n years = numpy.array([d.year for d in times])\n ncycle = numpy.unique(years).size\n print 'ncycle=',ncycle\n nt, ny, nx = values0.shape\n values = numpy.zeros([nt-ncycle*24, ny, nx])\n times2 = []\n nt2 = nt/ncycle\n # remove the first day in each year\n nt3 = nt2-24\n t_index = 0\n for icycle in numpy.arange(ncycle):\n for it in numpy.arange(nt3)+24:\n values[t_index,:] = values0[icycle*nt2+it,:]-values0[icycle*nt2+it-1,:]\n times2.append(times[icycle*nt2+it])\n t_index = t_index +1\n variable_name = 'PREC'\n variable_unit= 'mm/hr'\n times2 = numpy.array(times2)\n return Dataset(lats, lons, times2, values, variable_name, units=variable_unit, name=name)", "metadata": "root.load_WRF_2d_files_RAIN", "header": "['module', '___EOS___']", "index": 353 }, { "content": "def load_dataset_from_multiple_netcdf_files(variable_name, \n lat_name=None, lon_name=None, time_name=None,\n name='', file_list=None, file_path=None, filename_pattern=None,\n mask_file=None, mask_variable=None, mask_value=0):\n ''' Load multiple netCDF files from the same source \\\n (an observation or a model) into a Dataset. \\\n The dataset can be spatially subset.\n\n :param filelist: A text file including a list of filenames\n :type filelist: :mod:`string`\n\n :param variable_name: The variable name to load from the NetCDF file.\n :type variable_name: :mod:`string`\n\n :param lat_name: (Optional) The latitude variable name to extract from the \\\n dataset.\n :type lat_name: :mod:`string`\n\n :param lon_name: (Optional) The longitude variable name to extract from the \\\n dataset.\n :type lon_name: :mod:`string`\n\n :param time_name: (Optional) The time variable name to extract from the \\\n dataset.\n :type time_name: :mod:`string`\n\n :param name: (Optional) A name for the loaded dataset.\n :type name: :mod:`string`\n\n :param file_path: Directory to the NetCDF file to load.\n :type file_path: :mod:`string`\n\n :param filename_pattern: Path to the NetCDF file to load.\n :type filename_pattern: :mod:`string`\n\n :param mask_file: A netcdf file with two-dimensional mask indices\n :type filelist: :mod:`string`\n\n :param mask_variable: The variable name to load from the mask_file.\n :type variable_name: :mod:`string`\n\n :param mask_value: an index for spatial subsetting a dataset \n :type mask_value: :class:`int`\n\n :returns: An OCW Dataset object with the requested variable's data from \\\n the NetCDF file.\n :rtype: :class:`dataset.Dataset`\n\n :raises ValueError:\n '''\n nc_files = []\n if not file_list:\n for pattern in filename_pattern:\n nc_files.extend(glob(file_path + pattern))\n else:\n nc_files = [line.rstrip('\\n') for line in open(file_list)]\n\n nc_files.sort()\n\n dataset0 = load_file(nc_files[0], variable_name=variable_name, lat_name=lat_name, lon_name=lon_name, time_name=time_name)\n if dataset0.lons.ndim == 1 and dataset0.lats.ndim ==1:\n lons, lats = numpy.meshgrid(dataset0.lons, dataset0.lats)\n elif dataset0.lons.ndim == 2 and dataset0.lats.ndim ==2:\n lons = dataset0.lons\n lats = dataset0.lats\n\n if mask_file: \n mask_dataset = load_file(mask_file, mask_variable)\n y_index, x_index = numpy.where(mask_dataset.values == mask_value)\n\n times = []\n nfile = len(nc_files)\n for ifile, file in enumerate(nc_files):\n print 'NC file '+str(ifile+1)+'/'+str(nfile), file\n file_object0= load_file(file, variable_name)\n values0= file_object0.values\n times.extend(file_object0.times)\n if mask_file:\n values0 = values0[:,y_index, x_index]\n if ifile == 0:\n data_values = values0\n else:\n data_values= numpy.concatenate((data_values, values0))\n times = numpy.array(times)\n return Dataset(lats, lons, times, data_values, variable_name, name=name)", "metadata": "root.load_dataset_from_multiple_netcdf_files", "header": "['module', '___EOS___']", "index": 423 }, { "content": "def load_NLDAS_forcingA_files(file_path=None,\n filename_pattern=None,\n filelist=None,\n variable_name='APCPsfc_110_SFC_acc1h',\n name=''):\n ''' Load multiple NLDAS2 forcingAWRF files containing 2D fields such \\\n as precipitation and surface variables into a Dataset. The dataset \\\n can be spatially subset.\n\n :param file_path: Directory to the NetCDF file to load.\n :type file_path: :mod:`string`\n\n :param filename_pattern: Path to the NetCDF file to load.\n :type filename_pattern: :mod:`string`\n\n :param filelist: A list of filenames\n :type filelist: :mod:`string`\n\n :param variable_name: The variable name to load from the NetCDF file.\n :type variable_name: :mod:`string`\n\n :param name: (Optional) A name for the loaded dataset.\n :type name: :mod:`string`\n\n :returns: An OCW Dataset object with the requested variable's data from \\\n the NetCDF file.\n :rtype: :class:`dataset.Dataset`\n\n :raises ValueError:\n '''\n \n if not filelist:\n NLDAS_files = []\n for pattern in filename_pattern:\n NLDAS_files.extend(glob(file_path + pattern))\n else:\n NLDAS_files = [line.rstrip('\\n') for line in open(filelist)]\n\n NLDAS_files.sort()\n\n file_object_first = netCDF4.Dataset(NLDAS_files[0])\n lats = file_object_first.variables['lat_110'][:]\n lons = file_object_first.variables['lon_110'][:]\n lons, lats = numpy.meshgrid(lons, lats)\n\n times = []\n nfile = len(NLDAS_files)\n for ifile, file in enumerate(NLDAS_files):\n print 'Reading file '+str(ifile+1)+'/'+str(nfile), file\n file_object = netCDF4.Dataset(file)\n time_struct_parsed = strptime(file[-20:-7],\"%Y%m%d.%H%M\")\n times.append(datetime(*time_struct_parsed[:6]))\n \n values0 = file_object.variables[variable_name][:]\n values0 = numpy.expand_dims(values0, axis=0)\n if ifile == 0:\n values = values0\n variable_unit = file_object.variables[variable_name].units\n else:\n values = numpy.concatenate((values, values0))\n file_object.close()\n times = numpy.array(times)\n return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name)", "metadata": "root.load_NLDAS_forcingA_files", "header": "['module', '___EOS___']", "index": 509 }, { "content": "def load_GPM_IMERG_files(file_path=None,\n filename_pattern=None,\n filelist=None,\n variable_name='precipitationCal',\n name='GPM_IMERG'):\n ''' Load multiple GPM Level 3 IMEGE files containing calibrated \\\n precipitation and generate an OCW Dataset obejct.\n\n :param file_path: Directory to the HDF files to load.\n :type file_path: :mod:`string`\n\n :param filename_pattern: Path to the HDF files to load.\n :type filename_pattern: :mod:`string`\n\n :param filelist: A list of filenames\n :type filelist: :mod:`string`\n\n :param variable_name: The variable name to load from the HDF file.\n :type variable_name: :mod:`string`\n\n :param name: (Optional) A name for the loaded dataset.\n :type name: :mod:`string`\n\n :returns: An OCW Dataset object with the requested variable's data from \\\n the HDF file.\n :rtype: :class:`dataset.Dataset`\n\n :raises ValueError:\n '''\n\n if not filelist:\n GPM_files = []\n for pattern in filename_pattern:\n GPM_files.extend(glob(file_path + pattern))\n else:\n GPM_files = [line.rstrip('\\n') for line in open(filelist)]\n\n GPM_files.sort()\n\n file_object_first = h5py.File(GPM_files[0])\n lats = file_object_first['Grid']['lat'][:]\n lons = file_object_first['Grid']['lon'][:]\n\n lons, lats = numpy.meshgrid(lons, lats)\n\n variable_unit = \"mm/hr\"\n\n times = []\n nfile = len(GPM_files)\n for ifile, file in enumerate(GPM_files):\n print 'Reading file '+str(ifile+1)+'/'+str(nfile), file\n file_object = h5py.File(file)\n time_struct_parsed = strptime(file[-39:-23],\"%Y%m%d-S%H%M%S\")\n times.append(datetime(*time_struct_parsed[:6]))\n values0= numpy.transpose(ma.masked_less(file_object['Grid'][variable_name][:], 0.))\n values0= numpy.expand_dims(values0, axis=0)\n if ifile == 0:\n values = values0\n else:\n values = numpy.concatenate((values, values0))\n file_object.close()\n times = numpy.array(times)\n return Dataset(lats, lons, times, values, variable_name, units=variable_unit, name=name) ", "metadata": "root.load_GPM_IMERG_files", "header": "['module', '___EOS___']", "index": 573 } ]
[ { "span": "import calendar", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 15 }, { "span": "import re", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 9 }, { "span": "import string", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "License", "d", " ", "to", " ", "the", " ", "Ap", "ache", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", " ", "(", "AS", "F", ")", " ", "under", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "more", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "with", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", ".", " ", " ", "The", " ", "AS", "F", " ", "license", "s", " ", "this", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "you", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "ance_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "the", " ", "License", ".", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "software", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ations_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "calendar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "timedelta_", ",_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "strptime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glob_", "import_", "glob_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "oc", "w_", "._", "dataset_", "import_", "Dataset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "oc", "w_", "._", "utils_", "as_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "net", "CD", "F4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "h5py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "._", "ma_", "as_", "ma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LAT", "\\u", "NAMES_", "=_", "[_", "'", "y", "'_", ",_", "'", "rla", "t", "'_", ",_", "'", "rla", "ts", "'_", ",_", "'", "lat", "'_", ",_", "'", "lat", "s", "'_", ",_", "'", "latitude", "'_", ",_", "'", "latitude", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LON", "\\u", "NAMES_", "=_", "[_", "'", "x", "'_", ",_", "'", "rlo", "n", "'_", ",_", "'", "rlo", "ns", "'_", ",_", "'", "lon", "'_", ",_", "'", "lon", "s", "'_", ",_", "'", "longitude", "'_", ",_", "'", "longitude", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIME", "\\u", "NAMES_", "=_", "[_", "'", "time", "'_", ",_", "'", "times", "'_", ",_", "'", "date", "'_", ",_", "'", "dates", "'_", ",_", "'", "julia", "n", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "netcdf", "\\u", "variab", "le", "\\u", "name_", "(_", "valid", "\\u", "var", "\\u", "names_", ",_", "netcdf", "_", ",_", "netcdf", "\\u", "var_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Det", "erm", "ine", " ", "if", " ", "one", " ", "of", " ", "a", " ", "set", " ", "of", " ", "variab", "le", " ", "names", " ", "are", " ", "in", " ", "a", " ", "Net", "CD", "F", " ", "Datas", "et", ".", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Look", "s", " ", "for", " ", "an", " ", "occurrence", " ", "of", " ", "a", " ", "valid", "\\u", "var", "\\u", "name", " ", "in", " ", "the", " ", "Net", "CD", "F", " ", "variab", "le", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "usef", "ul", " ", "for", " ", "automati", "call", "y", " ", "determini", "ng", " ", "the", " ", "names", " ", "of", " ", "the", " ", "lat", ",", " ", "lon", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "time", " ", "variab", "le", " ", "names", " ", "insi", "de", " ", "of", " ", "a", " ", "dataset", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "valid", "\\u", "var", "\\u", "names", ":", " ", "The", " ", "possib", "le", " ", "variab", "le", " ", "names", " ", "to", " ", "search", " ", "for", " ", "in", " ", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "net", "CD", "F", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "valid", "\\u", "var", "\\u", "names", ":", " ", "List", " ", "of", " ", "String", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "netcdf", ":", " ", "The", " ", "net", "CD", "F", " ", "Datas", "et", " ", "object", " ", "in", " ", "whi", "ch", " ", "to", " ", "check", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "valid", "\\u", "var", "\\u", "names", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "netcdf", ":", " ", "netcdf", "4", ".", "Datas", "et", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "netcdf", "\\u", "var", ":", " ", "The", " ", "rele", "van", "t", " ", "variab", "le", " ", "name", " ", "to", " ", "search", " ", "over", " ", "in", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "netcdf", " ", "object", ".", " ", "Thi", "s", " ", "is", " ", "used", " ", "to", " ", "narrow", " ", "down", " ", "the", " ", "search", " ", "for", " ", "valid", "\\", "10", ";", " ", " ", " ", " ", "variab", "le", " ", "names", " ", "by", " ", "first", " ", "checking", " ", "the", " ", "desi", "red", " ", "variab", "le", "'", "s", " ", "dimension", "\\", "10", ";", " ", " ", " ", " ", "values", " ", "for", " ", "one", " ", "or", " ", "more", " ", "of", " ", "the", " ", "valid", " ", "variab", "le", " ", "names", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "variab", "le", " ", "from", " ", "valid", "\\u", "var", "\\u", "names", " ", "tha", "t", " ", "it", " ", "locat", "es", " ", "in", " ", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "net", "CD", "F", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", " ", "Whe", "n", " ", "una", "ble", " ", "to", " ", "locat", "e", " ", "a", " ", "single", " ", "matchi", "ng", " ", "variab", "le", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "in", " ", "the", " ", "Net", "CD", "F", " ", "Datas", "et", " ", "from", " ", "the", " ", "supplie", "d", " ", "list", " ", "of", " ", "valid", " ", "variab", "le", "\\", "10", ";", " ", " ", " ", " ", "names", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "valid", " ", "variab", "le", " ", "names", " ", "in", " ", "net", "CD", "F", " ", "variab", "le", " ", "dimensions_", "\\u\\u\\uNL\\u\\u\\u_", "dimensions_", "=_", "netcdf", "_", "._", "variables_", "[_", "netcdf", "\\u", "var_", "]_", "._", "dimensions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dims", "\\u", "lower_", "=_", "[_", "dim_", "._", "encode_", "(_", ")_", "._", "lower_", "(_", ")_", "for_", "dim_", "in_", "dimensions_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "intersect_", "=_", "set_", "(_", "valid", "\\u", "var", "\\u", "names_", ")_", "._", "intersection_", "(_", "dims", "\\u", "lower_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "intersect_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Retrieve", " ", "the", " ", "name", " ", "of", " ", "the", " ", "dimension", " ", "where", " ", "we", " ", "found", " ", "the", " ", "matching_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "le", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "dims", "\\u", "lower_", "._", "index_", "(_", "intersect_", "._", "pop_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dimension", "\\u", "name_", "=_", "dimensions_", "[_", "index_", "]_", "._", "encode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Locat", "e", " ", "all", " ", "of", " ", "the", " ", "variab", "les", " ", "tha", "t", " ", "share", " ", "the", " ", "dimension", " ", "tha", "t", " ", "we", " ", "matched_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ear", "lie", "r", ".", " ", "If", " ", "the", " ", "dimension", "'", "s", " ", "name", " ", "matche", "s", " ", "then", " ", "tha", "t", " ", "variab", "le", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "potenti", "ally", " ", "what", " ", "we", " ", "want", " ", "to", " ", "return", " ", "to", " ", "the", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "possib", "le", "\\u", "vars_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "var_", "in_", "netcdf", "_", "._", "variables_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var", "\\u", "dimensions_", "=_", "netcdf", "_", "._", "variables_", "[_", "var_", "]_", "._", "dimensions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ski", "p", " ", "any", " ", "dimension", "s", " ", "are", " ", ">", " ", "1", "D_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "var", "\\u", "dimensions_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "var", "\\u", "dimensions_", "[_", "0_", "]_", "._", "encode_", "(_", ")_", "==_", "dimension", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "possib", "le", "\\u", "vars_", "._", "append_", "(_", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "there", " ", "are", " ", "multiple", " ", "variab", "les", " ", "with", " ", "matchi", "ng", " ", "dimension", " ", "names", " ", "then", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", "n", "'", "t", " ", "able", " ", "to", " ", "determini", "ng", " ", "the", " ", "correct", " ", "variab", "le", " ", "name", " ", "usi", "ng", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "le", " ", "dimension", "s", ".", " ", "We", " ", "need", " ", "to", " ", "try", " ", "a", " ", "different", " ", "appro", "ach", ".", " ", "Ot", "her", "wis", "e", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", "'", "re", " ", "don", "e", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "possib", "le", "\\u", "vars_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "possib", "le", "\\u", "vars_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "valid", " ", "variab", "le", " ", "names", " ", "in", " ", "net", "CD", "F", " ", "variab", "le", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "variables_", "=_", "netcdf", "_", "._", "variables_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars", "\\u", "lower_", "=_", "[_", "var_", "._", "encode_", "(_", ")_", "._", "lower_", "(_", ")_", "for_", "var_", "in_", "variables_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "intersect_", "=_", "set_", "(_", "valid", "\\u", "var", "\\u", "names_", ")_", "._", "intersection_", "(_", "vars", "\\u", "lower_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "intersect_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "vars", "\\u", "lower_", "._", "index_", "(_", "intersect_", "._", "pop_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "variables_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "coul", "dn", "'", "t", " ", "locat", "e", " ", "a", " ", "single", " ", "matchi", "ng", " ", "valid", " ", "variab", "le", " ", "then", " ", "we", "'", "re", " ", "una", "ble_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "automati", "call", "y", " ", "dete", "rmin", "e", " ", "the", " ", "variab", "le", " ", "names", " ", "for", " ", "the", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "error_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Una", "ble", " ", "to", " ", "locat", "e", " ", "a", " ", "single", " ", "matchi", "ng", " ", "variab", "le", " ", "name", " ", "from", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "supplie", "d", " ", "list", " ", "of", " ", "valid", " ", "variab", "le", " ", "names", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "error_", ")_", "\\u\\u\\uNEWLINE\\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", "WR", "F", "\\u", "2d", "\\u", "files_", "(_", "file", "\\u", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename", "\\u", "pattern_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filelist_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "name_", "=_", "'", "T2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Load", " ", "multiple", " ", "WR", "F", " ", "(", "or", " ", "nu", "WR", "F", ")", " ", "original", " ", "output", " ", "files", " ", "contain", "ing", " ", "2", "D", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "fields", " ", "suc", "h", " ", "as", " ", "precip", "itation", " ", "and", " ", "surf", "ace", " ", "variab", "les", " ", "int", "o", " ", "a", " ", "Datas", "et", ".", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "dataset", " ", "can", " ", "be", " ", "spat", "ial", "ly", " ", "subse", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "Director", "y", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filename", "\\u", "pattern", ":", " ", "Path", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filename", "\\u", "pattern", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filelist", ":", " ", "A", " ", "list", " ", "of", " ", "filename", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filelist", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "name", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "(", "Optio", "nal", ")", " ", "A", " ", "name", " ", "for", " ", "the", " ", "load", "ed", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "OC", "W", " ", "Datas", "et", " ", "object", " ", "with", " ", "the", " ", "request", "ed", " ", "variab", "le", "'", "s", " ", "data", " ", "from", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "dataset", ".", "Datas", "et", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "filelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WR", "F", "\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pattern_", "in_", "filename", "\\u", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WR", "F", "\\u", "files_", "._", "extend_", "(_", "glob_", "(_", "file", "\\u", "path_", "+_", "pattern_", ")_", ")_", "\\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 ", " _", "WR", "F", "\\u", "files_", "=_", "[_", "line_", "._", "rstrip_", "(_", "'\\\\", "n", "'_", ")_", "for_", "line_", "in_", "open_", "(_", "filelist_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "WR", "F", "\\u", "files_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "object\\u", "first_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "WR", "F", "\\u", "files_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lats_", "=_", "file", "\\u", "object\\u", "first_", "._", "variables_", "[_", "'", "XL", "AT", "'_", "]_", "[_", "0_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lons_", "=_", "file", "\\u", "object\\u", "first_", "._", "variables_", "[_", "'", "XL", "ONG", "'_", "]_", "[_", "0_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nfile", "_", "=_", "len_", "(_", "WR", "F", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ifile_", ",_", "file_", "in_", "enumerate_", "(_", "WR", "F", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Reading", " ", "file", " ", "'_", "+_", "str_", "(_", "ifile_", "+_", "1_", ")_", "+_", "'/'_", "+_", "str_", "(_", "nfile", "_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "object_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "struct", "\\u", "parsed_", "=_", "strptime_", "(_", "file_", "[_", "-_", "19_", ":_", "]_", ",_", "\"%", "Y", "-%", "m", "-%", "d\\u", "%", "H", ":", "%", "M", ":", "%", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ih", "our_", "in_", "numpy_", "._", "arange_", "(_", "24_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "times_", "._", "append_", "(_", "datetime_", "(_", "*_", "time", "\\u", "struct", "\\u", "parsed_", "[_", ":_", "6_", "]_", ")_", "+_", "timedelta_", "(_", "hours_", "=_", "ih", "our_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values", "0_", "=_", "file", "\\u", "object_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ifile_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "file", "\\u", "object_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "._", "units_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "numpy_", "._", "concatenate_", "(_", "(_", "values_", ",_", "values", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "object_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times_", "=_", "numpy_", "._", "array_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Dataset_", "(_", "lats_", ",_", "lons_", ",_", "times_", ",_", "values_", ",_", "variab", "le", "\\u", "name_", ",_", "units_", "=_", "variab", "le", "\\u", "unit_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "file_", "(_", "file", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "elevat", "ion", "\\u", "index_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lat", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lon", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time", "\\u", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Load", " ", "a", " ", "Net", "CD", "F", " ", "file", " ", "int", "o", " ", "a", " ", "Datas", "et", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "Path", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "name", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "unit", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "variab", "le", " ", "unit", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "unit", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "elevat", "ion", "\\u", "index", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "elevat", "ion", " ", "index", " ", "for", " ", "whi", "ch", " ", "data", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "return", "ed", ".", " ", "Clim", "ate", " ", "data", " ", "is", " ", "oft", "en", " ", "times", " ", "4", " ", "dimension", "al", " ", "data", ".", " ", "Some", "\\", "10", ";", " ", " ", " ", " ", "dataset", "s", " ", "will", " ", "have", " ", "readi", "ns", " ", "at", " ", "different", " ", "height", "/", "elevat", "ion", " ", "level", "s", ".", " ", "OC", "W", "\\", "10", ";", " ", " ", " ", " ", "expect", "s", " ", "3", "D", " ", "data", " ", "so", " ", "a", " ", "single", " ", "layer", " ", "need", "s", " ", "to", " ", "be", " ", "strip", "ped", " ", "out", " ", "whe", "n", " ", "load", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "By", " ", "default", ",", " ", "the", " ", "first", " ", "elevat", "ion", " ", "layer", " ", "is", " ", "used", ".", " ", "If", " ", "desi", "red", " ", "you", " ", "may", "\\", "10", ";", " ", " ", " ", " ", "speci", "fy", " ", "the", " ", "elevat", "ion", " ", "value", " ", "to", " ", "use", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "elevat", "ion", "\\u", "index", ":", " ", ":", "class", ":`", "int", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "(", "Optio", "nal", ")", " ", "A", " ", "name", " ", "for", " ", "the", " ", "load", "ed", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "lat", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "latitude", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "lat", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "lon", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "longitude", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "lon", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "time", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "time", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "time", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "OC", "W", " ", "Datas", "et", " ", "object", " ", "with", " ", "the", " ", "request", "ed", " ", "variab", "le", "'", "s", " ", "data", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "dataset", ".", "Datas", "et", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", " ", "Whe", "n", " ", "the", " ", "specified", " ", "file", " ", "path", " ", "cann", "ot", " ", "be", " ", "load", "ed", " ", "by", " ", "nd", "f", "CD", "F4", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "whe", "n", " ", "the", " ", "lat", "/", "lon", "/", "time", " ", "variab", "le", " ", "name", " ", "cann", "ot", " ", "be", " ", "dete", "rmin", "ed", "\\", "10", ";", " ", " ", " ", " ", "automati", "call", "y", ".", "\\", "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 ", " _", "netcdf", "_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "file", "\\u", "path_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Run", "time", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err_", "=_", "\"", "Datas", "et", " ", "filepath", " ", "is", " ", "invalid", ".", " ", "Ple", "ase", " ", "ensure", " ", "it", " ", "is", " ", "correct", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "err_", ")_", "\\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 ", " _", "err_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "give", "n", " ", "file", " ", "cann", "ot", " ", "be", " ", "load", "ed", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "it", " ", "is", " ", "a", " ", "valid", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Net", "CD", "F", " ", "file", ".", " ", "If", " ", "problem", "s", " ", "persist", ",", " ", "report", " ", "them", " ", "to", " ", "the", " ", "project", "'", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mailing", " ", "list", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "lat", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lat", "\\u", "name_", "=_", "\\u", "get", "\\u", "netcdf", "\\u", "variab", "le", "\\u", "name_", "(_", "LAT", "\\u", "NAMES_", ",_", "netcdf", "_", ",_", "variab", "le", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "lon", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lon", "\\u", "name_", "=_", "\\u", "get", "\\u", "netcdf", "\\u", "variab", "le", "\\u", "name_", "(_", "LON", "\\u", "NAMES_", ",_", "netcdf", "_", ",_", "variab", "le", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "time", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "name_", "=_", "\\u", "get", "\\u", "netcdf", "\\u", "variab", "le", "\\u", "name_", "(_", "TIME", "\\u", "NAMES_", ",_", "netcdf", "_", ",_", "variab", "le", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lats_", "=_", "netcdf", "_", "._", "variables_", "[_", "lat", "\\u", "name_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lons_", "=_", "netcdf", "_", "._", "variables_", "[_", "lon", "\\u", "name_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "raw", "\\u", "values_", "=_", "netcdf", "_", "._", "variables_", "[_", "time", "\\u", "name_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "=_", "utils_", "._", "decode", "\\u", "time", "\\u", "values_", "(_", "netcdf", "_", ",_", "time", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "=_", "numpy_", "._", "array_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "ma_", "._", "array_", "(_", "netcdf", "_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "netcdf", "_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "._", "units_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "values", " ", "are", " ", "4", "D", " ", "then", " ", "we", " ", "need", " ", "to", " ", "strip", " ", "out", " ", "the", " ", "elevat", "ion", " ", "index_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "values_", "._", "shape_", ")_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "the", " ", "set", " ", "of", " ", "possib", "le", " ", "elevat", "ion", " ", "dimension", " ", "names", " ", "excluding", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "list", " ", "of", " ", "names", " ", "tha", "t", " ", "are", " ", "used", " ", "for", " ", "the", " ", "lat", ",", " ", "lon", ",", " ", "and", " ", "time", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dims_", "=_", "netcdf", "_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "._", "dimensions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dimension", "\\u", "names_", "=_", "[_", "dim", "\\u", "name_", "._", "encode_", "(_", ")_", "for_", "dim", "\\u", "name_", "in_", "dims_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lat", "\\u", "lon", "\\u", "time", "\\u", "var", "\\u", "names_", "=_", "[_", "lat", "\\u", "name_", ",_", "lon", "\\u", "name_", ",_", "time", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "elev", "\\u", "names_", "=_", "set_", "(_", "dimension", "\\u", "names_", ")_", "-_", "set_", "(_", "lat", "\\u", "lon", "\\u", "time", "\\u", "var", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "index", " ", "value", " ", "for", " ", "the", " ", "elevat", "ion", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "#", "level", "\\u", "index", " ", "=", " ", "dimension", "\\u", "names", ".", "index", "(", "elev", "\\u", "names", ".", "pop", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "level", "\\u", "index_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Strip", " ", "out", " ", "the", " ", "elevat", "ion", " ", "values", " ", "so", " ", "we", "'", "re", " ", "left", " ", "with", " ", "a", " ", "3", "D", " ", "array", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "level", "\\u", "index_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values_", "[_", "elevat", "ion", "\\u", "index_", ",_", ":_", ",_", ":_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "level", "\\u", "index_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values_", "[_", ":_", ",_", "elevat", "ion", "\\u", "index_", ",_", ":_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "level", "\\u", "index_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values_", "[_", ":_", ",_", ":_", ",_", "elevat", "ion", "\\u", "index_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values_", "[_", ":_", ",_", ":_", ",_", ":_", ",_", "elevat", "ion", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "origin_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "'", "local", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "file", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lat", "\\u", "name", "'_", ":_", "lat", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lon", "\\u", "name", "'_", ":_", "lon", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "name", "'_", ":_", "time", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "elevat", "ion", "\\u", "index_", "!=_", "0_", ":_", "origin_", "[_", "'", "elevat", "ion", "\\u", "index", "'_", "]_", "=_", "elevat", "ion", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Dataset_", "(_", "lats_", ",_", "lons_", ",_", "times_", ",_", "values_", ",_", "variable_", "=_", "variab", "le", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "units_", "=_", "variab", "le", "\\u", "unit_", ",_", "name_", "=_", "name_", ",_", "origin_", "=_", "origin_", ")_", "\\u\\u\\uNEWLINE\\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", "multiple", "\\u", "files_", "(_", "file", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset", "\\u", "name_", "=_", "'", "model", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lat", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lon", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time", "\\u", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "load", " ", "multiple", " ", "netcdf", " ", "files", " ", "with", " ", "common", " ", "filename", " ", "pattern", " ", "and", " ", "return", " ", "an", " ", "array", " ", "of", " ", "OC", "W", " ", "dataset", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "director", "y", " ", "name", " ", "and", " ", "common", " ", "file", " ", "name", " ", "pattern", "s", " ", "where", " ", "the", " ", "Net", "CD", "F", " ", "files", " ", "to", " ", "load", " ", "are", " ", "store", "d", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "dataset", "\\u", "name", ":", " ", "a", " ", "name", " ", "of", " ", "dataset", " ", "whe", "n", " ", "readi", "ng", " ", "a", " ", "single", " ", "file", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "dataset", "\\u", "name", ":", " ", ":", "mod", ":'", "string", "'", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "name", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "unit", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "variab", "le", " ", "unit", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "unit", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "elevat", "ion", "\\u", "index", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "elevat", "ion", " ", "index", " ", "for", " ", "whi", "ch", " ", "data", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "return", "ed", ".", " ", "Clim", "ate", " ", "data", " ", "is", " ", "oft", "en", " ", "times", " ", "4", " ", "dimension", "al", " ", "data", ".", " ", "Some", "\\", "10", ";", " ", " ", " ", " ", "dataset", "s", " ", "will", " ", "have", " ", "readi", "ns", " ", "at", " ", "different", " ", "height", "/", "elevat", "ion", " ", "level", "s", ".", " ", "OC", "W", "\\", "10", ";", " ", " ", " ", " ", "expect", "s", " ", "3", "D", " ", "data", " ", "so", " ", "a", " ", "single", " ", "layer", " ", "need", "s", " ", "to", " ", "be", " ", "strip", "ped", " ", "out", " ", "whe", "n", " ", "load", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "By", " ", "default", ",", " ", "the", " ", "first", " ", "elevat", "ion", " ", "layer", " ", "is", " ", "used", ".", " ", "If", " ", "desi", "red", " ", "you", " ", "may", "\\", "10", ";", " ", " ", " ", " ", "speci", "fy", " ", "the", " ", "elevat", "ion", " ", "value", " ", "to", " ", "use", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "lat", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "latitude", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "lat", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "lon", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "longitude", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "lon", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "time", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "time", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "time", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "array", " ", "of", " ", "OC", "W", " ", "Datas", "et", " ", "object", "s", ",", " ", "an", " ", "array", " ", "of", " ", "dataset", " ", "names", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "list", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "filenames_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "filenames_", "._", "extend_", "(_", "glob_", "(_", "file", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "filenames_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "number", " ", "of", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "ndata", "_", "=_", "len_", "(_", "data\\u", "filenames_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ndata", "_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "name_", "=_", "[_", "dataset", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "name_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "filename", "s", "\\u", "reversed_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "element_", "in_", "data\\u", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "filename", "s", "\\u", "reversed_", "._", "append_", "(_", "element_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prefix_", "=_", "os_", "._", "path_", "._", "common", "prefix_", "(_", "data\\u", "filenames_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "postfix_", "=_", "os_", "._", "path_", "._", "common", "prefix_", "(_", "data\\u", "filename", "s", "\\u", "reversed_", ")_", "[_", ":_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "element_", "in_", "data\\u", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "name_", "._", "append_", "(_", "element_", "._", "replace_", "(_", "prefix_", ",_", "''_", ")_", "._", "replace_", "(_", "postfix_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datasets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ifile_", ",_", "filename_", "in_", "enumerate_", "(_", "data\\u", "filenames_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "datasets_", "._", "append_", "(_", "load", "\\u", "file_", "(_", "filename_", ",_", "variab", "le", "\\u", "name_", ",_", "variab", "le", "\\u", "unit_", ",_", "name_", "=_", "data\\u", "name_", "[_", "ifile_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lat", "\\u", "name_", "=_", "lat", "\\u", "name_", ",_", "lon", "\\u", "name_", "=_", "lon", "\\u", "name_", ",_", "time", "\\u", "name_", "=_", "time", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "datasets_", ",_", "data\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "WR", "F", "\\u", "2d", "\\u", "files", "\\u", "RAI", "N_", "(_", "file", "\\u", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename", "\\u", "pattern_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filelist_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Load", " ", "multiple", " ", "WR", "F", " ", "(", "or", " ", "nu", "WR", "F", ")", " ", "original", " ", "output", " ", "files", " ", "contain", "ing", " ", "2", "D", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "fields", " ", "suc", "h", " ", "as", " ", "precip", "itation", " ", "and", " ", "surf", "ace", " ", "variab", "les", " ", "int", "o", " ", "a", " ", "Datas", "et", ".", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "dataset", " ", "can", " ", "be", " ", "spat", "ial", "ly", " ", "subse", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "Director", "y", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filename", "\\u", "pattern", ":", " ", "Path", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filename", "\\u", "pattern", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "(", "Optio", "nal", ")", " ", "A", " ", "name", " ", "for", " ", "the", " ", "load", "ed", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "OC", "W", " ", "Datas", "et", " ", "object", " ", "with", " ", "the", " ", "request", "ed", " ", "variab", "le", "'", "s", " ", "data", " ", "from", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "dataset", ".", "Datas", "et", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "filelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WR", "F", "\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pattern_", "in_", "filename", "\\u", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WR", "F", "\\u", "files_", "._", "extend_", "(_", "glob_", "(_", "file", "\\u", "path_", "+_", "pattern_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "WR", "F", "\\u", "files_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WR", "F", "\\u", "files_", "=_", "[_", "line_", "._", "rstrip_", "(_", "'\\\\", "n", "'_", ")_", "for_", "line_", "in_", "open_", "(_", "filelist_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "object\\u", "first_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "WR", "F", "\\u", "files_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lats_", "=_", "file", "\\u", "object\\u", "first_", "._", "variables_", "[_", "'", "XL", "AT", "'_", "]_", "[_", "0_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lons_", "=_", "file", "\\u", "object\\u", "first_", "._", "variables_", "[_", "'", "XL", "ONG", "'_", "]_", "[_", "0_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nfile", "_", "=_", "len_", "(_", "WR", "F", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ifile_", ",_", "file_", "in_", "enumerate_", "(_", "WR", "F", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Reading", " ", "file", " ", "'_", "+_", "str_", "(_", "ifile_", "+_", "1_", ")_", "+_", "'/'_", "+_", "str_", "(_", "nfile", "_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "object_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "struct", "\\u", "parsed_", "=_", "strptime_", "(_", "file_", "[_", "-_", "19_", ":_", "]_", ",_", "\"%", "Y", "-%", "m", "-%", "d\\u", "%", "H", ":", "%", "M", ":", "%", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ih", "our_", "in_", "range_", "(_", "24_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "times_", "._", "append_", "(_", "datetime_", "(_", "*_", "time", "\\u", "struct", "\\u", "parsed_", "[_", ":_", "6_", "]_", ")_", "+_", "timedelta_", "(_", "hours_", "=_", "ih", "our_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ifile_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values", "0_", "=_", "file", "\\u", "object_", "._", "variables_", "[_", "'", "RAI", "NC", "'_", "]_", "[_", ":_", "]_", "+_", "file", "\\u", "object_", "._", "variables_", "[_", "'", "RAI", "NN", "C", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values", "0_", "=_", "numpy_", "._", "concatenate_", "(_", "(_", "values", "0_", ",_", "file", "\\u", "object_", "._", "variables_", "[_", "'", "RAI", "NC", "'_", "]_", "[_", ":_", "]_", "+_", "file", "\\u", "object_", "._", "variables_", "[_", "'", "RAI", "NN", "C", "'_", "]_", "[_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "object_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times_", "=_", "numpy_", "._", "array_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "years_", "=_", "numpy_", "._", "array_", "(_", "[_", "d_", "._", "year_", "for_", "d_", "in_", "times_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nc", "ycle", "_", "=_", "numpy_", "._", "unique_", "(_", "years_", ")_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "nc", "ycle", "='_", ",_", "nc", "ycle", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nt_", ",_", "ny_", ",_", "nx_", "=_", "values", "0_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "numpy_", "._", "zeros_", "(_", "[_", "nt_", "-_", "nc", "ycle", "_", "*_", "24_", ",_", "ny_", ",_", "nx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nt", "2_", "=_", "nt_", "/_", "nc", "ycle", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remove", " ", "the", " ", "first", " ", "day", " ", "in", " ", "each", " ", "year_", "\\u\\u\\uNL\\u\\u\\u_", "nt", "3_", "=_", "nt", "2_", "-_", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ic", "ycle", "_", "in_", "numpy_", "._", "arange_", "(_", "nc", "ycle", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "it_", "in_", "numpy_", "._", "arange_", "(_", "nt", "3_", ")_", "+_", "24_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "[_", "t", "\\u", "index_", ",_", ":_", "]_", "=_", "values", "0_", "[_", "ic", "ycle", "_", "*_", "nt", "2_", "+_", "it_", ",_", ":_", "]_", "-_", "values", "0_", "[_", "ic", "ycle", "_", "*_", "nt", "2_", "+_", "it_", "-_", "1_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times", "2_", "._", "append_", "(_", "times_", "[_", "ic", "ycle", "_", "*_", "nt", "2_", "+_", "it_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "\\u", "index_", "=_", "t", "\\u", "index_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "variab", "le", "\\u", "name_", "=_", "'", "PRE", "C", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "'", "mm", "/", "hr", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times", "2_", "=_", "numpy_", "._", "array_", "(_", "times", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Dataset_", "(_", "lats_", ",_", "lons_", ",_", "times", "2_", ",_", "values_", ",_", "variab", "le", "\\u", "name_", ",_", "units_", "=_", "variab", "le", "\\u", "unit_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "dataset", "\\u", "from", "\\u", "multiple", "\\u", "netcdf", "\\u", "files_", "(_", "variab", "le", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lat", "\\u", "name_", "=_", "None_", ",_", "lon", "\\u", "name_", "=_", "None_", ",_", "time", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "''_", ",_", "file", "\\u", "list_", "=_", "None_", ",_", "file", "\\u", "path_", "=_", "None_", ",_", "filename", "\\u", "pattern_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mask", "\\u", "file_", "=_", "None_", ",_", "mask", "\\u", "variable_", "=_", "None_", ",_", "mask", "\\u", "value_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Load", " ", "multiple", " ", "net", "CD", "F", " ", "files", " ", "from", " ", "the", " ", "same", " ", "source", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "(", "an", " ", "observa", "tion", " ", "or", " ", "a", " ", "model", ")", " ", "int", "o", " ", "a", " ", "Datas", "et", ".", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "dataset", " ", "can", " ", "be", " ", "spat", "ial", "ly", " ", "subse", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filelist", ":", " ", "A", " ", "text", " ", "file", " ", "inclu", "ding", " ", "a", " ", "list", " ", "of", " ", "filename", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filelist", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "name", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "lat", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "latitude", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "lat", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "lon", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "longitude", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "lon", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "time", "\\u", "name", ":", " ", "(", "Optio", "nal", ")", " ", "The", " ", "time", " ", "variab", "le", " ", "name", " ", "to", " ", "extract", " ", "from", " ", "the", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "time", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "(", "Optio", "nal", ")", " ", "A", " ", "name", " ", "for", " ", "the", " ", "load", "ed", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "Director", "y", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filename", "\\u", "pattern", ":", " ", "Path", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filename", "\\u", "pattern", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "mask", "\\u", "file", ":", " ", "A", " ", "netcdf", " ", "file", " ", "with", " ", "two", "-", "dimension", "al", " ", "mask", " ", "indice", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filelist", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "mask", "\\u", "variab", "le", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "mask", "\\u", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "mask", "\\u", "value", ":", " ", "an", " ", "index", " ", "for", " ", "spat", "ial", " ", "subse", "tting", " ", "a", " ", "dataset", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "mask", "\\u", "value", ":", " ", ":", "class", ":`", "int", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "OC", "W", " ", "Datas", "et", " ", "object", " ", "with", " ", "the", " ", "request", "ed", " ", "variab", "le", "'", "s", " ", "data", " ", "from", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "dataset", ".", "Datas", "et", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nc", "\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "file", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "pattern_", "in_", "filename", "\\u", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nc", "\\u", "files_", "._", "extend_", "(_", "glob_", "(_", "file", "\\u", "path_", "+_", "pattern_", ")_", ")_", "\\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 ", " _", "nc", "\\u", "files_", "=_", "[_", "line_", "._", "rstrip_", "(_", "'\\\\", "n", "'_", ")_", "for_", "line_", "in_", "open_", "(_", "file", "\\u", "list_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nc", "\\u", "files_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dataset", "0_", "=_", "load", "\\u", "file_", "(_", "nc", "\\u", "files_", "[_", "0_", "]_", ",_", "variab", "le", "\\u", "name_", "=_", "variab", "le", "\\u", "name_", ",_", "lat", "\\u", "name_", "=_", "lat", "\\u", "name_", ",_", "lon", "\\u", "name_", "=_", "lon", "\\u", "name_", ",_", "time", "\\u", "name_", "=_", "time", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dataset", "0_", "._", "lons_", "._", "ndim_", "==_", "1_", "and_", "dataset", "0_", "._", "lats_", "._", "ndim_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lons_", ",_", "lats_", "=_", "numpy_", "._", "meshgrid_", "(_", "dataset", "0_", "._", "lons_", ",_", "dataset", "0_", "._", "lats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "dataset", "0_", "._", "lons_", "._", "ndim_", "==_", "2_", "and_", "dataset", "0_", "._", "lats_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lons_", "=_", "dataset", "0_", "._", "lons_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lats_", "=_", "dataset", "0_", "._", "lats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mask", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mask", "\\u", "dataset_", "=_", "load", "\\u", "file_", "(_", "mask", "\\u", "file_", ",_", "mask", "\\u", "variable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "index_", ",_", "x", "\\u", "index_", "=_", "numpy_", "._", "where_", "(_", "mask", "\\u", "dataset_", "._", "values_", "==_", "mask", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nfile", "_", "=_", "len_", "(_", "nc", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ifile_", ",_", "file_", "in_", "enumerate_", "(_", "nc", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "NC", " ", "file", " ", "'_", "+_", "str_", "(_", "ifile_", "+_", "1_", ")_", "+_", "'/'_", "+_", "str_", "(_", "nfile", "_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "object", "0_", "=_", "load", "\\u", "file_", "(_", "file_", ",_", "variab", "le", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values", "0_", "=_", "file", "\\u", "object", "0_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "._", "extend_", "(_", "file", "\\u", "object", "0_", "._", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mask", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values", "0_", "=_", "values", "0_", "[_", ":_", ",_", "y", "\\u", "index_", ",_", "x", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ifile_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "values_", "=_", "values", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "values_", "=_", "numpy_", "._", "concatenate_", "(_", "(_", "data\\u", "values_", ",_", "values", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times_", "=_", "numpy_", "._", "array_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Dataset_", "(_", "lats_", ",_", "lons_", ",_", "times_", ",_", "data\\u", "values_", ",_", "variab", "le", "\\u", "name_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "NL", "DAS", "\\u", "forcing", "A", "\\u", "files_", "(_", "file", "\\u", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename", "\\u", "pattern_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filelist_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "name_", "=_", "'", "AP", "CP", "sf", "c\\u", "110", "\\u", "SF", "C", "\\u", "acc", "1", "h", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Load", " ", "multiple", " ", "NL", "DAS", "2", " ", "forcing", "AW", "RF", " ", "files", " ", "contain", "ing", " ", "2", "D", " ", "fields", " ", "suc", "h", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "precip", "itation", " ", "and", " ", "surf", "ace", " ", "variab", "les", " ", "int", "o", " ", "a", " ", "Datas", "et", ".", " ", "The", " ", "dataset", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "can", " ", "be", " ", "spat", "ial", "ly", " ", "subse", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "Director", "y", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filename", "\\u", "pattern", ":", " ", "Path", " ", "to", " ", "the", " ", "Net", "CD", "F", " ", "file", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filename", "\\u", "pattern", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filelist", ":", " ", "A", " ", "list", " ", "of", " ", "filename", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filelist", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "name", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "(", "Optio", "nal", ")", " ", "A", " ", "name", " ", "for", " ", "the", " ", "load", "ed", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "OC", "W", " ", "Datas", "et", " ", "object", " ", "with", " ", "the", " ", "request", "ed", " ", "variab", "le", "'", "s", " ", "data", " ", "from", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Net", "CD", "F", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "dataset", ".", "Datas", "et", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "filelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "NL", "DAS", "\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pattern_", "in_", "filename", "\\u", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "NL", "DAS", "\\u", "files_", "._", "extend_", "(_", "glob_", "(_", "file", "\\u", "path_", "+_", "pattern_", ")_", ")_", "\\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 ", " _", "NL", "DAS", "\\u", "files_", "=_", "[_", "line_", "._", "rstrip_", "(_", "'\\\\", "n", "'_", ")_", "for_", "line_", "in_", "open_", "(_", "filelist_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "NL", "DAS", "\\u", "files_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "object\\u", "first_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "NL", "DAS", "\\u", "files_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lats_", "=_", "file", "\\u", "object\\u", "first_", "._", "variables_", "[_", "'", "lat", "\\u", "110", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lons_", "=_", "file", "\\u", "object\\u", "first_", "._", "variables_", "[_", "'", "lon", "\\u", "110", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lons_", ",_", "lats_", "=_", "numpy_", "._", "meshgrid_", "(_", "lons_", ",_", "lats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nfile", "_", "=_", "len_", "(_", "NL", "DAS", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ifile_", ",_", "file_", "in_", "enumerate_", "(_", "NL", "DAS", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Reading", " ", "file", " ", "'_", "+_", "str_", "(_", "ifile_", "+_", "1_", ")_", "+_", "'/'_", "+_", "str_", "(_", "nfile", "_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "object_", "=_", "net", "CD", "F4_", "._", "Dataset_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "struct", "\\u", "parsed_", "=_", "strptime_", "(_", "file_", "[_", "-_", "20_", ":_", "-_", "7_", "]_", ",_", "\"%", "Y", "%", "m", "%", "d", ".", "%", "H", "%", "M", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "._", "append_", "(_", "datetime_", "(_", "*_", "time", "\\u", "struct", "\\u", "parsed_", "[_", ":_", "6_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "values", "0_", "=_", "file", "\\u", "object_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values", "0_", "=_", "numpy_", "._", "expand", "\\u", "dims_", "(_", "values", "0_", ",_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ifile_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "file", "\\u", "object_", "._", "variables_", "[_", "variab", "le", "\\u", "name_", "]_", "._", "units_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "numpy_", "._", "concatenate_", "(_", "(_", "values_", ",_", "values", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "object_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times_", "=_", "numpy_", "._", "array_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Dataset_", "(_", "lats_", ",_", "lons_", ",_", "times_", ",_", "values_", ",_", "variab", "le", "\\u", "name_", ",_", "units_", "=_", "variab", "le", "\\u", "unit_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "GP", "M", "\\u", "IME", "RG", "\\u", "files_", "(_", "file", "\\u", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename", "\\u", "pattern_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filelist_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "name_", "=_", "'", "precip", "itation", "Cal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "GP", "M", "\\u", "IME", "RG", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Load", " ", "multiple", " ", "GP", "M", " ", "Leve", "l", " ", "3", " ", "IME", "GE", " ", "files", " ", "contain", "ing", " ", "calibrate", "d", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "precip", "itation", " ", "and", " ", "generat", "e", " ", "an", " ", "OC", "W", " ", "Datas", "et", " ", "obe", "jc", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "file", "\\u", "path", ":", " ", "Director", "y", " ", "to", " ", "the", " ", "HDF", " ", "files", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "file", "\\u", "path", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filename", "\\u", "pattern", ":", " ", "Path", " ", "to", " ", "the", " ", "HDF", " ", "files", " ", "to", " ", "load", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filename", "\\u", "pattern", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "filelist", ":", " ", "A", " ", "list", " ", "of", " ", "filename", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "filelist", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "variab", "le", "\\u", "name", ":", " ", "The", " ", "variab", "le", " ", "name", " ", "to", " ", "load", " ", "from", " ", "the", " ", "HDF", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "variab", "le", "\\u", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "(", "Optio", "nal", ")", " ", "A", " ", "name", " ", "for", " ", "the", " ", "load", "ed", " ", "dataset", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "name", ":", " ", ":", "mod", ":`", "string", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "An", " ", "OC", "W", " ", "Datas", "et", " ", "object", " ", "with", " ", "the", " ", "request", "ed", " ", "variab", "le", "'", "s", " ", "data", " ", "from", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "HDF", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", ":", "class", ":`", "dataset", ".", "Datas", "et", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Value", "Error", ":", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "filelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GP", "M", "\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pattern_", "in_", "filename", "\\u", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GP", "M", "\\u", "files_", "._", "extend_", "(_", "glob_", "(_", "file", "\\u", "path_", "+_", "pattern_", ")_", ")_", "\\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 ", " _", "GP", "M", "\\u", "files_", "=_", "[_", "line_", "._", "rstrip_", "(_", "'\\\\", "n", "'_", ")_", "for_", "line_", "in_", "open_", "(_", "filelist_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "GP", "M", "\\u", "files_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "object\\u", "first_", "=_", "h5py_", "._", "File_", "(_", "GP", "M", "\\u", "files_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lats_", "=_", "file", "\\u", "object\\u", "first_", "[_", "'", "Grid", "'_", "]_", "[_", "'", "lat", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lons_", "=_", "file", "\\u", "object\\u", "first_", "[_", "'", "Grid", "'_", "]_", "[_", "'", "lon", "'_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lons_", ",_", "lats_", "=_", "numpy_", "._", "meshgrid_", "(_", "lons_", ",_", "lats_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "variab", "le", "\\u", "unit_", "=_", "\"", "mm", "/", "hr", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nfile", "_", "=_", "len_", "(_", "GP", "M", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ifile_", ",_", "file_", "in_", "enumerate_", "(_", "GP", "M", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Reading", " ", "file", " ", "'_", "+_", "str_", "(_", "ifile_", "+_", "1_", ")_", "+_", "'/'_", "+_", "str_", "(_", "nfile", "_", ")_", ",_", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "object_", "=_", "h5py_", "._", "File_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "struct", "\\u", "parsed_", "=_", "strptime_", "(_", "file_", "[_", "-_", "39_", ":_", "-_", "23_", "]_", ",_", "\"%", "Y", "%", "m", "%", "d", "-", "S", "%", "H", "%", "M", "%", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "._", "append_", "(_", "datetime_", "(_", "*_", "time", "\\u", "struct", "\\u", "parsed_", "[_", ":_", "6_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values", "0_", "=_", "numpy_", "._", "transpose_", "(_", "ma_", "._", "mask", "ed", "\\u", "less_", "(_", "file", "\\u", "object_", "[_", "'", "Grid", "'_", "]_", "[_", "variab", "le", "\\u", "name_", "]_", "[_", ":_", "]_", ",_", "0._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values", "0_", "=_", "numpy_", "._", "expand", "\\u", "dims_", "(_", "values", "0_", ",_", "axis_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ifile_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "values", "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 ", " _", "values_", "=_", "numpy_", "._", "concatenate_", "(_", "(_", "values_", ",_", "values", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "object_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "times_", "=_", "numpy_", "._", "array_", "(_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Dataset_", "(_", "lats_", ",_", "lons_", ",_", "times_", ",_", "values_", ",_", "variab", "le", "\\u", "name_", ",_", "units_", "=_", "variab", "le", "\\u", "unit_", ",_", "name_", "=_", "name_", ")_" ]
[ 4, 4, 4, 4, 4, 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 ]
Except block handles 'BaseException'
haxsaw/actuator/src/tests/config_tests.py
[ { "content": "def test04():\n try:\n class T4Config(ConfigModel):\n t1 = NullTask(\"nt\")\n with_dependencies(t1 | \"other\")\n raise Exception(\"Failed to catch dependency creation with non-task\")\n except:\n assert True", "metadata": "root.test04", "header": "['module', '___EOS___']", "index": 67 }, { "content": "def test05():\n try:\n _ = _Dependency(NullTask(\"nt\"), \"other\")\n raise Exception(\"Failed to catch _Dependency creation with 'to' as non-task\")\n except:\n assert True", "metadata": "root.test05", "header": "['module', '___EOS___']", "index": 76 }, { "content": "def test06():\n try:\n _ = _Dependency(\"other\", NullTask(\"nt\"))\n raise Exception(\"Failed to catch _Dependency creation with 'from' as non-task\")\n except:\n assert True", "metadata": "root.test06", "header": "['module', '___EOS___']", "index": 83 } ]
[ { "span": "except:", "start_line": 73, "start_column": 4, "end_line": 73, "end_column": 11 }, { "span": "except:", "start_line": 80, "start_column": 4, "end_line": 80, "end_column": 11 }, { "span": "except:", "start_line": 87, "start_column": 4, "end_line": 87, "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_", "test0", "4_", "(_", ")_", ":_", "\\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 ", " _", "class_", "T", "4", "Config_", "(_", "Config", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Null", "Task_", "(_", "\"", "nt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with", "\\u", "dependencies_", "(_", "t1_", "|_", "\"", "other", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Exception_", "(_", "\"", "Fail", "ed", " ", "to", " ", "catch", " ", "dependen", "cy", " ", "creati", "on", " ", "with", " ", "non", "-", "task", "\"_", ")_", "\\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 ", " _", "assert_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "5_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u_", "=_", "\\u", "Dependency_", "(_", "Null", "Task_", "(_", "\"", "nt", "\"_", ")_", ",_", "\"", "other", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "\"", "Fail", "ed", " ", "to", " ", "catch", " ", "\\u", "Dependenc", "y", " ", "creati", "on", " ", "with", " ", "'", "to", "'", " ", "as", " ", "non", "-", "task", "\"_", ")_", "\\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 ", " _", "assert_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test0", "6_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u_", "=_", "\\u", "Dependency_", "(_", "\"", "other", "\"_", ",_", "Null", "Task_", "(_", "\"", "nt", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "\"", "Fail", "ed", " ", "to", " ", "catch", " ", "\\u", "Dependenc", "y", " ", "creati", "on", " ", "with", " ", "'", "from", "'", " ", "as", " ", "non", "-", "task", "\"_", ")_", "\\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 ", " _", "assert_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 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, 0, 1, 1, 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, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Unused import
eallik/spinoff/spinoff/actor/ref.py
[ { "content": "# coding: utf-8\nfrom __future__ import print_function\n\nimport abc\n\nfrom gevent import getcurrent, spawn_later\n\nfrom spinoff.actor.events import Events, DeadLetter\nfrom spinoff.actor.uri import Uri\nfrom spinoff.actor.misc import TempActor\nfrom spinoff.actor.context import get_context, _get_cell\nfrom spinoff.util.pattern_matching import ANY, IN, Matcher\nfrom spinoff.util.logging import dbg\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class _BaseRef(object):\n \"\"\"Internal abstract class for all objects that behave like actor references.\"\"\"\n __metaclass__ = abc.ABCMeta\n\n\n\n\n\n\n\n\n\n", "metadata": "root._BaseRef", "header": "['module', '___EOS___']", "index": 15 }, { "content": " @abc.abstractproperty\n def is_local(self):\n raise NotImplementedError", "metadata": "root._BaseRef.is_local", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 19 }, { "content": " @abc.abstractproperty\n def is_stopped(self):\n raise NotImplementedError", "metadata": "root._BaseRef.is_stopped", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 23 }, { "content": " @abc.abstractproperty\n def uri(self):\n raise NotImplementedError", "metadata": "root._BaseRef.uri", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 27 }, { "content": " def __div__(self, next):\n \"\"\"Looks up a descendant of this actor.\n\n Raises `LookupFailed` if this is a local ref and the descendant was not found.\n\n \"\"\"\n # local and not dead\n if self.is_local and self._cell:\n return self._cell.lookup_ref(next)\n # non-local or dead\n else:\n return Ref(cell=None, uri=self.uri / next, is_local=self.is_local,\n node=None if self.is_local else self.node)", "metadata": "root._BaseRef.__div__", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 31 }, { "content": " def __lshift__(self, message):\n \"\"\"A fancy looking alias to `_BaseRef.stop`, which in addition also supports chaining.\n\n someactor.send(msg1); someactor.send(msg2)\n someactor << msg1 << msg2\n\n \"\"\"\n self.send(message)\n return self", "metadata": "root._BaseRef.__lshift__", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 45 }, { "content": " def ask(self, msg, timeout=None):\n tmp, d = TempActor.make()\n self.send(msg, _sender=tmp)\n return d.get(timeout=timeout)", "metadata": "root._BaseRef.ask", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 55 }, { "content": " def forward(self, msg):\n sender = get_context().sender\n assert sender\n self.send(msg, _sender=sender)", "metadata": "root._BaseRef.forward", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 60 }, { "content": " def send_later(self, delay, message, _sender=None):\n spawn_later(delay, self.send, message, _sender=_sender or get_context().ref)", "metadata": "root._BaseRef.send_later", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 65 }, { "content": " def stop(self):\n \"\"\"Sends '_stop' to this actor\"\"\"\n self.send('_stop')", "metadata": "root._BaseRef.stop", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 68 }, { "content": " def kill(self):\n \"\"\"Sends '_kill' to this actor\"\"\"\n self.send('_kill')", "metadata": "root._BaseRef.kill", "header": "['class', '_BaseRef', '(', 'object', ')', ':', '___EOS___']", "index": 72 }, { "content": "class Ref(_BaseRef):\n \"\"\"A serializable, location-transparent, encapsulating reference to an actor.\n\n `Ref`s can be obtained in several different ways.\n\n Refs to already existing actors:\n\n * `self.ref`: a ref to the actor itself; this is meant to be the *only* channel an actor should ever be communicated\n through--an actor should *never* send out messages containing `self` and should instead *always* insert\n `self.ref` in messages sent out to other actors if it wants them to reach it back;\n\n * `Node.guardian`: a ref to the default `Guardian`\n (shouldn't be used fron inside an actor hierarchy if networkless, in-process testability is a goal, which it should be);\n\n * `self.node.guardian`: a ref to the `Guardian` of the actor hierarchy the actor belongs to; useful during testing\n\n By spawning new actors:\n\n * `self.spawn(...)`: a ref to a newly created subordinate actor of the spawning actor;\n\n * `spawn(...)`: a ref to a newly spawned top-level actor in the default hierarchy, however, top-level actors should\n in general be avoided, instead, have only one top-level actor under which your entire application is laid out;\n (this is an alias for `Node.spawn`, in turn alias for `Node.guardian.spawn`)\n\n * `self.node.spawn(...)`: a ref to a newly created top-level actor of the actor hierarchy that `self` is part of;\n useful during testing where the default `Node` should not be used, or cannot be used because multiple `Node`s\n might be residing in the same process;\n\n By looking up existing actors:\n\n * `self.ref / <name>`: looks up a child actor\n * `self.ref / <path/to/descendant>`: looks up a descendant actor\n * `self.ref / <name> / <name> / ...`: looks up a descendant actor\n\n * `Node.lookup(<uri or path>)`: looks up a local or remote actor in the default hierarchy starting from the root\n\n * `self.node.lookup(<uri or path>)`: looks up a local or remote actor in the hierarchy that `self` belongs to\n starting from the guardian;\n\n Note: refs to `Guardian`s are not true `Ref`s but merely objects that by all practical means have the same\n interface as Ref.\n\n \"\"\"\n\n _cell = None\n\n # XXX: should be is_resolved with perhaps is_local being None while is_resolved is False\n # Ref constructor should set is_resolved=False by default, but that requires is_dead for creating dead refs, because\n # currently dead refs are just Refs with no cell and is_local=True\n is_local = True\n uri = None\n node = None\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Ref", "header": "['module', '___EOS___']", "index": 77 }, { "content": " def __init__(self, cell, uri, node, is_local=True):\n assert is_local or not cell\n assert uri is None or isinstance(uri, Uri)\n self._cell = cell\n self.uri = uri\n self.node = node\n self.is_local = is_local", "metadata": "root.Ref.__init__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 130 }, { "content": " def send(self, message, _sender=None):\n \"\"\"Sends a message to the actor represented by this `Ref`.\"\"\"\n if not _sender:\n context = get_context()\n if context:\n _sender = context.ref\n if self._cell:\n if not self._cell.stopped:\n self._cell.receive(message, _sender)\n return\n else:\n self._cell = None\n if not self.is_local:\n if self.uri.node != self.node.nid:\n self.node.send_message(message, remote_ref=self, sender=_sender)\n else:\n self._cell = self.node.guardian.lookup_cell(self.uri)\n self.is_local = True\n self._cell.receive(message, _sender)\n else:\n if self.node and self.node.guardian:\n cell = self.node.guardian.lookup_cell(self.uri)\n if cell:\n cell.receive(message, _sender) # do NOT set self._cell--it will never be unset and will cause a memleak\n return\n if ('_watched', ANY) == message:\n message[1].send(('terminated', self), _sender=self)\n elif (message == ('terminated', ANY) or message == ('_unwatched', ANY) or message == ('_node_down', ANY) or\n message == '_stop' or message == '_kill' or message == '__done'):\n pass\n else:\n Events.log(DeadLetter(self, message, _sender))", "metadata": "root.Ref.send", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 138 }, { "content": " @property\n def is_stopped(self):\n \"\"\"Returns `True` if this actor is guaranteed to have stopped.\n\n If it returns `False`, it is not guaranteed that the actor isn't still running.\n\n \"\"\"\n return self.is_local and not self._cell", "metadata": "root.Ref.is_stopped", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 171 }, { "content": " def join(self):\n cell = _get_cell()\n cell.watch(self)\n cell.get(('terminated', self))", "metadata": "root.Ref.join", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 180 }, { "content": " def __eq__(self, other):\n \"\"\"Returns `True` if the `other` `Ref` points to the same actor.\n\n This method is cooperative with the `pattern_matching` module.\n\n \"\"\"\n return (isinstance(other, Ref) and self.uri == other.uri\n or isinstance(other, Matcher) and other == self)", "metadata": "root.Ref.__eq__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 185 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.Ref.__ne__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 194 }, { "content": " def __hash__(self):\n return hash(self.uri)", "metadata": "root.Ref.__hash__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 197 }, { "content": " def __repr__(self): # TODO: distinguish local and remote\n return '<%s>' % (str(self.uri),)", "metadata": "root.Ref.__repr__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 200 }, { "content": " def __getstate__(self):\n # assert self._cell or not self.is_local, \"TODO: if there is no cell and we're local, we should be returning a state that indicates a dead ref\"\n # assert self.uri.node, \"does not make sense to serialize a ref with no node: %r\" % (self,)\n return str(self.uri) # if self.is_local else (str(self.uri), self.node)", "metadata": "root.Ref.__getstate__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 203 }, { "content": " def __setstate__(self, uri):\n # if it's a tuple, it's a remote `Ref` and the tuple origates from IncomingMessageUnpickler,\n # otherwise it must be just a local `Ref` being pickled and unpickled for whatever reason:\n if isinstance(uri, tuple):\n self.is_local = False\n uri, self.node = uri\n self.uri = Uri.parse(uri)", "metadata": "root.Ref.__setstate__", "header": "['class', 'Ref', '(', '_BaseRef', ')', ':', '___EOS___']", "index": 208 } ]
[ { "span": "from gevent import getcurrent, spawn_later", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 42 }, { "span": "from spinoff.util.pattern_matching import ANY, IN, Matcher", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 58 }, { "span": "from spinoff.util.logging import dbg", "start_line": 12, "start_column": 0, "end_line": 12, "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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "abc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gevent_", "import_", "getc", "urrent", "_", ",_", "spawn", "\\u", "later_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "spin", "off_", "._", "actor_", "._", "events_", "import_", "Events_", ",_", "Dead", "Letter", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "spin", "off_", "._", "actor_", "._", "uri_", "import_", "Uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "spin", "off_", "._", "actor_", "._", "misc_", "import_", "Temp", "Actor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "spin", "off_", "._", "actor_", "._", "context_", "import_", "get", "\\u", "context_", ",_", "\\u", "get", "\\u", "cell_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "spin", "off_", "._", "util_", "._", "pattern", "\\u", "matching_", "import_", "ANY_", ",_", "IN_", ",_", "Matcher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "spin", "off_", "._", "util_", "._", "logging_", "import_", "dbg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Intern", "al", " ", "abstract", " ", "class", " ", "for", " ", "all", " ", "object", "s", " ", "tha", "t", " ", "behave", " ", "like", " ", "actor", " ", "reference", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "metaclass\\u\\u_", "=_", "abc_", "._", "ABC", "Meta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "abc_", "._", "abstract", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "local_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "abc_", "._", "abstract", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "stopped_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "abc_", "._", "abstract", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "uri_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "div\\u\\u_", "(_", "self_", ",_", "next_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Look", "s", " ", "up", " ", "a", " ", "descendant", " ", "of", " ", "this", " ", "actor", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "`", "Look", "up", "Fail", "ed", "`", " ", "if", " ", "this", " ", "is", " ", "a", " ", "local", " ", "ref", " ", "and", " ", "the", " ", "descendant", " ", "was", " ", "not", " ", "found", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "local", " ", "and", " ", "not", " ", "dead_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "local_", "and_", "self_", "._", "\\u", "cell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "cell_", "._", "look", "up", "\\u", "ref_", "(_", "next_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "non", "-", "local", " ", "or", " ", "dead_", "\\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 ", " _", "return_", "Ref_", "(_", "cell_", "=_", "None_", ",_", "uri_", "=_", "self_", "._", "uri_", "/_", "next_", ",_", "is", "\\u", "local_", "=_", "self_", "._", "is", "\\u", "local_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "=_", "None_", "if_", "self_", "._", "is", "\\u", "local_", "else_", "self_", "._", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "lsh", "ift", "\\u\\u_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "fancy", " ", "look", "ing", " ", "alias", " ", "to", " ", "`\\u", "Base", "Ref", ".", "stop", "`", ",", " ", "whi", "ch", " ", "in", " ", "addition", " ", "als", "o", " ", "support", "s", " ", "chain", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "some", "actor", ".", "send", "(", "msg", "1", ");", " ", "some", "actor", ".", "send", "(", "msg", "2", ")", "\\", "10", ";", " ", " ", " ", " ", "some", "actor", " ", "<<", " ", "msg", "1", " ", "<<", " ", "msg", "2", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ask_", "(_", "self_", ",_", "msg_", ",_", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", ",_", "d_", "=_", "Temp", "Actor_", "._", "make_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send_", "(_", "msg_", ",_", "\\u", "sender_", "=_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "d_", "._", "get_", "(_", "timeout_", "=_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "forward_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sender_", "=_", "get", "\\u", "context_", "(_", ")_", "._", "sender_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sender_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send_", "(_", "msg_", ",_", "\\u", "sender_", "=_", "sender_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "later_", "(_", "self_", ",_", "delay_", ",_", "message_", ",_", "\\u", "sender_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spawn", "\\u", "later_", "(_", "delay_", ",_", "self_", "._", "send_", ",_", "message_", ",_", "\\u", "sender_", "=_", "\\u", "sender_", "or_", "get", "\\u", "context_", "(_", ")_", "._", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "ds", " ", "'\\u", "stop", "'", " ", "to", " ", "this", " ", "actor", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send_", "(_", "'\\u", "stop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Base", "Ref_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "kill_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "ds", " ", "'\\u", "kill", "'", " ", "to", " ", "this", " ", "actor", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send_", "(_", "'\\u", "kill", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "serializable", ",", " ", "location", "-", "transp", "arent", ",", " ", "encapsulat", "ing", " ", "reference", " ", "to", " ", "an", " ", "actor", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "Ref", "`", "s", " ", "can", " ", "be", " ", "obtain", "ed", " ", "in", " ", "sever", "al", " ", "different", " ", "way", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Refs", " ", "to", " ", "alr", "ead", "y", " ", "exist", "ing", " ", "actors", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "ref", "`", ":", " ", "a", " ", "ref", " ", "to", " ", "the", " ", "actor", " ", "its", "elf", ";", " ", "this", " ", "is", " ", "mean", "t", " ", "to", " ", "be", " ", "the", " ", "*", "only", "*", " ", "channel", " ", "an", " ", "actor", " ", "shou", "ld", " ", "ever", " ", "be", " ", "communi", "cated", "\\", "10", ";", " ", " ", " ", "through", "--", "an", " ", "actor", " ", "shou", "ld", " ", "*", "neve", "r", "*", " ", "send", " ", "out", " ", "message", "s", " ", "contain", "ing", " ", "`", "self", "`", " ", "and", " ", "shou", "ld", " ", "inst", "ead", " ", "*", "alw", "ay", "s", "*", " ", "insert", "\\", "10", ";", " ", " ", " ", "`", "self", ".", "ref", "`", " ", "in", " ", "message", "s", " ", "sent", " ", "out", " ", "to", " ", "other", " ", "actors", " ", "if", " ", "it", " ", "want", "s", " ", "them", " ", "to", " ", "reach", " ", "it", " ", "back", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "Node", ".", "guard", "ian", "`", ":", " ", "a", " ", "ref", " ", "to", " ", "the", " ", "default", " ", "`", "Guard", "ian", "`", "\\", "10", ";", " ", " ", " ", "(", "shou", "ld", "n", "'", "t", " ", "be", " ", "used", " ", "fro", "n", " ", "insi", "de", " ", "an", " ", "actor", " ", "hier", "arch", "y", " ", "if", " ", "network", "less", ",", " ", "in", "-", "process", " ", "testa", "bilit", "y", " ", "is", " ", "a", " ", "goal", ",", " ", "whi", "ch", " ", "it", " ", "shou", "ld", " ", "be", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "node", ".", "guard", "ian", "`", ":", " ", "a", " ", "ref", " ", "to", " ", "the", " ", "`", "Guard", "ian", "`", " ", "of", " ", "the", " ", "actor", " ", "hier", "arch", "y", " ", "the", " ", "actor", " ", "belo", "ngs", " ", "to", ";", " ", "usef", "ul", " ", "dur", "ing", " ", "testi", "ng", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "By", " ", "spawn", "ing", " ", "new", " ", "actors", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "spawn", "(...)", "`", ":", " ", "a", " ", "ref", " ", "to", " ", "a", " ", "newl", "y", " ", "created", " ", "subo", "rdin", "ate", " ", "actor", " ", "of", " ", "the", " ", "spawn", "ing", " ", "actor", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "spawn", "(...)", "`", ":", " ", "a", " ", "ref", " ", "to", " ", "a", " ", "newl", "y", " ", "spawne", "d", " ", "top", "-", "level", " ", "actor", " ", "in", " ", "the", " ", "default", " ", "hier", "arch", "y", ",", " ", "how", "ever", ",", " ", "top", "-", "level", " ", "actors", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", "in", " ", "genera", "l", " ", "be", " ", "avoid", "ed", ",", " ", "inst", "ead", ",", " ", "have", " ", "only", " ", "one", " ", "top", "-", "level", " ", "actor", " ", "under", " ", "whi", "ch", " ", "your", " ", "entire", " ", "applica", "tion", " ", "is", " ", "lai", "d", " ", "out", ";", "\\", "10", ";", " ", " ", " ", "(", "this", " ", "is", " ", "an", " ", "alias", " ", "for", " ", "`", "Node", ".", "spawn", "`", ",", " ", "in", " ", "turn", " ", "alias", " ", "for", " ", "`", "Node", ".", "guard", "ian", ".", "spawn", "`)", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "node", ".", "spawn", "(...)", "`", ":", " ", "a", " ", "ref", " ", "to", " ", "a", " ", "newl", "y", " ", "created", " ", "top", "-", "level", " ", "actor", " ", "of", " ", "the", " ", "actor", " ", "hier", "arch", "y", " ", "tha", "t", " ", "`", "self", "`", " ", "is", " ", "part", " ", "of", ";", "\\", "10", ";", " ", " ", " ", "usef", "ul", " ", "dur", "ing", " ", "testi", "ng", " ", "where", " ", "the", " ", "default", " ", "`", "Node", "`", " ", "shou", "ld", " ", "not", " ", "be", " ", "used", ",", " ", "or", " ", "cann", "ot", " ", "be", " ", "used", " ", "bec", "aus", "e", " ", "multiple", " ", "`", "Node", "`", "s", "\\", "10", ";", " ", " ", " ", "mig", "ht", " ", "be", " ", "resid", "ing", " ", "in", " ", "the", " ", "same", " ", "process", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "By", " ", "look", "ing", " ", "up", " ", "exist", "ing", " ", "actors", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "ref", " ", "/", " ", "<", "name", ">`", ":", " ", "look", "s", " ", "up", " ", "a", " ", "child", " ", "actor", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "ref", " ", "/", " ", "<", "path", "/", "to", "/", "descendant", ">`", ":", " ", "look", "s", " ", "up", " ", "a", " ", "descendant", " ", "actor", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "ref", " ", "/", " ", "<", "name", ">", " ", "/", " ", "<", "name", ">", " ", "/", " ", "...", "`", ":", " ", "look", "s", " ", "up", " ", "a", " ", "descendant", " ", "actor", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "Node", ".", "look", "up", "(", "<", "uri", " ", "or", " ", "path", ">)", "`", ":", " ", "look", "s", " ", "up", " ", "a", " ", "local", " ", "or", " ", "remote", " ", "actor", " ", "in", " ", "the", " ", "default", " ", "hier", "arch", "y", " ", "startin", "g", " ", "from", " ", "the", " ", "root", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "`", "self", ".", "node", ".", "look", "up", "(", "<", "uri", " ", "or", " ", "path", ">)", "`", ":", " ", "look", "s", " ", "up", " ", "a", " ", "local", " ", "or", " ", "remote", " ", "actor", " ", "in", " ", "the", " ", "hier", "arch", "y", " ", "tha", "t", " ", "`", "self", "`", " ", "belo", "ngs", " ", "to", "\\", "10", ";", " ", " ", " ", "startin", "g", " ", "from", " ", "the", " ", "guard", "ian", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", " ", "refs", " ", "to", " ", "`", "Guard", "ian", "`", "s", " ", "are", " ", "not", " ", "true", " ", "`", "Ref", "`", "s", " ", "but", " ", "mer", "el", "y", " ", "object", "s", " ", "tha", "t", " ", "by", " ", "all", " ", "practic", "al", " ", "means", " ", "have", " ", "the", " ", "same", "\\", "10", ";", " ", " ", " ", " ", "interface", " ", "as", " ", "Ref", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "cell_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "shou", "ld", " ", "be", " ", "is", "\\u", "resolve", "d", " ", "with", " ", "per", "hap", "s", " ", "is", "\\u", "local", " ", "bei", "ng", " ", "Non", "e", " ", "whi", "le", " ", "is", "\\u", "resolve", "d", " ", "is", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ref", " ", "construct", "or", " ", "shou", "ld", " ", "set", " ", "is", "\\u", "resolve", "d", "=", "Fal", "se", " ", "by", " ", "default", ",", " ", "but", " ", "tha", "t", " ", "require", "s", " ", "is", "\\u", "dead", " ", "for", " ", "creati", "ng", " ", "dead", " ", "refs", ",", " ", "bec", "aus", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "currentl", "y", " ", "dead", " ", "refs", " ", "are", " ", "just", " ", "Refs", " ", "with", " ", "no", " ", "cell", " ", "and", " ", "is", "\\u", "local", "=", "True_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "local_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "cell_", ",_", "uri_", ",_", "node_", ",_", "is", "\\u", "local_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "is", "\\u", "local_", "or_", "not_", "cell_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "uri_", "is_", "None_", "or_", "isinstance_", "(_", "uri_", ",_", "Uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cell_", "=_", "cell_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "uri_", "=_", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "node_", "=_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "local_", "=_", "is", "\\u", "local_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send_", "(_", "self_", ",_", "message_", ",_", "\\u", "sender_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Sen", "ds", " ", "a", " ", "message", " ", "to", " ", "the", " ", "actor", " ", "represent", "ed", " ", "by", " ", "this", " ", "`", "Ref", "`.\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "sender_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "get", "\\u", "context_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "context_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "sender_", "=_", "context_", "._", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "cell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "cell_", "._", "stopped_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "cell_", "._", "receive_", "(_", "message_", ",_", "\\u", "sender_", ")_", "\\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 ", " _", "self_", "._", "\\u", "cell_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "is", "\\u", "local_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "uri_", "._", "node_", "!=_", "self_", "._", "node_", "._", "nid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "node_", "._", "send", "\\u", "message_", "(_", "message_", ",_", "remote", "\\u", "ref_", "=_", "self_", ",_", "sender_", "=_", "\\u", "sender_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "cell_", "=_", "self_", "._", "node_", "._", "guard", "ian_", "._", "look", "up", "\\u", "cell_", "(_", "self_", "._", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "local_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cell_", "._", "receive_", "(_", "message_", ",_", "\\u", "sender_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "node_", "and_", "self_", "._", "node_", "._", "guard", "ian_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cell_", "=_", "self_", "._", "node_", "._", "guard", "ian_", "._", "look", "up", "\\u", "cell_", "(_", "self_", "._", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cell_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cell_", "._", "receive_", "(_", "message_", ",_", "\\u", "sender_", ")_", "#", " ", "do", " ", "NOT", " ", "set", " ", "self", ".\\u", "cell", "--", "it", " ", "will", " ", "neve", "r", " ", "be", " ", "unse", "t", " ", "and", " ", "will", " ", "caus", "e", " ", "a", " ", "mem", "leak", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "'\\u", "watched", "'_", ",_", "ANY_", ")_", "==_", "message_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "[_", "1_", "]_", "._", "send_", "(_", "(_", "'", "terminate", "d", "'_", ",_", "self_", ")_", ",_", "\\u", "sender_", "=_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "message_", "==_", "(_", "'", "terminate", "d", "'_", ",_", "ANY_", ")_", "or_", "message_", "==_", "(_", "'\\u", "unwa", "tche", "d", "'_", ",_", "ANY_", ")_", "or_", "message_", "==_", "(_", "'\\u", "node", "\\u", "down", "'_", ",_", "ANY_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "==_", "'\\u", "stop", "'_", "or_", "message_", "==_", "'\\u", "kill", "'_", "or_", "message_", "==_", "'\\u", "\\u", "don", "e", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Events_", "._", "log_", "(_", "Dead", "Letter", "_", "(_", "self_", ",_", "message_", ",_", "\\u", "sender_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\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_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "stopped_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "`", "Tru", "e", "`", " ", "if", " ", "this", " ", "actor", " ", "is", " ", "guaran", "tee", "d", " ", "to", " ", "have", " ", "stopp", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "it", " ", "return", "s", " ", "`", "Fal", "se", "`", ",", " ", "it", " ", "is", " ", "not", " ", "guaran", "tee", "d", " ", "tha", "t", " ", "the", " ", "actor", " ", "isn", "'", "t", " ", "still", " ", "runn", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "is", "\\u", "local_", "and_", "not_", "self_", "._", "\\u", "cell_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "join_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cell_", "=_", "\\u", "get", "\\u", "cell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell_", "._", "watch_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cell_", "._", "get_", "(_", "(_", "'", "terminate", "d", "'_", ",_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\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", "s", " ", "`", "Tru", "e", "`", " ", "if", " ", "the", " ", "`", "other", "`", " ", "`", "Ref", "`", " ", "points", " ", "to", " ", "the", " ", "same", " ", "actor", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "is", " ", "coop", "erat", "ive", " ", "with", " ", "the", " ", "`", "pattern", "\\u", "matchi", "ng", "`", " ", "module", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "isinstance_", "(_", "other_", ",_", "Ref_", ")_", "and_", "self_", "._", "uri_", "==_", "other_", "._", "uri_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "isinstance_", "(_", "other_", ",_", "Matcher_", ")_", "and_", "other_", "==_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\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]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "self_", "._", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\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_", ")_", ":_", "#", " ", "TOD", "O", ":", " ", "distinguish", " ", "local", " ", "and", " ", "remote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'<", "%", "s", ">'_", "%_", "(_", "str_", "(_", "self_", "._", "uri_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assert", " ", "self", ".\\u", "cell", " ", "or", " ", "not", " ", "self", ".", "is", "\\u", "local", ",", " ", "\"", "TOD", "O", ":", " ", "if", " ", "there", " ", "is", " ", "no", " ", "cell", " ", "and", " ", "we", "'", "re", " ", "local", ",", " ", "we", " ", "shou", "ld", " ", "be", " ", "return", "ing", " ", "a", " ", "state", " ", "tha", "t", " ", "indicat", "es", " ", "a", " ", "dead", " ", "ref", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assert", " ", "self", ".", "uri", ".", "node", ",", " ", "\"", "doe", "s", " ", "not", " ", "make", " ", "sense", " ", "to", " ", "serialize", " ", "a", " ", "ref", " ", "with", " ", "no", " ", "node", ":", " ", "%", "r", "\"", " ", "%", " ", "(", "self", ",)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "str_", "(_", "self_", "._", "uri_", ")_", "#", " ", "if", " ", "self", ".", "is", "\\u", "local", " ", "else", " ", "(", "str", "(", "self", ".", "uri", "),", " ", "self", ".", "node", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ref_", "(_", "\\u", "Base", "Ref_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setstate", "\\u\\u_", "(_", "self_", ",_", "uri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "it", "'", "s", " ", "a", " ", "tuple", ",", " ", "it", "'", "s", " ", "a", " ", "remote", " ", "`", "Ref", "`", " ", "and", " ", "the", " ", "tuple", " ", "orig", "ates", " ", "from", " ", "Inco", "ming", "Messag", "e", "Unp", "ickle", "r", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", " ", "it", " ", "must", " ", "be", " ", "just", " ", "a", " ", "local", " ", "`", "Ref", "`", " ", "bei", "ng", " ", "pickled", " ", "and", " ", "unpickle", "d", " ", "for", " ", "what", "ever", " ", "reason", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "uri_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "is", "\\u", "local_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", ",_", "self_", "._", "node_", "=_", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "uri_", "=_", "Uri_", "._", "parse_", "(_", "uri_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
weblabdeusto/weblabdeusto/server/src/test/unit/experiments/ud_xilinx/test_server_logic.py
[ { "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2005 onwards University of Deusto\n# All rights reserved.\n#\n# This software is licensed as described in the file COPYING, which\n# you should have received as part of this distribution.\n#\n# This software consists of contributions made by many individuals,\n# listed below:\n#\n# Author: Luis Rodriguez <[email protected]>\n#\nfrom __future__ import print_function, unicode_literals\n\n#\n# Note: The purpose of creating a new file (test_server_logic.py) rather than using the existing\n# test_server.py is mainly because some methods from test_server.py seem to be failing but shouldn't.\n# Also, the tests here are meant to be higher level than the test_server.py tests, which seem to be oriented\n# towards board-programming, etc.\n#\nfrom mock import patch\n\nimport json\nimport mock\nimport experiments.ud_xilinx.server as UdXilinxExperiment\nimport experiments.ud_xilinx.exc as UdXilinxExperimentErrors\nfrom experiments.ud_xilinx import command_senders as UdXilinxCommandSenders\nimport unittest\nfrom experiments.ud_xilinx.watertank_simulation import Watertank\nfrom test.unit.experiments.ud_xilinx.test_server import FakeSerialPort, FakeHttpDevice\nimport voodoo.configuration as ConfigurationManager\n\nimport test.unit.configuration as configuration_module\nimport time\n\n\n# TODO: These tests are very incomplete.\n# However, certain \"advanced\" features are probably required for more effective testing,\n# such as the ability to control time.time() returns, etc.\n\nfrom mock import patch, Mock\nimport time\n\n\n# We mock the time so that we can control time.time and time.sleep.\n\n_time = 100\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _sleep_mock_handler(*args, **kwargs):\n global _time\n _time += args[0]", "metadata": "root._sleep_mock_handler", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def _time_mock_handler(*args, **kwargs):\n global _time\n return _time", "metadata": "root._time_mock_handler", "header": "['module', '___EOS___']", "index": 56 }, { "content": "class BasicUdXilinxExperimentTestCase(unittest.TestCase):\n\n\n\n\n\n\n\n # TODO: This test is currently failing. REPORT_SWITCHES shouldn't return a list, but a string.\n", "metadata": "root.BasicUdXilinxExperimentTestCase", "header": "['module', '___EOS___']", "index": 61 }, { "content": " def setUp(self):\n from voodoo.configuration import ConfigurationManager\n from voodoo.sessions.session_id import SessionId\n\n self.cfg_manager = ConfigurationManager()\n self.cfg_manager.append_module(configuration_module)\n self.cfg_manager._set_value(\"webcam\", \"http://localhost\")\n\n # For later.\n self.cfg_manager._set_value(\"weblab_xilinx_experiment_xilinx_device\", \"FPGA\")\n\n UdXilinxCommandSenders._SerialPort = FakeSerialPort\n UdXilinxCommandSenders._HttpDevice = FakeHttpDevice\n\n self.experiment = UdXilinxExperiment.UdXilinxExperiment(None, None, self.cfg_manager)\n\n self.lab_session_id = SessionId('my-session-id')", "metadata": "root.BasicUdXilinxExperimentTestCase.setUp", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 62 }, { "content": " def cleanUp(self):\n pass", "metadata": "root.BasicUdXilinxExperimentTestCase.cleanUp", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 80 }, { "content": " def test_basic_start(self):\n configjson = self.experiment.do_start_experiment()\n self.assertIsNotNone(configjson)", "metadata": "root.BasicUdXilinxExperimentTestCase.test_basic_start", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 83 }, { "content": " def test_basic_start_config(self):\n configjson = self.experiment.do_start_experiment()\n self.assertEquals(UdXilinxExperiment.STATE_NOT_READY, self.experiment._current_state)\n\n initconfig = json.loads(configjson)\n\n self.assertIsNotNone(initconfig)\n\n self.assertTrue(\"initial_configuration\" in initconfig)\n\n config = json.loads(initconfig[\"initial_configuration\"])\n\n self.assertTrue(\"webcam\" in config)", "metadata": "root.BasicUdXilinxExperimentTestCase.test_basic_start_config", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 87 }, { "content": " def test_basic_start_end(self):\n self.experiment.do_start_experiment()\n\n self.experiment.do_dispose()", "metadata": "root.BasicUdXilinxExperimentTestCase.test_basic_start_end", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 101 }, { "content": " def test_check_state(self):\n self.experiment.do_start_experiment()\n resp = self.experiment.do_send_command_to_device(\"STATE\")\n self.assertEquals(resp, \"STATE=\" + UdXilinxExperiment.STATE_NOT_READY)", "metadata": "root.BasicUdXilinxExperimentTestCase.test_check_state", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 107 }, { "content": " def _test_report_switches(self):\n self.experiment.do_start_experiment()\n resp = self.experiment.do_send_command_to_device(\"REPORT_SWITCHES\")\n self.assertEquals(\"1111111111\", resp)", "metadata": "root.BasicUdXilinxExperimentTestCase._test_report_switches", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 113 }, { "content": " def test_api_version(self):\n api = self.experiment.do_get_api()\n self.assertEquals(\"2\", api)", "metadata": "root.BasicUdXilinxExperimentTestCase.test_api_version", "header": "['class', 'BasicUdXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 118 }, { "content": "class EarlyKickingXilinxExperimentTestCase(unittest.TestCase):\n\n\n\n", "metadata": "root.EarlyKickingXilinxExperimentTestCase", "header": "['module', '___EOS___']", "index": 123 }, { "content": " def setUp(self):\n from voodoo.configuration import ConfigurationManager\n from voodoo.sessions.session_id import SessionId\n\n self.cfg_manager = ConfigurationManager()\n self.cfg_manager.append_module(configuration_module)\n self.cfg_manager._set_value(\"webcam\", \"http://localhost\")\n self.cfg_manager._set_value(\"weblab_xilinx_experiment_xilinx_device\", \"FPGA\")\n self.cfg_manager._set_value(\"xilinx_max_use_time\", \"3600\")\n\n UdXilinxCommandSenders._SerialPort = FakeSerialPort\n UdXilinxCommandSenders._HttpDevice = FakeHttpDevice\n\n self.experiment = UdXilinxExperiment.UdXilinxExperiment(None, None, self.cfg_manager)\n\n self.lab_session_id = SessionId('my-session-id')", "metadata": "root.EarlyKickingXilinxExperimentTestCase.setUp", "header": "['class', 'EarlyKickingXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 124 }, { "content": " def test_basic_start_config(self):\n configjson = self.experiment.do_start_experiment()\n self.assertEquals(UdXilinxExperiment.STATE_NOT_READY, self.experiment._current_state)\n\n initconfig = json.loads(configjson)\n\n self.assertIsNotNone(initconfig)\n\n self.assertTrue(\"initial_configuration\" in initconfig)\n\n config = json.loads(initconfig[\"initial_configuration\"])\n\n self.assertTrue(\"webcam\" in config)\n self.assertTrue(\"max_use_time\" in config)", "metadata": "root.EarlyKickingXilinxExperimentTestCase.test_basic_start_config", "header": "['class', 'EarlyKickingXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 142 }, { "content": " def test_cleanup(self):\n self.experiment.do_start_experiment()\n self.experiment.do_dispose()\n self.assertIsNone(self.experiment._use_time_start)", "metadata": "root.EarlyKickingXilinxExperimentTestCase.test_cleanup", "header": "['class', 'EarlyKickingXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 157 }, { "content": " def test_report(self):\n self.experiment.do_start_experiment()\n resp = self.experiment.do_send_command_to_device(\"REPORT_USE_TIME_LEFT\")\n\n self.assertEquals(\"unknown\", resp)", "metadata": "root.EarlyKickingXilinxExperimentTestCase.test_report", "header": "['class', 'EarlyKickingXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 162 }, { "content": "class PermissionsXilinxExperimentTestCase(unittest.TestCase):\n\n\n\n", "metadata": "root.PermissionsXilinxExperimentTestCase", "header": "['module', '___EOS___']", "index": 169 }, { "content": " def setUp(self):\n from voodoo.configuration import ConfigurationManager\n from voodoo.sessions.session_id import SessionId\n\n self.cfg_manager = ConfigurationManager()\n self.cfg_manager.append_module(configuration_module)\n self.cfg_manager._set_value(\"webcam\", \"http://localhost\")\n self.cfg_manager._set_value(\"weblab_xilinx_experiment_xilinx_device\", \"FPGA\")\n self.cfg_manager._set_value(\"xilinx_max_use_time\", \"3600\")\n self.cfg_manager._set_value(\"xilinx_bit_allowed\", False)\n\n UdXilinxCommandSenders._SerialPort = FakeSerialPort\n UdXilinxCommandSenders._HttpDevice = FakeHttpDevice\n\n self.experiment = UdXilinxExperiment.UdXilinxExperiment(None, None, self.cfg_manager)\n self.lab_session_id = SessionId('my-session-id')", "metadata": "root.PermissionsXilinxExperimentTestCase.setUp", "header": "['class', 'PermissionsXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 170 }, { "content": " def cleanUp(self):\n self.experiment.do_dispose()", "metadata": "root.PermissionsXilinxExperimentTestCase.cleanUp", "header": "['class', 'PermissionsXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 187 }, { "content": " def test_bit_disallowed(self):\n new_state = self.experiment.do_send_file_to_device(\"CONTENTS\", \"bit\")\n self.assertEquals(\"STATE=not_allowed\", new_state)", "metadata": "root.PermissionsXilinxExperimentTestCase.test_bit_disallowed", "header": "['class', 'PermissionsXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 190 }, { "content": " def test_vhd_allowed(self):\n new_state = self.experiment.do_send_file_to_device(\"CONTENTS\", \"vhd\")\n self.assertNotEquals(\"STATE=not_allowed\", new_state)", "metadata": "root.PermissionsXilinxExperimentTestCase.test_vhd_allowed", "header": "['class', 'PermissionsXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 194 }, { "content": " def test_all_disallowed(self):\n new_state = self.experiment.do_send_file_to_device(\"CONTENTS\", \"wha\");\n self.assertEquals(\"STATE=not_allowed\", new_state)", "metadata": "root.PermissionsXilinxExperimentTestCase.test_all_disallowed", "header": "['class', 'PermissionsXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 198 }, { "content": "class CompilerXilinxExperimentTestCase(unittest.TestCase):\n\n", "metadata": "root.CompilerXilinxExperimentTestCase", "header": "['module', '___EOS___']", "index": 203 }, { "content": " def setUp(self):\n from voodoo.configuration import ConfigurationManager\n from voodoo.sessions.session_id import SessionId\n\n self.cfg_manager = ConfigurationManager()\n self.cfg_manager.append_module(configuration_module)\n self.cfg_manager._set_value(\"webcam\", \"http://localhost\")\n\n # For later.\n self.cfg_manager._set_value(\"weblab_xilinx_experiment_xilinx_device\", \"FPGA\")\n\n UdXilinxCommandSenders._SerialPort = FakeSerialPort\n UdXilinxCommandSenders._HttpDevice = FakeHttpDevice\n\n self.experiment = UdXilinxExperiment.UdXilinxExperiment(None, None, self.cfg_manager)\n\n self.configjson = self.experiment.do_start_experiment()\n\n self.lab_session_id = SessionId('my-session-id')", "metadata": "root.CompilerXilinxExperimentTestCase.setUp", "header": "['class', 'CompilerXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 204 }, { "content": " @mock.patch(\"experiments.xilinxc.compiler.Compiler\")\n def test_compile(self, compiler_class):\n pass\n # TODO: Test isn't working for now.\n # thr = self.experiment._compile_program_file_t(\"CONTENTS\")\n # print thr", "metadata": "root.CompilerXilinxExperimentTestCase.test_compile", "header": "['class', 'CompilerXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 224 }, { "content": " def cleanUp(self):\n self.experiment.do_dispose()", "metadata": "root.CompilerXilinxExperimentTestCase.cleanUp", "header": "['class', 'CompilerXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 231 }, { "content": "class VirtualWorldXilinxExperimentTestCase(unittest.TestCase):\n\n\n\n", "metadata": "root.VirtualWorldXilinxExperimentTestCase", "header": "['module', '___EOS___']", "index": 235 }, { "content": " def setUp(self):\n from voodoo.configuration import ConfigurationManager\n from voodoo.sessions.session_id import SessionId\n\n self.cfg_manager = ConfigurationManager()\n self.cfg_manager.append_module(configuration_module)\n self.cfg_manager._set_value(\"webcam\", \"http://localhost\")\n\n # For later.\n self.cfg_manager._set_value(\"weblab_xilinx_experiment_xilinx_device\", \"FPGA\")\n\n UdXilinxCommandSenders._SerialPort = FakeSerialPort\n UdXilinxCommandSenders._HttpDevice = FakeHttpDevice\n\n self.experiment = UdXilinxExperiment.UdXilinxExperiment(None, None, self.cfg_manager)\n\n self.configjson = self.experiment.do_start_experiment()\n\n self.lab_session_id = SessionId('my-session-id')", "metadata": "root.VirtualWorldXilinxExperimentTestCase.setUp", "header": "['class', 'VirtualWorldXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 236 }, { "content": " def cleanUp(self):\n self.experiment.do_dispose()", "metadata": "root.VirtualWorldXilinxExperimentTestCase.cleanUp", "header": "['class', 'VirtualWorldXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 256 }, { "content": " def test_basic_state_command(self):\n resp = self.experiment.do_send_command_to_device(\"VIRTUALWORLD_STATE\")\n self.assertEquals(\"{}\", resp)", "metadata": "root.VirtualWorldXilinxExperimentTestCase.test_basic_state_command", "header": "['class', 'VirtualWorldXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 259 }, { "content": " def _test_virtualworld_mode_command(self):\n resp = self.experiment.do_send_command_to_device(\"VIRTUALWORLD_MODE watertank\")\n self.assertEquals(\"ok\", resp)", "metadata": "root.VirtualWorldXilinxExperimentTestCase._test_virtualworld_mode_command", "header": "['class', 'VirtualWorldXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 263 }, { "content": " def test_virtualworld_non_existant(self):\n resp = self.experiment.do_send_command_to_device(\"VIRTUALWORLD_MODE thisdoesntexist\")\n self.assertEquals(\"unknown_virtualworld\", resp)", "metadata": "root.VirtualWorldXilinxExperimentTestCase.test_virtualworld_non_existant", "header": "['class', 'VirtualWorldXilinxExperimentTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 267 }, { "content": "class WatertankSimulationTestCase(unittest.TestCase):\n\n\n", "metadata": "root.WatertankSimulationTestCase", "header": "['module', '___EOS___']", "index": 272 }, { "content": " def setUp(self):\n self.watertank = Watertank(1000, [10, 10], [10], 0.5)", "metadata": "root.WatertankSimulationTestCase.setUp", "header": "['class', 'WatertankSimulationTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 273 }, { "content": " def test_water_raises(self):\n so = self.watertank.get_json_state([20, 20], [20])\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertGreater(sf[\"water\"], so[\"water\"])", "metadata": "root.WatertankSimulationTestCase.test_water_raises", "header": "['class', 'WatertankSimulationTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 276 }, { "content": " def test_water_lowers(self):\n self.watertank.set_inputs([0, 0])\n\n so = self.watertank.get_json_state([20, 20], [20])\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertLess(sf[\"water\"], so[\"water\"])", "metadata": "root.WatertankSimulationTestCase.test_water_lowers", "header": "['class', 'WatertankSimulationTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 287 }, { "content": " def cleanUp(self):\n pass", "metadata": "root.WatertankSimulationTestCase.cleanUp", "header": "['class', 'WatertankSimulationTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 300 }, { "content": "class WatertankSimulationTestCaseTemperatures(unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.WatertankSimulationTestCaseTemperatures", "header": "['module', '___EOS___']", "index": 304 }, { "content": " def setUp(self):\n self.watertank = Watertank(1000, [10, 10], [10], 0.5, True)", "metadata": "root.WatertankSimulationTestCaseTemperatures.setUp", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 305 }, { "content": " def test_not_overheat(self):\n\n self.assertFalse(self.watertank.firstPumpOverheated)\n self.assertFalse(self.watertank.secondPumpOverheated)\n\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n self.assertFalse(self.watertank.firstPumpOverheated)\n self.assertFalse(self.watertank.secondPumpOverheated)", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_not_overheat", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 308 }, { "content": " def test_stay_within_temp_work_range(self):\n\n self.assertTrue(self.watertank.firstPumpWorkRange[1] >= self.watertank.firstPumpTemperature >=\n self.watertank.secondPumpWorkRange[0])\n\n for i in range(3):\n self.watertank.update(1)\n\n self.assertTrue(self.watertank.firstPumpWorkRange[1] >= self.watertank.firstPumpTemperature >=\n self.watertank.secondPumpWorkRange[0])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_stay_within_temp_work_range", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 320 }, { "content": " def test_water_raises(self):\n so = self.watertank.get_json_state([20, 20], [20])\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertGreater(sf[\"water\"], so[\"water\"])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_water_raises", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 331 }, { "content": " def test_water_lowers(self):\n self.watertank.set_inputs([0, 0])\n\n so = self.watertank.get_json_state([20, 20], [20])\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertLess(sf[\"water\"], so[\"water\"])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_water_lowers", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 342 }, { "content": " def test_left_temperature_raises(self):\n self.watertank.set_inputs([10, 0])\n\n so = self.watertank.get_json_state([20, 20], [20])\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertGreater(sf[\"temperatures\"][0], so[\"temperatures\"][0])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_left_temperature_raises", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 355 }, { "content": " def test_left_temperature_remains(self):\n self.watertank.set_inputs([0, 0])\n\n so = self.watertank.get_json_state([20, 20], [20])\n rso = self.watertank.firstPumpTemperature\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n rsf = self.watertank.firstPumpTemperature\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertEquals(rsf, rso)\n self.assertEquals(sf[\"temperatures\"][0], so[\"temperatures\"][0])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_left_temperature_remains", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 368 }, { "content": " def test_right_temperature_raises(self):\n self.watertank.set_inputs([0, 10])\n\n so = self.watertank.get_json_state([20, 20], [20])\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertGreater(sf[\"temperatures\"][1], so[\"temperatures\"][1])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_right_temperature_raises", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 384 }, { "content": " def test_right_temperature_remains(self):\n self.watertank.set_inputs([0, 0])\n\n so = self.watertank.get_json_state([20, 20], [20])\n rso = self.watertank.secondPumpTemperature\n for i in range(3):\n self.watertank.update(1)\n sf = self.watertank.get_json_state([20, 20], [20])\n rsf = self.watertank.secondPumpTemperature\n\n so = json.loads(so)\n sf = json.loads(sf)\n\n self.assertEquals(rsf, rso)\n self.assertEquals(sf[\"temperatures\"][1], so[\"temperatures\"][1])", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_right_temperature_remains", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 397 }, { "content": " def test_all_overheat(self):\n self.watertank.set_inputs([10, 10])\n\n for i in range(30):\n self.watertank.update(1)\n\n self.assertTrue(self.watertank.firstPumpOverheated)\n self.assertTrue(self.watertank.secondPumpOverheated)", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_all_overheat", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 413 }, { "content": " def test_all_recover_after_overheat(self):\n self.watertank.set_inputs([10, 10])\n\n for i in range(30):\n self.watertank.update(1)\n\n self.watertank.set_inputs([0, 0])\n\n for i in range(20):\n self.watertank.update(1)\n\n self.assertFalse(self.watertank.firstPumpOverheated)\n self.assertFalse(self.watertank.secondPumpOverheated)", "metadata": "root.WatertankSimulationTestCaseTemperatures.test_all_recover_after_overheat", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 422 }, { "content": " def cleanUp(self):\n pass", "metadata": "root.WatertankSimulationTestCaseTemperatures.cleanUp", "header": "['class', 'WatertankSimulationTestCaseTemperatures', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 436 }, { "content": "class FakeOpen(object):", "metadata": "root.FakeOpen", "header": "['module', '___EOS___']", "index": 440 }, { "content": " def read(self):\n return \"\"\"\n {\n \"inputs\" : [\n {\n \"inputNumber\": \"0\",\n \"value\": \"0\"\n },\n {\n \"inputNumber\": \"1\",\n \"value\": \"1\"\n },\n {\n \"inputNumber\": \"2\",\n \"value\": \"1\"\n },\n {\n \"inputNumber\": \"3\",\n \"value\": \"0\"\n },\n {\n \"inputNumber\": \"4\",\n \"value\": \"1\"\n },\n {\n \"inputNumber\": \"5\",\n \"value\": \"1\"\n },\n {\n \"inputNumber\": \"6\",\n \"value\": \"0\"\n },\n {\n \"inputNumber\": \"7\",\n \"value\": \"1\"\n }\n ]\n }\n \"\"\"", "metadata": "root.FakeOpen.read", "header": "['class', 'FakeOpen', '(', 'object', ')', ':', '___EOS___']", "index": 441 }, { "content": "def _ret_fake(self):\n return VirtualWorldXilinxExperimentTestCase.FakeOpen()", "metadata": "root._ret_fake", "header": "['module', '___EOS___']", "index": 482 }, { "content": "@patch(\"urllib2.urlopen\", new=_ret_fake)\ndef test_read_leds(self):\n resp = self.experiment.query_leds_from_json()\n self.assertEquals([\"0\", \"1\", \"1\", \"0\", \"1\", \"1\", \"0\", \"1\"], resp)\n\n resp = self.experiment.do_send_command_to_device(\"READ_LEDS\")\n self.assertEquals(\"01101101\", resp)", "metadata": "root.test_read_leds", "header": "['module', '___EOS___']", "index": 486 }, { "content": "def suite():\n return unittest.TestSuite(\n (\n # unittest.makeSuite(BasicUdXilinxExperimentTestCase),\n # unittest.makeSuite(PermissionsXilinxExperimentTestCase),\n # unittest.makeSuite(EarlyKickingXilinxExperimentTestCase),\n # unittest.makeSuite(VirtualWorldXilinxExperimentTestCase),\n # unittest.makeSuite(WatertankSimulationTestCase),\n # unittest.makeSuite(WatertankSimulationTestCaseTemperatures)\n )\n )", "metadata": "root.suite", "header": "['module', '___EOS___']", "index": 495 }, { "content": "class FakeImpact(object):\n\n\n", "metadata": "root.FakeImpact", "header": "['module', '___EOS___']", "index": 508 }, { "content": " def __init__(self):\n super(FakeImpact, self).__init__()", "metadata": "root.FakeImpact.__init__", "header": "['class', 'FakeImpact', '(', 'object', ')', ':', '___EOS___']", "index": 509 }, { "content": " def program_device(self, program_path):\n pass", "metadata": "root.FakeImpact.program_device", "header": "['class', 'FakeImpact', '(', 'object', ')', ':', '___EOS___']", "index": 512 }, { "content": " def source2svf(self, program_path):\n pass", "metadata": "root.FakeImpact.source2svf", "header": "['class', 'FakeImpact', '(', 'object', ')', ':', '___EOS___']", "index": 515 }, { "content": " def get_suffix(self):\n return \"whatever\"", "metadata": "root.FakeImpact.get_suffix", "header": "['class', 'FakeImpact', '(', 'object', ')', ':', '___EOS___']", "index": 518 }, { "content": "class FakeSerialPort(object):\n\n\n\n", "metadata": "root.FakeSerialPort", "header": "['module', '___EOS___']", "index": 522 }, { "content": " def __init__(self):\n super(FakeSerialPort, self).__init__()\n self.dict = {'open': 0, 'close': 0, 'send': 0}\n self.codes = []", "metadata": "root.FakeSerialPort.__init__", "header": "['class', 'FakeSerialPort', '(', 'object', ')', ':', '___EOS___']", "index": 523 }, { "content": " def _increment(self, sth):\n self.dict[sth] = self.dict[sth] + 1", "metadata": "root.FakeSerialPort._increment", "header": "['class', 'FakeSerialPort', '(', 'object', ')', ':', '___EOS___']", "index": 528 }, { "content": " def open_serial_port(self, number):\n self._increment('open')", "metadata": "root.FakeSerialPort.open_serial_port", "header": "['class', 'FakeSerialPort', '(', 'object', ')', ':', '___EOS___']", "index": 531 }, { "content": " def send_code(self, n):\n self._increment('send')\n self.codes.append(n)", "metadata": "root.FakeSerialPort.send_code", "header": "['class', 'FakeSerialPort', '(', 'object', ')', ':', '___EOS___']", "index": 534 }, { "content": " def close_serial_port(self):\n self._increment('close')", "metadata": "root.FakeSerialPort.close_serial_port", "header": "['class', 'FakeSerialPort', '(', 'object', ')', ':', '___EOS___']", "index": 538 }, { "content": "class FakeHttpDevice(object):\n", "metadata": "root.FakeHttpDevice", "header": "['module', '___EOS___']", "index": 542 }, { "content": " def __init__(self, *args, **kargs):\n super(FakeHttpDevice, self).__init__()\n self.sent = 0\n self.msgs = []", "metadata": "root.FakeHttpDevice.__init__", "header": "['class', 'FakeHttpDevice', '(', 'object', ')', ':', '___EOS___']", "index": 543 }, { "content": " def send_message(self, msg):\n self.sent += len(msg)\n self.msgs.append(msg)", "metadata": "root.FakeHttpDevice.send_message", "header": "['class', 'FakeHttpDevice', '(', 'object', ')', ':', '___EOS___']", "index": 548 } ]
[ { "span": "import experiments.ud_xilinx.exc as UdXilinxExperimentErrors", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 60 }, { "span": "import voodoo.configuration as ConfigurationManager", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 51 }, { "span": "import time", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 11 }, { "span": "from mock import patch, Mock", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 28 }, { "span": "import time", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2005", " ", "on", "ward", "s", " ", "Univers", "it", "y", " ", "of", " ", "De", "ust", "o_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "software", " ", "is", " ", "license", "d", " ", "as", " ", "descri", "bed", " ", "in", " ", "the", " ", "file", " ", "COPY", "ING", ",", " ", "which_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "as", " ", "part", " ", "of", " ", "this", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "software", " ", "consi", "sts", " ", "of", " ", "contributions", " ", "made", " ", "by", " ", "many", " ", "individual", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "liste", "d", " ", "belo", "w", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Lu", "is", " ", "Rod", "rig", "ue", "z", " ", "<", "lui", "s", ".", "rod", "rig", "ue", "zg", "il", "@", "deu", "sto", ".", "es", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "The", " ", "purpose", " ", "of", " ", "creati", "ng", " ", "a", " ", "new", " ", "file", " ", "(", "test\\u", "server", "\\u", "logic", ".", "py", ")", " ", "rat", "her", " ", "than", " ", "usi", "ng", " ", "the", " ", "existing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test\\u", "server", ".", "py", " ", "is", " ", "mainl", "y", " ", "bec", "aus", "e", " ", "some", " ", "method", "s", " ", "from", " ", "test\\u", "server", ".", "py", " ", "see", "m", " ", "to", " ", "be", " ", "faili", "ng", " ", "but", " ", "shou", "ld", "n", "'", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", ",", " ", "the", " ", "tests", " ", "here", " ", "are", " ", "mean", "t", " ", "to", " ", "be", " ", "higher", " ", "level", " ", "than", " ", "the", " ", "test\\u", "server", ".", "py", " ", "tests", ",", " ", "whi", "ch", " ", "see", "m", " ", "to", " ", "be", " ", "orient", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "towards", " ", "board", "-", "program", "ming", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mock_", "import_", "patch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "experiments_", "._", "ud", "\\u", "xi", "lin", "x_", "._", "server_", "as_", "Ud", "Xi", "lin", "x", "Experiment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "experiments_", "._", "ud", "\\u", "xi", "lin", "x_", "._", "exc_", "as_", "Ud", "Xi", "lin", "x", "Experiment", "Errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "experiments_", "._", "ud", "\\u", "xi", "lin", "x_", "import_", "command", "\\u", "sender", "s_", "as_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "experiments_", "._", "ud", "\\u", "xi", "lin", "x_", "._", "water", "tank", "\\u", "simulation_", "import_", "Water", "tank", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "unit_", "._", "experiments_", "._", "ud", "\\u", "xi", "lin", "x_", "._", "test\\u", "server_", "import_", "Fake", "Ser", "ial", "Port_", ",_", "Fake", "Http", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vo", "odoo_", "._", "configuration_", "as_", "Configura", "tion", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "test_", "._", "unit_", "._", "configuration_", "as_", "configura", "tion", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "The", "se", " ", "tests", " ", "are", " ", "very", " ", "incomplete", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "we", "ver", ",", " ", "cert", "ain", " ", "\"", "advanced", "\"", " ", "features", " ", "are", " ", "probab", "ly", " ", "require", "d", " ", "for", " ", "more", " ", "effective", " ", "testi", "ng", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "suc", "h", " ", "as", " ", "the", " ", "abilit", "y", " ", "to", " ", "control", " ", "time", ".", "time", "()", " ", "return", "s", ",", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mock_", "import_", "patch_", ",_", "Mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "mock", " ", "the", " ", "time", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "control", " ", "time", ".", "time", " ", "and", " ", "time", ".", "sleep", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "time_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "sleep", "\\u", "mock", "\\u", "handler_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "time_", "+=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "time", "\\u", "mock", "\\u", "handler_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Thi", "s", " ", "test", " ", "is", " ", "currentl", "y", " ", "faili", "ng", ".", " ", "REPORT", "\\u", "SWITCH", "ES", " ", "shou", "ld", "n", "'", "t", " ", "return", " ", "a", " ", "list", ",", " ", "but", " ", "a", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vo", "odoo_", "._", "configuration_", "import_", "Configura", "tion", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vo", "odoo_", "._", "sessions_", "._", "session", "\\u", "id_", "import_", "Sess", "ion", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "=_", "Configura", "tion", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "append", "\\u", "module_", "(_", "configura", "tion", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webca", "m", "\"_", ",_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webla", "b", "\\u", "xi", "lin", "x", "\\u", "experiment", "\\u", "xi", "lin", "x", "\\u", "device", "\"_", ",_", "\"", "FP", "GA", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Ser", "ial", "Port_", "=_", "Fake", "Ser", "ial", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Http", "Device_", "=_", "Fake", "Http", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "experiment_", "=_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "Ud", "Xi", "lin", "x", "Experiment_", "(_", "None_", ",_", "None_", ",_", "self_", "._", "cfg", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lab", "\\u", "session", "\\u", "id_", "=_", "Sess", "ion", "Id_", "(_", "'", "my", "-", "session", "-", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "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", "basic", "\\u", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config", "json_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "config", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "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", "basic", "\\u", "start", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config", "json_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "STATE", "\\u", "NOT", "\\u", "READY", "_", ",_", "self_", "._", "experiment_", "._", "\\u", "current", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "init", "config_", "=_", "json_", "._", "loads_", "(_", "config", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "init", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "initial", "\\u", "configura", "tion", "\"_", "in_", "init", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "json_", "._", "loads_", "(_", "init", "config_", "[_", "\"", "initial", "\\u", "configura", "tion", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "webca", "m", "\"_", "in_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "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", "basic", "\\u", "start", "\\u", "end_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "experiment_", "._", "do", "\\u", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "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", "check", "\\u", "state_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "STATE", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "resp_", ",_", "\"", "STATE", "=\"_", "+_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "STATE", "\\u", "NOT", "\\u", "READY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "report", "\\u", "switches_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "REPORT", "\\u", "SWITCH", "ES", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "11111111", "11", "\"_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "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", "api", "\\u", "version_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "api_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "get", "\\u", "api_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "2", "\"_", ",_", "api_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Earl", "y", "Kick", "ing", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Earl", "y", "Kick", "ing", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vo", "odoo_", "._", "configuration_", "import_", "Configura", "tion", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vo", "odoo_", "._", "sessions_", "._", "session", "\\u", "id_", "import_", "Sess", "ion", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "=_", "Configura", "tion", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "append", "\\u", "module_", "(_", "configura", "tion", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webca", "m", "\"_", ",_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webla", "b", "\\u", "xi", "lin", "x", "\\u", "experiment", "\\u", "xi", "lin", "x", "\\u", "device", "\"_", ",_", "\"", "FP", "GA", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "xi", "lin", "x", "\\u", "max", "\\u", "use", "\\u", "time", "\"_", ",_", "\"", "3600", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Ser", "ial", "Port_", "=_", "Fake", "Ser", "ial", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Http", "Device_", "=_", "Fake", "Http", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "experiment_", "=_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "Ud", "Xi", "lin", "x", "Experiment_", "(_", "None_", ",_", "None_", ",_", "self_", "._", "cfg", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lab", "\\u", "session", "\\u", "id_", "=_", "Sess", "ion", "Id_", "(_", "'", "my", "-", "session", "-", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Earl", "y", "Kick", "ing", "Xi", "lin", "x", "Experiment", "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", "basic", "\\u", "start", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config", "json_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "STATE", "\\u", "NOT", "\\u", "READY", "_", ",_", "self_", "._", "experiment_", "._", "\\u", "current", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "init", "config_", "=_", "json_", "._", "loads_", "(_", "config", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "Not", "None_", "(_", "init", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "initial", "\\u", "configura", "tion", "\"_", "in_", "init", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "json_", "._", "loads_", "(_", "init", "config_", "[_", "\"", "initial", "\\u", "configura", "tion", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "webca", "m", "\"_", "in_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "max", "\\u", "use", "\\u", "time", "\"_", "in_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Earl", "y", "Kick", "ing", "Xi", "lin", "x", "Experiment", "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", "cleanup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "experiment_", "._", "do", "\\u", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "self_", "._", "experiment_", "._", "\\u", "use", "\\u", "time", "\\u", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Earl", "y", "Kick", "ing", "Xi", "lin", "x", "Experiment", "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", "report_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "REPORT", "\\u", "USE", "\\u", "TIME", "\\u", "LEF", "T", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "unknown", "\"_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vo", "odoo_", "._", "configuration_", "import_", "Configura", "tion", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vo", "odoo_", "._", "sessions_", "._", "session", "\\u", "id_", "import_", "Sess", "ion", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "=_", "Configura", "tion", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "append", "\\u", "module_", "(_", "configura", "tion", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webca", "m", "\"_", ",_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webla", "b", "\\u", "xi", "lin", "x", "\\u", "experiment", "\\u", "xi", "lin", "x", "\\u", "device", "\"_", ",_", "\"", "FP", "GA", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "xi", "lin", "x", "\\u", "max", "\\u", "use", "\\u", "time", "\"_", ",_", "\"", "3600", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "xi", "lin", "x", "\\u", "bit", "\\u", "allow", "ed", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Ser", "ial", "Port_", "=_", "Fake", "Ser", "ial", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Http", "Device_", "=_", "Fake", "Http", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "experiment_", "=_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "Ud", "Xi", "lin", "x", "Experiment_", "(_", "None_", ",_", "None_", ",_", "self_", "._", "cfg", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lab", "\\u", "session", "\\u", "id_", "=_", "Sess", "ion", "Id_", "(_", "'", "my", "-", "session", "-", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "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", "bit", "\\u", "disallow", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "state_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "file", "\\u", "to", "\\u", "device_", "(_", "\"", "CONTE", "NTS", "\"_", ",_", "\"", "bit", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "STATE", "=", "not", "\\u", "allow", "ed", "\"_", ",_", "new", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "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", "vhd", "\\u", "allowed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "state_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "file", "\\u", "to", "\\u", "device_", "(_", "\"", "CONTE", "NTS", "\"_", ",_", "\"", "vhd", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "\"", "STATE", "=", "not", "\\u", "allow", "ed", "\"_", ",_", "new", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "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", "all", "\\u", "disallow", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "state_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "file", "\\u", "to", "\\u", "device_", "(_", "\"", "CONTE", "NTS", "\"_", ",_", "\"", "wh", "a", "\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "STATE", "=", "not", "\\u", "allow", "ed", "\"_", ",_", "new", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Compil", "er", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Compil", "er", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vo", "odoo_", "._", "configuration_", "import_", "Configura", "tion", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vo", "odoo_", "._", "sessions_", "._", "session", "\\u", "id_", "import_", "Sess", "ion", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "=_", "Configura", "tion", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "append", "\\u", "module_", "(_", "configura", "tion", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webca", "m", "\"_", ",_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webla", "b", "\\u", "xi", "lin", "x", "\\u", "experiment", "\\u", "xi", "lin", "x", "\\u", "device", "\"_", ",_", "\"", "FP", "GA", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Ser", "ial", "Port_", "=_", "Fake", "Ser", "ial", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Http", "Device_", "=_", "Fake", "Http", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "experiment_", "=_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "Ud", "Xi", "lin", "x", "Experiment_", "(_", "None_", ",_", "None_", ",_", "self_", "._", "cfg", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config", "json_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lab", "\\u", "session", "\\u", "id_", "=_", "Sess", "ion", "Id_", "(_", "'", "my", "-", "session", "-", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compil", "er", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "\"", "experiment", "s", ".", "xi", "lin", "xc", ".", "compiler", ".", "Compil", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "compile_", "(_", "self_", ",_", "compiler", "\\u", "class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Test", " ", "isn", "'", "t", " ", "working", " ", "for", " ", "now", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "thr", " ", "=", " ", "self", ".", "experiment", ".\\u", "compile", "\\u", "program", "\\u", "file", "\\u", "t", "(\"", "CONTE", "NTS", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "thr_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Compil", "er", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vo", "odoo_", "._", "configuration_", "import_", "Configura", "tion", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vo", "odoo_", "._", "sessions_", "._", "session", "\\u", "id_", "import_", "Sess", "ion", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "=_", "Configura", "tion", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "append", "\\u", "module_", "(_", "configura", "tion", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webca", "m", "\"_", ",_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg", "\\u", "manager_", "._", "\\u", "set\\u", "value_", "(_", "\"", "webla", "b", "\\u", "xi", "lin", "x", "\\u", "experiment", "\\u", "xi", "lin", "x", "\\u", "device", "\"_", ",_", "\"", "FP", "GA", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Ser", "ial", "Port_", "=_", "Fake", "Ser", "ial", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ud", "Xi", "lin", "x", "Command", "Sen", "ders", "_", "._", "\\u", "Http", "Device_", "=_", "Fake", "Http", "Device_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "experiment_", "=_", "Ud", "Xi", "lin", "x", "Experiment_", "._", "Ud", "Xi", "lin", "x", "Experiment_", "(_", "None_", ",_", "None_", ",_", "self_", "._", "cfg", "\\u", "manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config", "json_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "start", "\\u", "experiment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lab", "\\u", "session", "\\u", "id_", "=_", "Sess", "ion", "Id_", "(_", "'", "my", "-", "session", "-", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "experiment_", "._", "do", "\\u", "dispose", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "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", "basic", "\\u", "state", "\\u", "command_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "VIRTUAL", "WORLD", "\\u", "STATE", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"{}\"_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "virtual", "world", "\\u", "mode", "\\u", "command_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "VIRTUAL", "WORLD", "\\u", "MODE", " ", "water", "tank", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "ok", "\"_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "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", "virtual", "world", "\\u", "non", "\\u", "exist", "ant_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "VIRTUAL", "WORLD", "\\u", "MODE", " ", "this", "doesnt", "exist", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "unknown", "\\u", "virtual", "world", "\"_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Water", "tank", "Simul", "ation", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "=_", "Water", "tank", "_", "(_", "1000_", ",_", "[_", "10_", ",_", "10_", "]_", ",_", "[_", "10_", "]_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "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", "water", "\\u", "raises_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "sf_", "[_", "\"", "water", "\"_", "]_", ",_", "so_", "[_", "\"", "water", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "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", "water", "\\u", "lower", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "sf_", "[_", "\"", "water", "\"_", "]_", ",_", "so_", "[_", "\"", "water", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "Up_", "(_", "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_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "=_", "Water", "tank", "_", "(_", "1000_", ",_", "[_", "10_", ",_", "10_", "]_", ",_", "[_", "10_", "]_", ",_", "0.5_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "not", "\\u", "over", "heat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "stay", "\\u", "within", "\\u", "temp", "\\u", "work", "\\u", "range_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Work", "Range_", "[_", "1_", "]_", ">=_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Temperature_", ">=_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Work", "Range_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Work", "Range_", "[_", "1_", "]_", ">=_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Temperature_", ">=_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Work", "Range_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "water", "\\u", "raises_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "sf_", "[_", "\"", "water", "\"_", "]_", ",_", "so_", "[_", "\"", "water", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "water", "\\u", "lower", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "sf_", "[_", "\"", "water", "\"_", "]_", ",_", "so_", "[_", "\"", "water", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "left", "\\u", "tempe", "ratur", "e\\u", "raises_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "10_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "sf_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "0_", "]_", ",_", "so_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "left", "\\u", "tempe", "ratur", "e\\u", "remains", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rs", "o_", "=_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Temperature_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rs", "f_", "=_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Temperature_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "rs", "f_", ",_", "rs", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "sf_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "0_", "]_", ",_", "so_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "right", "\\u", "tempe", "ratur", "e\\u", "raises_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "0_", ",_", "10_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Greater_", "(_", "sf_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "1_", "]_", ",_", "so_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "right", "\\u", "tempe", "ratur", "e\\u", "remains", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rs", "o_", "=_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Temperature_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sf_", "=_", "self_", "._", "water", "tank", "_", "._", "get", "\\u", "json", "\\u", "state_", "(_", "[_", "20_", ",_", "20_", "]_", ",_", "[_", "20_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rs", "f_", "=_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Temperature_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "so_", "=_", "json_", "._", "loads_", "(_", "so_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sf_", "=_", "json_", "._", "loads_", "(_", "sf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "rs", "f_", ",_", "rs", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "sf_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "1_", "]_", ",_", "so_", "[_", "\"", "temperatures", "\"_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "all", "\\u", "over", "heat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "10_", ",_", "10_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "30_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "all", "\\u", "recover", "\\u", "after", "\\u", "over", "heat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "10_", ",_", "10_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "30_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "water", "tank", "_", "._", "set\\u", "inputs_", "(_", "[_", "0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "20_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "water", "tank", "_", "._", "update_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "water", "tank", "_", "._", "first", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "water", "tank", "_", "._", "second", "Pump", "Over", "heat", "ed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean", "Up_", "(_", "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_", "Fake", "Open_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Open_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "read_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "\"", "inputs", "\"", " ", ":", " ", "[", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "0", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "0", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "1", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "1", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "2", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "1", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "3", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "0", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "4", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "1", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "5", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "1", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "6", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "0", "\"", "\\", "10", ";", " ", " ", "},", "\\", "10", ";", " ", " ", "{", "\\", "10", ";", " ", " ", "\"", "input", "Number", "\":", " ", "\"", "7", "\",", "\\", "10", ";", " ", " ", "\"", "value", "\":", " ", "\"", "1", "\"", "\\", "10", ";", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "]", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "ret", "\\u", "fake_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "Test", "Case_", "._", "Fake", "Open_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "\"", "url", "lib", "2", ".", "urlo", "pen", "\"_", ",_", "new_", "=_", "\\u", "ret", "\\u", "fake_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "read", "\\u", "leds", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "experiment_", "._", "query", "\\u", "leds", "\\u", "from", "\\u", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "[_", "\"", "0", "\"_", ",_", "\"", "1", "\"_", ",_", "\"", "1", "\"_", ",_", "\"", "0", "\"_", ",_", "\"", "1", "\"_", ",_", "\"", "1", "\"_", ",_", "\"", "0", "\"_", ",_", "\"", "1", "\"_", "]_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "experiment_", "._", "do", "\\u", "send", "\\u", "command", "\\u", "to", "\\u", "device_", "(_", "\"", "READ", "\\u", "LED", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "0110", "1101", "\"_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "suite_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unittest_", "._", "Test", "Suite_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "make", "Suit", "e", "(", "Basic", "Ud", "Xi", "lin", "x", "Experiment", "Test", "Case", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "make", "Suit", "e", "(", "Permi", "ssion", "s", "Xi", "lin", "x", "Experiment", "Test", "Case", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "make", "Suit", "e", "(", "Earl", "y", "Kick", "ing", "Xi", "lin", "x", "Experiment", "Test", "Case", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "make", "Suit", "e", "(", "Virt", "ual", "Wor", "ld", "Xi", "lin", "x", "Experiment", "Test", "Case", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "make", "Suit", "e", "(", "Water", "tank", "Simul", "ation", "Test", "Case", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unittest", ".", "make", "Suit", "e", "(", "Water", "tank", "Simul", "ation", "Test", "Case", "Tempe", "ratur", "es", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Fake", "Imp", "act_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Imp", "act_", "(_", "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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Fake", "Imp", "act_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Imp", "act_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "program", "\\u", "device_", "(_", "self_", ",_", "program", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Imp", "act_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "source", "2s", "vf_", "(_", "self_", ",_", "program", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Imp", "act_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "suffix_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "what", "ever", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Fake", "Ser", "ial", "Port_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Ser", "ial", "Port_", "(_", "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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Fake", "Ser", "ial", "Port_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dict_", "=_", "{_", "'", "open", "'_", ":_", "0_", ",_", "'", "close", "'_", ":_", "0_", ",_", "'", "send", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "codes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Ser", "ial", "Port_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "increment_", "(_", "self_", ",_", "sth", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dict_", "[_", "sth", "_", "]_", "=_", "self_", "._", "dict_", "[_", "sth", "_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Ser", "ial", "Port_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "open", "\\u", "serial", "\\u", "port_", "(_", "self_", ",_", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "increment_", "(_", "'", "open", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Ser", "ial", "Port_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "code_", "(_", "self_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "increment_", "(_", "'", "send", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "codes_", "._", "append_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Ser", "ial", "Port_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close", "\\u", "serial", "\\u", "port_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "increment_", "(_", "'", "close", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Fake", "Http", "Device_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Http", "Device_", "(_", "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_", ",_", "*_", "args_", ",_", "**_", "kargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Fake", "Http", "Device_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sent_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "msgs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fake", "Http", "Device_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "message_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sent_", "+=_", "len_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "msgs_", "._", "append_", "(_", "msg_", ")_", "\\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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unnecessary pass
PyCQA/pycodestyle/testsuite/E26.py
[ { "content": "#: E261:1:5\npass # an inline comment\n#: E262:1:12\nx = x + 1 #Increment x\n#: E262:1:12\nx = x + 1 # Increment x\n#: E262:1:12\nx = y + 1 #: Increment x\n#: E265:1:1\n#Block comment\na = 1\n#: E265:2:1\nm = 42\n#! This is important\nmx = 42 - 42\n#: E266:3:5 E266:6:5\n#: E265:1:1 E266:2:1\n##if DEBUG:\n## logging.error()\n#: W291:1:42\n######################################### \n#:\n\n#: Okay\n#!/usr/bin/env python\n\npass # an inline comment\nx = x + 1 # Increment x\ny = y + 1 #: Increment x\n\n# Block comment\na = 1\n\n# Block comment1\n\n# Block comment2\naaa = 1\n\n\n# example of docstring (not parsed)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "pass ", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 4 }, { "span": "pass ", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 4 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", ":", " ", "E2", "6", "1", ":", "1", ":", "5_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "#", " ", "an", " ", "inline", " ", "comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "2", ":", "1", ":", "12_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "x_", "+_", "1_", "#", "Increment", " ", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "2", ":", "1", ":", "12_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "x_", "+_", "1_", "#", " ", " ", "Increment", " ", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "2", ":", "1", ":", "12_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "y_", "+_", "1_", "#", ":", " ", " ", "Increment", " ", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "5", ":", "1", ":", "1_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Block", " ", "comment_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "5", ":", "2", ":", "1_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#!", " ", "Thi", "s", " ", "is", " ", "importa", "nt_", "\\u\\u\\uNL\\u\\u\\u_", "mx_", "=_", "42_", "-_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "6", ":", "3", ":", "5", " ", "E2", "6", "6", ":", "6", ":", "5_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", ":", " ", "E2", "6", "5", ":", "1", ":", "1", " ", "E2", "6", "6", ":", "2", ":", "1_", "\\u\\u\\uNL\\u\\u\\u_", "##", "if", " ", "DEBU", "G", ":_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "logg", "ing", ".", "error", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "W2", "9", "1", ":", "1", ":", "42_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "######", "##", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "Ok", "ay_", "\\u\\u\\uNL\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "#", " ", "an", " ", "inline", " ", "comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "x_", "+_", "1_", "#", " ", "Increment", " ", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "y_", "+_", "1_", "#", ":", " ", "Increment", " ", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Block", " ", "comment_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Block", " ", "comment", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Block", " ", "comment", "2_", "\\u\\u\\uNL\\u\\u\\u_", "aaa", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
c4all/c4all/admin/tests/user.py
[ { "content": " def test_get_users_returns_all_users_except_admin(self):\n thread = Thread.objects.create(site=self.site)\n Comment.objects.create(thread=thread, user=self.user)\n Comment.objects.create(thread=thread, user=self.user_hidden)\n Comment.objects.create(thread=thread, user=self.admin)\n\n resp = self.client.get(reverse(\"c4all_admin:get_users\",\n args=[self.site.id]))\n\n self.assertEqual(resp.status_code, 200)\n users = resp.context['users'].object_list\n\n self.assertTrue(self.user in users)\n self.assertTrue(self.user_hidden in users)\n self.assertTrue(self.admin not in users)", "metadata": "root.AdminUsertestCases.test_get_users_returns_all_users_except_admin", "header": "['class', 'AdminUsertestCases', '(', 'TestCase', ')', ':', '___EOS___']", "index": 40 }, { "content": " def test_get_hidden_users_returns_hidden_users(self):\n thread = Thread.objects.create(site=self.site)\n Comment.objects.create(thread=thread, user=self.user)\n Comment.objects.create(thread=thread, user=self.user_hidden)\n\n resp = self.client.get(reverse(\"c4all_admin:get_users\",\n args=[self.site.id]), {\"hidden\": True})\n self.assertTrue(resp.status_code, 200)\n\n users = resp.context['users'].object_list\n\n self.assertTrue(self.user_hidden in users)\n self.assertFalse(self.user in users)", "metadata": "root.AdminUsertestCases.test_get_hidden_users_returns_hidden_users", "header": "['class', 'AdminUsertestCases', '(', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_user_bulk_actions_hide_successfully_hides_users(self):\n users = User.objects.filter(hidden=True)\n self.assertEqual(users.count(), 1)\n\n resp = self.client.post(\n reverse(\"c4all_admin:user_bulk_actions\"),\n {\n \"site_id\": self.site.id,\n \"action\": [\"hide\"],\n \"choices\": [self.user.id]\n }\n )\n\n self.assertEqual(resp.status_code, 302)\n users = User.objects.filter(hidden=True)\n self.assertEqual(users.count(), 2)\n self.assertTrue(self.user in users)", "metadata": "root.AdminUsertestCases.test_user_bulk_actions_hide_successfully_hides_users", "header": "['class', 'AdminUsertestCases', '(', 'TestCase', ')', ':', '___EOS___']", "index": 110 }, { "content": " def test_user_bulk_actions_hide_successfully_hides_user_not_admin(self):\n site2 = Site.objects.create(domain='www.example.com')\n users = Site.objects.get(id=site2.id).hidden_users.all()\n self.assertEqual(users.count(), 0)\n self.assertTrue(self.admin not in users)\n\n resp = self.client.post(\n reverse(\"c4all_admin:user_bulk_actions\"),\n {\n \"site_id\": site2.id,\n \"action\": [\"hide\"],\n \"choices\": [self.user.id, self.admin.id]\n }\n )\n\n self.assertEqual(resp.status_code, 302)\n users = Site.objects.get(id=site2.id).hidden_users.all()\n self.assertEqual(users.count(), 1)\n self.assertTrue(self.admin not in users)", "metadata": "root.AdminUsertestCases.test_user_bulk_actions_hide_successfully_hides_user_not_admin", "header": "['class', 'AdminUsertestCases', '(', 'TestCase', ')', ':', '___EOS___']", "index": 128 }, { "content": " def test_user_bulk_actions_hide_hidden_user_doesnt_change_status(self):\n resp = self.client.post(\n reverse(\"c4all_admin:user_bulk_actions\"),\n {\n \"site_id\": self.site.id,\n \"action\": [\"hide\"],\n \"choices\": [self.user_hidden.id]\n }\n )\n\n self.assertEqual(resp.status_code, 302)\n users = User.objects.filter(hidden=True)\n self.assertEqual(users.count(), 1)\n self.assertTrue(self.user_hidden in users)", "metadata": "root.AdminUsertestCases.test_user_bulk_actions_hide_hidden_user_doesnt_change_status", "header": "['class', 'AdminUsertestCases', '(', 'TestCase', ')', ':', '___EOS___']", "index": 148 } ]
[ { "span": "self.assertTrue(self.user in users)", "start_line": 52, "start_column": 8, "end_line": 52, "end_column": 43 }, { "span": "self.assertTrue(self.user_hidden in users)", "start_line": 53, "start_column": 8, "end_line": 53, "end_column": 50 }, { "span": "self.assertTrue(self.admin not in users)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 48 }, { "span": "self.assertTrue(self.user_hidden in users)", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 50 }, { "span": "self.assertFalse(self.user in users)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 44 }, { "span": "self.assertTrue(self.user in users)", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 43 }, { "span": "self.assertTrue(self.admin not in users)", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 48 }, { "span": "self.assertTrue(self.admin not in users)", "start_line": 146, "start_column": 8, "end_line": 146, "end_column": 48 }, { "span": "self.assertTrue(self.user_hidden in users)", "start_line": 161, "start_column": 8, "end_line": 161, "end_column": 50 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Admi", "n", "User", "test", "Cases_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "users", "\\u", "return", "s", "\\u", "all", "\\u", "users", "\\u", "except", "\\u", "admin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "Thread_", "._", "objects_", "._", "create_", "(_", "site_", "=_", "self_", "._", "site_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Comment_", "._", "objects_", "._", "create_", "(_", "thread_", "=_", "thread_", ",_", "user_", "=_", "self_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Comment_", "._", "objects_", "._", "create_", "(_", "thread_", "=_", "thread_", ",_", "user_", "=_", "self_", "._", "user", "\\u", "hidden_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Comment_", "._", "objects_", "._", "create_", "(_", "thread_", "=_", "thread_", ",_", "user_", "=_", "self_", "._", "admin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "reverse_", "(_", "\"", "c4", "all", "\\u", "admin", ":", "get", "\\u", "users", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "self_", "._", "site_", "._", "id_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "=_", "resp_", "._", "context_", "[_", "'", "users", "'_", "]_", "._", "object\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user", "\\u", "hidden_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "admin_", "not_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Admi", "n", "User", "test", "Cases_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "hidden", "\\u", "users", "\\u", "return", "s", "\\u", "hidden", "\\u", "users_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "Thread_", "._", "objects_", "._", "create_", "(_", "site_", "=_", "self_", "._", "site_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Comment_", "._", "objects_", "._", "create_", "(_", "thread_", "=_", "thread_", ",_", "user_", "=_", "self_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Comment_", "._", "objects_", "._", "create_", "(_", "thread_", "=_", "thread_", ",_", "user_", "=_", "self_", "._", "user", "\\u", "hidden_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "reverse_", "(_", "\"", "c4", "all", "\\u", "admin", ":", "get", "\\u", "users", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "self_", "._", "site_", "._", "id_", "]_", ")_", ",_", "{_", "\"", "hidden", "\"_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", "=_", "resp_", "._", "context_", "[_", "'", "users", "'_", "]_", "._", "object\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user", "\\u", "hidden_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "user_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Admi", "n", "User", "test", "Cases_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "user", "\\u", "bul", "k", "\\u", "action", "s", "\\u", "hide", "\\u", "success", "full", "y", "\\u", "hide", "s", "\\u", "users_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "users_", "=_", "User_", "._", "objects_", "._", "filter_", "(_", "hidden_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "users_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "\"", "c4", "all", "\\u", "admin", ":", "user", "\\u", "bul", "k", "\\u", "action", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "site", "\\u", "id", "\"_", ":_", "self_", "._", "site_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "[_", "\"", "hide", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "choice", "s", "\"_", ":_", "[_", "self_", "._", "user_", "._", "id_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "302_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "=_", "User_", "._", "objects_", "._", "filter_", "(_", "hidden_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "users_", "._", "count_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Admi", "n", "User", "test", "Cases_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "user", "\\u", "bul", "k", "\\u", "action", "s", "\\u", "hide", "\\u", "success", "full", "y", "\\u", "hide", "s", "\\u", "user", "\\u", "not", "\\u", "admin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "site", "2_", "=_", "Site_", "._", "objects_", "._", "create_", "(_", "domain_", "=_", "'", "www", ".", "example", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "=_", "Site_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "site", "2_", "._", "id_", ")_", "._", "hidden", "\\u", "users_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "users_", "._", "count_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "admin_", "not_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "\"", "c4", "all", "\\u", "admin", ":", "user", "\\u", "bul", "k", "\\u", "action", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "site", "\\u", "id", "\"_", ":_", "site", "2_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "[_", "\"", "hide", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "choice", "s", "\"_", ":_", "[_", "self_", "._", "user_", "._", "id_", ",_", "self_", "._", "admin_", "._", "id_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "302_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "=_", "Site_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "site", "2_", "._", "id_", ")_", "._", "hidden", "\\u", "users_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "users_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "admin_", "not_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Admi", "n", "User", "test", "Cases_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "user", "\\u", "bul", "k", "\\u", "action", "s", "\\u", "hide", "\\u", "hidden", "\\u", "user", "\\u", "doesnt", "\\u", "change", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "(_", "\"", "c4", "all", "\\u", "admin", ":", "user", "\\u", "bul", "k", "\\u", "action", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "site", "\\u", "id", "\"_", ":_", "self_", "._", "site_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "[_", "\"", "hide", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "choice", "s", "\"_", ":_", "[_", "self_", "._", "user", "\\u", "hidden_", "._", "id_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "302_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "=_", "User_", "._", "objects_", "._", "filter_", "(_", "hidden_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "users_", "._", "count_", "(_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user", "\\u", "hidden_", "in_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
tyiannak/pyAudioAnalysis/audioAnalysisRecordAlsa.py
[ { "content": "import sys, os, alsaaudio, time, audioop, numpy, glob, scipy, subprocess, wave, mlpy, cPickle, threading, shutil\nimport matplotlib.pyplot as plt\nimport scipy.io.wavfile as wavfile\nfrom scipy.fftpack import rfft\nimport audioFeatureExtraction as aF\t\nimport audioTrainTest as aT\nimport audioSegmentation as aS\nfrom scipy.fftpack import fft\nimport matplotlib\nmatplotlib.use('TkAgg')\n\nFs = 16000\n\n\t\n\n\t\nif __name__ == '__main__':\n\tmain(sys.argv)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def recordAudioSegments(RecordPath, BLOCKSIZE):\t\n\t# This function is used for recording audio segments (until ctr+c is pressed)\n\t# ARGUMENTS:\n\t# - RecordPath:\t\tthe path where the wav segments will be stored\n\t# - BLOCKSIZE:\t\tsegment recording size (in seconds)\n\t# \n\t# NOTE: filenames are based on clock() value\n\t\n\tprint \"Press Ctr+C to stop recording\"\n\tRecordPath += os.sep\n\td = os.path.dirname(RecordPath)\n\tif os.path.exists(d) and RecordPath!=\".\":\n\t\tshutil.rmtree(RecordPath)\t\n\tos.makedirs(RecordPath)\t\n\n\tinp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE,alsaaudio.PCM_NONBLOCK)\n\tinp.setchannels(1)\n\tinp.setrate(Fs)\n\tinp.setformat(alsaaudio.PCM_FORMAT_S16_LE)\n\tinp.setperiodsize(512)\n\tmidTermBufferSize = int(Fs*BLOCKSIZE)\n\tmidTermBuffer = []\n\tcurWindow = []\n\telapsedTime = \"%08.3f\" % (time.time())\n\twhile 1:\n\t\t\tl,data = inp.read()\t\t \n\t\t \tif l:\n\t\t\t\tfor i in range(len(data)/2):\n\t\t\t\t\tcurWindow.append(audioop.getsample(data, 2, i))\n\t\t\n\t\t\t\tif (len(curWindow)+len(midTermBuffer)>midTermBufferSize):\n\t\t\t\t\tsamplesToCopyToMidBuffer = midTermBufferSize - len(midTermBuffer)\n\t\t\t\telse:\n\t\t\t\t\tsamplesToCopyToMidBuffer = len(curWindow)\n\n\t\t\t\tmidTermBuffer = midTermBuffer + curWindow[0:samplesToCopyToMidBuffer];\n\t\t\t\tdel(curWindow[0:samplesToCopyToMidBuffer])\n\t\t\t\n\n\t\t\tif len(midTermBuffer) == midTermBufferSize:\n\t\t\t\t# allData = allData + midTermBuffer\t\t\t\t\n\t\t\t\tcurWavFileName = RecordPath + os.sep + str(elapsedTime) + \".wav\"\t\t\t\t\n\t\t\t\tmidTermBufferArray = numpy.int16(midTermBuffer)\n\t\t\t\twavfile.write(curWavFileName, Fs, midTermBufferArray)\n\t\t\t\tprint \"AUDIO OUTPUT: Saved \" + curWavFileName\n\t\t\t\tmidTermBuffer = []\n\t\t\t\telapsedTime = \"%08.3f\" % (time.time())\t", "metadata": "root.recordAudioSegments", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def recordAnalyzeAudio(duration, outputWavFile, midTermBufferSizeSec, modelName, modelType):\n\t'''\n\trecordAnalyzeAudio(duration, outputWavFile, midTermBufferSizeSec, modelName, modelType)\n\n\tThis function is used to record and analyze audio segments, in a fix window basis.\n\n\tARGUMENTS: \n\t- duration\t\t\ttotal recording duration\n\t- outputWavFile\t\t\tpath of the output WAV file\n\t- midTermBufferSizeSec\t\t(fix)segment length in seconds\n\t- modelName\t\t\tclassification model name\n\t- modelType\t\t\tclassification model type\n\n\t'''\n\n\tif modelType=='svm':\n\t\t[Classifier, MEAN, STD, classNames, mtWin, mtStep, stWin, stStep, computeBEAT] = aT.loadSVModel(modelName)\n\telif modelType=='knn':\n\t\t[Classifier, MEAN, STD, classNames, mtWin, mtStep, stWin, stStep, computeBEAT] = aT.loadKNNModel(modelName)\n\telse:\n\t\tClassifier = None\n\n\tinp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NONBLOCK)\n\tinp.setchannels(1)\n\tinp.setrate(Fs)\n\tinp.setformat(alsaaudio.PCM_FORMAT_S16_LE)\n\tinp.setperiodsize(512)\n\tmidTermBufferSize = int(midTermBufferSizeSec * Fs)\n\tallData = []\n\tmidTermBuffer = []\n\tcurWindow = []\n\tcount = 0\n\n\twhile len(allData)<duration*Fs:\n\t\t# Read data from device\n\t\tl,data = inp.read()\n\t \tif l:\n\t\t\tfor i in range(l):\n\t\t\t\tcurWindow.append(audioop.getsample(data, 2, i))\t\t\n\t\t\tif (len(curWindow)+len(midTermBuffer)>midTermBufferSize):\n\t\t\t\tsamplesToCopyToMidBuffer = midTermBufferSize - len(midTermBuffer)\n\t\t\telse:\n\t\t\t\tsamplesToCopyToMidBuffer = len(curWindow)\n\t\t\tmidTermBuffer = midTermBuffer + curWindow[0:samplesToCopyToMidBuffer];\n\t\t\tdel(curWindow[0:samplesToCopyToMidBuffer])\n\t\tif len(midTermBuffer) == midTermBufferSize:\n\t\t\tcount += 1\t\t\t\t\t\t\n\t\t\tif Classifier!=None:\n\t\t\t\t[mtFeatures, stFeatures] = aF.mtFeatureExtraction(midTermBuffer, Fs, 2.0*Fs, 2.0*Fs, 0.020*Fs, 0.020*Fs)\n\t\t\t\tcurFV = (mtFeatures[:,0] - MEAN) / STD;\n\t\t\t\t[result, P] = aT.classifierWrapper(Classifier, modelType, curFV)\n\t\t\t\tprint classNames[int(result)]\n\t\t\tallData = allData + midTermBuffer\n\n\t\t\tplt.clf()\n\t\t\tplt.plot(midTermBuffer)\n\t\t\tplt.show(block = False)\n\t\t\tplt.draw()\n\n\n\t\t\tmidTermBuffer = []\n\n\tallDataArray = numpy.int16(allData)\n\twavfile.write(outputWavFile, Fs, allDataArray)", "metadata": "root.recordAnalyzeAudio", "header": "['module', '___EOS___']", "index": 61 }, { "content": "def main(argv):\n\tif argv[1] == '-recordSegments':\t\t# record input\n\t\tif (len(argv)==4): \t\t\t# record segments (until ctrl+c pressed)\n\t\t\trecordAudioSegments(argv[2], float(argv[3]))\n\t\telse:\n\t\t\tprint \"Error.\\nSyntax: \" + argv[0] + \" -recordSegments <recordingPath> <segmentDuration>\"\n\n\tif argv[1] == '-recordAndClassifySegments':\t# record input\n\t\tif (len(argv)==6):\t\t\t# recording + audio analysis\n\t\t\tduration = int(argv[2])\n\t\t\toutputWavFile = argv[3]\n\t\t\tmodelName = argv[4]\n\t\t\tmodelType = argv[5]\n\t\t\tif modelType not in [\"svm\", \"knn\"]:\n\t\t\t\traise Exception(\"ModelType has to be either svm or knn!\")\n\t\t\tif not os.path.isfile(modelName):\n\t\t\t\traise Exception(\"Input modelName not found!\")\n\t\t\trecordAnalyzeAudio(duration, outputWavFile, 2.0, modelName, modelType)\n\t\telse:\n\t\t\tprint \"Error.\\nSyntax: \" + argv[0] + \" -recordAndClassifySegments <duration> <outputWafFile> <modelName> <modelType>\"", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 126 } ]
[ { "span": "import sys, os, alsaaudio, time, audioop, numpy, glob, scipy, subprocess, wave, mlpy, cPickle, threading, shutil", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 113 }, { "span": "from scipy.fftpack import rfft", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 30 }, { "span": "import audioSegmentation as aS", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 30 }, { "span": "from scipy.fftpack import fft", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", ",_", "os_", ",_", "als", "aa", "udio", "_", ",_", "time_", ",_", "audio", "op_", ",_", "numpy_", ",_", "glob_", ",_", "scipy_", ",_", "subprocess_", ",_", "wave_", ",_", "mlp", "y_", ",_", "c", "Pickle_", ",_", "threading_", ",_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "io_", "._", "wav", "file_", "as_", "wav", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "fft", "pack_", "import_", "rf", "ft_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "audio", "Feature", "Extraction", "_", "as_", "a", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "audio", "Train", "Test_", "as_", "a", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "audio", "Segmentation", "_", "as_", "a", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "fft", "pack_", "import_", "fft_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matplotlib_", "._", "use_", "(_", "'", "Tk", "Agg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Fs_", "=_", "16000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\t", "_", "main_", "(_", "sys_", "._", "argv_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "record", "Audi", "o", "Segments", "_", "(_", "Record", "Path_", ",_", "BLOCKS", "IZE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "function", " ", "is", " ", "used", " ", "for", " ", "record", "ing", " ", "audio", " ", "segments", " ", "(", "unti", "l", " ", "ctr", "+", "c", " ", "is", " ", "presse", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARGUMENT", "S", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "Record", "Path", ":", "\t", "\t", "the", " ", "path", " ", "where", " ", "the", " ", "wav", " ", "segments", " ", "will", " ", "be", " ", "stored_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "BLOCKS", "IZE", ":", "\t", "\t", "segment", " ", "record", "ing", " ", "size", " ", "(", "in", " ", "second", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "filename", "s", " ", "are", " ", "based", " ", "on", " ", "clock", "()", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "print_", "\"", "Press", " ", "Ct", "r", "+", "C", " ", "to", " ", "stop", " ", "record", "ing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Record", "Path_", "+=_", "os_", "._", "sep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "Record", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "d_", ")_", "and_", "Record", "Path_", "!=_", "\".\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "shutil_", "._", "rmtree_", "(_", "Record", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "makedirs_", "(_", "Record", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inp_", "=_", "als", "aa", "udio", "_", "._", "PCM", "_", "(_", "als", "aa", "udio", "_", "._", "PCM", "\\u", "CAPT", "URE_", ",_", "als", "aa", "udio", "_", "._", "PCM", "\\u", "NON", "BLOCK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "setc", "hannel", "s_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "set", "rate_", "(_", "Fs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "setf", "ormat_", "(_", "als", "aa", "udio", "_", "._", "PCM", "\\u", "FORMAT", "\\u", "S1", "6", "\\u", "LE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "setp", "eriod", "size_", "(_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "Term", "Buffer", "Size_", "=_", "int_", "(_", "Fs_", "*_", "BLOCKS", "IZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "Term", "Buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "Window_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ela", "pse", "d", "Time_", "=_", "\"%", "0", "8.3", "f", "\"_", "%_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "l_", ",_", "data_", "=_", "inp_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "data_", ")_", "/_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "cur", "Window_", "._", "append_", "(_", "audio", "op_", "._", "gets", "ample", "_", "(_", "data_", ",_", "2_", ",_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "len_", "(_", "cur", "Window_", ")_", "+_", "len_", "(_", "mid", "Term", "Buffer_", ")_", ">_", "mid", "Term", "Buffer", "Size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "=_", "mid", "Term", "Buffer", "Size_", "-_", "len_", "(_", "mid", "Term", "Buffer_", ")_", "\\u\\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_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "=_", "len_", "(_", "cur", "Window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mid", "Term", "Buffer_", "=_", "mid", "Term", "Buffer_", "+_", "cur", "Window_", "[_", "0_", ":_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "]_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "cur", "Window_", "[_", "0_", ":_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "]_", ")_", "\\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_", "len_", "(_", "mid", "Term", "Buffer_", ")_", "==_", "mid", "Term", "Buffer", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "all", "Data", " ", "=", " ", "all", "Data", " ", "+", " ", "mid", "Term", "Buffer", "\t\t\t\t_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "cur", "Wa", "v", "File", "Name_", "=_", "Record", "Path_", "+_", "os_", "._", "sep_", "+_", "str_", "(_", "ela", "pse", "d", "Time_", ")_", "+_", "\".", "wav", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "Term", "Buffer", "Array_", "=_", "numpy_", "._", "int16_", "(_", "mid", "Term", "Buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wav", "file_", "._", "write_", "(_", "cur", "Wa", "v", "File", "Name_", ",_", "Fs_", ",_", "mid", "Term", "Buffer", "Array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "AUDIO", " ", " ", "OUTPU", "T", ":", " ", "Save", "d", " ", "\"_", "+_", "cur", "Wa", "v", "File", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "Term", "Buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ela", "pse", "d", "Time_", "=_", "\"%", "0", "8.3", "f", "\"_", "%_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "record", "Analy", "ze", "Audio_", "(_", "duration_", ",_", "output", "Wa", "v", "File_", ",_", "mid", "Term", "Buffer", "Size", "Sec_", ",_", "model", "Name_", ",_", "model", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "'''", "\\", "10", ";", "\t", "record", "Analy", "ze", "Audi", "o", "(", "duration", ",", " ", "output", "Wa", "v", "File", ",", " ", "mid", "Term", "Buffer", "Size", "Sec", ",", " ", "model", "Name", ",", " ", "model", "Type", ")", "\\", "10", ";", "\\", "10", ";", "\t", "Thi", "s", " ", "function", " ", "is", " ", "used", " ", "to", " ", "record", " ", "and", " ", "analyze", " ", "audio", " ", "segments", ",", " ", "in", " ", "a", " ", "fix", " ", "window", " ", "basi", "s", ".", "\\", "10", ";", "\\", "10", ";", "\t", "ARGUMENT", "S", ":", " ", "\\", "10", ";", "\t", "-", " ", "duration", "\t\t\t", "total", " ", "record", "ing", " ", "duration", "\\", "10", ";", "\t", "-", " ", "output", "Wa", "v", "File", "\t\t\t", "path", " ", "of", " ", "the", " ", "output", " ", "WA", "V", " ", "file", "\\", "10", ";", "\t", "-", " ", "mid", "Term", "Buffer", "Size", "Sec", "\t", "\t", "(", "fix", ")", "segment", " ", "length", " ", "in", " ", "second", "s", "\\", "10", ";", "\t", "-", " ", "model", "Name", "\t\t\t", "classificati", "on", " ", "model", " ", "name", "\\", "10", ";", "\t", "-", " ", "model", "Type", "\t\t\t", "classificati", "on", " ", "model", " ", "type", "\\", "10", ";", "\\", "10", ";", "\t", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "model", "Type_", "==_", "'", "svm", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "[_", "Classifier_", ",_", "MEAN", "_", ",_", "STD", "_", ",_", "class", "Names_", ",_", "mt", "Win_", ",_", "mt", "Step_", ",_", "st", "Win_", ",_", "st", "Step_", ",_", "compute", "BEA", "T_", "]_", "=_", "a", "T_", "._", "load", "SV", "Model_", "(_", "model", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "model", "Type_", "==_", "'", "knn", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "[_", "Classifier_", ",_", "MEAN", "_", ",_", "STD", "_", ",_", "class", "Names_", ",_", "mt", "Win_", ",_", "mt", "Step_", ",_", "st", "Win_", ",_", "st", "Step_", ",_", "compute", "BEA", "T_", "]_", "=_", "a", "T_", "._", "load", "KN", "NM", "odel_", "(_", "model", "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\t", "\t_", "Classifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "inp_", "=_", "als", "aa", "udio", "_", "._", "PCM", "_", "(_", "als", "aa", "udio", "_", "._", "PCM", "\\u", "CAPT", "URE_", ",_", "als", "aa", "udio", "_", "._", "PCM", "\\u", "NON", "BLOCK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "setc", "hannel", "s_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "set", "rate_", "(_", "Fs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "setf", "ormat_", "(_", "als", "aa", "udio", "_", "._", "PCM", "\\u", "FORMAT", "\\u", "S1", "6", "\\u", "LE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp_", "._", "setp", "eriod", "size_", "(_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "Term", "Buffer", "Size_", "=_", "int_", "(_", "mid", "Term", "Buffer", "Size", "Sec_", "*_", "Fs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "Data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mid", "Term", "Buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "Window_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "len_", "(_", "all", "Data_", ")_", "<_", "duration_", "*_", "Fs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Read", " ", "data", " ", "from", " ", "device_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "l_", ",_", "data_", "=_", "inp_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "i_", "in_", "range_", "(_", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "cur", "Window_", "._", "append_", "(_", "audio", "op_", "._", "gets", "ample", "_", "(_", "data_", ",_", "2_", ",_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "len_", "(_", "cur", "Window_", ")_", "+_", "len_", "(_", "mid", "Term", "Buffer_", ")_", ">_", "mid", "Term", "Buffer", "Size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "=_", "mid", "Term", "Buffer", "Size_", "-_", "len_", "(_", "mid", "Term", "Buffer_", ")_", "\\u\\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_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "=_", "len_", "(_", "cur", "Window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mid", "Term", "Buffer_", "=_", "mid", "Term", "Buffer_", "+_", "cur", "Window_", "[_", "0_", ":_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "]_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "(_", "cur", "Window_", "[_", "0_", ":_", "samples", "To", "Copy", "To", "Mid", "Buffer_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "mid", "Term", "Buffer_", ")_", "==_", "mid", "Term", "Buffer", "Size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Classifier_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "[_", "mt", "Features_", ",_", "st", "Features_", "]_", "=_", "a", "F_", "._", "mt", "Feature", "Extraction", "_", "(_", "mid", "Term", "Buffer_", ",_", "Fs_", ",_", "2.0_", "*_", "Fs_", ",_", "2.0_", "*_", "Fs_", ",_", "0.02", "0_", "*_", "Fs_", ",_", "0.02", "0_", "*_", "Fs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "FV", "_", "=_", "(_", "mt", "Features_", "[_", ":_", ",_", "0_", "]_", "-_", "MEAN", "_", ")_", "/_", "STD", "_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "result_", ",_", "P_", "]_", "=_", "a", "T_", "._", "classif", "ier", "Wrapper_", "(_", "Classifier_", ",_", "model", "Type_", ",_", "cur", "FV", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "class", "Names_", "[_", "int_", "(_", "result_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "Data_", "=_", "all", "Data_", "+_", "mid", "Term", "Buffer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "clf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "mid", "Term", "Buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", "block_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "draw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mid", "Term", "Buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "Data", "Array_", "=_", "numpy_", "._", "int16_", "(_", "all", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wav", "file_", "._", "write_", "(_", "output", "Wa", "v", "File_", ",_", "Fs_", ",_", "all", "Data", "Array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", "argv_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "argv_", "[_", "1_", "]_", "==_", "'-", "record", "Segments", "'_", ":_", "#", " ", "record", " ", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "(_", "len_", "(_", "argv_", ")_", "==_", "4_", ")_", ":_", "#", " ", "record", " ", "segments", " ", "(", "unti", "l", " ", "ctrl", "+", "c", " ", "presse", "d", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "record", "Audi", "o", "Segments", "_", "(_", "argv_", "[_", "2_", "]_", ",_", "float_", "(_", "argv_", "[_", "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\t", "\t\t_", "print_", "\"", "Error", ".\\\\", "n", "Syntax", ":", " ", "\"_", "+_", "argv_", "[_", "0_", "]_", "+_", "\"", " ", "-", "record", "Segments", " ", "<", "record", "ing", "Path", ">", " ", "<", "segment", "Dur", "ation", ">\"_", "\\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_", "argv_", "[_", "1_", "]_", "==_", "'-", "record", "And", "Classif", "y", "Segments", "'_", ":_", "#", " ", "record", " ", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "(_", "len_", "(_", "argv_", ")_", "==_", "6_", ")_", ":_", "#", " ", "record", "ing", " ", "+", " ", "audio", " ", "analysis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "duration_", "=_", "int_", "(_", "argv_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Wa", "v", "File_", "=_", "argv_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Name_", "=_", "argv_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Type_", "=_", "argv_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "model", "Type_", "not_", "in_", "[_", "\"", "svm", "\"_", ",_", "\"", "knn", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Exception_", "(_", "\"", "Model", "Type", " ", "has", " ", "to", " ", "be", " ", "eit", "her", " ", "svm", " ", "or", " ", "knn", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "model", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "raise_", "Exception_", "(_", "\"", "Inp", "ut", " ", "model", "Name", " ", "not", " ", "found", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "record", "Analy", "ze", "Audio_", "(_", "duration_", ",_", "output", "Wa", "v", "File_", ",_", "2.0_", ",_", "model", "Name_", ",_", "model", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "\"", "Error", ".\\\\", "n", "Syntax", ":", " ", "\"_", "+_", "argv_", "[_", "0_", "]_", "+_", "\"", " ", "-", "record", "And", "Classif", "y", "Segments", " ", "<", "duration", ">", " ", "<", "output", "Wa", "f", "File", ">", " ", "<", "model", "Name", ">", " ", "<", "model", "Type", ">\"_", "\\u\\u\\uNEWLINE\\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, 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, 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, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
openstack/ironic/ironic/tests/unit/objects/test_objects.py
[ { "content": " def test_changes_in_primitive(self):\n obj = MyObj(self.context)\n obj.foo = 123\n self.assertEqual(set(['foo']), obj.obj_what_changed())\n primitive = obj.obj_to_primitive()\n self.assertTrue('ironic_object.changes' in primitive)\n obj2 = MyObj.obj_from_primitive(primitive)\n self.assertEqual(set(['foo']), obj2.obj_what_changed())\n obj2.obj_reset_changes()\n self.assertEqual(set(), obj2.obj_what_changed())", "metadata": "root._TestObject.test_changes_in_primitive", "header": "['class', '_TestObject', '(', 'object', ')', ':', '___EOS___']", "index": 195 }, { "content": " def test_contains(self):\n obj = MyObj(self.context)\n self.assertFalse('foo' in obj)\n obj.foo = 1\n self.assertTrue('foo' in obj)\n self.assertFalse('does_not_exist' in obj)", "metadata": "root._TestObject.test_contains", "header": "['class', '_TestObject', '(', 'object', ')', ':', '___EOS___']", "index": 292 }, { "content": " def test_object_serialization(self):\n ser = base.IronicObjectSerializer()\n obj = MyObj(self.context)\n primitive = ser.serialize_entity(self.context, obj)\n self.assertTrue('ironic_object.name' in primitive)\n obj2 = ser.deserialize_entity(self.context, primitive)\n self.assertIsInstance(obj2, MyObj)\n self.assertEqual(self.context, obj2._context)", "metadata": "root.TestObjectSerializer.test_object_serialization", "header": "['class', 'TestObjectSerializer', '(', 'test_base', '.', 'TestCase', ')', ':', '___EOS___']", "index": 432 } ]
[ { "span": "self.assertTrue('ironic_object.changes' in primitive)", "start_line": 200, "start_column": 8, "end_line": 200, "end_column": 61 }, { "span": "self.assertFalse('foo' in obj)", "start_line": 294, "start_column": 8, "end_line": 294, "end_column": 38 }, { "span": "self.assertTrue('foo' in obj)", "start_line": 296, "start_column": 8, "end_line": 296, "end_column": 37 }, { "span": "self.assertFalse('does_not_exist' in obj)", "start_line": 297, "start_column": 8, "end_line": 297, "end_column": 49 }, { "span": "self.assertTrue('ironic_object.name' in primitive)", "start_line": 436, "start_column": 8, "end_line": 436, "end_column": 58 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "\\u", "Test", "Object_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "change", "s", "\\u", "in", "\\u", "primitive_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "My", "Obj_", "(_", "self_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "foo_", "=_", "123_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "[_", "'", "foo", "'_", "]_", ")_", ",_", "obj_", "._", "obj", "\\u", "what", "\\u", "changed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primitive_", "=_", "obj_", "._", "obj", "\\u", "to", "\\u", "primitive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "ironic", "\\u", "object", ".", "change", "s", "'_", "in_", "primitive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj2_", "=_", "My", "Obj_", "._", "obj", "\\u", "from", "\\u", "primitive_", "(_", "primitive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "[_", "'", "foo", "'_", "]_", ")_", ",_", "obj2_", "._", "obj", "\\u", "what", "\\u", "changed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj2_", "._", "obj", "\\u", "reset", "\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", ")_", ",_", "obj2_", "._", "obj", "\\u", "what", "\\u", "changed_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Test", "Object_", "(_", "object_", ")_", ":_", "\\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 ", " _", "obj_", "=_", "My", "Obj_", "(_", "self_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "foo", "'_", "in_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "foo_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "foo", "'_", "in_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "doe", "s", "\\u", "not", "\\u", "exist", "'_", "in_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Object", "Serializer_", "(_", "test\\u", "base_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "object\\u", "serialization_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ser_", "=_", "base_", "._", "Iron", "ic", "Object", "Serializer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "=_", "My", "Obj_", "(_", "self_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "primitive_", "=_", "ser_", "._", "serialize", "\\u", "entity_", "(_", "self_", "._", "context_", ",_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "ironic", "\\u", "object", ".", "name", "'_", "in_", "primitive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj2_", "=_", "ser_", "._", "deserialize", "\\u", "entity_", "(_", "self_", "._", "context_", ",_", "primitive_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "obj2_", ",_", "My", "Obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "context_", ",_", "obj2_", "._", "\\u", "context_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 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 ]
Use of the return value of a procedure
spotify/snakebite/snakebite/commandlineparser.py
[ { "content": " def command(args=\"\", descr=\"\", allowed_opts=\"\", visible=True, req_args=None):\n def wrap(f):\n Commands.methods[f.func_name] = {\"method\": f,\n \"args\": args,\n \"descr\": descr,\n \"allowed_opts\": allowed_opts,\n \"visible\": visible,\n \"req_args\": req_args}\n return wrap", "metadata": "root.CommandLineParser.command", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 463 }, { "content": " @command(visible=False)\n def commands(self):\n print \"\\n\".join(sorted([k for k, v in Commands.methods.iteritems() if v['visible']]))", "metadata": "root.CommandLineParser.commands", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 473 }, { "content": " @command(args=\"[path]\", descr=\"Used for command line completion\", visible=False, req_args=['[dirs]'])\n def complete(self):\n self.args.summary = True\n self.args.directory = False\n self.args.recurse = False\n self.args.human = False\n try:\n for line in self._listing():\n print line.replace(\" \", \"\\\\\\\\ \")\n except FileNotFoundException:\n pass", "metadata": "root.CommandLineParser.complete", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 477 }, { "content": " @command(args=\"[paths]\", descr=\"list a path\", allowed_opts=[\"d\", \"R\", \"s\", \"h\"], req_args=['[dirs]'])\n def ls(self):\n for line in self._listing():\n print line", "metadata": "root.CommandLineParser.ls", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 489 }, { "content": " def _listing(self):\n # Mimicking hadoop client behaviour\n if self.args.directory:\n include_children = False\n recurse = False\n include_toplevel = True\n else:\n include_children = True\n include_toplevel = False\n recurse = self.args.recurse\n\n listing = self.client.ls(self.args.dir, recurse=recurse,\n include_toplevel=include_toplevel,\n include_children=include_children)\n\n for line in format_listing(listing, json_output=self.args.json,\n human_readable=self.args.human,\n recursive=recurse,\n summary=self.args.summary):\n yield line", "metadata": "root.CommandLineParser._listing", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 494 }, { "content": " @command(args=\"[paths]\", descr=\"create directories\", req_args=['dir [dirs]'])\n def mkdir(self):\n creations = self.client.mkdir(self.args.dir)\n for line in format_results(creations, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.mkdir", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 515 }, { "content": " @command(args=\"[paths]\", descr=\"create directories and their parents\", req_args=['dir [dirs]'])\n def mkdirp(self):\n creations = self.client.mkdir(self.args.dir, create_parent=True)\n for line in format_results(creations, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.mkdirp", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 521 }, { "content": " @command(args=\"<owner:grp> [paths]\", descr=\"change owner\", allowed_opts=[\"R\"], req_args=['arg', 'dir [dirs]'])\n def chown(self):\n owner = self.args.single_arg\n try:\n mods = self.client.chown(self.args.dir, owner, recurse=self.args.recurse)\n for line in format_results(mods, json_output=self.args.json):\n print line\n except FileNotFoundException:\n exitError(sys.exc_info())", "metadata": "root.CommandLineParser.chown", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 527 }, { "content": " @command(args=\"<mode> [paths]\", descr=\"change file mode (octal)\", allowed_opts=[\"R\"], req_args=['(int) arg', 'dir [dirs]'])\n def chmod(self):\n mode = int(str(self.args.single_int_arg), 8)\n mods = self.client.chmod(self.args.dir, mode, recurse=self.args.recurse)\n for line in format_results(mods, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.chmod", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 537 }, { "content": " @command(args=\"<grp> [paths]\", descr=\"change group\", allowed_opts=[\"R\"], req_args=['arg', 'dir [dirs]'])\n def chgrp(self):\n grp = self.args.single_arg\n mods = self.client.chgrp(self.args.dir, grp, recurse=self.args.recurse)\n for line in format_results(mods, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.chgrp", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 544 }, { "content": " @command(args=\"[paths]\", descr=\"display stats for paths\", allowed_opts=['h'], req_args=['[dirs]'])\n def count(self):\n counts = self.client.count(self.args.dir)\n for line in format_counts(counts, json_output=self.args.json,\n human_readable=self.args.human):\n print line", "metadata": "root.CommandLineParser.count", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 551 }, { "content": " @command(args=\"\", descr=\"display fs stats\", allowed_opts=['h'])\n def df(self):\n result = self.client.df()\n for line in format_fs_stats(result, json_output=self.args.json,\n human_readable=self.args.human):\n print line", "metadata": "root.CommandLineParser.df", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 558 }, { "content": " @command(args=\"[paths]\", descr=\"display disk usage statistics\", allowed_opts=[\"s\", \"h\"], req_args=['[dirs]'])\n def du(self):\n if self.args.summary:\n include_children = False\n include_toplevel = True\n else:\n include_children = True\n include_toplevel = False\n result = self.client.du(self.args.dir, include_toplevel=include_toplevel, include_children=include_children)\n for line in format_du(result, json_output=self.args.json, human_readable=self.args.human):\n print line", "metadata": "root.CommandLineParser.du", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 565 }, { "content": " @command(args=\"[paths] dst\", descr=\"move paths to destination\", req_args=['dir [dirs]', 'arg'])\n def mv(self):\n paths = self.args.dir\n dst = self.args.single_arg\n result = self.client.rename(paths, dst)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.mv", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 577 }, { "content": " @command(args=\"[paths]\", descr=\"remove paths\", allowed_opts=[\"R\", \"S\", \"T\"], req_args=['dir [dirs]'])\n def rm(self):\n result = self.client.delete(self.args.dir, recurse=self.args.recurse)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.rm", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 585 }, { "content": " @command(args=\"[paths]\", descr=\"creates a file of zero length\", req_args=['dir [dirs]'])\n def touchz(self):\n result = self.client.touchz(self.args.dir)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.touchz", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 591 }, { "content": " @command(args=\"\", descr=\"show server information\")\n def serverdefaults(self):\n print self.client.serverdefaults()", "metadata": "root.CommandLineParser.serverdefaults", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 597 }, { "content": " @command(args=\"[dirs]\", descr=\"delete a directory\", req_args=['dir [dirs]'])\n def rmdir(self):\n result = self.client.rmdir(self.args.dir)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.rmdir", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 601 }, { "content": " @command(args=\"<rep> [paths]\", descr=\"set replication factor\", allowed_opts=['R'], req_args=['(int) arg', 'dir [dirs]'])\n def setrep(self):\n rep_factor = int(self.args.single_int_arg)\n result = self.client.setrep(self.args.dir, rep_factor, recurse=self.args.recurse)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.setrep", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 607 }, { "content": " @command(args=\"<cmd>\", descr=\"show cmd usage\", req_args=['[args]'])\n def usage(self):\n if not 'arg' in self.args or self.args.arg == []:\n self.parser.print_help()\n sys.exit(-1)\n\n for sub_cmd in self.args.arg:\n self.usage_helper(sub_cmd)", "metadata": "root.CommandLineParser.usage", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 614 }, { "content": " @command(args=\"[paths]\", descr=\"stat information\", req_args=['dir [dirs]'])\n def stat(self):\n print format_stat(self.client.stat(self.args.dir), json_output=self.args.json)", "metadata": "root.CommandLineParser.stat", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 647 }, { "content": " @command(args=\"path\", descr=\"test a path\", allowed_opts=['d', 'z', 'e'], req_args=['arg'])\n def test(self):\n path = self.args.single_arg\n\n try:\n result = self.client.test(path, exists=self.args.exists, directory=self.args.directory, zero_length=self.args.zero)\n except FileNotFoundException:\n result = False\n\n if result:\n sys.exit(0)\n else:\n sys.exit(1)", "metadata": "root.CommandLineParser.test", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 651 }, { "content": " @command(args=\"[paths]\", descr=\"copy source paths to stdout\", allowed_opts=['checkcrc'], req_args=['dir [dirs]'])\n def cat(self):\n for file_to_read in self.client.cat(self.args.dir, check_crc=self.args.checkcrc):\n for load in file_to_read:\n sys.stdout.write(load)", "metadata": "root.CommandLineParser.cat", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 665 }, { "content": " @command(args=\"path dst\", descr=\"copy local file reference to destination\", req_args=['dir [dirs]', 'arg'], visible=False)\n def copyFromLocal(self):\n src = self.args.dir\n dst = self.args.single_arg\n result = self.client.copyFromLocal(src, dst)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.copyFromLocal", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 671 }, { "content": " @command(args=\"[paths] dst\", descr=\"copy paths to local file system destination\", allowed_opts=['checkcrc'], req_args=['dir [dirs]', 'arg'])\n def copyToLocal(self):\n paths = self.args.dir\n dst = self.args.single_arg\n result = self.client.copyToLocal(paths, dst, check_crc=self.args.checkcrc)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.copyToLocal", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 679 }, { "content": " @command(args=\"[paths] dst\", descr=\"copy files from source to destination\", allowed_opts=['checkcrc'], req_args=['dir [dirs]', 'arg'], visible=False)\n def cp(self):\n paths = self.args.dir\n dst = self.args.single_arg\n result = self.client.cp(paths, dst, checkcrc=self.args.checkcrc)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.cp", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 687 }, { "content": " @command(args=\"file dst\", descr=\"copy files to local file system destination\", allowed_opts=['checkcrc'], req_args=['dir [dirs]', 'arg'])\n def get(self):\n paths = self.args.dir\n dst = self.args.single_arg\n result = self.client.copyToLocal(paths, dst, check_crc=self.args.checkcrc)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.get", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 695 }, { "content": " @command(args=\"dir dst\", descr=\"concatenates files in source dir into destination local file\", allowed_opts=['nl'], req_args=['src dst'])\n def getmerge(self):\n source = self.args.src_dst[0]\n dst = self.args.src_dst[1]\n result = self.client.getmerge(source, dst, newline=self.args.newline)\n for line in format_results(result, json_output=self.args.json):\n print line", "metadata": "root.CommandLineParser.getmerge", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 703 }, { "content": " @command(args=\"path\", descr=\"display last kilobyte of the file to stdout\", allowed_opts=['f'], req_args=['arg'])\n def tail(self):\n path = self.args.single_arg\n result = self.client.tail(path, append=self.args.append)\n for line in result:\n print line", "metadata": "root.CommandLineParser.tail", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 719 }, { "content": " @command(args=\"path [paths]\", descr=\"output file in text format\", allowed_opts=['checkcrc'], req_args=['dir [dirs]'])\n def text(self):\n paths = self.args.dir\n result = self.client.text(paths)\n for line in result:\n print line", "metadata": "root.CommandLineParser.text", "header": "['class', 'CommandLineParser', '(', 'object', ')', ':', '___EOS___']", "index": 726 } ]
[ { "span": "command(visible=False)", "start_line": 473, "start_column": 5, "end_line": 473, "end_column": 27 }, { "span": "command(args=\"[path]\", descr=\"Used for command line completion\", visible=False, req_args=['[dirs]'])", "start_line": 477, "start_column": 5, "end_line": 477, "end_column": 105 }, { "span": "command(args=\"[paths]\", descr=\"list a path\", allowed_opts=[\"d\", \"R\", \"s\", \"h\"], req_args=['[dirs]'])", "start_line": 489, "start_column": 5, "end_line": 489, "end_column": 105 }, { "span": "command(args=\"[paths]\", descr=\"create directories\", req_args=['dir [dirs]'])", "start_line": 515, "start_column": 5, "end_line": 515, "end_column": 81 }, { "span": "command(args=\"[paths]\", descr=\"create directories and their parents\", req_args=['dir [dirs]'])", "start_line": 521, "start_column": 5, "end_line": 521, "end_column": 99 }, { "span": "command(args=\"<owner:grp> [paths]\", descr=\"change owner\", allowed_opts=[\"R\"], req_args=['arg', 'dir [dirs]'])", "start_line": 527, "start_column": 5, "end_line": 527, "end_column": 114 }, { "span": "command(args=\"<mode> [paths]\", descr=\"change file mode (octal)\", allowed_opts=[\"R\"], req_args=['(int) arg', 'dir [dirs]'])", "start_line": 537, "start_column": 5, "end_line": 537, "end_column": 127 }, { "span": "command(args=\"<grp> [paths]\", descr=\"change group\", allowed_opts=[\"R\"], req_args=['arg', 'dir [dirs]'])", "start_line": 544, "start_column": 5, "end_line": 544, "end_column": 108 }, { "span": "command(args=\"[paths]\", descr=\"display stats for paths\", allowed_opts=['h'], req_args=['[dirs]'])", "start_line": 551, "start_column": 5, "end_line": 551, "end_column": 102 }, { "span": "command(args=\"\", descr=\"display fs stats\", allowed_opts=['h'])", "start_line": 558, "start_column": 5, "end_line": 558, "end_column": 67 }, { "span": "command(args=\"[paths]\", descr=\"display disk usage statistics\", allowed_opts=[\"s\", \"h\"], req_args=['[dirs]'])", "start_line": 565, "start_column": 5, "end_line": 565, "end_column": 113 }, { "span": "command(args=\"[paths] dst\", descr=\"move paths to destination\", req_args=['dir [dirs]', 'arg'])", "start_line": 577, "start_column": 5, "end_line": 577, "end_column": 99 }, { "span": "command(args=\"[paths]\", descr=\"remove paths\", allowed_opts=[\"R\", \"S\", \"T\"], req_args=['dir [dirs]'])", "start_line": 585, "start_column": 5, "end_line": 585, "end_column": 105 }, { "span": "command(args=\"[paths]\", descr=\"creates a file of zero length\", req_args=['dir [dirs]'])", "start_line": 591, "start_column": 5, "end_line": 591, "end_column": 92 }, { "span": "command(args=\"\", descr=\"show server information\")", "start_line": 597, "start_column": 5, "end_line": 597, "end_column": 54 }, { "span": "command(args=\"[dirs]\", descr=\"delete a directory\", req_args=['dir [dirs]'])", "start_line": 601, "start_column": 5, "end_line": 601, "end_column": 80 }, { "span": "command(args=\"<rep> [paths]\", descr=\"set replication factor\", allowed_opts=['R'], req_args=['(int) arg', 'dir [dirs]'])", "start_line": 607, "start_column": 5, "end_line": 607, "end_column": 124 }, { "span": "command(args=\"<cmd>\", descr=\"show cmd usage\", req_args=['[args]'])", "start_line": 614, "start_column": 5, "end_line": 614, "end_column": 71 }, { "span": "command(args=\"[paths]\", descr=\"stat information\", req_args=['dir [dirs]'])", "start_line": 647, "start_column": 5, "end_line": 647, "end_column": 79 }, { "span": "command(args=\"path\", descr=\"test a path\", allowed_opts=['d', 'z', 'e'], req_args=['arg'])", "start_line": 651, "start_column": 5, "end_line": 651, "end_column": 94 }, { "span": "command(args=\"[paths]\", descr=\"copy source paths to stdout\", allowed_opts=['checkcrc'], req_args=['dir [dirs]'])", "start_line": 665, "start_column": 5, "end_line": 665, "end_column": 117 }, { "span": "command(args=\"path dst\", descr=\"copy local file reference to destination\", req_args=['dir [dirs]', 'arg'], visible=False)", "start_line": 671, "start_column": 5, "end_line": 671, "end_column": 126 }, { "span": "command(args=\"[paths] dst\", descr=\"copy paths to local file system destination\", allowed_opts=['checkcrc'], req_args=['dir [dirs]', 'arg'])", "start_line": 679, "start_column": 5, "end_line": 679, "end_column": 144 }, { "span": "command(args=\"[paths] dst\", descr=\"copy files from source to destination\", allowed_opts=['checkcrc'], req_args=['dir [dirs]', 'arg'], visible=False)", "start_line": 687, "start_column": 5, "end_line": 687, "end_column": 153 }, { "span": "command(args=\"file dst\", descr=\"copy files to local file system destination\", allowed_opts=['checkcrc'], req_args=['dir [dirs]', 'arg'])", "start_line": 695, "start_column": 5, "end_line": 695, "end_column": 141 }, { "span": "command(args=\"dir dst\", descr=\"concatenates files in source dir into destination local file\", allowed_opts=['nl'], req_args=['src dst'])", "start_line": 703, "start_column": 5, "end_line": 703, "end_column": 141 }, { "span": "command(args=\"path\", descr=\"display last kilobyte of the file to stdout\", allowed_opts=['f'], req_args=['arg'])", "start_line": 719, "start_column": 5, "end_line": 719, "end_column": 116 }, { "span": "command(args=\"path [paths]\", descr=\"output file in text format\", allowed_opts=['checkcrc'], req_args=['dir [dirs]'])", "start_line": 726, "start_column": 5, "end_line": 726, "end_column": 121 } ]
[ { "span": "def wrap(f):", "start_line": 464, "start_column": 8, "end_line": 464, "end_column": 20 } ]
1
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command_", "(_", "args_", "=_", "\"\"_", ",_", "descr_", "=_", "\"\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "\"\"_", ",_", "visible_", "=_", "True_", ",_", "req", "\\u", "args_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "wrap_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Commands_", "._", "methods_", "[_", "f_", "._", "func", "\\u", "name_", "]_", "=_", "{_", "\"", "method", "\"_", ":_", "f_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "descr", "\"_", ":_", "descr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "allow", "ed", "\\u", "opts", "\"_", ":_", "allow", "ed", "\\u", "opts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "visi", "ble", "\"_", ":_", "visible_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "req", "\\u", "args", "\"_", ":_", "req", "\\u", "args_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "commands_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "sorted_", "(_", "[_", "k_", "for_", "k_", ",_", "v_", "in_", "Commands_", "._", "methods_", "._", "iteritems_", "(_", ")_", "if_", "v_", "[_", "'", "visi", "ble", "'_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "]\"_", ",_", "descr_", "=_", "\"", "Us", "ed", " ", "for", " ", "command", " ", "line", " ", "completion", "\"_", ",_", "visible_", "=_", "False_", ",_", "req", "\\u", "args_", "=_", "[_", "'[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "complete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "args_", "._", "summary_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "args_", "._", "directory_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "args_", "._", "recurse_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "args_", "._", "human_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "self_", "._", "\\u", "listing_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "._", "replace_", "(_", "\"", " ", "\"_", ",_", "\"\\\\\\\\\\\\", "\\\\", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "File", "Not", "Foun", "d", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "list", " ", "a", " ", "path", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "\"", "d", "\"_", ",_", "\"", "R", "\"_", ",_", "\"", "s", "\"_", ",_", "\"", "h", "\"_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "self_", "._", "\\u", "listing_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "listing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Mim", "ick", "ing", " ", "hadoop", " ", "client", " ", "behaviour", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "args_", "._", "directory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "include", "\\u", "children_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recurse_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "include", "\\u", "toplevel_", "=_", "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 ", " _", "include", "\\u", "children_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "include", "\\u", "toplevel_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recurse_", "=_", "self_", "._", "args_", "._", "recurse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "listing_", "=_", "self_", "._", "client_", "._", "ls_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "recurse_", "=_", "recurse_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "toplevel_", "=_", "include", "\\u", "toplevel_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "children_", "=_", "include", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "listing_", "(_", "listing_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "human", "\\u", "readable_", "=_", "self_", "._", "args_", "._", "human_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "recursive_", "=_", "recurse_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "summary_", "=_", "self_", "._", "args_", "._", "summary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "create", " ", "director", "ies", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "mkdir_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "creati", "ons_", "=_", "self_", "._", "client_", "._", "mkdir_", "(_", "self_", "._", "args_", "._", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "creati", "ons_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "create", " ", "director", "ies", " ", "and", " ", "thei", "r", " ", "parents", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "mkd", "ir", "p_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "creati", "ons_", "=_", "self_", "._", "client_", "._", "mkdir_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "create", "\\u", "parent_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "creati", "ons_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"<", "owner", ":", "grp", ">", " ", "[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "change", " ", "owner", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "\"", "R", "\"_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "arg", "'_", ",_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "chown", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "owner_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mods_", "=_", "self_", "._", "client_", "._", "chown", "_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "owner_", ",_", "recurse_", "=_", "self_", "._", "args_", "._", "recurse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "mods_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "File", "Not", "Foun", "d", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exit", "Error_", "(_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"<", "mode", ">", " ", "[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "change", " ", "file", " ", "mode", " ", "(", "octa", "l", ")\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "\"", "R", "\"_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'(", "int", ")", " ", "arg", "'_", ",_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "chmod_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mode_", "=_", "int_", "(_", "str_", "(_", "self_", "._", "args_", "._", "single", "\\u", "int\\u", "arg_", ")_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mods_", "=_", "self_", "._", "client_", "._", "chmod_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "mode_", ",_", "recurse_", "=_", "self_", "._", "args_", "._", "recurse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "mods_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"<", "grp", ">", " ", "[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "change", " ", "group", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "\"", "R", "\"_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "arg", "'_", ",_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "chg", "rp_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grp_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mods_", "=_", "self_", "._", "client_", "._", "chg", "rp_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "grp_", ",_", "recurse_", "=_", "self_", "._", "args_", "._", "recurse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "mods_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "display", " ", "stats", " ", "for", " ", "path", "s", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "h", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "count_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "=_", "self_", "._", "client_", "._", "count_", "(_", "self_", "._", "args_", "._", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "counts_", "(_", "counts_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "human", "\\u", "readable_", "=_", "self_", "._", "args_", "._", "human_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"\"_", ",_", "descr_", "=_", "\"", "display", " ", "fs", " ", "stats", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "h", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "df_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "client_", "._", "df_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "fs", "\\u", "stats_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "human", "\\u", "readable_", "=_", "self_", "._", "args_", "._", "human_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "display", " ", "disk", " ", "usage", " ", "statistic", "s", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "\"", "s", "\"_", ",_", "\"", "h", "\"_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "du_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "args_", "._", "summary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "include", "\\u", "children_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "include", "\\u", "toplevel_", "=_", "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 ", " _", "include", "\\u", "children_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "include", "\\u", "toplevel_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "du_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "include", "\\u", "toplevel_", "=_", "include", "\\u", "toplevel_", ",_", "include", "\\u", "children_", "=_", "include", "\\u", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "du_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ",_", "human", "\\u", "readable_", "=_", "self_", "._", "args_", "._", "human_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]", " ", "dst", "\"_", ",_", "descr_", "=_", "\"", "move", " ", "path", "s", " ", "to", " ", "destinat", "ion", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", ",_", "'", "arg", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "mv_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "self_", "._", "args_", "._", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "rename_", "(_", "paths_", ",_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "remove", " ", "path", "s", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "\"", "R", "\"_", ",_", "\"", "S", "\"_", ",_", "\"", "T", "\"_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rm_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "client_", "._", "delete_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "recurse_", "=_", "self_", "._", "args_", "._", "recurse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "create", "s", " ", "a", " ", "file", " ", "of", " ", "zero", " ", "length", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "touch", "z_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "client_", "._", "touch", "z_", "(_", "self_", "._", "args_", "._", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"\"_", ",_", "descr_", "=_", "\"", "show", " ", "server", " ", "informati", "on", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "server", "defaults_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "self_", "._", "client_", "._", "server", "defaults_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "dirs", "]\"_", ",_", "descr_", "=_", "\"", "delete", " ", "a", " ", "director", "y", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rmdir_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "client_", "._", "rmdir_", "(_", "self_", "._", "args_", "._", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"<", "rep", ">", " ", "[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "set", " ", "replication", " ", "factor", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "R", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'(", "int", ")", " ", "arg", "'_", ",_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "setre", "p_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rep", "\\u", "factor_", "=_", "int_", "(_", "self_", "._", "args_", "._", "single", "\\u", "int\\u", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "setre", "p_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "rep", "\\u", "factor_", ",_", "recurse_", "=_", "self_", "._", "args_", "._", "recurse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"<", "cmd", ">\"_", ",_", "descr_", "=_", "\"", "show", " ", "cmd", " ", "usage", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'[", "args", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "usage_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "'", "arg", "'_", "in_", "self_", "._", "args_", "or_", "self_", "._", "args_", "._", "arg_", "==_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parser_", "._", "print", "\\u", "help_", "(_", ")_", "\\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_", "for_", "sub\\u", "cmd_", "in_", "self_", "._", "args_", "._", "arg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "usage", "\\u", "helper_", "(_", "sub\\u", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "stat", " ", "informati", "on", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "stat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "format\\u", "stat_", "(_", "self_", "._", "client_", "._", "stat_", "(_", "self_", "._", "args_", "._", "dir_", ")_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"", "path", "\"_", ",_", "descr_", "=_", "\"", "test", " ", "a", " ", "path", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "d", "'_", ",_", "'", "z", "'_", ",_", "'", "e", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "arg", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\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 ", " _", "result_", "=_", "self_", "._", "client_", "._", "test_", "(_", "path_", ",_", "exists_", "=_", "self_", "._", "args_", "._", "exists_", ",_", "directory_", "=_", "self_", "._", "args_", "._", "directory_", ",_", "zero", "\\u", "length_", "=_", "self_", "._", "args_", "._", "zero_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "File", "Not", "Foun", "d", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "copy", " ", "source", " ", "path", "s", " ", "to", " ", "stdout", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "check", "crc", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "file", "\\u", "to", "\\u", "read_", "in_", "self_", "._", "client_", "._", "cat_", "(_", "self_", "._", "args_", "._", "dir_", ",_", "check", "\\u", "crc_", "=_", "self_", "._", "args_", "._", "check", "crc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "load_", "in_", "file", "\\u", "to", "\\u", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "load_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"", "path", " ", "dst", "\"_", ",_", "descr_", "=_", "\"", "copy", " ", "local", " ", "file", " ", "reference", " ", "to", " ", "destinat", "ion", "\"_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", ",_", "'", "arg", "'_", "]_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "copy", "Fro", "m", "Local_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src_", "=_", "self_", "._", "args_", "._", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "copy", "Fro", "m", "Local_", "(_", "src_", ",_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]", " ", "dst", "\"_", ",_", "descr_", "=_", "\"", "copy", " ", "path", "s", " ", "to", " ", "local", " ", "file", " ", "system", " ", "destinat", "ion", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "check", "crc", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", ",_", "'", "arg", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "copy", "To", "Local_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "self_", "._", "args_", "._", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "copy", "To", "Local_", "(_", "paths_", ",_", "dst_", ",_", "check", "\\u", "crc_", "=_", "self_", "._", "args_", "._", "check", "crc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"[", "path", "s", "]", " ", "dst", "\"_", ",_", "descr_", "=_", "\"", "copy", " ", "files", " ", "from", " ", "source", " ", "to", " ", "destinat", "ion", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "check", "crc", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", ",_", "'", "arg", "'_", "]_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cp_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "self_", "._", "args_", "._", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "cp_", "(_", "paths_", ",_", "dst_", ",_", "check", "crc_", "=_", "self_", "._", "args_", "._", "check", "crc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"", "file", " ", "dst", "\"_", ",_", "descr_", "=_", "\"", "copy", " ", "files", " ", "to", " ", "local", " ", "file", " ", "system", " ", "destinat", "ion", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "check", "crc", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", ",_", "'", "arg", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "self_", "._", "args_", "._", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "copy", "To", "Local_", "(_", "paths_", ",_", "dst_", ",_", "check", "\\u", "crc_", "=_", "self_", "._", "args_", "._", "check", "crc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"", "dir", " ", "dst", "\"_", ",_", "descr_", "=_", "\"", "concatenate", "s", " ", "files", " ", "in", " ", "source", " ", "dir", " ", "int", "o", " ", "destinat", "ion", " ", "local", " ", "file", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "nl", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "src", " ", "dst", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "getm", "erge", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "self_", "._", "args_", "._", "src", "\\u", "dst_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst_", "=_", "self_", "._", "args_", "._", "src", "\\u", "dst_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "getm", "erge", "_", "(_", "source_", ",_", "dst_", ",_", "newline_", "=_", "self_", "._", "args_", "._", "newline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "format\\u", "results_", "(_", "result_", ",_", "json", "\\u", "output_", "=_", "self_", "._", "args_", "._", "json_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"", "path", "\"_", ",_", "descr_", "=_", "\"", "display", " ", "last", " ", "kilo", "byte", " ", "of", " ", "the", " ", "file", " ", "to", " ", "stdout", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "f", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "arg", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tail_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "self_", "._", "args_", "._", "single", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "tail_", "(_", "path_", ",_", "append_", "=_", "self_", "._", "args_", "._", "append_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Line", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "(_", "args_", "=_", "\"", "path", " ", "[", "path", "s", "]\"_", ",_", "descr_", "=_", "\"", "output", " ", "file", " ", "in", " ", "text", " ", "format", "\"_", ",_", "allow", "ed", "\\u", "opts_", "=_", "[_", "'", "check", "crc", "'_", "]_", ",_", "req", "\\u", "args_", "=_", "[_", "'", "dir", " ", "[", "dirs", "]'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "text_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "paths_", "=_", "self_", "._", "args_", "._", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "client_", "._", "text_", "(_", "paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "line_" ]
[ 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, 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, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
kvh/ramp/ramp/selectors.py
[ { "content": " def sets(self, x, y, n_keep):\n alphas, active, coef_path = linear_model.lars_path(x.values, y.values)\n sets = []\n seen = set()\n logging.debug(coef_path)\n for coefs in coef_path.T:\n cols = [x.columns[i] for i in range(len(coefs)) if coefs[i] > 1e-9]\n if len(cols) >= n_keep:\n return cols\n return cols", "metadata": "root.LassoPathSelector.sets", "header": "['class', 'LassoPathSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 118 } ]
[ { "span": "sets ", "start_line": 120, "start_column": 8, "end_line": 120, "end_column": 12 }, { "span": "seen ", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Las", "so", "Path", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "sets_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alphas_", ",_", "active_", ",_", "coef\\u", "path_", "=_", "linear", "\\u", "model_", "._", "lars", "\\u", "path_", "(_", "x_", "._", "values_", ",_", "y_", "._", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seen_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "coef\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "coefs_", "in_", "coef\\u", "path_", "._", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "[_", "x_", "._", "columns_", "[_", "i_", "]_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "coefs_", ")_", ")_", "if_", "coefs_", "[_", "i_", "]_", ">_", "1e-", "9_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "cols_", ")_", ">=_", "n", "\\u", "keep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cols_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 0, 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 ]
Unused import
b3mb4m/shellsploit-framework/shell/Session/netcat.py
[ { "content": "from __future__ import print_function\nfrom socket import socket, AF_INET, SOCK_STREAM, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR\nfrom threading import Thread\nfrom select import select\nfrom time import sleep\nfrom sys import exit\n\nlistening = False\nclisock = None\ndone = False\n \n#Beta script for listener.\n#Same effect nc -vlp [PORT]\n\n\n#Greetz:\n #Goodies\n #https://twitter.com/GoodiesHQ\n\n\n\ntry:\n input = raw_input \nexcept NameError:\n pass \n \n \n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def listen(port=4444):\n global clisock, listening, done\n s = socket(AF_INET, SOCK_STREAM) \n s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) \n s.bind(('0.0.0.0', port)) \n s.listen(3) \n listening = True\n sock, addr = s.accept() \n clisock = sock \n print(\"Client connected from {}\".format(addr))\n data = \"\"\n while listening:\n try:\n rr, _, _ = select([sock,], [], [], 1) \n if rr:\n data = sock.recv(1024) \n print(\"{}\".format(data), end=\"\") \n except:\n exit()\n print(\"Done listening.\")\n done = True", "metadata": "root.listen", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def write():\n global clisock, listening, done\n while True:\n if clisock:\n data = input()\n if data.strip().lower() in [\"exit\", \"quit\"]:\n clisock.close()\n exit()\n listening = False\n while not done: sleep(0.1)\n break\n _, wr, _ = select([], [clisock,], [], 1)\n if wr:\n clisock.sendall(data + \"\\n\")\n else:\n pass", "metadata": "root.write", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def nc( PORT=4444):\n listenThread = Thread(target=listen, args=(int(PORT),))\n writeThread = Thread(target=write)\n listenThread.start()\n writeThread.start()", "metadata": "root.nc", "header": "['module', '___EOS___']", "index": 66 } ]
[ { "span": "from socket import socket, AF_INET, SOCK_STREAM, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 85 } ]
[]
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_", "from_", "socket_", "import_", "socket_", ",_", "AF", "\\u", "INET_", ",_", "SOCK", "\\u", "STREAM_", ",_", "SOCK", "\\u", "DGRAM_", ",_", "SOL", "\\u", "SOCKET_", ",_", "SO", "\\u", "REUSE", "ADDR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "select_", "import_", "select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sys_", "import_", "exit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listen", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cli", "sock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Beta", " ", "script", " ", "for", " ", "listen", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "Sam", "e", " ", "effect", " ", "nc", " ", "-", "vl", "p", " ", "[", "PORT", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Gree", "tz", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Good", "ies_", "\\u\\u\\uNL\\u\\u\\u_", "#", "https", "://", "twit", "ter", ".", "com", "/", "Good", "ies", "HQ", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input_", "=_", "raw", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "listen_", "(_", "port_", "=_", "4444", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "cli", "sock_", ",_", "listen", "ing_", ",_", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "socket_", "(_", "AF", "\\u", "INET_", ",_", "SOCK", "\\u", "STREAM_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "setsockopt_", "(_", "SOL", "\\u", "SOCKET_", ",_", "SO", "\\u", "REUSE", "ADDR_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "bind_", "(_", "(_", "'", "0.", "0.", "0.", "0", "'_", ",_", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "listen_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ing_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sock_", ",_", "addr_", "=_", "s_", "._", "accept_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cli", "sock_", "=_", "sock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Client", " ", "connect", "ed", " ", "from", " ", "{}\"_", "._", "format_", "(_", "addr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "listen", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rr_", ",_", "\\u_", ",_", "\\u_", "=_", "select_", "(_", "[_", "sock_", ",_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "sock_", "._", "recv_", "(_", "1024_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"{}\"_", "._", "format_", "(_", "data_", ")_", ",_", "end_", "=_", "\"\"_", ")_", "\\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 ", " _", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "\"", "Don", "e", " ", "listen", "ing", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "done_", "=_", "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_", "write_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "cli", "sock_", ",_", "listen", "ing_", ",_", "done_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cli", "sock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "input_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "._", "strip_", "(_", ")_", "._", "lower_", "(_", ")_", "in_", "[_", "\"", "exit", "\"_", ",_", "\"", "quit", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cli", "sock_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "done_", ":_", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u_", ",_", "wr_", ",_", "\\u_", "=_", "select_", "(_", "[_", "]_", ",_", "[_", "cli", "sock_", ",_", "]_", ",_", "[_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "wr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cli", "sock_", "._", "sendall_", "(_", "data_", "+_", "\"\\\\", "n", "\"_", ")_", "\\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 ", " _", "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_", "nc_", "(_", "PORT_", "=_", "4444", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "listen", "Thread_", "=_", "Thread_", "(_", "target_", "=_", "listen_", ",_", "args_", "=_", "(_", "int_", "(_", "PORT_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Thread_", "=_", "Thread_", "(_", "target_", "=_", "write_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listen", "Thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "Thread_", "._", "start_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
cloudera/hue/desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/odf2moinmoin.py
[ { "content": "# -*- coding: utf-8 -*-\n# Copyright (C) 2006-2008 Søren Roug, European Environment Agency\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library 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 GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n# See http://trac.edgewall.org/wiki/WikiFormatting\n#\n# Contributor(s):\n#\n\nimport sys, zipfile, xml.dom.minidom\nfrom .namespaces import nsdict\nfrom .elementtypes import *\n\nIGNORED_TAGS = [\n 'draw:a'\n 'draw:g',\n 'draw:line',\n 'draw:object-ole',\n 'office:annotation',\n 'presentation:notes',\n 'svg:desc',\n] + [ nsdict[item[0]]+\":\"+item[1] for item in empty_elements]\n\nINLINE_TAGS = [ nsdict[item[0]]+\":\"+item[1] for item in inline_elements]\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TextProps:\n \"\"\" Holds properties for a text style. \"\"\"\n\n\n\n\n\n\n\n", "metadata": "root.TextProps", "header": "['module', '___EOS___']", "index": 39 }, { "content": " def __init__(self):\n\n self.italic = False\n self.bold = False\n self.fixed = False\n self.underlined = False\n self.strikethrough = False\n self.superscript = False\n self.subscript = False", "metadata": "root.TextProps.__init__", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 42 }, { "content": " def setItalic(self, value):\n if value == \"italic\":\n self.italic = True\n elif value == \"normal\":\n self.italic = False", "metadata": "root.TextProps.setItalic", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 52 }, { "content": " def setBold(self, value):\n if value == \"bold\":\n self.bold = True\n elif value == \"normal\":\n self.bold = False", "metadata": "root.TextProps.setBold", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 58 }, { "content": " def setFixed(self, value):\n self.fixed = value", "metadata": "root.TextProps.setFixed", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 64 }, { "content": " def setUnderlined(self, value):\n if value and value != \"none\":\n self.underlined = True", "metadata": "root.TextProps.setUnderlined", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 67 }, { "content": " def setStrikethrough(self, value):\n if value and value != \"none\":\n self.strikethrough = True", "metadata": "root.TextProps.setStrikethrough", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 71 }, { "content": " def setPosition(self, value):\n if value is None or value == '':\n return\n posisize = value.split(' ')\n textpos = posisize[0]\n if textpos.find('%') == -1:\n if textpos == \"sub\":\n self.superscript = False\n self.subscript = True\n elif textpos == \"super\":\n self.superscript = True\n self.subscript = False\n else:\n itextpos = int(textpos[:textpos.find('%')])\n if itextpos > 10:\n self.superscript = False\n self.subscript = True\n elif itextpos < -10:\n self.superscript = True\n self.subscript = False", "metadata": "root.TextProps.setPosition", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 75 }, { "content": " def __str__(self):\n\n return \"[italic=%s, bold=i%s, fixed=%s]\" % (str(self.italic),\n str(self.bold),\n str(self.fixed))", "metadata": "root.TextProps.__str__", "header": "['class', 'TextProps', ':', '___EOS___']", "index": 96 }, { "content": "class ParagraphProps:\n \"\"\" Holds properties of a paragraph style. \"\"\"\n\n\n\n\n\n\n", "metadata": "root.ParagraphProps", "header": "['module', '___EOS___']", "index": 102 }, { "content": " def __init__(self):\n\n self.blockquote = False\n self.headingLevel = 0\n self.code = False\n self.title = False\n self.indented = 0", "metadata": "root.ParagraphProps.__init__", "header": "['class', 'ParagraphProps', ':', '___EOS___']", "index": 105 }, { "content": " def setIndented(self, value):\n self.indented = value", "metadata": "root.ParagraphProps.setIndented", "header": "['class', 'ParagraphProps', ':', '___EOS___']", "index": 113 }, { "content": " def setHeading(self, level):\n self.headingLevel = level", "metadata": "root.ParagraphProps.setHeading", "header": "['class', 'ParagraphProps', ':', '___EOS___']", "index": 116 }, { "content": " def setTitle(self, value):\n self.title = value", "metadata": "root.ParagraphProps.setTitle", "header": "['class', 'ParagraphProps', ':', '___EOS___']", "index": 119 }, { "content": " def setCode(self, value):\n self.code = value", "metadata": "root.ParagraphProps.setCode", "header": "['class', 'ParagraphProps', ':', '___EOS___']", "index": 122 }, { "content": " def __str__(self):\n\n return \"[bq=%s, h=%d, code=%s]\" % (str(self.blockquote),\n self.headingLevel,\n str(self.code))", "metadata": "root.ParagraphProps.__str__", "header": "['class', 'ParagraphProps', ':', '___EOS___']", "index": 126 }, { "content": "class ListProperties:\n \"\"\" Holds properties for a list style. \"\"\"\n\n", "metadata": "root.ListProperties", "header": "['module', '___EOS___']", "index": 133 }, { "content": " def __init__(self):\n self.ordered = False", "metadata": "root.ListProperties.__init__", "header": "['class', 'ListProperties', ':', '___EOS___']", "index": 136 }, { "content": " def setOrdered(self, value):\n self.ordered = value", "metadata": "root.ListProperties.setOrdered", "header": "['class', 'ListProperties', ':', '___EOS___']", "index": 139 }, { "content": "class ODF2MoinMoin(object):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#-----------------------------------\n\n\n\n\n\n\n\n\n\n#-----------------------------------\n\n\n\n\n\n\n\n", "metadata": "root.ODF2MoinMoin", "header": "['module', '___EOS___']", "index": 144 }, { "content": " def __init__(self, filepath):\n self.footnotes = []\n self.footnoteCounter = 0\n self.textStyles = {\"Standard\": TextProps()}\n self.paragraphStyles = {\"Standard\": ParagraphProps()}\n self.listStyles = {}\n self.fixedFonts = []\n self.hasTitle = 0\n self.lastsegment = None\n\n # Tags\n self.elements = {\n 'draw:page': self.textToString,\n 'draw:frame': self.textToString,\n 'draw:image': self.draw_image,\n 'draw:text-box': self.textToString,\n 'text:a': self.text_a,\n 'text:note': self.text_note,\n }\n for tag in IGNORED_TAGS:\n self.elements[tag] = self.do_nothing\n\n for tag in INLINE_TAGS:\n self.elements[tag] = self.inline_markup\n self.elements['text:line-break'] = self.text_line_break\n self.elements['text:s'] = self.text_s\n self.elements['text:tab'] = self.text_tab\n\n self.load(filepath)", "metadata": "root.ODF2MoinMoin.__init__", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 147 }, { "content": " def processFontDeclarations(self, fontDecl):\n \"\"\" Extracts necessary font information from a font-declaration\n element.\n \"\"\"\n for fontFace in fontDecl.getElementsByTagName(\"style:font-face\"):\n if fontFace.getAttribute(\"style:font-pitch\") == \"fixed\":\n self.fixedFonts.append(fontFace.getAttribute(\"style:name\"))", "metadata": "root.ODF2MoinMoin.processFontDeclarations", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 177 }, { "content": " def extractTextProperties(self, style, parent=None):\n \"\"\" Extracts text properties from a style element. \"\"\"\n\n textProps = TextProps()\n\n if parent:\n parentProp = self.textStyles.get(parent, None)\n if parentProp:\n textProp = parentProp\n\n textPropEl = style.getElementsByTagName(\"style:text-properties\")\n if not textPropEl: return textProps\n\n textPropEl = textPropEl[0]\n\n textProps.setItalic(textPropEl.getAttribute(\"fo:font-style\"))\n textProps.setBold(textPropEl.getAttribute(\"fo:font-weight\"))\n textProps.setUnderlined(textPropEl.getAttribute(\"style:text-underline-style\"))\n textProps.setStrikethrough(textPropEl.getAttribute(\"style:text-line-through-style\"))\n textProps.setPosition(textPropEl.getAttribute(\"style:text-position\"))\n\n if textPropEl.getAttribute(\"style:font-name\") in self.fixedFonts:\n textProps.setFixed(True)\n\n return textProps", "metadata": "root.ODF2MoinMoin.extractTextProperties", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 187 }, { "content": " def extractParagraphProperties(self, style, parent=None):\n \"\"\" Extracts paragraph properties from a style element. \"\"\"\n\n paraProps = ParagraphProps()\n\n name = style.getAttribute(\"style:name\")\n\n if name.startswith(\"Heading_20_\"):\n level = name[11:]\n try:\n level = int(level)\n paraProps.setHeading(level)\n except:\n level = 0\n\n if name == \"Title\":\n paraProps.setTitle(True)\n\n paraPropEl = style.getElementsByTagName(\"style:paragraph-properties\")\n if paraPropEl:\n paraPropEl = paraPropEl[0]\n leftMargin = paraPropEl.getAttribute(\"fo:margin-left\")\n if leftMargin:\n try:\n leftMargin = float(leftMargin[:-2])\n if leftMargin > 0.01:\n paraProps.setIndented(True)\n except:\n pass\n\n textProps = self.extractTextProperties(style)\n if textProps.fixed:\n paraProps.setCode(True)\n\n return paraProps", "metadata": "root.ODF2MoinMoin.extractParagraphProperties", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 213 }, { "content": " def processStyles(self, styleElements):\n \"\"\" Runs through \"style\" elements extracting necessary information.\n \"\"\"\n\n for style in styleElements:\n\n name = style.getAttribute(\"style:name\")\n\n if name == \"Standard\": continue\n\n family = style.getAttribute(\"style:family\")\n parent = style.getAttribute(\"style:parent-style-name\")\n\n if family == \"text\":\n self.textStyles[name] = self.extractTextProperties(style, parent)\n\n elif family == \"paragraph\":\n self.paragraphStyles[name] = \\\n self.extractParagraphProperties(style, parent)\n self.textStyles[name] = self.extractTextProperties(style, parent)", "metadata": "root.ODF2MoinMoin.processStyles", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 250 }, { "content": " def processListStyles(self, listStyleElements):\n\n for style in listStyleElements:\n name = style.getAttribute(\"style:name\")\n\n prop = ListProperties()\n if style.hasChildNodes():\n subitems = [el for el in style.childNodes\n if el.nodeType == xml.dom.Node.ELEMENT_NODE\n and el.tagName == \"text:list-level-style-number\"]\n if len(subitems) > 0:\n prop.setOrdered(True)\n\n self.listStyles[name] = prop", "metadata": "root.ODF2MoinMoin.processListStyles", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 271 }, { "content": " def load(self, filepath):\n \"\"\" Loads an ODT file. \"\"\"\n\n zip = zipfile.ZipFile(filepath)\n\n styles_doc = xml.dom.minidom.parseString(zip.read(\"styles.xml\"))\n fontfacedecls = styles_doc.getElementsByTagName(\"office:font-face-decls\")\n if fontfacedecls:\n self.processFontDeclarations(fontfacedecls[0])\n self.processStyles(styles_doc.getElementsByTagName(\"style:style\"))\n self.processListStyles(styles_doc.getElementsByTagName(\"text:list-style\"))\n\n self.content = xml.dom.minidom.parseString(zip.read(\"content.xml\"))\n fontfacedecls = self.content.getElementsByTagName(\"office:font-face-decls\")\n if fontfacedecls:\n self.processFontDeclarations(fontfacedecls[0])\n\n self.processStyles(self.content.getElementsByTagName(\"style:style\"))\n self.processListStyles(self.content.getElementsByTagName(\"text:list-style\"))", "metadata": "root.ODF2MoinMoin.load", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 287 }, { "content": " def compressCodeBlocks(self, text):\n \"\"\" Removes extra blank lines from code blocks. \"\"\"\n\n return text\n lines = text.split(\"\\n\")\n buffer = []\n numLines = len(lines)\n for i in range(numLines):\n\n if (lines[i].strip() or i == numLines-1 or i == 0 or\n not ( lines[i-1].startswith(\" \")\n and lines[i+1].startswith(\" \") ) ):\n buffer.append(\"\\n\" + lines[i])\n\n return ''.join(buffer)", "metadata": "root.ODF2MoinMoin.compressCodeBlocks", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 307 }, { "content": " def do_nothing(self, node):\n return ''", "metadata": "root.ODF2MoinMoin.do_nothing", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 324 }, { "content": " def draw_image(self, node):\n \"\"\"\n \"\"\"\n\n link = node.getAttribute(\"xlink:href\")\n if link and link[:2] == './': # Indicates a sub-object, which isn't supported\n return \"%s\\n\" % link\n if link and link[:9] == 'Pictures/':\n link = link[9:]\n return \"[[Image(%s)]]\\n\" % link", "metadata": "root.ODF2MoinMoin.draw_image", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 327 }, { "content": " def text_a(self, node):\n text = self.textToString(node)\n link = node.getAttribute(\"xlink:href\")\n if link.strip() == text.strip():\n return \"[%s] \" % link.strip()\n else:\n return \"[%s %s] \" % (link.strip(), text.strip())", "metadata": "root.ODF2MoinMoin.text_a", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 338 }, { "content": " def text_line_break(self, node):\n return \"[[BR]]\"", "metadata": "root.ODF2MoinMoin.text_line_break", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 347 }, { "content": " def text_note(self, node):\n cite = (node.getElementsByTagName(\"text:note-citation\")[0]\n .childNodes[0].nodeValue)\n body = (node.getElementsByTagName(\"text:note-body\")[0]\n .childNodes[0])\n self.footnotes.append((cite, self.textToString(body)))\n return \"^%s^\" % cite", "metadata": "root.ODF2MoinMoin.text_note", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 350 }, { "content": " def text_s(self, node):\n try:\n num = int(node.getAttribute(\"text:c\"))\n return \" \"*num\n except:\n return \" \"", "metadata": "root.ODF2MoinMoin.text_s", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 358 }, { "content": " def text_tab(self, node):\n return \" \"", "metadata": "root.ODF2MoinMoin.text_tab", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 365 }, { "content": " def inline_markup(self, node):\n text = self.textToString(node)\n\n if not text.strip():\n return '' # don't apply styles to white space\n\n styleName = node.getAttribute(\"text:style-name\")\n style = self.textStyles.get(styleName, TextProps())\n\n if style.fixed:\n return \"`\" + text + \"`\"\n\n mark = []\n if style:\n if style.italic:\n mark.append(\"''\")\n if style.bold:\n mark.append(\"'''\")\n if style.underlined:\n mark.append(\"__\")\n if style.strikethrough:\n mark.append(\"~~\")\n if style.superscript:\n mark.append(\"^\")\n if style.subscript:\n mark.append(\",,\")\n revmark = mark[:]\n revmark.reverse()\n return \"%s%s%s\" % (''.join(mark), text, ''.join(revmark))", "metadata": "root.ODF2MoinMoin.inline_markup", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 368 }, { "content": " def listToString(self, listElement, indent = 0):\n\n self.lastsegment = listElement.tagName\n buffer = []\n\n styleName = listElement.getAttribute(\"text:style-name\")\n props = self.listStyles.get(styleName, ListProperties())\n\n i = 0\n for item in listElement.childNodes:\n buffer.append(\" \"*indent)\n i += 1\n if props.ordered:\n number = str(i)\n number = \" \" + number + \". \"\n buffer.append(\" 1. \")\n else:\n buffer.append(\" * \")\n subitems = [el for el in item.childNodes\n if el.tagName in [\"text:p\", \"text:h\", \"text:list\"]]\n for subitem in subitems:\n if subitem.tagName == \"text:list\":\n buffer.append(\"\\n\")\n buffer.append(self.listToString(subitem, indent+3))\n else:\n buffer.append(self.paragraphToString(subitem, indent+3))\n self.lastsegment = subitem.tagName\n self.lastsegment = item.tagName\n buffer.append(\"\\n\")\n\n return ''.join(buffer)", "metadata": "root.ODF2MoinMoin.listToString", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 399 }, { "content": " def tableToString(self, tableElement):\n \"\"\" MoinMoin uses || to delimit table cells\n \"\"\"\n\n self.lastsegment = tableElement.tagName\n buffer = []\n\n for item in tableElement.childNodes:\n self.lastsegment = item.tagName\n if item.tagName == \"table:table-header-rows\":\n buffer.append(self.tableToString(item))\n if item.tagName == \"table:table-row\":\n buffer.append(\"\\n||\")\n for cell in item.childNodes:\n buffer.append(self.inline_markup(cell))\n buffer.append(\"||\")\n self.lastsegment = cell.tagName\n return ''.join(buffer)", "metadata": "root.ODF2MoinMoin.tableToString", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 431 }, { "content": " def toString(self):\n \"\"\" Converts the document to a string.\n FIXME: Result from second call differs from first call\n \"\"\"\n body = self.content.getElementsByTagName(\"office:body\")[0]\n text = body.childNodes[0]\n\n buffer = []\n\n paragraphs = [el for el in text.childNodes\n if el.tagName in [\"draw:page\", \"text:p\", \"text:h\",\"text:section\",\n \"text:list\", \"table:table\"]]\n\n for paragraph in paragraphs:\n if paragraph.tagName == \"text:list\":\n text = self.listToString(paragraph)\n elif paragraph.tagName == \"text:section\":\n text = self.textToString(paragraph)\n elif paragraph.tagName == \"table:table\":\n text = self.tableToString(paragraph)\n else:\n text = self.paragraphToString(paragraph)\n if text:\n buffer.append(text)\n\n if self.footnotes:\n\n buffer.append(\"----\")\n for cite, body in self.footnotes:\n buffer.append(\"%s: %s\" % (cite, body))\n\n\n buffer.append(\"\")\n return self.compressCodeBlocks('\\n'.join(buffer))", "metadata": "root.ODF2MoinMoin.toString", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 451 }, { "content": " def textToString(self, element):\n\n buffer = []\n\n for node in element.childNodes:\n\n if node.nodeType == xml.dom.Node.TEXT_NODE:\n buffer.append(node.nodeValue)\n\n elif node.nodeType == xml.dom.Node.ELEMENT_NODE:\n tag = node.tagName\n\n if tag in (\"draw:text-box\", \"draw:frame\"):\n buffer.append(self.textToString(node))\n\n elif tag in (\"text:p\", \"text:h\"):\n text = self.paragraphToString(node)\n if text:\n buffer.append(text)\n elif tag == \"text:list\":\n buffer.append(self.listToString(node))\n else:\n method = self.elements.get(tag)\n if method:\n buffer.append(method(node))\n else:\n buffer.append(\" {\" + tag + \"} \")\n\n return ''.join(buffer)", "metadata": "root.ODF2MoinMoin.textToString", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 487 }, { "content": " def paragraphToString(self, paragraph, indent = 0):\n\n dummyParaProps = ParagraphProps()\n\n style_name = paragraph.getAttribute(\"text:style-name\")\n paraProps = self.paragraphStyles.get(style_name, dummyParaProps)\n text = self.inline_markup(paragraph)\n\n if paraProps and not paraProps.code:\n text = text.strip()\n\n if paragraph.tagName == \"text:p\" and self.lastsegment == \"text:p\":\n text = \"\\n\" + text\n\n self.lastsegment = paragraph.tagName\n\n if paraProps.title:\n self.hasTitle = 1\n return \"= \" + text + \" =\\n\"\n\n outlinelevel = paragraph.getAttribute(\"text:outline-level\")\n if outlinelevel:\n\n level = int(outlinelevel)\n if self.hasTitle: level += 1\n\n if level >= 1:\n return \"=\" * level + \" \" + text + \" \" + \"=\" * level + \"\\n\"\n\n elif paraProps.code:\n return \"{{{\\n\" + text + \"\\n}}}\\n\"\n\n if paraProps.indented:\n return self.wrapParagraph(text, indent = indent, blockquote = True)\n\n else:\n return self.wrapParagraph(text, indent = indent)", "metadata": "root.ODF2MoinMoin.paragraphToString", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 517 }, { "content": " def wrapParagraph(self, text, indent = 0, blockquote=False):\n\n counter = 0\n buffer = []\n LIMIT = 50\n\n if blockquote:\n buffer.append(\" \")\n\n return ''.join(buffer) + text\n # Unused from here\n for token in text.split():\n\n if counter > LIMIT - indent:\n buffer.append(\"\\n\" + \" \"*indent)\n if blockquote:\n buffer.append(\" \")\n counter = 0\n\n buffer.append(token + \" \")\n counter += len(token)\n\n return ''.join(buffer)", "metadata": "root.ODF2MoinMoin.wrapParagraph", "header": "['class', 'ODF2MoinMoin', '(', 'object', ')', ':', '___EOS___']", "index": 556 } ]
[ { "span": "import sys, zipfile, xml.dom.minidom", "start_line": 22, "start_column": 0, "end_line": 22, "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_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2006", "-", "2008", " ", "S", "\\", "248", ";", "ren", " ", "Rou", "g", ",", " ", "Euro", "pea", "n", " ", "Environ", "ment", " ", "Agency", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "librar", "y", " ", "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", " ", "Less", "er", " ", "General", " ", "Public", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "as", " ", "publi", "shed", " ", "by", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", " ", "2.1", " ", "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", " ", "librar", "y", " ", "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", " ", "GN", "U_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Less", "er", " ", "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", " ", "Less", "er", " ", "General", " ", "Public", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "along", " ", "with", " ", "this", " ", "librar", "y", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "1", " ", "Frankl", "in", " ", "Stre", "et", ",", " ", "Fifth", " ", "Flo", "or", ",", " ", "Bo", "ston", ",", " ", "MA", " ", " ", "0211", "0", "-1", "301", " ", " ", "USA", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "http", "://", "trac", ".", "edge", "wall", ".", "org", "/", "wiki", "/", "Wiki", "Formatt", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Contributor", "(", "s", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "zipfile_", ",_", "xml_", "._", "dom_", "._", "minidom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "namespaces_", "import_", "ns", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "element", "types_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "IGNORE", "D", "\\u", "TAGS_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "a", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "g", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "line", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "object", "-", "ole", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "office", ":", "annot", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "presentation", ":", "note", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "svg", ":", "desc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "+_", "[_", "ns", "dict_", "[_", "item_", "[_", "0_", "]_", "]_", "+_", "\":\"_", "+_", "item_", "[_", "1_", "]_", "for_", "item_", "in_", "empty", "\\u", "elements_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "IN", "LINE", "\\u", "TAGS_", "=_", "[_", "ns", "dict_", "[_", "item_", "[_", "0_", "]_", "]_", "+_", "\":\"_", "+_", "item_", "[_", "1_", "]_", "for_", "item_", "in_", "inline", "\\u", "elements_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Text", "Props_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Hold", "s", " ", "proper", "ties", " ", "for", " ", "a", " ", "text", " ", "style", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Text", "Props_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "italic", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bold_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fixed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "underl", "ine", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "strike", "through_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "supers", "cript_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subscript", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Italic", "_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "==_", "\"", "italic", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "italic", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "==_", "\"", "normal", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "italic", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\u\\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", "Bold_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "==_", "\"", "bold", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "bold_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "==_", "\"", "normal", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "bold_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\u\\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", "Fixed_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fixed_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Underl", "ine", "d_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "and_", "value_", "!=_", "\"", "none", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "underl", "ine", "d_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\u\\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", "Stri", "ket", "hro", "ugh", "_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "and_", "value_", "!=_", "\"", "none", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "strike", "through_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\u\\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", "Position_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", "or_", "value_", "==_", "''_", ":_", "\\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_", "posi", "size_", "=_", "value_", "._", "split_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "pos_", "=_", "posi", "size_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text", "pos_", "._", "find_", "(_", "'%'_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text", "pos_", "==_", "\"", "sub", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "supers", "cript_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subscript", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "text", "pos_", "==_", "\"", "super", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "supers", "cript_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subscript", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ite", "xt", "pos_", "=_", "int_", "(_", "text", "pos_", "[_", ":_", "text", "pos_", "._", "find_", "(_", "'%'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ite", "xt", "pos_", ">_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "supers", "cript_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subscript", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ite", "xt", "pos_", "<_", "-_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "supers", "cript_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "subscript", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "Props_", ":_", "\\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", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[", "italic", "=", "%", "s", ",", " ", "bold", "=", "i", "%", "s", ",", " ", "fixed", "=", "%", "s", "]\"_", "%_", "(_", "str_", "(_", "self_", "._", "italic", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "self_", "._", "bold_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "self_", "._", "fixed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Para", "graph", "Props_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Hold", "s", " ", "proper", "ties", " ", "of", " ", "a", " ", "paragraph", " ", "style", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Para", "graph", "Props_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "block", "quote_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "heading", "Level_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "code_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "title_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indented", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Para", "graph", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Indent", "ed_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "indented", "_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Para", "graph", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Head", "ing_", "(_", "self_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "heading", "Level_", "=_", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Para", "graph", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Title_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "title_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Para", "graph", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Code_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "code_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Para", "graph", "Props_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[", "bq", "=", "%", "s", ",", " ", "h", "=", "%", "d", ",", " ", "code", "=", "%", "s", "]\"_", "%_", "(_", "str_", "(_", "self_", "._", "block", "quote_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "heading", "Level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "self_", "._", "code_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "List", "Properties_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Hold", "s", " ", "proper", "ties", " ", "for", " ", "a", " ", "list", " ", "style", ".", " ", "\"\"\"_", "\\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_", "List", "Properties_", ":_", "\\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_", "._", "ordered_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "List", "Properties_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Order", "ed_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ordered_", "=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", ",_", "filepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "footnote", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "footnote", "Counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text", "Styles", "_", "=_", "{_", "\"", "Standard", "\"_", ":_", "Text", "Props_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "paragraph", "Styles", "_", "=_", "{_", "\"", "Standard", "\"_", ":_", "Para", "graph", "Props_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "Styles", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fixed", "Font", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "has", "Title_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lasts", "eg", "ment_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tags_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "page", "'_", ":_", "self_", "._", "text", "To", "String_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "frame", "'_", ":_", "self_", "._", "text", "To", "String_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "image", "'_", ":_", "self_", "._", "draw", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "draw", ":", "text", "-", "box", "'_", ":_", "self_", "._", "text", "To", "String_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", ":", "a", "'_", ":_", "self_", "._", "text", "\\u", "a_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", ":", "note", "'_", ":_", "self_", "._", "text", "\\u", "note_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tag_", "in_", "IGNORE", "D", "\\u", "TAGS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "elements_", "[_", "tag_", "]_", "=_", "self_", "._", "do", "\\u", "nothing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "tag_", "in_", "IN", "LINE", "\\u", "TAGS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "elements_", "[_", "tag_", "]_", "=_", "self_", "._", "inline", "\\u", "markup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "elements_", "[_", "'", "text", ":", "line", "-", "break", "'_", "]_", "=_", "self_", "._", "text", "\\u", "line", "\\u", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "elements_", "[_", "'", "text", ":", "s", "'_", "]_", "=_", "self_", "._", "text", "\\u", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "elements_", "[_", "'", "text", ":", "tab", "'_", "]_", "=_", "self_", "._", "text", "\\u", "tab_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "load_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "Font", "Declarati", "ons_", "(_", "self_", ",_", "font", "Decl", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Extract", "s", " ", "necessar", "y", " ", "font", " ", "informati", "on", " ", "from", " ", "a", " ", "font", "-", "declaration", "\\", "10", ";", " ", " ", " ", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "font", "Face_", "in_", "font", "Decl", "_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "style", ":", "font", "-", "face", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "font", "Face_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "font", "-", "pitch", "\"_", ")_", "==_", "\"", "fixed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fixed", "Font", "s_", "._", "append_", "(_", "font", "Face_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "name", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", "extract", "Text", "Properties_", "(_", "self_", ",_", "style_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Extract", "s", " ", "text", " ", "proper", "ties", " ", "from", " ", "a", " ", "style", " ", "element", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text", "Props_", "=_", "Text", "Props_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "parent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parent", "Prop_", "=_", "self_", "._", "text", "Styles", "_", "._", "get_", "(_", "parent_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parent", "Prop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text", "Prop_", "=_", "parent", "Prop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text", "Prop", "El", "_", "=_", "style_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "style", ":", "text", "-", "proper", "ties", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "text", "Prop", "El", "_", ":_", "return_", "text", "Props_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text", "Prop", "El", "_", "=_", "text", "Prop", "El", "_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text", "Props_", "._", "set", "Italic", "_", "(_", "text", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "fo", ":", "font", "-", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "Props_", "._", "set", "Bold_", "(_", "text", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "fo", ":", "font", "-", "weight", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "Props_", "._", "set", "Underl", "ine", "d_", "(_", "text", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "text", "-", "underl", "ine", "-", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "Props_", "._", "set", "Stri", "ket", "hro", "ugh", "_", "(_", "text", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "text", "-", "line", "-", "through", "-", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "Props_", "._", "set", "Position_", "(_", "text", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "text", "-", "position", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "font", "-", "name", "\"_", ")_", "in_", "self_", "._", "fixed", "Font", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text", "Props_", "._", "set", "Fixed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text", "Props_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extract", "Para", "graph", "Properties_", "(_", "self_", ",_", "style_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Extract", "s", " ", "paragraph", " ", "proper", "ties", " ", "from", " ", "a", " ", "style", " ", "element", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "para", "Props_", "=_", "Para", "graph", "Props_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "style_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "._", "startswith_", "(_", "\"", "Head", "ing", "\\u", "20", "\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "name_", "[_", "11_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "int_", "(_", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "para", "Props_", "._", "set", "Head", "ing_", "(_", "level_", ")_", "\\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 ", " _", "level_", "=_", "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_", "name_", "==_", "\"", "Tit", "le", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "para", "Props_", "._", "set", "Title_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "para", "Prop", "El", "_", "=_", "style_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "style", ":", "paragraph", "-", "proper", "ties", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "para", "Prop", "El", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "para", "Prop", "El", "_", "=_", "para", "Prop", "El", "_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "Margin_", "=_", "para", "Prop", "El", "_", "._", "get", "Attribute_", "(_", "\"", "fo", ":", "marg", "in", "-", "left", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "left", "Margin_", ":_", "\\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 ", " ", "_", "left", "Margin_", "=_", "float_", "(_", "left", "Margin_", "[_", ":_", "-_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "left", "Margin_", ">_", "0.01_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "para", "Props_", "._", "set", "Indent", "ed_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text", "Props_", "=_", "self_", "._", "extract", "Text", "Properties_", "(_", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text", "Props_", "._", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "para", "Props_", "._", "set", "Code_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "para", "Props_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "Styles", "_", "(_", "self_", ",_", "style", "Elements_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Run", "s", " ", "through", " ", "\"", "style", "\"", " ", "element", "s", " ", "extracti", "ng", " ", "necessar", "y", " ", "informati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "style_", "in_", "style", "Elements_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "style_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "==_", "\"", "Standard", "\"_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "family_", "=_", "style_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "famil", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "style_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "parent", "-", "style", "-", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "family_", "==_", "\"", "text", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text", "Styles", "_", "[_", "name_", "]_", "=_", "self_", "._", "extract", "Text", "Properties_", "(_", "style_", ",_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "family_", "==_", "\"", "paragraph", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "paragraph", "Styles", "_", "[_", "name_", "]_", "=_", "self_", "._", "extract", "Para", "graph", "Properties_", "(_", "style_", ",_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text", "Styles", "_", "[_", "name_", "]_", "=_", "self_", "._", "extract", "Text", "Properties_", "(_", "style_", ",_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", "process", "List", "Styles", "_", "(_", "self_", ",_", "list", "Style", "Elements_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "style_", "in_", "list", "Style", "Elements_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "style_", "._", "get", "Attribute_", "(_", "\"", "style", ":", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prop_", "=_", "List", "Properties_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "style_", "._", "has", "Chil", "d", "Nodes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subi", "tems_", "=_", "[_", "el_", "for_", "el_", "in_", "style_", "._", "child", "Nodes_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "el_", "._", "node", "Type_", "==_", "xml_", "._", "dom_", "._", "Node_", "._", "ELEMENT", "\\u", "NODE_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "el_", "._", "tag", "Name_", "==_", "\"", "text", ":", "list", "-", "level", "-", "style", "-", "number", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "subi", "tems_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "prop_", "._", "set", "Order", "ed_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "list", "Styles", "_", "[_", "name_", "]_", "=_", "prop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", "load_", "(_", "self_", ",_", "filepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Load", "s", " ", "an", " ", "OD", "T", " ", "file", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "zip_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "style", "s", "\\u", "doc_", "=_", "xml_", "._", "dom_", "._", "minidom_", "._", "parse", "String_", "(_", "zip_", "._", "read_", "(_", "\"", "style", "s", ".", "xml", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "font", "face", "decl", "s_", "=_", "style", "s", "\\u", "doc_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "office", ":", "font", "-", "face", "-", "decl", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "font", "face", "decl", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "process", "Font", "Declarati", "ons_", "(_", "font", "face", "decl", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "process", "Styles", "_", "(_", "style", "s", "\\u", "doc_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "style", ":", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "process", "List", "Styles", "_", "(_", "style", "s", "\\u", "doc_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "text", ":", "list", "-", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "content_", "=_", "xml_", "._", "dom_", "._", "minidom_", "._", "parse", "String_", "(_", "zip_", "._", "read_", "(_", "\"", "content", ".", "xml", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "font", "face", "decl", "s_", "=_", "self_", "._", "content_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "office", ":", "font", "-", "face", "-", "decl", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "font", "face", "decl", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "process", "Font", "Declarati", "ons_", "(_", "font", "face", "decl", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "process", "Styles", "_", "(_", "self_", "._", "content_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "style", ":", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "process", "List", "Styles", "_", "(_", "self_", "._", "content_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "text", ":", "list", "-", "style", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compress", "Code", "Blocks_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Remove", "s", " ", "extra", " ", "blank", " ", "lines", " ", "from", " ", "code", " ", "blocks", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "text_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Lines_", "=_", "len_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "lines_", "[_", "i_", "]_", "._", "strip_", "(_", ")_", "or_", "i_", "==_", "num", "Lines_", "-_", "1_", "or_", "i_", "==_", "0_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "(_", "lines_", "[_", "i_", "-_", "1_", "]_", "._", "startswith_", "(_", "\"", " ", " ", " ", " ", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "lines_", "[_", "i_", "+_", "1_", "]_", "._", "startswith_", "(_", "\"", " ", " ", " ", " ", "\"_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"\\\\", "n", "\"_", "+_", "lines_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "nothing_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "draw", "\\u", "image_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "link_", "=_", "node_", "._", "get", "Attribute_", "(_", "\"", "xli", "nk", ":", "href", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "link_", "and_", "link_", "[_", ":_", "2_", "]_", "==_", "'./'_", ":_", "#", " ", "Indicat", "es", " ", "a", " ", "sub", "-", "object", ",", " ", "whi", "ch", " ", "isn", "'", "t", " ", "supported_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", "\\\\", "n", "\"_", "%_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "link_", "and_", "link_", "[_", ":_", "9_", "]_", "==_", "'", "Picture", "s", "/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link_", "=_", "link_", "[_", "9_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"[", "[", "Image", "(%", "s", ")]", "]\\\\", "n", "\"_", "%_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "text", "\\u", "a_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "text", "To", "String_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "node_", "._", "get", "Attribute_", "(_", "\"", "xli", "nk", ":", "href", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "link_", "._", "strip_", "(_", ")_", "==_", "text_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[", "%", "s", "]", " ", "\"_", "%_", "link_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[", "%", "s", " ", "%", "s", "]", " ", "\"_", "%_", "(_", "link_", "._", "strip_", "(_", ")_", ",_", "text_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", "text", "\\u", "line", "\\u", "break_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[", "[", "BR", "]]", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "text", "\\u", "note_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cite", "_", "=_", "(_", "node_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "text", ":", "note", "-", "cit", "ation", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "._", "child", "Nodes_", "[_", "0_", "]_", "._", "node", "Value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "(_", "node_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "text", ":", "note", "-", "body", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "._", "child", "Nodes_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "footnote", "s_", "._", "append_", "(_", "(_", "cite", "_", ",_", "self_", "._", "text", "To", "String_", "(_", "body_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", "^", "%", "s", "^", "\"_", "%_", "cite", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "text", "\\u", "s_", "(_", "self_", ",_", "node_", ")_", ":_", "\\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 ", " _", "num_", "=_", "int_", "(_", "node_", "._", "get", "Attribute_", "(_", "\"", "text", ":", "c", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", " ", "\"_", "*_", "num_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", "text", "\\u", "tab_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", " ", " ", " ", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "inline", "\\u", "markup_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "text", "To", "String_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "text_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "#", " ", "don", "'", "t", " ", "appl", "y", " ", "style", "s", " ", "to", " ", "white", " ", "space_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "style", "Name_", "=_", "node_", "._", "get", "Attribute_", "(_", "\"", "text", ":", "style", "-", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "style_", "=_", "self_", "._", "text", "Styles", "_", "._", "get_", "(_", "style", "Name_", ",_", "Text", "Props_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "style_", "._", "fixed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"`", "\"_", "+_", "text_", "+_", "\"`", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mark_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "style_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "style_", "._", "italic", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "._", "append_", "(_", "\"''\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "style_", "._", "bold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "._", "append_", "(_", "\"'''", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "style_", "._", "underl", "ine", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "._", "append_", "(_", "\"\\u\\u", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "style_", "._", "strike", "through_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "._", "append_", "(_", "\"", "~~", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "style_", "._", "supers", "cript_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "._", "append_", "(_", "\"", "^", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "style_", "._", "subscript", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "._", "append_", "(_", "\",", ",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rev", "mark_", "=_", "mark_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rev", "mark_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"%", "s", "%", "s", "%", "s", "\"_", "%_", "(_", "''_", "._", "join_", "(_", "mark_", ")_", ",_", "text_", ",_", "''_", "._", "join_", "(_", "rev", "mark_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "To", "String_", "(_", "self_", ",_", "list", "Element_", ",_", "indent_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lasts", "eg", "ment_", "=_", "list", "Element_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "style", "Name_", "=_", "list", "Element_", "._", "get", "Attribute_", "(_", "\"", "text", ":", "style", "-", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "props_", "=_", "self_", "._", "list", "Styles", "_", "._", "get_", "(_", "style", "Name_", ",_", "List", "Properties_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "list", "Element_", "._", "child", "Nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"", " ", "\"_", "*_", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "props_", "._", "ordered_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "number_", "=_", "str_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "number_", "=_", "\"", " ", "\"_", "+_", "number_", "+_", "\".", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "._", "append_", "(_", "\"", " ", "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 ", " _", "buffer_", "._", "append_", "(_", "\"", " ", "*", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "subi", "tems_", "=_", "[_", "el_", "for_", "el_", "in_", "item_", "._", "child", "Nodes_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "el_", "._", "tag", "Name_", "in_", "[_", "\"", "text", ":", "p", "\"_", ",_", "\"", "text", ":", "h", "\"_", ",_", "\"", "text", ":", "list", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "subi", "tem_", "in_", "subi", "tems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "subi", "tem_", "._", "tag", "Name_", "==_", "\"", "text", ":", "list", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "buffer_", "._", "append_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "._", "append_", "(_", "self_", "._", "list", "To", "String_", "(_", "subi", "tem_", ",_", "indent_", "+_", "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 ", " ", "_", "buffer_", "._", "append_", "(_", "self_", "._", "paragraph", "To", "String_", "(_", "subi", "tem_", ",_", "indent_", "+_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "lasts", "eg", "ment_", "=_", "subi", "tem_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "lasts", "eg", "ment_", "=_", "item_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "._", "append_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "table", "To", "String_", "(_", "self_", ",_", "table", "Element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Moi", "n", "Moi", "n", " ", "use", "s", " ", "||", " ", "to", " ", "delim", "it", " ", "table", " ", "cells", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lasts", "eg", "ment_", "=_", "table", "Element_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "table", "Element_", "._", "child", "Nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lasts", "eg", "ment_", "=_", "item_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item_", "._", "tag", "Name_", "==_", "\"", "table", ":", "table", "-", "header", "-", "rows", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "self_", "._", "table", "To", "String_", "(_", "item_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "tag", "Name_", "==_", "\"", "table", ":", "table", "-", "row", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"\\\\", "n", "||", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cell_", "in_", "item_", "._", "child", "Nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "buffer_", "._", "append_", "(_", "self_", "._", "inline", "\\u", "markup_", "(_", "cell_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "._", "append_", "(_", "\"|", "|\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lasts", "eg", "ment_", "=_", "cell_", "._", "tag", "Name_", "\\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_", "''_", "._", "join_", "(_", "buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "String_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Convert", "s", " ", "the", " ", "document", " ", "to", " ", "a", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "FIX", "ME", ":", " ", "Result", " ", "from", " ", "second", " ", "call", " ", "differs", " ", "from", " ", "first", " ", "call", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "self_", "._", "content_", "._", "get", "Element", "s", "By", "Ta", "g", "Name_", "(_", "\"", "office", ":", "body", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "body_", "._", "child", "Nodes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "paragraphs_", "=_", "[_", "el_", "for_", "el_", "in_", "text_", "._", "child", "Nodes_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "el_", "._", "tag", "Name_", "in_", "[_", "\"", "draw", ":", "page", "\"_", ",_", "\"", "text", ":", "p", "\"_", ",_", "\"", "text", ":", "h", "\"_", ",_", "\"", "text", ":", "section", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "text", ":", "list", "\"_", ",_", "\"", "table", ":", "table", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "paragraph_", "in_", "paragraphs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "paragraph_", "._", "tag", "Name_", "==_", "\"", "text", ":", "list", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "list", "To", "String_", "(_", "paragraph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "paragraph_", "._", "tag", "Name_", "==_", "\"", "text", ":", "section", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "text", "To", "String_", "(_", "paragraph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "paragraph_", "._", "tag", "Name_", "==_", "\"", "table", ":", "table", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "table", "To", "String_", "(_", "paragraph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "paragraph", "To", "String_", "(_", "paragraph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "text_", ")_", "\\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_", "._", "footnote", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"----", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cite", "_", ",_", "body_", "in_", "self_", "._", "footnote", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "cite", "_", ",_", "body_", ")_", ")_", "\\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_", "buffer_", "._", "append_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "compress", "Code", "Blocks_", "(_", "'\\\\", "n", "'_", "._", "join_", "(_", "buffer_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "text", "To", "String_", "(_", "self_", ",_", "element_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", "in_", "element_", "._", "child", "Nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "node_", "._", "node", "Type_", "==_", "xml_", "._", "dom_", "._", "Node_", "._", "TEXT", "\\u", "NODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "node_", "._", "node", "Value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "node_", "._", "node", "Type_", "==_", "xml_", "._", "dom_", "._", "Node_", "._", "ELEMENT", "\\u", "NODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", "=_", "node_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "tag_", "in_", "(_", "\"", "draw", ":", "text", "-", "box", "\"_", ",_", "\"", "draw", ":", "frame", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "buffer_", "._", "append_", "(_", "self_", "._", "text", "To", "String_", "(_", "node_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tag_", "in_", "(_", "\"", "text", ":", "p", "\"_", ",_", "\"", "text", ":", "h", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "text_", "=_", "self_", "._", "paragraph", "To", "String_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "buffer_", "._", "append_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "tag_", "==_", "\"", "text", ":", "list", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "buffer_", "._", "append_", "(_", "self_", "._", "list", "To", "String_", "(_", "node_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "method_", "=_", "self_", "._", "elements_", "._", "get_", "(_", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "method_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "buffer_", "._", "append_", "(_", "method_", "(_", "node_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "buffer_", "._", "append_", "(_", "\"", " ", "{\"_", "+_", "tag_", "+_", "\"}", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "paragraph", "To", "String_", "(_", "self_", ",_", "paragraph_", ",_", "indent_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dummy", "Para", "Props_", "=_", "Para", "graph", "Props_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "style", "\\u", "name_", "=_", "paragraph_", "._", "get", "Attribute_", "(_", "\"", "text", ":", "style", "-", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "para", "Props_", "=_", "self_", "._", "paragraph", "Styles", "_", "._", "get_", "(_", "style", "\\u", "name_", ",_", "dummy", "Para", "Props_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "self_", "._", "inline", "\\u", "markup_", "(_", "paragraph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "para", "Props_", "and_", "not_", "para", "Props_", "._", "code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "text_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "paragraph_", "._", "tag", "Name_", "==_", "\"", "text", ":", "p", "\"_", "and_", "self_", "._", "lasts", "eg", "ment_", "==_", "\"", "text", ":", "p", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\\\\", "n", "\"_", "+_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "lasts", "eg", "ment_", "=_", "paragraph_", "._", "tag", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "para", "Props_", "._", "title_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "Title_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"=", " ", "\"_", "+_", "text_", "+_", "\"", " ", "=\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outline", "level_", "=_", "paragraph_", "._", "get", "Attribute_", "(_", "\"", "text", ":", "outline", "-", "level", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "outline", "level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "level_", "=_", "int_", "(_", "outline", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "Title_", ":_", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "level_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"=\"_", "*_", "level_", "+_", "\"", " ", "\"_", "+_", "text_", "+_", "\"", " ", "\"_", "+_", "\"=\"_", "*_", "level_", "+_", "\"\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "para", "Props_", "._", "code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"{", "{{", "\\\\", "n", "\"_", "+_", "text_", "+_", "\"\\\\", "n", "}}}", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "para", "Props_", "._", "indented", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "wrap", "Paragraph_", "(_", "text_", ",_", "indent_", "=_", "indent_", ",_", "block", "quote_", "=_", "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 ", " _", "return_", "self_", "._", "wrap", "Paragraph_", "(_", "text_", ",_", "indent_", "=_", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OD", "F2", "Moi", "n", "Moi", "n_", "(_", "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_", "wrap", "Paragraph_", "(_", "self_", ",_", "text_", ",_", "indent_", "=_", "0_", ",_", "block", "quote_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LIMIT_", "=_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "block", "quote_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"", " ", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "buffer_", ")_", "+_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Un", "used", " ", "from", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "token_", "in_", "text_", "._", "split_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "counter_", ">_", "LIMIT_", "-_", "indent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buffer_", "._", "append_", "(_", "\"\\\\", "n", "\"_", "+_", "\"", " ", "\"_", "*_", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "block", "quote_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "buffer_", "._", "append_", "(_", "\"", " ", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "buffer_", "._", "append_", "(_", "token_", "+_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counter_", "+=_", "len_", "(_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "buffer_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/tests/test_general.py
[ { "content": " def assertDupeShape(self, origShape, shapeDup):\n self.assertTrue(shapeDup.__class__ == origShape.__class__)\n \n # As of Maya 2009, shapeCompare doesn't handle subdivs, and always\n # returns 1 for curves\n if not isinstance(origShape, (nt.Subdiv, nt.NurbsCurve)):\n if shapeCompare(origShape, shapeDup) != 0:\n self.fail(\"shapes do not compare equal: %r, %r)\" %\n (origShape, shapeDup))\n self.assertFalse(origShape.isInstanceOf(shapeDup))", "metadata": "root.testCase_duplicateShape.assertDupeShape", "header": "['class', 'testCase_duplicateShape', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 741 } ]
[ { "span": "self.assertTrue(shapeDup.__class__ == origShape.__class__)", "start_line": 742, "start_column": 12, "end_line": 742, "end_column": 70 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "test", "Case", "\\u", "duplicat", "e", "Shape_", "(_", "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_", "assert", "Dup", "e", "Shape_", "(_", "self_", ",_", "orig", "Shape_", ",_", "shape", "Dup", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "shape", "Dup", "_", "._", "\\u\\u", "class\\u\\u_", "==_", "orig", "Shape_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", " ", "of", " ", "Maya", " ", "200", "9", ",", " ", "shape", "Compare", " ", "doe", "sn", "'", "t", " ", "handle", " ", "subd", "iv", "s", ",", " ", "and", " ", "alw", "ays_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", "s", " ", "1", " ", "for", " ", "curves_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "orig", "Shape_", ",_", "(_", "nt_", "._", "Subd", "iv_", ",_", "nt_", "._", "Nu", "rb", "s", "Curve_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "shape", "Compare", "_", "(_", "orig", "Shape_", ",_", "shape", "Dup", "_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "fail_", "(_", "\"", "shape", "s", " ", "do", " ", "not", " ", "compare", " ", "equal", ":", " ", "%", "r", ",", " ", "%", "r", ")\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "orig", "Shape_", ",_", "shape", "Dup", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "orig", "Shape_", "._", "is", "Insta", "nce", "Of_", "(_", "shape", "Dup", "_", ")_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
kivy/kivy/kivy/core/image/img_gif.py
[ { "content": " def load(self, filename):\n try:\n try:\n im = GifDecoder(open(filename, 'rb').read())\n except UnicodeEncodeError:\n if PY2:\n im = GifDecoder(open(filename.encode('utf8'), 'rb').read())\n except:\n Logger.warning('Image: Unable to load Image <%s>' % filename)\n raise\n\n if Debug:\n print(im.print_info())\n img_data = []\n ls_width = im.ls_width\n ls_height = im.ls_height\n im_images = im.images\n im_palette = im.palette\n pixel_map = array('B', [0] * (ls_width * ls_height * 4))\n for img in im_images:\n palette = img.palette if img.local_color_table_flag\\\n else im_palette\n have_transparent_color = img.has_transparent_color\n transparent_color = img.transparent_color\n #draw_method_restore_previous = 1 \\\n # if img.draw_method == 'restore previous' else 0\n draw_method_replace = 1 \\\n if ((img.draw_method == 'replace') or\n (img.draw_method == 'restore background')) else 0\n pixels = img.pixels\n img_height = img.height\n img_width = img.width\n left = img.left\n top = img.top\n if img_height > ls_height or img_width > ls_width or\\\n top > ls_height or left > ls_width:\n Logger.warning('Image_GIF: decoding error on frame <%s>' %\n len(img_data))\n img_height = ls_height\n img_width = ls_width\n left = top = 0\n #reverse top to bottom and left to right\n tmp_top = (ls_height - (img_height + top))\n img_width_plus_left = (img_width + left)\n ls_width_multiply_4 = ls_width * 4\n left_multiply_4 = left * 4\n img_data_append = img_data.append\n while img_height > 0:\n i = left\n img_height -= 1\n x = (img_height * img_width) - left\n rgba_pos = (tmp_top * ls_width_multiply_4) + (left_multiply_4)\n tmp_top += 1\n while i < img_width_plus_left:\n #this should now display corrupted gif's\n #instead of crashing on gif's not decoded properly\n try:\n (r, g, b) = palette[pixels[x + i]]\n except:\n rgba_pos += 4\n i += 1\n continue\n # when not magic pink\n if (r, g, b) != (255, 0, 255):\n if have_transparent_color:\n if transparent_color == pixels[x + i]:\n if draw_method_replace:\n #transparent pixel draw method replace\n pixel_map[rgba_pos + 3] = 0\n rgba_pos += 4\n i += 1\n continue\n #transparent pixel draw method combine\n rgba_pos += 4\n i += 1\n continue\n # this pixel isn't transparent\n #doesn't have transparent color\n (pixel_map[rgba_pos], pixel_map[rgba_pos + 1],\n pixel_map[rgba_pos + 2]) = (r, g, b)\n pixel_map[rgba_pos + 3] = 255\n # if magic pink move to next pixel\n rgba_pos += 4\n i += 1\n\n if PY2:\n img_data_append(ImageData(ls_width, ls_height,\n 'rgba', pixel_map.tostring(), flip_vertical=False))\n else:\n img_data_append(ImageData(ls_width, ls_height,\n 'rgba', pixel_map.tobytes(), flip_vertical=False))\n\n if draw_method_replace:\n pixel_map = array('B', [0] * (ls_width * ls_height * 4))\n\n self.filename = filename\n\n return img_data", "metadata": "root.ImageLoaderGIF.load", "header": "['class', 'ImageLoaderGIF', '(', 'ImageLoaderBase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def fill(self):\n '''reads the data and fills each field of the file'''\n\n # start reading from the beggining of the file\n self.pointer = 0\n\n #17. Header.\n #18. Logical Screen Descriptor.\n data = self.pops(Gif.FMT_HEADER, self.data)\n\n self.header = data[0]\n self.ls_width = data[1]\n self.ls_height = data[2]\n self.background_color = data[4]\n self.aspect_ratio = data[5]\n\n # flags field\n self.flags = get_bits(data[3])\n #1 bit\n self.color_table_flag = self.flags[7]\n self.sort_flag = self.flags[3]\n #3 bit\n self.color_resolution = pack_bits(self.flags[4:7]) # 7 not included\n #3 bit\n self.global_color_table_size = 2 ** (pack_bits(self.flags[:3]) + 1)\n\n #19. Global Color Table.\n if self.color_table_flag:\n size = (self.global_color_table_size) * 3\n self.palette = self.get_color_table(size)\n else:\n # generate a greyscale palette\n self.palette = [(x, x, x) for x in range(256)]\n\n # blocks\n image = None\n self_data = self.data\n self_pops = self.pops\n Gif_IMAGE_SEPARATOR = Gif.IMAGE_SEPARATOR\n Gif_FMT_IMGDESC = Gif.FMT_IMGDESC\n self_new_image = self.new_image\n self_pop = self.pop\n self_debug_enabled = self.debug_enabled\n self_lzw_decode = self.lzw_decode\n Gif_EXTENSION_INTRODUCER = Gif.EXTENSION_INTRODUCER\n Gif_GIF_TRAILER = Gif.GIF_TRAILER\n Gif_LABEL_GRAPHIC_CONTROL = Gif.LABEL_GRAPHIC_CONTROL\n trans_color = 0\n has_transparent_color = 0\n drw_method = 'replace'\n while True:\n try:\n nextbyte = self_pops('<B', self_data)[0]\n except:\n nextbyte = 0x3b # force end\n\n #20. Image Descriptor\n if nextbyte == Gif_IMAGE_SEPARATOR:\n descriptor = self_pops(Gif_FMT_IMGDESC, self_data)\n image = self_new_image(descriptor)\n image.transparent_color = trans_color\n image.has_transparent_color = has_transparent_color\n image.draw_method = drw_method\n image.codesize = self_pops('<B', self_data)[0]\n image.lzwcode = b''\n image_lzwcode = image.lzwcode\n ###TODO too many corner casses for gifs:(\n table_size = image.local_color_table_size\\\n if image.local_color_table_flag and \\\n self.global_color_table_size < image.local_color_table_size\\\n else self.global_color_table_size\n\n while True:\n try:\n blocksize = self_pops('<B', self_data)[0]\n except:\n break\n if blocksize == 0:\n break # no more image data\n lzwdata = self_pop(self_data, blocksize)\n image_lzwcode = b''.join((image_lzwcode, lzwdata))\n\n if self_debug_enabled:\n print('LZW length:', len(image_lzwcode))\n\n image.lzwcode = image_lzwcode\n image.pixels = self_lzw_decode(image.lzwcode, image.codesize,\n table_size)\n\n # Extensions\n elif nextbyte == Gif_EXTENSION_INTRODUCER:\n pass\n # Gif trailer\n elif nextbyte == Gif_GIF_TRAILER:\n return\n elif nextbyte == Gif_LABEL_GRAPHIC_CONTROL:\n nextbyte = self_pops('<B', self_data)[0]\n drw_bits = (get_bits(self_pops('<B', self_data)[0]))\n has_transparent_color = drw_bits[0]\n if drw_bits[2:5] == array('B', [0, 0, 1]):\n drw_method = 'replace'\n elif (drw_bits[2:5]) == array('B', [0, 1, 0]):\n drw_method = 'restore background'\n else:\n drw_method = 'restore previous'\n nextbyte = self_pops('<B', self_data)[0]\n nextbyte = self_pops('<B', self_data)[0]\n nextbyte = self_pops('<B', self_data)[0]\n trans_color = nextbyte\n pass\n # \"No Idea What Is This\"\n else:\n pass", "metadata": "root.GifDecoder.fill", "header": "['class', 'GifDecoder', '(', 'Gif', ')', ':', '___EOS___']", "index": 306 } ]
[ { "span": "except:", "start_line": 109, "start_column": 20, "end_line": 109, "end_column": 27 }, { "span": "except:", "start_line": 359, "start_column": 12, "end_line": 359, "end_column": 19 }, { "span": "except:", "start_line": 381, "start_column": 20, "end_line": 381, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Image", "Load", "er", "GIF", "_", "(_", "Image", "Load", "er", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "im_", "=_", "Gi", "f", "Decoder_", "(_", "open_", "(_", "filename_", ",_", "'", "rb", "'_", ")_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unic", "ode", "Encode", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "im_", "=_", "Gi", "f", "Decoder_", "(_", "open_", "(_", "filename_", "._", "encode_", "(_", "'", "utf", "8", "'_", ")_", ",_", "'", "rb", "'_", ")_", "._", "read_", "(_", ")_", ")_", "\\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 ", " _", "Logger_", "._", "warning_", "(_", "'", "Image", ":", " ", "Una", "ble", " ", "to", " ", "load", " ", "Image", " ", "<", "%", "s", ">'_", "%_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "im_", "._", "print", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img", "\\u", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls", "\\u", "width_", "=_", "im_", "._", "ls", "\\u", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls", "\\u", "height_", "=_", "im_", "._", "ls", "\\u", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "images_", "=_", "im_", "._", "images_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "im", "\\u", "palette_", "=_", "im_", "._", "palette_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pixel", "\\u", "map_", "=_", "array_", "(_", "'", "B", "'_", ",_", "[_", "0_", "]_", "*_", "(_", "ls", "\\u", "width_", "*_", "ls", "\\u", "height_", "*_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "img_", "in_", "im", "\\u", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "palette_", "=_", "img_", "._", "palette_", "if_", "img_", "._", "local", "\\u", "color", "\\u", "table", "\\u", "flag_", "else_", "im", "\\u", "palette_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "have", "\\u", "transp", "arent", "\\u", "color_", "=_", "img_", "._", "has", "\\u", "transp", "arent", "\\u", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transp", "arent", "\\u", "color_", "=_", "img_", "._", "transp", "arent", "\\u", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "draw", "\\u", "method", "\\u", "restore", "\\u", "previ", "ous", " ", "=", " ", " ", "1", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "img", ".", "draw", "\\u", "method", " ", "==", " ", "'", "restore", " ", "previ", "ous", "'", " ", "else", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "draw", "\\u", "method", "\\u", "replace_", "=_", "1_", "if_", "(_", "(_", "img_", "._", "draw", "\\u", "method_", "==_", "'", "replace", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "img_", "._", "draw", "\\u", "method_", "==_", "'", "restore", " ", "background", "'_", ")_", ")_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pixels_", "=_", "img_", "._", "pixels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "height_", "=_", "img_", "._", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "width_", "=_", "img_", "._", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "img_", "._", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "=_", "img_", "._", "top_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "img", "\\u", "height_", ">_", "ls", "\\u", "height_", "or_", "img", "\\u", "width_", ">_", "ls", "\\u", "width_", "or_", "top_", ">_", "ls", "\\u", "height_", "or_", "left_", ">_", "ls", "\\u", "width_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Logger_", "._", "warning_", "(_", "'", "Image", "\\u", "GIF", ":", " ", "deco", "ding", " ", "error", " ", "on", " ", "frame", " ", "<", "%", "s", ">'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "img", "\\u", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "height_", "=_", "ls", "\\u", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "width_", "=_", "ls", "\\u", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "top_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "reverse", " ", "top", " ", "to", " ", "bottom", " ", "and", " ", "left", " ", "to", " ", "right_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "top_", "=_", "(_", "ls", "\\u", "height_", "-_", "(_", "img", "\\u", "height_", "+_", "top_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "widt", "h", "\\u", "plus", "\\u", "left_", "=_", "(_", "img", "\\u", "width_", "+_", "left_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls", "\\u", "widt", "h", "\\u", "multipl", "y", "\\u", "4_", "=_", "ls", "\\u", "width_", "*_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u", "multipl", "y", "\\u", "4_", "=_", "left_", "*_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "data\\u", "append_", "=_", "img", "\\u", "data_", "._", "append_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "img", "\\u", "height_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "height_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "(_", "img", "\\u", "height_", "*_", "img", "\\u", "width_", ")_", "-_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rgb", "a", "\\u", "pos_", "=_", "(_", "tmp", "\\u", "top_", "*_", "ls", "\\u", "widt", "h", "\\u", "multipl", "y", "\\u", "4_", ")_", "+_", "(_", "left", "\\u", "multipl", "y", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "top_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<_", "img", "\\u", "widt", "h", "\\u", "plus", "\\u", "left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "this", " ", "shou", "ld", " ", "now", " ", "display", " ", "corrupted", " ", "gif", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "inst", "ead", " ", "of", " ", "crash", "ing", " ", "on", " ", "gif", "'", "s", " ", "not", " ", "decode", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "(_", "r_", ",_", "g_", ",_", "b_", ")_", "=_", "palette_", "[_", "pixels_", "[_", "x_", "+_", "i_", "]_", "]_", "\\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 ", " ", " _", "rgb", "a", "\\u", "pos_", "+=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "whe", "n", " ", "not", " ", "magic", " ", "pin", "k_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "r_", ",_", "g_", ",_", "b_", ")_", "!=_", "(_", "255_", ",_", "0_", ",_", "255_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "have", "\\u", "transp", "arent", "\\u", "color_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "transp", "arent", "\\u", "color_", "==_", "pixels_", "[_", "x_", "+_", "i_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "draw", "\\u", "method", "\\u", "replace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "transp", "arent", " ", "pixel", " ", "draw", " ", "method", " ", "replace_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pixel", "\\u", "map_", "[_", "rgb", "a", "\\u", "pos_", "+_", "3_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rgb", "a", "\\u", "pos_", "+=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "transp", "arent", " ", "pixel", " ", "draw", " ", "method", " ", "combine_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rgb", "a", "\\u", "pos_", "+=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "pixel", " ", "isn", "'", "t", " ", "transparent_", "\\u\\u\\uNL\\u\\u\\u_", "#", "doe", "sn", "'", "t", " ", "have", " ", "transp", "arent", " ", "color_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "pixel", "\\u", "map_", "[_", "rgb", "a", "\\u", "pos_", "]_", ",_", "pixel", "\\u", "map_", "[_", "rgb", "a", "\\u", "pos_", "+_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pixel", "\\u", "map_", "[_", "rgb", "a", "\\u", "pos_", "+_", "2_", "]_", ")_", "=_", "(_", "r_", ",_", "g_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pixel", "\\u", "map_", "[_", "rgb", "a", "\\u", "pos_", "+_", "3_", "]_", "=_", "255_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "magic", " ", "pin", "k", " ", "move", " ", "to", " ", "next", " ", "pixel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rgb", "a", "\\u", "pos_", "+=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "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_", "PY", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img", "\\u", "data\\u", "append_", "(_", "Image", "Data_", "(_", "ls", "\\u", "width_", ",_", "ls", "\\u", "height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rgb", "a", "'_", ",_", "pixel", "\\u", "map_", "._", "tostring_", "(_", ")_", ",_", "flip", "\\u", "vertical_", "=_", "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 ", " _", "img", "\\u", "data\\u", "append_", "(_", "Image", "Data_", "(_", "ls", "\\u", "width_", ",_", "ls", "\\u", "height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rgb", "a", "'_", ",_", "pixel", "\\u", "map_", "._", "tob", "ytes_", "(_", ")_", ",_", "flip", "\\u", "vertical_", "=_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "draw", "\\u", "method", "\\u", "replace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pixel", "\\u", "map_", "=_", "array_", "(_", "'", "B", "'_", ",_", "[_", "0_", "]_", "*_", "(_", "ls", "\\u", "width_", "*_", "ls", "\\u", "height_", "*_", "4_", ")_", ")_", "\\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_", "._", "filename_", "=_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "img", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "f", "Decoder_", "(_", "Gi", "f_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fill_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "reads", " ", "the", " ", "data", " ", "and", " ", "fills", " ", "each", " ", "field", " ", "of", " ", "the", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "readi", "ng", " ", "from", " ", "the", " ", "beg", "gini", "ng", " ", "of", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pointer_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "17.", " ", "Head", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "18.", " ", "Logi", "cal", " ", "Scr", "een", " ", "Descrip", "tor", "._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "pops", "_", "(_", "Gi", "f_", "._", "FMT", "\\u", "HEADER_", ",_", "self_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "header_", "=_", "data_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ls", "\\u", "width_", "=_", "data_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ls", "\\u", "height_", "=_", "data_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "background", "\\u", "color_", "=_", "data_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "aspect", "\\u", "ratio_", "=_", "data_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flags", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "flags_", "=_", "get", "\\u", "bits_", "(_", "data_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "1", " ", "bit_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "color", "\\u", "table", "\\u", "flag_", "=_", "self_", "._", "flags_", "[_", "7_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sort", "\\u", "flag_", "=_", "self_", "._", "flags_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "3", " ", "bit_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "color", "\\u", "resolution_", "=_", "pack", "\\u", "bits_", "(_", "self_", "._", "flags_", "[_", "4_", ":_", "7_", "]_", ")_", "#", " ", "7", " ", "not", " ", "included_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "3", " ", "bit_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "global", "\\u", "color", "\\u", "table", "\\u", "size_", "=_", "2_", "**_", "(_", "pack", "\\u", "bits_", "(_", "self_", "._", "flags_", "[_", ":_", "3_", "]_", ")_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "19.", " ", "Global", " ", "Color", " ", "Table", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "color", "\\u", "table", "\\u", "flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "(_", "self_", "._", "global", "\\u", "color", "\\u", "table", "\\u", "size_", ")_", "*_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "palette_", "=_", "self_", "._", "get", "\\u", "color", "\\u", "table_", "(_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "generat", "e", " ", "a", " ", "grey", "scale", " ", "palette_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "palette_", "=_", "[_", "(_", "x_", ",_", "x_", ",_", "x_", ")_", "for_", "x_", "in_", "range_", "(_", "256_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "blocks_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "image_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "\\u", "data_", "=_", "self_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "\\u", "pops", "_", "=_", "self_", "._", "pops", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gi", "f", "\\u", "IMA", "GE", "\\u", "SEPARATOR_", "=_", "Gi", "f_", "._", "IMA", "GE", "\\u", "SEPARATOR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gi", "f", "\\u", "FMT", "\\u", "IMG", "DESC_", "=_", "Gi", "f_", "._", "FMT", "\\u", "IMG", "DESC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "\\u", "new", "\\u", "image_", "=_", "self_", "._", "new", "\\u", "image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "\\u", "pop_", "=_", "self_", "._", "pop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "\\u", "debug", "\\u", "enabled_", "=_", "self_", "._", "debug", "\\u", "enabled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self", "\\u", "lz", "w", "\\u", "decode_", "=_", "self_", "._", "lz", "w", "\\u", "decode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gi", "f", "\\u", "EXTENSION", "\\u", "INT", "RO", "DU", "CE", "R_", "=_", "Gi", "f_", "._", "EXTENSION", "\\u", "INT", "RO", "DU", "CE", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gi", "f", "\\u", "GIF", "\\u", "TRA", "ILE", "R_", "=_", "Gi", "f_", "._", "GIF", "\\u", "TRA", "ILE", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Gi", "f", "\\u", "LAB", "EL", "\\u", "GRAPHI", "C", "\\u", "CONTROL_", "=_", "Gi", "f_", "._", "LAB", "EL", "\\u", "GRAPHI", "C", "\\u", "CONTROL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trans", "\\u", "color_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "transp", "arent", "\\u", "color_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dr", "w", "\\u", "method_", "=_", "'", "replace", "'_", "\\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 ", " _", "next", "byte_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "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 ", " _", "next", "byte_", "=_", "0x3", "b_", "#", " ", "force", " ", "end_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "20.", " ", "Image", " ", "Descriptor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "next", "byte_", "==_", "Gi", "f", "\\u", "IMA", "GE", "\\u", "SEPARATOR_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self", "\\u", "pops", "_", "(_", "Gi", "f", "\\u", "FMT", "\\u", "IMG", "DESC_", ",_", "self", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "self", "\\u", "new", "\\u", "image_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "transp", "arent", "\\u", "color_", "=_", "trans", "\\u", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "has", "\\u", "transp", "arent", "\\u", "color_", "=_", "has", "\\u", "transp", "arent", "\\u", "color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "draw", "\\u", "method_", "=_", "dr", "w", "\\u", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "codes", "ize_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "lz", "wco", "de_", "=_", "b", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "lz", "wco", "de_", "=_", "image_", "._", "lz", "wco", "de_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "TOD", "O", " ", "too", " ", "many", " ", "corn", "er", " ", "cass", "es", " ", "for", " ", "gif", "s", ":(", "_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "size_", "=_", "image_", "._", "local", "\\u", "color", "\\u", "table", "\\u", "size_", "if_", "image_", "._", "local", "\\u", "color", "\\u", "table", "\\u", "flag_", "and_", "self_", "._", "global", "\\u", "color", "\\u", "table", "\\u", "size_", "<_", "image_", "._", "local", "\\u", "color", "\\u", "table", "\\u", "size_", "else_", "self_", "._", "global", "\\u", "color", "\\u", "table", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "blocksize_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "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 ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "blocksize_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "#", " ", "no", " ", "more", " ", "image", " ", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lz", "wda", "ta_", "=_", "self", "\\u", "pop_", "(_", "self", "\\u", "data_", ",_", "blocksize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "lz", "wco", "de_", "=_", "b", "''_", "._", "join_", "(_", "(_", "image", "\\u", "lz", "wco", "de_", ",_", "lz", "wda", "ta_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self", "\\u", "debug", "\\u", "enabled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "(_", "'", "LZ", "W", " ", "length", ":'_", ",_", "len_", "(_", "image", "\\u", "lz", "wco", "de_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "image_", "._", "lz", "wco", "de_", "=_", "image", "\\u", "lz", "wco", "de_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "pixels_", "=_", "self", "\\u", "lz", "w", "\\u", "decode_", "(_", "image_", "._", "lz", "wco", "de_", ",_", "image_", "._", "codes", "ize_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extensions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "next", "byte_", "==_", "Gi", "f", "\\u", "EXTENSION", "\\u", "INT", "RO", "DU", "CE", "R_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Gi", "f", " ", "trailer", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "next", "byte_", "==_", "Gi", "f", "\\u", "GIF", "\\u", "TRA", "ILE", "R_", ":_", "\\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_", "next", "byte_", "==_", "Gi", "f", "\\u", "LAB", "EL", "\\u", "GRAPHI", "C", "\\u", "CONTROL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "byte_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dr", "w", "\\u", "bits_", "=_", "(_", "get", "\\u", "bits_", "(_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "transp", "arent", "\\u", "color_", "=_", "dr", "w", "\\u", "bits_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dr", "w", "\\u", "bits_", "[_", "2_", ":_", "5_", "]_", "==_", "array_", "(_", "'", "B", "'_", ",_", "[_", "0_", ",_", "0_", ",_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "dr", "w", "\\u", "method_", "=_", "'", "replace", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "dr", "w", "\\u", "bits_", "[_", "2_", ":_", "5_", "]_", ")_", "==_", "array_", "(_", "'", "B", "'_", ",_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "dr", "w", "\\u", "method_", "=_", "'", "restore", " ", "background", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "dr", "w", "\\u", "method_", "=_", "'", "restore", " ", "previ", "ous", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "byte_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "byte_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "byte_", "=_", "self", "\\u", "pops", "_", "(_", "'<", "B", "'_", ",_", "self", "\\u", "data_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trans", "\\u", "color_", "=_", "next", "byte_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
pearu/pylibtiff/libtiff/tiff_h_3_8_2.py
[ { "content": "TIFF_VERSION = 42\nTIFF_BIGTIFF_VERSION = 43\nTIFF_BIGENDIAN = 0x4d4d\nTIFF_LITTLEENDIAN = 0x4949\nMDI_LITTLEENDIAN = 0x5045\nMDI_BIGENDIAN = 0x4550\nTIFF_MAGIC_SIZE = 2\nTIFF_VERSION_SIZE = 2\nTIFF_DIROFFSET_SIZE = 4\nTIFFTAG_SUBFILETYPE = 254\nFILETYPE_REDUCEDIMAGE = 0x1\nFILETYPE_PAGE = 0x2\nFILETYPE_MASK = 0x4\nTIFFTAG_OSUBFILETYPE = 255\nOFILETYPE_IMAGE = 1\nOFILETYPE_REDUCEDIMAGE = 2\nOFILETYPE_PAGE = 3\nTIFFTAG_IMAGEWIDTH = 256\nTIFFTAG_IMAGELENGTH = 257\nTIFFTAG_BITSPERSAMPLE = 258\nTIFFTAG_COMPRESSION = 259\nCOMPRESSION_NONE = 1\nCOMPRESSION_CCITTRLE = 2\nCOMPRESSION_CCITTFAX3 = 3\nCOMPRESSION_CCITT_T4 = 3\nCOMPRESSION_CCITTFAX4 = 4\nCOMPRESSION_CCITT_T6 = 4\nCOMPRESSION_LZW = 5\nCOMPRESSION_OJPEG = 6\nCOMPRESSION_JPEG = 7\nCOMPRESSION_NEXT = 32766\nCOMPRESSION_CCITTRLEW = 32771\nCOMPRESSION_PACKBITS = 32773\nCOMPRESSION_THUNDERSCAN = 32809\nCOMPRESSION_IT8CTPAD = 32895\nCOMPRESSION_IT8LW = 32896\nCOMPRESSION_IT8MP = 32897\nCOMPRESSION_IT8BL = 32898\nCOMPRESSION_PIXARFILM = 32908\nCOMPRESSION_PIXARLOG = 32909\nCOMPRESSION_DEFLATE = 32946\nCOMPRESSION_ADOBE_DEFLATE = 8\nCOMPRESSION_DCS = 32947\nCOMPRESSION_JBIG = 34661\nCOMPRESSION_SGILOG = 34676\nCOMPRESSION_SGILOG24 = 34677\nCOMPRESSION_JP2000 = 34712\nTIFFTAG_PHOTOMETRIC = 262\nPHOTOMETRIC_MINISWHITE = 0\nPHOTOMETRIC_MINISBLACK = 1\nPHOTOMETRIC_RGB = 2\nPHOTOMETRIC_PALETTE = 3\nPHOTOMETRIC_MASK = 4\nPHOTOMETRIC_SEPARATED = 5\nPHOTOMETRIC_YCBCR = 6\nPHOTOMETRIC_CIELAB = 8\nPHOTOMETRIC_ICCLAB = 9\nPHOTOMETRIC_ITULAB = 10\nPHOTOMETRIC_LOGL = 32844\nPHOTOMETRIC_LOGLUV = 32845\nTIFFTAG_THRESHHOLDING = 263\nTHRESHHOLD_BILEVEL = 1\nTHRESHHOLD_HALFTONE = 2\nTHRESHHOLD_ERRORDIFFUSE = 3\nTIFFTAG_CELLWIDTH = 264\nTIFFTAG_CELLLENGTH = 265\nTIFFTAG_FILLORDER = 266\nFILLORDER_MSB2LSB = 1\nFILLORDER_LSB2MSB = 2\nTIFFTAG_DOCUMENTNAME = 269\nTIFFTAG_IMAGEDESCRIPTION = 270\nTIFFTAG_MAKE = 271\nTIFFTAG_MODEL = 272\nTIFFTAG_STRIPOFFSETS = 273\nTIFFTAG_ORIENTATION = 274\nORIENTATION_TOPLEFT = 1\nORIENTATION_TOPRIGHT = 2\nORIENTATION_BOTRIGHT = 3\nORIENTATION_BOTLEFT = 4\nORIENTATION_LEFTTOP = 5\nORIENTATION_RIGHTTOP = 6\nORIENTATION_RIGHTBOT = 7\nORIENTATION_LEFTBOT = 8\nTIFFTAG_SAMPLESPERPIXEL = 277\nTIFFTAG_ROWSPERSTRIP = 278\nTIFFTAG_STRIPBYTECOUNTS = 279\nTIFFTAG_MINSAMPLEVALUE = 280\nTIFFTAG_MAXSAMPLEVALUE = 281\nTIFFTAG_XRESOLUTION = 282\nTIFFTAG_YRESOLUTION = 283\nTIFFTAG_PLANARCONFIG = 284\nPLANARCONFIG_CONTIG = 1\nPLANARCONFIG_SEPARATE = 2\nTIFFTAG_PAGENAME = 285\nTIFFTAG_XPOSITION = 286\nTIFFTAG_YPOSITION = 287\nTIFFTAG_FREEOFFSETS = 288\nTIFFTAG_FREEBYTECOUNTS = 289\nTIFFTAG_GRAYRESPONSEUNIT = 290\nGRAYRESPONSEUNIT_10S = 1\nGRAYRESPONSEUNIT_100S = 2\nGRAYRESPONSEUNIT_1000S = 3\nGRAYRESPONSEUNIT_10000S = 4\nGRAYRESPONSEUNIT_100000S = 5\nTIFFTAG_GRAYRESPONSECURVE = 291\nTIFFTAG_GROUP3OPTIONS = 292\nTIFFTAG_T4OPTIONS = 292\nGROUP3OPT_2DENCODING = 0x1\nGROUP3OPT_UNCOMPRESSED = 0x2\nGROUP3OPT_FILLBITS = 0x4\nTIFFTAG_GROUP4OPTIONS = 293\nTIFFTAG_T6OPTIONS = 293\nGROUP4OPT_UNCOMPRESSED = 0x2\nTIFFTAG_RESOLUTIONUNIT = 296\nRESUNIT_NONE = 1\nRESUNIT_INCH = 2\nRESUNIT_CENTIMETER = 3\nTIFFTAG_PAGENUMBER = 297\nTIFFTAG_COLORRESPONSEUNIT = 300\nCOLORRESPONSEUNIT_10S = 1\nCOLORRESPONSEUNIT_100S = 2\nCOLORRESPONSEUNIT_1000S = 3\nCOLORRESPONSEUNIT_10000S = 4\nCOLORRESPONSEUNIT_100000S = 5\nTIFFTAG_TRANSFERFUNCTION = 301\nTIFFTAG_SOFTWARE = 305\nTIFFTAG_DATETIME = 306\nTIFFTAG_ARTIST = 315\nTIFFTAG_HOSTCOMPUTER = 316\nTIFFTAG_PREDICTOR = 317\nPREDICTOR_NONE = 1\nPREDICTOR_HORIZONTAL = 2\nPREDICTOR_FLOATINGPOINT = 3\nTIFFTAG_WHITEPOINT = 318\nTIFFTAG_PRIMARYCHROMATICITIES = 319\nTIFFTAG_COLORMAP = 320\nTIFFTAG_HALFTONEHINTS = 321\nTIFFTAG_TILEWIDTH = 322\nTIFFTAG_TILELENGTH = 323\nTIFFTAG_TILEOFFSETS = 324\nTIFFTAG_TILEBYTECOUNTS = 325\nTIFFTAG_BADFAXLINES = 326\nTIFFTAG_CLEANFAXDATA = 327\nCLEANFAXDATA_CLEAN = 0\nCLEANFAXDATA_REGENERATED = 1\nCLEANFAXDATA_UNCLEAN = 2\nTIFFTAG_CONSECUTIVEBADFAXLINES = 328\nTIFFTAG_SUBIFD = 330\nTIFFTAG_INKSET = 332\nINKSET_CMYK = 1\nINKSET_MULTIINK = 2\nTIFFTAG_INKNAMES = 333\nTIFFTAG_NUMBEROFINKS = 334\nTIFFTAG_DOTRANGE = 336\nTIFFTAG_TARGETPRINTER = 337\nTIFFTAG_EXTRASAMPLES = 338\nEXTRASAMPLE_UNSPECIFIED = 0\nEXTRASAMPLE_ASSOCALPHA = 1\nEXTRASAMPLE_UNASSALPHA = 2\nTIFFTAG_SAMPLEFORMAT = 339\nSAMPLEFORMAT_UINT = 1\nSAMPLEFORMAT_INT = 2\nSAMPLEFORMAT_IEEEFP = 3\nSAMPLEFORMAT_VOID = 4\nSAMPLEFORMAT_COMPLEXINT = 5\nSAMPLEFORMAT_COMPLEXIEEEFP = 6\nTIFFTAG_SMINSAMPLEVALUE = 340\nTIFFTAG_SMAXSAMPLEVALUE = 341\nTIFFTAG_CLIPPATH = 343\nTIFFTAG_XCLIPPATHUNITS = 344\nTIFFTAG_YCLIPPATHUNITS = 345\nTIFFTAG_INDEXED = 346\nTIFFTAG_JPEGTABLES = 347\nTIFFTAG_OPIPROXY = 351\nTIFFTAG_JPEGPROC = 512\nJPEGPROC_BASELINE = 1\nJPEGPROC_LOSSLESS = 14\nTIFFTAG_JPEGIFOFFSET = 513\nTIFFTAG_JPEGIFBYTECOUNT = 514\nTIFFTAG_JPEGRESTARTINTERVAL = 515\nTIFFTAG_JPEGLOSSLESSPREDICTORS = 517\nTIFFTAG_JPEGPOINTTRANSFORM = 518\nTIFFTAG_JPEGQTABLES = 519\nTIFFTAG_JPEGDCTABLES = 520\nTIFFTAG_JPEGACTABLES = 521\nTIFFTAG_YCBCRCOEFFICIENTS = 529\nTIFFTAG_YCBCRSUBSAMPLING = 530\nTIFFTAG_YCBCRPOSITIONING = 531\nYCBCRPOSITION_CENTERED = 1\nYCBCRPOSITION_COSITED = 2\nTIFFTAG_REFERENCEBLACKWHITE = 532\nTIFFTAG_XMLPACKET = 700\nTIFFTAG_OPIIMAGEID = 32781\nTIFFTAG_REFPTS = 32953\nTIFFTAG_REGIONTACKPOINT = 32954\nTIFFTAG_REGIONWARPCORNERS = 32955\nTIFFTAG_REGIONAFFINE = 32956\nTIFFTAG_MATTEING = 32995\nTIFFTAG_DATATYPE = 32996\nTIFFTAG_IMAGEDEPTH = 32997\nTIFFTAG_TILEDEPTH = 32998\nTIFFTAG_PIXAR_IMAGEFULLWIDTH = 33300\nTIFFTAG_PIXAR_IMAGEFULLLENGTH = 33301\nTIFFTAG_PIXAR_TEXTUREFORMAT = 33302\nTIFFTAG_PIXAR_WRAPMODES = 33303\nTIFFTAG_PIXAR_FOVCOT = 33304\nTIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN = 33305\nTIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA = 33306\nTIFFTAG_WRITERSERIALNUMBER = 33405\nTIFFTAG_COPYRIGHT = 33432\nTIFFTAG_RICHTIFFIPTC = 33723\nTIFFTAG_IT8SITE = 34016\nTIFFTAG_IT8COLORSEQUENCE = 34017\nTIFFTAG_IT8HEADER = 34018\nTIFFTAG_IT8RASTERPADDING = 34019\nTIFFTAG_IT8BITSPERRUNLENGTH = 34020\nTIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH = 34021\nTIFFTAG_IT8COLORTABLE = 34022\nTIFFTAG_IT8IMAGECOLORINDICATOR = 34023\nTIFFTAG_IT8BKGCOLORINDICATOR = 34024\nTIFFTAG_IT8IMAGECOLORVALUE = 34025\nTIFFTAG_IT8BKGCOLORVALUE = 34026\nTIFFTAG_IT8PIXELINTENSITYRANGE = 34027\nTIFFTAG_IT8TRANSPARENCYINDICATOR = 34028\nTIFFTAG_IT8COLORCHARACTERIZATION = 34029\nTIFFTAG_IT8HCUSAGE = 34030\nTIFFTAG_IT8TRAPINDICATOR = 34031\nTIFFTAG_IT8CMYKEQUIVALENT = 34032\nTIFFTAG_FRAMECOUNT = 34232\nTIFFTAG_PHOTOSHOP = 34377\nTIFFTAG_EXIFIFD = 34665\nTIFFTAG_ICCPROFILE = 34675\nTIFFTAG_JBIGOPTIONS = 34750\nTIFFTAG_GPSIFD = 34853\nTIFFTAG_FAXRECVPARAMS = 34908\nTIFFTAG_FAXSUBADDRESS = 34909\nTIFFTAG_FAXRECVTIME = 34910\nTIFFTAG_FAXDCS = 34911\nTIFFTAG_STONITS = 37439\nTIFFTAG_FEDEX_EDR = 34929\nTIFFTAG_INTEROPERABILITYIFD = 40965\nTIFFTAG_DNGVERSION = 50706\nTIFFTAG_DNGBACKWARDVERSION = 50707\nTIFFTAG_UNIQUECAMERAMODEL = 50708\nTIFFTAG_LOCALIZEDCAMERAMODEL = 50709\nTIFFTAG_CFAPLANECOLOR = 50710\nTIFFTAG_CFALAYOUT = 50711\nTIFFTAG_LINEARIZATIONTABLE = 50712\nTIFFTAG_BLACKLEVELREPEATDIM = 50713\nTIFFTAG_BLACKLEVEL = 50714\nTIFFTAG_BLACKLEVELDELTAH = 50715\nTIFFTAG_BLACKLEVELDELTAV = 50716\nTIFFTAG_WHITELEVEL = 50717\nTIFFTAG_DEFAULTSCALE = 50718\nTIFFTAG_DEFAULTCROPORIGIN = 50719\nTIFFTAG_DEFAULTCROPSIZE = 50720\nTIFFTAG_COLORMATRIX1 = 50721\nTIFFTAG_COLORMATRIX2 = 50722\nTIFFTAG_CAMERACALIBRATION1 = 50723\nTIFFTAG_CAMERACALIBRATION2 = 50724\nTIFFTAG_REDUCTIONMATRIX1 = 50725\nTIFFTAG_REDUCTIONMATRIX2 = 50726\nTIFFTAG_ANALOGBALANCE = 50727\nTIFFTAG_ASSHOTNEUTRAL = 50728\nTIFFTAG_ASSHOTWHITEXY = 50729\nTIFFTAG_BASELINEEXPOSURE = 50730\nTIFFTAG_BASELINENOISE = 50731\nTIFFTAG_BASELINESHARPNESS = 50732\nTIFFTAG_BAYERGREENSPLIT = 50733\nTIFFTAG_LINEARRESPONSELIMIT = 50734\nTIFFTAG_CAMERASERIALNUMBER = 50735\nTIFFTAG_LENSINFO = 50736\nTIFFTAG_CHROMABLURRADIUS = 50737\nTIFFTAG_ANTIALIASSTRENGTH = 50738\nTIFFTAG_SHADOWSCALE = 50739\nTIFFTAG_DNGPRIVATEDATA = 50740\nTIFFTAG_MAKERNOTESAFETY = 50741\nTIFFTAG_CALIBRATIONILLUMINANT1 = 50778\nTIFFTAG_CALIBRATIONILLUMINANT2 = 50779\nTIFFTAG_BESTQUALITYSCALE = 50780\nTIFFTAG_RAWDATAUNIQUEID = 50781\nTIFFTAG_ORIGINALRAWFILENAME = 50827\nTIFFTAG_ORIGINALRAWFILEDATA = 50828\nTIFFTAG_ACTIVEAREA = 50829\nTIFFTAG_MASKEDAREAS = 50830\nTIFFTAG_ASSHOTICCPROFILE = 50831\nTIFFTAG_ASSHOTPREPROFILEMATRIX = 50832\nTIFFTAG_CURRENTICCPROFILE = 50833\nTIFFTAG_CURRENTPREPROFILEMATRIX = 50834\nTIFFTAG_DCSHUESHIFTVALUES = 65535\nTIFFTAG_FAXMODE = 65536\nFAXMODE_CLASSIC = 0x0000\nFAXMODE_NORTC = 0x0001\nFAXMODE_NOEOL = 0x0002\nFAXMODE_BYTEALIGN = 0x0004\nFAXMODE_WORDALIGN = 0x0008\nFAXMODE_CLASSF = FAXMODE_NORTC\nTIFFTAG_JPEGQUALITY = 65537\nTIFFTAG_JPEGCOLORMODE = 65538\nJPEGCOLORMODE_RAW = 0x0000\nJPEGCOLORMODE_RGB = 0x0001\nTIFFTAG_JPEGTABLESMODE = 65539\nJPEGTABLESMODE_QUANT = 0x0001\nJPEGTABLESMODE_HUFF = 0x0002\nTIFFTAG_FAXFILLFUNC = 65540\nTIFFTAG_PIXARLOGDATAFMT = 65549\nPIXARLOGDATAFMT_8BIT = 0\nPIXARLOGDATAFMT_8BITABGR = 1\nPIXARLOGDATAFMT_11BITLOG = 2\nPIXARLOGDATAFMT_12BITPICIO = 3\nPIXARLOGDATAFMT_16BIT = 4\nPIXARLOGDATAFMT_FLOAT = 5\nTIFFTAG_DCSIMAGERTYPE = 65550\nDCSIMAGERMODEL_M3 = 0\nDCSIMAGERMODEL_M5 = 1\nDCSIMAGERMODEL_M6 = 2\nDCSIMAGERFILTER_IR = 0\nDCSIMAGERFILTER_MONO = 1\nDCSIMAGERFILTER_CFA = 2\nDCSIMAGERFILTER_OTHER = 3\nTIFFTAG_DCSINTERPMODE = 65551\nDCSINTERPMODE_NORMAL = 0x0\nDCSINTERPMODE_PREVIEW = 0x1\nTIFFTAG_DCSBALANCEARRAY = 65552\nTIFFTAG_DCSCORRECTMATRIX = 65553\nTIFFTAG_DCSGAMMA = 65554\nTIFFTAG_DCSTOESHOULDERPTS = 65555\nTIFFTAG_DCSCALIBRATIONFD = 65556\nTIFFTAG_ZIPQUALITY = 65557\nTIFFTAG_PIXARLOGQUALITY = 65558\nTIFFTAG_DCSCLIPRECTANGLE = 65559\nTIFFTAG_SGILOGDATAFMT = 65560\nSGILOGDATAFMT_FLOAT = 0\nSGILOGDATAFMT_16BIT = 1\nSGILOGDATAFMT_RAW = 2\nSGILOGDATAFMT_8BIT = 3\nTIFFTAG_SGILOGENCODE = 65561\nSGILOGENCODE_NODITHER = 0\nSGILOGENCODE_RANDITHER = 1\nEXIFTAG_EXPOSURETIME = 33434\nEXIFTAG_FNUMBER = 33437\nEXIFTAG_EXPOSUREPROGRAM = 34850\nEXIFTAG_SPECTRALSENSITIVITY = 34852\nEXIFTAG_ISOSPEEDRATINGS = 34855\nEXIFTAG_OECF = 34856\nEXIFTAG_EXIFVERSION = 36864\nEXIFTAG_DATETIMEORIGINAL = 36867\nEXIFTAG_DATETIMEDIGITIZED = 36868\nEXIFTAG_COMPONENTSCONFIGURATION = 37121\nEXIFTAG_COMPRESSEDBITSPERPIXEL = 37122\nEXIFTAG_SHUTTERSPEEDVALUE = 37377\nEXIFTAG_APERTUREVALUE = 37378\nEXIFTAG_BRIGHTNESSVALUE = 37379\nEXIFTAG_EXPOSUREBIASVALUE = 37380\nEXIFTAG_MAXAPERTUREVALUE = 37381\nEXIFTAG_SUBJECTDISTANCE = 37382\nEXIFTAG_METERINGMODE = 37383\nEXIFTAG_LIGHTSOURCE = 37384\nEXIFTAG_FLASH = 37385\nEXIFTAG_FOCALLENGTH = 37386\nEXIFTAG_SUBJECTAREA = 37396\nEXIFTAG_MAKERNOTE = 37500\nEXIFTAG_USERCOMMENT = 37510\nEXIFTAG_SUBSECTIME = 37520\nEXIFTAG_SUBSECTIMEORIGINAL = 37521\nEXIFTAG_SUBSECTIMEDIGITIZED = 37522\nEXIFTAG_FLASHPIXVERSION = 40960\nEXIFTAG_COLORSPACE = 40961\nEXIFTAG_PIXELXDIMENSION = 40962\nEXIFTAG_PIXELYDIMENSION = 40963\nEXIFTAG_RELATEDSOUNDFILE = 40964\nEXIFTAG_FLASHENERGY = 41483\nEXIFTAG_SPATIALFREQUENCYRESPONSE = 41484\nEXIFTAG_FOCALPLANEXRESOLUTION = 41486\nEXIFTAG_FOCALPLANEYRESOLUTION = 41487\nEXIFTAG_FOCALPLANERESOLUTIONUNIT = 41488\nEXIFTAG_SUBJECTLOCATION = 41492\nEXIFTAG_EXPOSUREINDEX = 41493\nEXIFTAG_SENSINGMETHOD = 41495\nEXIFTAG_FILESOURCE = 41728\nEXIFTAG_SCENETYPE = 41729\nEXIFTAG_CFAPATTERN = 41730\nEXIFTAG_CUSTOMRENDERED = 41985\nEXIFTAG_EXPOSUREMODE = 41986\nEXIFTAG_WHITEBALANCE = 41987\nEXIFTAG_DIGITALZOOMRATIO = 41988\nEXIFTAG_FOCALLENGTHIN35MMFILM = 41989\nEXIFTAG_SCENECAPTURETYPE = 41990\nEXIFTAG_GAINCONTROL = 41991\nEXIFTAG_CONTRAST = 41992\nEXIFTAG_SATURATION = 41993\nEXIFTAG_SHARPNESS = 41994\nEXIFTAG_DEVICESETTINGDESCRIPTION = 41995\nEXIFTAG_SUBJECTDISTANCERANGE = 41996\nEXIFTAG_GAINCONTROL = 41991\nEXIFTAG_GAINCONTROL = 41991\nEXIFTAG_IMAGEUNIQUEID = 42016\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "EXIFTAG_GAINCONTROL ", "start_line": 388, "start_column": 0, "end_line": 388, "end_column": 19 }, { "span": "EXIFTAG_GAINCONTROL ", "start_line": 394, "start_column": 0, "end_line": 394, "end_column": 19 } ]
[ { "span": "EXIFTAG_GAINCONTROL ", "start_line": 395, "start_column": 0, "end_line": 395, "end_column": 19 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "TIF", "F", "\\u", "VERSION_", "=_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "F", "\\u", "BIG", "TIF", "F", "\\u", "VERSION_", "=_", "43_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "F", "\\u", "BIG", "ENDI", "AN_", "=_", "0x4", "d4", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "F", "\\u", "LIT", "TLE", "ENDI", "AN_", "=_", "0x49", "49_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MD", "I", "\\u", "LIT", "TLE", "ENDI", "AN_", "=_", "0x5", "045", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MD", "I", "\\u", "BIG", "ENDI", "AN_", "=_", "0x45", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "F", "\\u", "MAGIC", "\\u", "SIZE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "F", "\\u", "VERSI", "ON", "\\u", "SIZE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "F", "\\u", "DIR", "OFFSET", "\\u", "SIZE_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SUB", "FILET", "YPE_", "=_", "254_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FILET", "YP", "E", "\\u", "RED", "UCE", "DIM", "AGE_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FILET", "YP", "E", "\\u", "PAGE_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FILET", "YP", "E", "\\u", "MASK_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "OS", "UB", "FILET", "YPE_", "=_", "255_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OF", "ILE", "TYPE", "\\u", "IMAGE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OF", "ILE", "TYPE", "\\u", "RED", "UCE", "DIM", "AGE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OF", "ILE", "TYPE", "\\u", "PAGE_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IMA", "GE", "WIDTH_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IMA", "GE", "LENGTH_", "=_", "257_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BITS", "PERS", "AMP", "LE_", "=_", "258", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "COMPRESS", "ION_", "=_", "259_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "NONE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "CC", "IT", "TR", "LE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "CC", "IT", "TF", "AX", "3_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "CC", "IT", "T", "\\u", "T", "4_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "CC", "IT", "TF", "AX", "4_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "CC", "IT", "T", "\\u", "T6", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "LZ", "W_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "OJ", "PE", "G_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "JP", "EG", "_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "NEXT", "_", "=_", "3276", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "CC", "IT", "TR", "LE", "W_", "=_", "327", "71_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "PACK", "BITS_", "=_", "327", "73_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "TH", "UNDER", "SCAN", "_", "=_", "328", "09_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "IT", "8", "CT", "PAD", "_", "=_", "328", "95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "IT", "8", "LW", "_", "=_", "328", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "IT", "8", "MP_", "=_", "328", "97_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "IT", "8", "BL", "_", "=_", "328", "98_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "PIX", "AR", "FIL", "M_", "=_", "329", "08_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "PIX", "AR", "LOG_", "=_", "329", "09_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "DEF", "LATE", "_", "=_", "329", "46_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "ADO", "BE", "\\u", "DEF", "LATE", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "DC", "S_", "=_", "329", "47_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "JB", "IG", "_", "=_", "346", "61_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "SGI", "LOG_", "=_", "346", "76_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "SGI", "LOG", "24_", "=_", "346", "77_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COMPRESS", "ION", "\\u", "JP", "2000_", "=_", "347", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PHOTO", "METRIC", "_", "=_", "262", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "MINI", "SW", "HIT", "E_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "MINI", "SB", "LAC", "K_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "RGB_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "PAL", "ETT", "E_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "MASK_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "SEPA", "RAT", "ED_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "YC", "BC", "R_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "CIE", "LAB", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "IC", "CLA", "B_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "ITU", "LAB", "_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "LOG", "L_", "=_", "328", "44_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PHOTO", "METRIC", "\\u", "LOG", "LU", "V_", "=_", "328", "45_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "THRESH", "HOLD", "ING_", "=_", "263", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "THRESH", "HOLD", "\\u", "BIL", "EVE", "L_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "THRESH", "HOLD", "\\u", "HALF", "TON", "E_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "THRESH", "HOLD", "\\u", "ERROR", "DIFF", "USE", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CELL", "WIDTH_", "=_", "264_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CELL", "LENGTH_", "=_", "265_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FILL", "ORDER_", "=_", "266_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FILL", "ORDE", "R", "\\u", "MS", "B2", "LS", "B_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FILL", "ORDE", "R", "\\u", "LS", "B2", "MS", "B_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DOCUMENT", "NAME_", "=_", "269", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IMA", "GE", "DESCRIPTION_", "=_", "270_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MAKE", "_", "=_", "271", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MODEL_", "=_", "272", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "STRIP", "OFFSET", "S_", "=_", "273", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ORIE", "NTA", "TION_", "=_", "274", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "TOP", "LEFT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "TOP", "RIGHT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "BOT", "RIGHT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "BOT", "LEFT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "LEF", "TT", "OP_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "RIG", "HT", "TOP_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "RIG", "HT", "BOT", "_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ORIE", "NTA", "TIO", "N", "\\u", "LEF", "TB", "OT", "_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SAMPLES", "PER", "PIXEL", "_", "=_", "277", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ROWS", "PERS", "TRI", "P_", "=_", "278_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "STRIP", "BYTE", "COUNT", "S_", "=_", "279", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MIN", "SAMPLE", "VALUE_", "=_", "280_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MAX", "SAMPLE", "VALUE_", "=_", "281", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "XR", "ES", "OLUT", "ION_", "=_", "282", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "YR", "ES", "OLUT", "ION_", "=_", "283", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PLAN", "ARC", "ONF", "IG", "_", "=_", "284", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PLAN", "ARC", "ONF", "IG", "\\u", "CONTI", "G_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PLAN", "ARC", "ONF", "IG", "\\u", "SEPA", "RATE_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PAGE", "NAME_", "=_", "285", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "XP", "OSI", "TION_", "=_", "286", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "YP", "OSI", "TION_", "=_", "287", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FREE", "OFFSET", "S_", "=_", "288_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FREE", "BYTE", "COUNT", "S_", "=_", "289", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "GRA", "YR", "ESP", "ONS", "EU", "NIT", "_", "=_", "290_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GRA", "YR", "ESP", "ONS", "EU", "NIT", "\\u", "10", "S_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GRA", "YR", "ESP", "ONS", "EU", "NIT", "\\u", "100", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GRA", "YR", "ESP", "ONS", "EU", "NIT", "\\u", "1000", "S_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GRA", "YR", "ESP", "ONS", "EU", "NIT", "\\u", "10000", "S_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GRA", "YR", "ESP", "ONS", "EU", "NIT", "\\u", "100000", "S_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "GRA", "YR", "ESP", "ONS", "ECU", "RV", "E_", "=_", "291", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "GROU", "P3", "OPTIONS_", "=_", "292", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "T", "4", "OPTIONS_", "=_", "292", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GROU", "P3", "OPT", "\\u", "2", "DEN", "COD", "ING_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GROU", "P3", "OPT", "\\u", "UNC", "OMP", "RESS", "ED_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GROU", "P3", "OPT", "\\u", "FILL", "BITS_", "=_", "0x4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "GROU", "P4", "OPTIONS_", "=_", "293", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "T6", "OPTIONS_", "=_", "293", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GROU", "P4", "OPT", "\\u", "UNC", "OMP", "RESS", "ED_", "=_", "0x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "RESOL", "UTION", "UNIT", "_", "=_", "296", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RESU", "NIT", "\\u", "NONE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RESU", "NIT", "\\u", "INC", "H_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RESU", "NIT", "\\u", "CEN", "TIME", "TER_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PAGE", "NUMBER_", "=_", "297", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "COLOR", "RESPONSE", "UNIT", "_", "=_", "300_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COLOR", "RESPONSE", "UNIT", "\\u", "10", "S_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COLOR", "RESPONSE", "UNIT", "\\u", "100", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COLOR", "RESPONSE", "UNIT", "\\u", "1000", "S_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COLOR", "RESPONSE", "UNIT", "\\u", "10000", "S_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "COLOR", "RESPONSE", "UNIT", "\\u", "100000", "S_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TRANSFER", "FUNCTION_", "=_", "301_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SOFT", "WARE", "_", "=_", "305_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DATETIME", "_", "=_", "306", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ARTI", "ST_", "=_", "315", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "HOST", "COMPUTE", "R_", "=_", "316", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PREDIC", "TOR", "_", "=_", "317", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PREDIC", "TOR", "\\u", "NONE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PREDIC", "TOR", "\\u", "HORIZONTAL_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PREDIC", "TOR", "\\u", "FLOAT", "ING", "POINT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "WHITE", "POINT_", "=_", "318", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PRIMA", "RY", "CHROM", "ATI", "CIT", "IES_", "=_", "319", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "COLOR", "MAP_", "=_", "320_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "HALF", "TON", "EH", "INT", "S_", "=_", "321_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TILE", "WIDTH_", "=_", "322", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TILE", "LENGTH_", "=_", "323", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TILE", "OFFSET", "S_", "=_", "324", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TILE", "BYTE", "COUNT", "S_", "=_", "325_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BAD", "FA", "XL", "INE", "S_", "=_", "326", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CLEAN", "FA", "XD", "ATA", "_", "=_", "327", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CLEAN", "FA", "XD", "ATA", "\\u", "CLEAN", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CLEAN", "FA", "XD", "ATA", "\\u", "REG", "ENE", "RAT", "ED_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CLEAN", "FA", "XD", "ATA", "\\u", "UNC", "LEA", "N_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CONS", "ECU", "TIVE", "BAD", "FA", "XL", "INE", "S_", "=_", "328", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SUB", "IF", "D_", "=_", "330_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "INK", "SET_", "=_", "332", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "INK", "SET", "\\u", "CM", "YK", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "INK", "SET", "\\u", "MULTI", "INK", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "INK", "NAMES_", "=_", "333_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "NUMB", "ERO", "FIN", "KS", "_", "=_", "334", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DOT", "RANGE_", "=_", "336", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TARGET", "PRINT", "ER_", "=_", "337", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "EXTRA", "SAMPLES", "_", "=_", "338", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXTRA", "SAMPLE", "\\u", "UNSPEC", "IFIED", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXTRA", "SAMPLE", "\\u", "ASSOC", "ALPHA_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EXTRA", "SAMPLE", "\\u", "UNA", "SSA", "LP", "HA", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SAMPLE", "FORMAT_", "=_", "339", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "FORMAT", "\\u", "UINT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "FORMAT", "\\u", "INT_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "FORMAT", "\\u", "IE", "EE", "FP", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "FORMAT", "\\u", "VOID", "_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "FORMAT", "\\u", "COMPL", "EX", "INT_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAMPLE", "FORMAT", "\\u", "COMPL", "EX", "IE", "EE", "FP", "_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SMI", "NS", "AMP", "LE", "VALUE_", "=_", "340_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SMA", "XS", "AMP", "LE", "VALUE_", "=_", "341", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CLIP", "PATH_", "=_", "343", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "XC", "LI", "PP", "ATH", "UNITS_", "=_", "344", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "YC", "LI", "PP", "ATH", "UNITS_", "=_", "345", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "INDE", "XE", "D_", "=_", "346", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "TABLES", "_", "=_", "347", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "OP", "IP", "RO", "XY_", "=_", "351", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "PROC", "_", "=_", "512_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JP", "EG", "PROC", "\\u", "BASE", "LINE_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JP", "EG", "PROC", "\\u", "LOSS", "LESS", "_", "=_", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "IF", "OFFSET_", "=_", "513", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "IF", "BYTE", "COUNT_", "=_", "514", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "RESTA", "RT", "INTERVAL_", "=_", "515", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EGL", "OSS", "LESS", "PREDIC", "TOR", "S_", "=_", "517", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "POINT", "TRANSFORM", "_", "=_", "518", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "QT", "AB", "LES", "_", "=_", "519", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "DC", "TABLES", "_", "=_", "520", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EGA", "CTA", "BL", "ES_", "=_", "521", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "YC", "BC", "RC", "OE", "FFI", "CIE", "NTS", "_", "=_", "529", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "YC", "BC", "RS", "UB", "SAM", "PLI", "NG_", "=_", "530", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "YC", "BC", "RP", "OSI", "TIO", "NING", "_", "=_", "531", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "YC", "BC", "RP", "OSI", "TIO", "N", "\\u", "CENTER", "ED_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "YC", "BC", "RP", "OSI", "TIO", "N", "\\u", "COS", "ITE", "D_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "REFERENCE", "BLACK", "WHITE_", "=_", "532", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "XML", "PACKET", "_", "=_", "700_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "OP", "II", "MAGE", "ID_", "=_", "327", "81_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "REF", "PT", "S_", "=_", "329", "53_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "REGION", "TACK", "POINT_", "=_", "329", "54_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "REGION", "WAR", "PC", "OR", "NER", "S_", "=_", "329", "55_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "REGION", "AFF", "INE", "_", "=_", "329", "56_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MAT", "TE", "ING_", "=_", "329", "95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DATA", "TYPE_", "=_", "329", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IMA", "GE", "DEPTH", "_", "=_", "329", "97_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "TILE", "DEPTH", "_", "=_", "329", "98_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "IMA", "GE", "FULL", "WIDTH_", "=_", "333", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "IMA", "GE", "FULL", "LENGTH_", "=_", "333", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "TEXT", "URE", "FORMAT_", "=_", "333", "02_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "WRAP", "MODES_", "=_", "333", "03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "FO", "VC", "OT", "_", "=_", "333", "04_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "MATRIX", "\\u", "WORLD", "TOS", "CRE", "EN_", "=_", "333", "05_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "\\u", "MATRIX", "\\u", "WORLD", "TOC", "AME", "RA_", "=_", "333", "06_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "WRITE", "RSE", "RIA", "LN", "UM", "BER", "_", "=_", "334", "05_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "COPY", "RIGHT_", "=_", "334", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "RIC", "HT", "IF", "FI", "PT", "C_", "=_", "337", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "SITE", "_", "=_", "340", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "COLOR", "SEQUENCE", "_", "=_", "340", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "HEADER_", "=_", "340", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "RAS", "TER", "PADDING", "_", "=_", "340", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "BITS", "PER", "RUN", "LENGTH_", "=_", "340", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "BITS", "PER", "EXTEND", "ED", "RUN", "LENGTH_", "=_", "340", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "COLOR", "TABLE_", "=_", "340", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "IMA", "GE", "COLOR", "INDIC", "ATOR", "_", "=_", "340", "23_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "BK", "GC", "OLO", "RIN", "DI", "CAT", "OR_", "=_", "340", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "IMA", "GE", "COLOR", "VALUE_", "=_", "340", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "BK", "GC", "OLO", "RV", "AL", "UE", "_", "=_", "340", "26_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "PIXEL", "INTEN", "SIT", "YR", "ANGE", "_", "=_", "340", "27_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "TRANSP", "ARE", "NCY", "INDIC", "ATOR", "_", "=_", "340", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "COLOR", "CHARACTER", "IZA", "TION_", "=_", "340", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "HC", "USAGE", "_", "=_", "340", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "TRA", "PIN", "DI", "CAT", "OR_", "=_", "340", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IT", "8", "CM", "YK", "EQU", "IV", "ALE", "NT_", "=_", "340", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FRAME", "COUNT_", "=_", "342", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PHOTO", "SHO", "P_", "=_", "343", "77_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "EX", "IF", "IF", "D_", "=_", "346", "65_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "IC", "CP", "RO", "FILE_", "=_", "346", "75_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JB", "IG", "OPTIONS_", "=_", "347", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "GPS", "IF", "D_", "=_", "348", "53_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FA", "XR", "EC", "VP", "ARA", "MS_", "=_", "349", "08_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FA", "XS", "UB", "ADDRESS_", "=_", "349", "09_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FA", "XR", "EC", "VT", "IME", "_", "=_", "349", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FA", "XD", "CS_", "=_", "349", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "STO", "NIT", "S_", "=_", "374", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FED", "EX", "\\u", "ED", "R_", "=_", "349", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "INTER", "OPER", "ABI", "LIT", "YI", "FD_", "=_", "409", "65_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DN", "GV", "ERS", "ION_", "=_", "507", "06_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DN", "GB", "AC", "KW", "ARD", "VERSION_", "=_", "507", "07_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "UNI", "QUE", "CAMER", "AMO", "DEL", "_", "=_", "507", "08_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "LOCAL", "IZED", "CAMER", "AMO", "DEL", "_", "=_", "507", "09_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CF", "AP", "LAN", "ECO", "LO", "R_", "=_", "507", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CF", "AL", "AY", "OUT_", "=_", "507", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "LINEAR", "IZA", "TIO", "NTA", "BLE_", "=_", "507", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BLACK", "LE", "VEL", "REPEAT", "DIM_", "=_", "507", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BLACK", "LEVEL_", "=_", "507", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BLACK", "LE", "VEL", "DELTA", "H_", "=_", "507", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BLACK", "LE", "VEL", "DELTA", "V_", "=_", "507", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "WHITE", "LEVEL_", "=_", "507", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DEF", "AUL", "TS", "CAL", "E_", "=_", "507", "18_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DEF", "AUL", "TC", "ROP", "ORIGIN", "_", "=_", "507", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DEF", "AUL", "TC", "ROP", "SIZE_", "=_", "5072", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "COLOR", "MATRIX", "1_", "=_", "5072", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "COLOR", "MATRIX", "2_", "=_", "5072", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CAMER", "ACA", "LIB", "RATION", "1_", "=_", "5072", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CAMER", "ACA", "LIB", "RATION", "2_", "=_", "5072", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "RED", "UCT", "ION", "MATRIX", "1_", "=_", "5072", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "RED", "UCT", "ION", "MATRIX", "2_", "=_", "5072", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ANA", "LOG", "BALA", "NCE_", "=_", "5072", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ASS", "HOT", "NEU", "TRA", "L_", "=_", "5072", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ASS", "HOT", "WHITE", "XY_", "=_", "5072", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BASE", "LINE", "EXP", "OS", "URE_", "=_", "507", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BASE", "LINE", "NO", "ISE", "_", "=_", "507", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BASE", "LINES", "HAR", "PN", "ESS", "_", "=_", "507", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BA", "YE", "RG", "REE", "NS", "PLI", "T_", "=_", "507", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "LINEAR", "RESPONSE", "LIMIT_", "=_", "507", "34_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CAMER", "AS", "ERI", "AL", "NUMBER_", "=_", "507", "35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "LEN", "SIN", "FO", "_", "=_", "507", "36_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CHROM", "AB", "LU", "RR", "AD", "IU", "S_", "=_", "507", "37_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ANTI", "ALIAS", "STRE", "NG", "TH_", "=_", "507", "38_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SHA", "DO", "WS", "CAL", "E_", "=_", "507", "39_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DN", "GPR", "IV", "ATED", "ATA", "_", "=_", "507", "40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MAKE", "RN", "OT", "ES", "AF", "ET", "Y_", "=_", "507", "41_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CALI", "BRA", "TIO", "NI", "LL", "UM", "INA", "NT", "1_", "=_", "507", "78_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CALI", "BRA", "TIO", "NI", "LL", "UM", "INA", "NT", "2_", "=_", "507", "79_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "BES", "TQ", "UAL", "IT", "YS", "CAL", "E_", "=_", "507", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "RA", "WD", "ATA", "UNI", "QUE", "ID_", "=_", "507", "81_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ORIGIN", "AL", "RA", "WF", "ILE", "NAME_", "=_", "508", "27_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ORIGIN", "AL", "RA", "WF", "ILE", "DATA_", "=_", "508", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ACTI", "VE", "AREA", "_", "=_", "508", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "MASK", "EDA", "REA", "S_", "=_", "508", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ASS", "HOT", "IC", "CP", "RO", "FILE_", "=_", "508", "31_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ASS", "HOT", "PREP", "RO", "FILE", "MATRIX", "_", "=_", "508", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CURREN", "TIC", "CP", "RO", "FILE_", "=_", "508", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "CURREN", "TP", "REP", "RO", "FILE", "MATRIX", "_", "=_", "508", "34_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SHU", "ES", "HIFT", "VALUES_", "=_", "65535_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FA", "XM", "ODE", "_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "XM", "ODE", "\\u", "CLASS", "IC_", "=_", "0x0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "XM", "ODE", "\\u", "NOR", "TC_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "XM", "ODE", "\\u", "NO", "EO", "L_", "=_", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "XM", "ODE", "\\u", "BYTE", "ALIGN", "_", "=_", "0x000", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "XM", "ODE", "\\u", "WORD", "ALIGN", "_", "=_", "0x000", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FA", "XM", "ODE", "\\u", "CLASS", "F_", "=_", "FA", "XM", "ODE", "\\u", "NOR", "TC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "QUALITY", "_", "=_", "6553", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "COLOR", "MODE_", "=_", "6553", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JP", "EG", "COLOR", "MODE", "\\u", "RAW_", "=_", "0x0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JP", "EG", "COLOR", "MODE", "\\u", "RGB_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "JP", "EG", "TABLES", "MODE_", "=_", "6553", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JP", "EG", "TABLES", "MODE", "\\u", "QUA", "NT_", "=_", "0x0001", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "JP", "EG", "TABLES", "MODE", "\\u", "HU", "FF_", "=_", "0x000", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "FA", "XF", "ILL", "FUNC", "_", "=_", "655", "40_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "LOG", "DATA", "FMT_", "=_", "655", "49_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PIX", "AR", "LOG", "DATA", "FMT", "\\u", "8", "BIT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PIX", "AR", "LOG", "DATA", "FMT", "\\u", "8", "BIT", "AB", "GR", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PIX", "AR", "LOG", "DATA", "FMT", "\\u", "11", "BIT", "LOG_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PIX", "AR", "LOG", "DATA", "FMT", "\\u", "1", "2", "BIT", "PIC", "IO_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PIX", "AR", "LOG", "DATA", "FMT", "\\u", "16", "BIT_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PIX", "AR", "LOG", "DATA", "FMT", "\\u", "FLOAT_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SIM", "AGE", "RT", "YPE_", "=_", "655", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RM", "ODE", "L", "\\u", "M3", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RM", "ODE", "L", "\\u", "M", "5_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RM", "ODE", "L", "\\u", "M6", "_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RF", "IL", "TER", "\\u", "IR_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RF", "IL", "TER", "\\u", "MON", "O_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RF", "IL", "TER", "\\u", "CF", "A_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIM", "AGE", "RF", "IL", "TER", "\\u", "OTHER", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SIN", "TER", "PM", "ODE", "_", "=_", "655", "51_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIN", "TER", "PM", "ODE", "\\u", "NORMAL_", "=_", "0x0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DC", "SIN", "TER", "PM", "ODE", "\\u", "PREVI", "EW", "_", "=_", "0x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SB", "AL", "ANCE", "ARRAY_", "=_", "655", "52_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SCO", "RR", "ECT", "MATRIX", "_", "=_", "655", "53_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SG", "AM", "MA_", "=_", "655", "54_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "STO", "ES", "HO", "UL", "DER", "PT", "S_", "=_", "655", "55_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SCAL", "IB", "RATION", "FD_", "=_", "655", "56_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "ZI", "PQ", "UAL", "ITY_", "=_", "655", "57_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "PIX", "AR", "LOG", "QUALITY", "_", "=_", "655", "58_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "DC", "SC", "LI", "PRE", "CTA", "NG", "LE_", "=_", "655", "59_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SGI", "LOG", "DATA", "FMT_", "=_", "655", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGI", "LOG", "DATA", "FMT", "\\u", "FLOAT_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGI", "LOG", "DATA", "FMT", "\\u", "16", "BIT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGI", "LOG", "DATA", "FMT", "\\u", "RAW_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGI", "LOG", "DATA", "FMT", "\\u", "8", "BIT_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIF", "FT", "AG", "\\u", "SGI", "LOG", "ENCODE", "_", "=_", "655", "61_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGI", "LOG", "ENCODE", "\\u", "NOD", "IT", "HER", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGI", "LOG", "ENCODE", "\\u", "RAN", "DI", "THER", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "EXP", "OS", "URE", "TIME_", "=_", "334", "34_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FN", "UM", "BER", "_", "=_", "334", "37_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "EXP", "OS", "URE", "PROGRAM", "_", "=_", "348", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SPEC", "TRA", "LS", "ENS", "ITI", "VIT", "Y_", "=_", "348", "52_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "ISO", "SPEED", "RAT", "INGS", "_", "=_", "348", "55_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "OE", "CF_", "=_", "348", "56_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "EX", "IF", "VERSION_", "=_", "368", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "DATETIME", "ORIGIN", "AL_", "=_", "368", "67_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "DATETIME", "DIGIT", "IZED", "_", "=_", "368", "68_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "COMPONENT", "SCO", "NF", "IG", "URA", "TION_", "=_", "371", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "COMPRESS", "ED", "BITS", "PER", "PIXEL", "_", "=_", "371", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SHU", "TT", "ERS", "PE", "ED", "VALUE_", "=_", "373", "77_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "AP", "ERT", "URE", "VALUE_", "=_", "373", "78_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "BRIGHT", "NESS", "VALUE_", "=_", "373", "79_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "EXP", "OS", "URE", "BIA", "SV", "AL", "UE", "_", "=_", "373", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "MAX", "AP", "ERT", "URE", "VALUE_", "=_", "373", "81_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBJECT", "DISTANCE", "_", "=_", "373", "82_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "METER", "ING", "MODE_", "=_", "373", "83_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "LIGHT", "SOURCE_", "=_", "373", "84_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FLASH", "_", "=_", "373", "85_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FOC", "ALL", "ENG", "TH_", "=_", "373", "86_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBJECT", "AREA", "_", "=_", "373", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "MAKE", "RN", "OT", "E_", "=_", "375", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "USER", "COMMENT_", "=_", "375", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBS", "ECTI", "ME_", "=_", "375", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBS", "ECTI", "ME", "ORIGIN", "AL_", "=_", "375", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBS", "ECTI", "MED", "IG", "ITI", "ZED", "_", "=_", "375", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FLASH", "PIX", "VERSION_", "=_", "409", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "COLOR", "SPACE_", "=_", "409", "61_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "PIXEL", "XD", "IME", "NS", "ION_", "=_", "409", "62_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "PIXEL", "YD", "IME", "NS", "ION_", "=_", "409", "63_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "RELAT", "ED", "SOUND", "FILE_", "=_", "409", "64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FLASH", "ENE", "RG", "Y_", "=_", "414", "83_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SPA", "TI", "AL", "FREQUENCY", "RESPONSE_", "=_", "414", "84_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FOC", "AL", "PLAN", "EX", "RESOL", "UTION", "_", "=_", "414", "86_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FOC", "AL", "PLAN", "EY", "RESOL", "UTION", "_", "=_", "414", "87_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FOC", "AL", "PLAN", "ERE", "SOL", "UTION", "UNIT", "_", "=_", "414", "88_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBJECT", "LOCATION_", "=_", "414", "92_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "EXP", "OS", "URE", "INDEX_", "=_", "414", "93_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SENS", "ING", "METHOD_", "=_", "414", "95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FILE", "SOURCE_", "=_", "417", "28_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SCEN", "ET", "YPE_", "=_", "417", "29_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "CF", "AP", "ATTE", "RN", "_", "=_", "417", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "CUSTOM", "RENDER", "ED_", "=_", "419", "85_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "EXP", "OS", "URE", "MODE_", "=_", "419", "86_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "WHITE", "BALA", "NCE_", "=_", "419", "87_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "DIGIT", "AL", "ZOO", "MR", "ATI", "O_", "=_", "419", "88_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "FOC", "ALL", "ENG", "THI", "N3", "5", "MM", "FIL", "M_", "=_", "419", "89_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SCEN", "EC", "AP", "TUR", "ET", "YPE_", "=_", "419", "90_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "GAIN", "CONTROL_", "=_", "419", "91_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "CONTR", "AST_", "=_", "419", "92_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SAT", "URA", "TION_", "=_", "419", "93_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SHAR", "PN", "ESS", "_", "=_", "419", "94_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "DEVICES", "ETT", "ING", "DESCRIPTION_", "=_", "419", "95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "SUBJECT", "DISTANCE", "RANGE_", "=_", "419", "96_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "GAIN", "CONTROL_", "=_", "419", "91_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "GAIN", "CONTROL_", "=_", "419", "91_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EX", "IF", "TAG", "\\u", "IMA", "GE", "UNI", "QUE", "ID_", "=_", "420", "16_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 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 ]
Unused import
neuropoly/spinalcordtoolbox/scripts/sct_register_to_template.py
[ { "content": "#!/usr/bin/env python\n#########################################################################################\n#\n# Register anatomical image to the template using the spinal cord centerline/segmentation.\n#\n# ---------------------------------------------------------------------------------------\n# Copyright (c) 2013 Polytechnique Montreal <www.neuro.polymtl.ca>\n# Author: Benjamin De Leener, Julien Cohen-Adad, Augustin Roux\n# Modified: 2015-03-31\n#\n# About the license: see the file LICENSE.TXT\n#########################################################################################\n\n# TODO: testing script for all cases\n\nimport sys\nimport os\nimport commands\nimport time\nfrom glob import glob\nimport sct_utils as sct\nfrom sct_utils import add_suffix\nfrom sct_image import set_orientation\nfrom sct_register_multimodal import Paramreg, ParamregMultiStep, register\nfrom msct_parser import Parser\nfrom msct_image import Image, find_zmin_zmax\nfrom shutil import move\nfrom sct_label_utils import ProcessLabels\n\n\n# get path of the toolbox\nstatus, path_sct = commands.getstatusoutput('echo $SCT_DIR')\n\n# DEFAULT PARAMETERS\n\n\n# get default parameters\nstep1 = Paramreg(step='1', type='seg', algo='rigid', metric='MeanSquares', slicewise='1', smooth='5')\nstep2 = Paramreg(step='2', type='seg', algo='bsplinesyn', metric='MeanSquares', iter='5', smooth='1')\nstep3 = Paramreg(step='3', type='im', algo='syn', metric='CC', iter='3')\nparamreg = ParamregMultiStep([step1, step2, step3])\n\n\n\n\n# MAIN\n# ==========================================================================================\n\n\n# Resample labels\n# ==========================================================================================\n\n\n# START PROGRAM\n# ==========================================================================================\nif __name__ == \"__main__\":\n # call main function\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Param:\n ## The constructor", "metadata": "root.Param", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def __init__(self):\n self.debug = 0\n self.remove_temp_files = 1 # remove temporary files\n self.output_type = 1\n self.fname_mask = '' # this field is needed in the function register@sct_register_multimodal\n self.padding = 10 # this field is needed in the function register@sct_register_multimodal\n # self.speed = 'fast' # speed of registration. slow | normal | fast\n # self.nb_iterations = '5'\n # self.algo = 'SyN'\n # self.gradientStep = '0.5'\n # self.metric = 'MI'\n self.verbose = 1 # verbose\n self.folder_template = 'template/' # folder where template files are stored (MNI-Poly-AMU_T2.nii.gz, etc.)\n self.path_template = path_sct+'/data'\n # self.file_template = 'MNI-Poly-AMU_T2.nii.gz'\n self.file_template_label = 'landmarks_center.nii.gz'\n # self.file_template_seg = 'MNI-Poly-AMU_cord.nii.gz'\n self.zsubsample = '0.25'\n self.param_straighten = ''\n # self.smoothing_sigma = 5 # Smoothing along centerline to improve accuracy and remove step effects", "metadata": "root.Param.__init__", "header": "['class', 'Param', ':', '___NEWLINE___', '## The constructor', '___NL___', '___EOS___']", "index": 36 }, { "content": "def get_parser():\n param = Param()\n parser = Parser(__file__)\n parser.usage.set_description('Register anatomical image to the template.')\n parser.add_option(name=\"-i\",\n type_value=\"file\",\n description=\"Anatomical image.\",\n mandatory=True,\n example=\"anat.nii.gz\")\n parser.add_option(name=\"-s\",\n type_value=\"file\",\n description=\"Spinal cord segmentation.\",\n mandatory=True,\n example=\"anat_seg.nii.gz\")\n parser.add_option(name=\"-l\",\n type_value=\"file\",\n description=\"Labels. See: http://sourceforge.net/p/spinalcordtoolbox/wiki/create_labels/\",\n mandatory=True,\n default_value='',\n example=\"anat_labels.nii.gz\")\n parser.add_option(name=\"-ofolder\",\n type_value=\"folder_creation\",\n description=\"Output folder.\",\n mandatory=False,\n default_value='')\n parser.add_option(name=\"-t\",\n type_value=\"folder\",\n description=\"Path to template.\",\n mandatory=False,\n default_value=param.path_template)\n parser.add_option(name='-c',\n type_value='multiple_choice',\n description='Contrast to use for registration.',\n mandatory=False,\n default_value='t2',\n example=['t1', 't2'])\n parser.add_option(name=\"-param\",\n type_value=[[':'], 'str'],\n description='Parameters for registration (see sct_register_multimodal). Default: \\\n \\n--\\nstep=1\\ntype=' + paramreg.steps['1'].type + '\\nalgo=' + paramreg.steps['1'].algo + '\\nmetric=' + paramreg.steps['1'].metric + '\\niter=' + paramreg.steps['1'].iter + '\\nsmooth=' + paramreg.steps['1'].smooth + '\\ngradStep=' + paramreg.steps['1'].gradStep + '\\nslicewise=' + paramreg.steps['1'].slicewise + '\\\n \\n--\\nstep=2\\ntype=' + paramreg.steps['2'].type + '\\nalgo=' + paramreg.steps['2'].algo + '\\nmetric=' + paramreg.steps['2'].metric + '\\niter=' + paramreg.steps['2'].iter + '\\nsmooth=' + paramreg.steps['2'].smooth + '\\ngradStep=' + paramreg.steps['2'].gradStep + '\\\n \\n--\\nstep=3\\ntype=' + paramreg.steps['3'].type + '\\nalgo=' + paramreg.steps['3'].algo + '\\nmetric=' + paramreg.steps['3'].metric + '\\niter=' + paramreg.steps['3'].iter + '\\nsmooth=' + paramreg.steps['3'].smooth + '\\ngradStep=' + paramreg.steps['3'].gradStep + '\\n',\n mandatory=False,\n example=\"step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=5,shrink=2:step=3,type=im,algo=syn,metric=MI,iter=5,shrink=1,gradStep=0.3\")\n parser.add_option(name=\"-p\",\n type_value=None,\n description='Parameters for registration (see sct_register_multimodal). Default: \\\n \\n--\\nstep=1\\ntype=' + paramreg.steps['1'].type + '\\nalgo=' + paramreg.steps['1'].algo + '\\nmetric=' + paramreg.steps['1'].metric + '\\iter=' + paramreg.steps['1'].iter + '\\smooth=' + paramreg.steps['1'].smooth + '\\gradStep=' + paramreg.steps['1'].gradStep + '\\slicewise=' + paramreg.steps['1'].slicewise + '\\\n \\n--\\nstep=1\\ntype=' + paramreg.steps['2'].type + '\\nalgo=' + paramreg.steps['2'].algo + '\\nmetric=' + paramreg.steps['2'].metric + '\\iter=' + paramreg.steps['2'].iter + '\\smooth=' + paramreg.steps['2'].smooth + '\\gradStep=' + paramreg.steps['2'].gradStep + '\\slicewise=' + paramreg.steps['2'].slicewise + '\\\n \\n--\\nstep=1\\ntype=' + paramreg.steps['3'].type + '\\nalgo=' + paramreg.steps['3'].algo + '\\nmetric=' + paramreg.steps['3'].metric + '\\iter=' + paramreg.steps['3'].iter + '\\smooth=' + paramreg.steps['3'].smooth + '\\gradStep=' + paramreg.steps['3'].gradStep + '\\slicewise=' + paramreg.steps['3'].slicewise + '\\n',\n mandatory=False,\n deprecated_by='-param')\n parser.add_option(name=\"-param-straighten\",\n type_value='str',\n description=\"\"\"Parameters for straightening (see sct_straighten_spinalcord).\"\"\",\n mandatory=False,\n default_value='',\n example=\"-params bspline_meshsize=3x3x5\")\n # parser.add_option(name=\"-cpu-nb\",\n # type_value=\"int\",\n # description=\"Number of CPU used for straightening. 0: no multiprocessing. By default, uses all the available cores.\",\n # mandatory=False,\n # example=\"8\")\n parser.add_option(name=\"-r\",\n type_value=\"multiple_choice\",\n description=\"\"\"Remove temporary files.\"\"\",\n mandatory=False,\n default_value='1',\n example=['0', '1'])\n parser.add_option(name=\"-v\",\n type_value=\"multiple_choice\",\n description=\"\"\"Verbose. 0: nothing. 1: basic. 2: extended.\"\"\",\n mandatory=False,\n default_value=param.verbose,\n example=['0', '1', '2'])\n\n return parser", "metadata": "root.get_parser", "header": "['module', '___EOS___']", "index": 65 }, { "content": "def main():\n parser = get_parser()\n param = Param()\n\n arguments = parser.parse(sys.argv[1:])\n\n # get arguments\n fname_data = arguments['-i']\n fname_seg = arguments['-s']\n fname_landmarks = arguments['-l']\n if '-ofolder' in arguments:\n path_output = arguments['-ofolder']\n else:\n path_output = ''\n path_template = sct.slash_at_the_end(arguments['-t'], 1)\n contrast_template = arguments['-c']\n remove_temp_files = int(arguments['-r'])\n verbose = int(arguments['-v'])\n if '-param-straighten' in arguments:\n param.param_straighten = arguments['-param-straighten']\n # if '-cpu-nb' in arguments:\n # arg_cpu = ' -cpu-nb '+str(arguments['-cpu-nb'])\n # else:\n # arg_cpu = ''\n if '-param' in arguments:\n paramreg_user = arguments['-param']\n # update registration parameters\n for paramStep in paramreg_user:\n paramreg.addStep(paramStep)\n\n # initialize other parameters\n file_template_label = param.file_template_label\n output_type = param.output_type\n zsubsample = param.zsubsample\n # smoothing_sigma = param.smoothing_sigma\n\n # capitalize letters for contrast\n if contrast_template == 't1':\n contrast_template = 'T1'\n elif contrast_template == 't2':\n contrast_template = 'T2'\n\n # retrieve file_template based on contrast\n fname_template_list = glob(path_template+param.folder_template+'*'+contrast_template+'.nii.gz')\n # TODO: make sure there is only one file -- check if file is there otherwise it crashes\n fname_template = fname_template_list[0]\n\n # retrieve file_template_seg\n fname_template_seg_list = glob(path_template+param.folder_template+'*cord.nii.gz')\n # TODO: make sure there is only one file\n fname_template_seg = fname_template_seg_list[0]\n\n # start timer\n start_time = time.time()\n\n # get absolute path - TO DO: remove! NEVER USE ABSOLUTE PATH...\n path_template = os.path.abspath(path_template+param.folder_template)\n\n # get fname of the template + template objects\n # fname_template = sct.slash_at_the_end(path_template, 1)+file_template\n fname_template_label = sct.slash_at_the_end(path_template, 1)+file_template_label\n # fname_template_seg = sct.slash_at_the_end(path_template, 1)+file_template_seg\n\n # check file existence\n sct.printv('\\nCheck template files...')\n sct.check_file_exist(fname_template, verbose)\n sct.check_file_exist(fname_template_label, verbose)\n sct.check_file_exist(fname_template_seg, verbose)\n\n # print arguments\n sct.printv('\\nCheck parameters:', verbose)\n sct.printv('.. Data: '+fname_data, verbose)\n sct.printv('.. Landmarks: '+fname_landmarks, verbose)\n sct.printv('.. Segmentation: '+fname_seg, verbose)\n sct.printv('.. Path template: '+path_template, verbose)\n sct.printv('.. Path output: '+path_output, verbose)\n sct.printv('.. Output type: '+str(output_type), verbose)\n sct.printv('.. Remove temp files: '+str(remove_temp_files), verbose)\n\n sct.printv('\\nParameters for registration:')\n for pStep in range(1, len(paramreg.steps)+1):\n sct.printv('Step #'+paramreg.steps[str(pStep)].step, verbose)\n sct.printv('.. Type #'+paramreg.steps[str(pStep)].type, verbose)\n sct.printv('.. Algorithm................ '+paramreg.steps[str(pStep)].algo, verbose)\n sct.printv('.. Metric................... '+paramreg.steps[str(pStep)].metric, verbose)\n sct.printv('.. Number of iterations..... '+paramreg.steps[str(pStep)].iter, verbose)\n sct.printv('.. Shrink factor............ '+paramreg.steps[str(pStep)].shrink, verbose)\n sct.printv('.. Smoothing factor......... '+paramreg.steps[str(pStep)].smooth, verbose)\n sct.printv('.. Gradient step............ '+paramreg.steps[str(pStep)].gradStep, verbose)\n sct.printv('.. Degree of polynomial..... '+paramreg.steps[str(pStep)].poly, verbose)\n\n path_data, file_data, ext_data = sct.extract_fname(fname_data)\n\n sct.printv('\\nCheck if data, segmentation and landmarks are in the same space...')\n if not sct.check_if_same_space(fname_data, fname_seg):\n sct.printv('ERROR: Data image and segmentation are not in the same space. Please check space and orientation of your files', verbose, 'error')\n if not sct.check_if_same_space(fname_data, fname_landmarks):\n sct.printv('ERROR: Data image and landmarks are not in the same space. Please check space and orientation of your files', verbose, 'error')\n\n sct.printv('\\nCheck input labels...')\n # check if label image contains coherent labels\n image_label = Image(fname_landmarks)\n # -> all labels must be different\n labels = image_label.getNonZeroCoordinates(sorting='value')\n hasDifferentLabels = True\n for lab in labels:\n for otherlabel in labels:\n if lab != otherlabel and lab.hasEqualValue(otherlabel):\n hasDifferentLabels = False\n break\n if not hasDifferentLabels:\n sct.printv('ERROR: Wrong landmarks input. All labels must be different.', verbose, 'error')\n # all labels must be available in tempalte\n image_label_template = Image(fname_template_label)\n labels_template = image_label_template.getNonZeroCoordinates(sorting='value')\n if labels[-1].value > labels_template[-1].value:\n sct.printv('ERROR: Wrong landmarks input. Labels must have correspondence in template space. \\nLabel max '\n 'provided: ' + str(labels[-1].value) + '\\nLabel max from template: ' +\n str(labels_template[-1].value), verbose, 'error')\n\n # create temporary folder\n path_tmp = sct.tmp_create(verbose=verbose)\n\n # set temporary file names\n ftmp_data = 'data.nii'\n ftmp_seg = 'seg.nii.gz'\n ftmp_label = 'label.nii.gz'\n ftmp_template = 'template.nii'\n ftmp_template_seg = 'template_seg.nii.gz'\n ftmp_template_label = 'template_label.nii.gz'\n\n # copy files to temporary folder\n sct.printv('\\nCopying input data to tmp folder and convert to nii...', verbose)\n sct.run('sct_convert -i '+fname_data+' -o '+path_tmp+ftmp_data)\n sct.run('sct_convert -i '+fname_seg+' -o '+path_tmp+ftmp_seg)\n sct.run('sct_convert -i '+fname_landmarks+' -o '+path_tmp+ftmp_label)\n sct.run('sct_convert -i '+fname_template+' -o '+path_tmp+ftmp_template)\n sct.run('sct_convert -i '+fname_template_seg+' -o '+path_tmp+ftmp_template_seg)\n sct.run('sct_convert -i '+fname_template_label+' -o '+path_tmp+ftmp_template_label)\n\n # go to tmp folder\n os.chdir(path_tmp)\n\n # smooth segmentation (jcohenadad, issue #613)\n sct.printv('\\nSmooth segmentation...', verbose)\n sct.run('sct_maths -i '+ftmp_seg+' -smooth 1.5 -o '+add_suffix(ftmp_seg, '_smooth'))\n ftmp_seg = add_suffix(ftmp_seg, '_smooth')\n\n # resample data to 1mm isotropic\n sct.printv('\\nResample data to 1mm isotropic...', verbose)\n sct.run('sct_resample -i '+ftmp_data+' -mm 1.0x1.0x1.0 -x linear -o '+add_suffix(ftmp_data, '_1mm'))\n ftmp_data = add_suffix(ftmp_data, '_1mm')\n sct.run('sct_resample -i '+ftmp_seg+' -mm 1.0x1.0x1.0 -x linear -o '+add_suffix(ftmp_seg, '_1mm'))\n ftmp_seg = add_suffix(ftmp_seg, '_1mm')\n # N.B. resampling of labels is more complicated, because they are single-point labels, therefore resampling with neighrest neighbour can make them disappear. Therefore a more clever approach is required.\n resample_labels(ftmp_label, ftmp_data, add_suffix(ftmp_label, '_1mm'))\n ftmp_label = add_suffix(ftmp_label, '_1mm')\n\n # Change orientation of input images to RPI\n sct.printv('\\nChange orientation of input images to RPI...', verbose)\n sct.run('sct_image -i '+ftmp_data+' -setorient RPI -o '+add_suffix(ftmp_data, '_rpi'))\n ftmp_data = add_suffix(ftmp_data, '_rpi')\n sct.run('sct_image -i '+ftmp_seg+' -setorient RPI -o '+add_suffix(ftmp_seg, '_rpi'))\n ftmp_seg = add_suffix(ftmp_seg, '_rpi')\n sct.run('sct_image -i '+ftmp_label+' -setorient RPI -o '+add_suffix(ftmp_label, '_rpi'))\n ftmp_label = add_suffix(ftmp_label, '_rpi')\n\n # get landmarks in native space\n # crop segmentation\n # output: segmentation_rpi_crop.nii.gz\n status_crop, output_crop = sct.run('sct_crop_image -i '+ftmp_seg+' -o '+add_suffix(ftmp_seg, '_crop')+' -dim 2 -bzmax', verbose)\n ftmp_seg = add_suffix(ftmp_seg, '_crop')\n cropping_slices = output_crop.split('Dimension 2: ')[1].split('\\n')[0].split(' ')\n\n # straighten segmentation\n sct.printv('\\nStraighten the spinal cord using centerline/segmentation...', verbose)\n sct.run('sct_straighten_spinalcord -i '+ftmp_seg+' -s '+ftmp_seg+' -o '+add_suffix(ftmp_seg, '_straight')+' -qc 0 -r 0 -v '+str(verbose), verbose)\n # N.B. DO NOT UPDATE VARIABLE ftmp_seg BECAUSE TEMPORARY USED LATER\n # re-define warping field using non-cropped space (to avoid issue #367)\n sct.run('sct_concat_transfo -w warp_straight2curve.nii.gz -d '+ftmp_data+' -o warp_straight2curve.nii.gz')\n\n # Label preparation:\n # --------------------------------------------------------------------------------\n # Remove unused label on template. Keep only label present in the input label image\n sct.printv('\\nRemove unused label on template. Keep only label present in the input label image...', verbose)\n sct.run('sct_label_utils -p remove -i '+ftmp_template_label+' -o '+ftmp_template_label+' -r '+ftmp_label)\n\n # Dilating the input label so they can be straighten without losing them\n sct.printv('\\nDilating input labels using 3vox ball radius')\n sct.run('sct_maths -i '+ftmp_label+' -o '+add_suffix(ftmp_label, '_dilate')+' -dilate 3')\n ftmp_label = add_suffix(ftmp_label, '_dilate')\n\n # Apply straightening to labels\n sct.printv('\\nApply straightening to labels...', verbose)\n sct.run('sct_apply_transfo -i '+ftmp_label+' -o '+add_suffix(ftmp_label, '_straight')+' -d '+add_suffix(ftmp_seg, '_straight')+' -w warp_curve2straight.nii.gz -x nn')\n ftmp_label = add_suffix(ftmp_label, '_straight')\n\n # Create crosses for the template labels and get coordinates\n sct.printv('\\nCreate a 15 mm cross for the template labels...', verbose)\n template_image = Image(ftmp_template_label)\n coordinates_input = template_image.getNonZeroCoordinates(sorting='value')\n # jcohenadad, issue #628 <<<<<\n # landmark_template = ProcessLabels.get_crosses_coordinates(coordinates_input, gapxy=15)\n landmark_template = coordinates_input\n # >>>>>\n if verbose == 2:\n # TODO: assign cross to image before saving\n template_image.setFileName(add_suffix(ftmp_template_label, '_cross'))\n template_image.save(type='minimize_int')\n\n # Create crosses for the input labels into straight space and get coordinates\n sct.printv('\\nCreate a 15 mm cross for the input labels...', verbose)\n label_straight_image = Image(ftmp_label)\n coordinates_input = label_straight_image.getCoordinatesAveragedByValue() # landmarks are sorted by value\n # jcohenadad, issue #628 <<<<<\n # landmark_straight = ProcessLabels.get_crosses_coordinates(coordinates_input, gapxy=15)\n landmark_straight = coordinates_input\n # >>>>>\n if verbose == 2:\n # TODO: assign cross to image before saving\n label_straight_image.setFileName(add_suffix(ftmp_label, '_cross'))\n label_straight_image.save(type='minimize_int')\n\n # Reorganize landmarks\n points_fixed, points_moving = [], []\n for coord in landmark_straight:\n point_straight = label_straight_image.transfo_pix2phys([[coord.x, coord.y, coord.z]])\n points_moving.append([point_straight[0][0], point_straight[0][1], point_straight[0][2]])\n\n for coord in landmark_template:\n point_template = template_image.transfo_pix2phys([[coord.x, coord.y, coord.z]])\n points_fixed.append([point_template[0][0], point_template[0][1], point_template[0][2]])\n\n # Register curved landmarks on straight landmarks based on python implementation\n sct.printv('\\nComputing rigid transformation (algo=translation-scaling-z) ...', verbose)\n\n import msct_register_landmarks\n # for some reason, the moving and fixed points are inverted between ITK transform and our python-based transform.\n # and for another unknown reason, x and y dimensions have a negative sign (at least for translation and center of rotation).\n if verbose == 2:\n show_transfo = True\n else:\n show_transfo = False\n (rotation_matrix, translation_array, points_moving_reg, points_moving_barycenter) = msct_register_landmarks.getRigidTransformFromLandmarks(points_moving, points_fixed, constraints='translation-scaling-z', show=show_transfo)\n # writing rigid transformation file\n text_file = open(\"straight2templateAffine.txt\", \"w\")\n text_file.write(\"#Insight Transform File V1.0\\n\")\n text_file.write(\"#Transform 0\\n\")\n text_file.write(\"Transform: AffineTransform_double_3_3\\n\")\n text_file.write(\"Parameters: %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f\\n\" % (\n rotation_matrix[0, 0], rotation_matrix[0, 1], rotation_matrix[0, 2],\n rotation_matrix[1, 0], rotation_matrix[1, 1], rotation_matrix[1, 2],\n rotation_matrix[2, 0], rotation_matrix[2, 1], rotation_matrix[2, 2],\n -translation_array[0, 0], -translation_array[0, 1], translation_array[0, 2]))\n text_file.write(\"FixedParameters: %.9f %.9f %.9f\\n\" % (-points_moving_barycenter[0],\n -points_moving_barycenter[1],\n points_moving_barycenter[2]))\n text_file.close()\n\n # Concatenate transformations: curve --> straight --> affine\n sct.printv('\\nConcatenate transformations: curve --> straight --> affine...', verbose)\n sct.run('sct_concat_transfo -w warp_curve2straight.nii.gz,straight2templateAffine.txt -d template.nii -o warp_curve2straightAffine.nii.gz')\n\n # Apply transformation\n sct.printv('\\nApply transformation...', verbose)\n sct.run('sct_apply_transfo -i '+ftmp_data+' -o '+add_suffix(ftmp_data, '_straightAffine')+' -d '+ftmp_template+' -w warp_curve2straightAffine.nii.gz')\n ftmp_data = add_suffix(ftmp_data, '_straightAffine')\n sct.run('sct_apply_transfo -i '+ftmp_seg+' -o '+add_suffix(ftmp_seg, '_straightAffine')+' -d '+ftmp_template+' -w warp_curve2straightAffine.nii.gz -x linear')\n ftmp_seg = add_suffix(ftmp_seg, '_straightAffine')\n\n # threshold and binarize\n sct.printv('\\nBinarize segmentation...', verbose)\n sct.run('sct_maths -i '+ftmp_seg+' -thr 0.4 -o '+add_suffix(ftmp_seg, '_thr'))\n sct.run('sct_maths -i '+add_suffix(ftmp_seg, '_thr')+' -bin -o '+add_suffix(ftmp_seg, '_thr_bin'))\n ftmp_seg = add_suffix(ftmp_seg, '_thr_bin')\n\n # find min-max of anat2template (for subsequent cropping)\n zmin_template, zmax_template = find_zmin_zmax(ftmp_seg)\n\n # crop template in z-direction (for faster processing)\n sct.printv('\\nCrop data in template space (for faster processing)...', verbose)\n sct.run('sct_crop_image -i '+ftmp_template+' -o '+add_suffix(ftmp_template, '_crop')+' -dim 2 -start '+str(zmin_template)+' -end '+str(zmax_template))\n ftmp_template = add_suffix(ftmp_template, '_crop')\n sct.run('sct_crop_image -i '+ftmp_template_seg+' -o '+add_suffix(ftmp_template_seg, '_crop')+' -dim 2 -start '+str(zmin_template)+' -end '+str(zmax_template))\n ftmp_template_seg = add_suffix(ftmp_template_seg, '_crop')\n sct.run('sct_crop_image -i '+ftmp_data+' -o '+add_suffix(ftmp_data, '_crop')+' -dim 2 -start '+str(zmin_template)+' -end '+str(zmax_template))\n ftmp_data = add_suffix(ftmp_data, '_crop')\n sct.run('sct_crop_image -i '+ftmp_seg+' -o '+add_suffix(ftmp_seg, '_crop')+' -dim 2 -start '+str(zmin_template)+' -end '+str(zmax_template))\n ftmp_seg = add_suffix(ftmp_seg, '_crop')\n\n # sub-sample in z-direction\n sct.printv('\\nSub-sample in z-direction (for faster processing)...', verbose)\n sct.run('sct_resample -i '+ftmp_template+' -o '+add_suffix(ftmp_template, '_sub')+' -f 1x1x'+zsubsample, verbose)\n ftmp_template = add_suffix(ftmp_template, '_sub')\n sct.run('sct_resample -i '+ftmp_template_seg+' -o '+add_suffix(ftmp_template_seg, '_sub')+' -f 1x1x'+zsubsample, verbose)\n ftmp_template_seg = add_suffix(ftmp_template_seg, '_sub')\n sct.run('sct_resample -i '+ftmp_data+' -o '+add_suffix(ftmp_data, '_sub')+' -f 1x1x'+zsubsample, verbose)\n ftmp_data = add_suffix(ftmp_data, '_sub')\n sct.run('sct_resample -i '+ftmp_seg+' -o '+add_suffix(ftmp_seg, '_sub')+' -f 1x1x'+zsubsample, verbose)\n ftmp_seg = add_suffix(ftmp_seg, '_sub')\n\n # Registration straight spinal cord to template\n sct.printv('\\nRegister straight spinal cord to template...', verbose)\n\n # loop across registration steps\n warp_forward = []\n warp_inverse = []\n for i_step in range(1, len(paramreg.steps)+1):\n sct.printv('\\nEstimate transformation for step #'+str(i_step)+'...', verbose)\n # identify which is the src and dest\n if paramreg.steps[str(i_step)].type == 'im':\n src = ftmp_data\n dest = ftmp_template\n interp_step = 'linear'\n elif paramreg.steps[str(i_step)].type == 'seg':\n src = ftmp_seg\n dest = ftmp_template_seg\n interp_step = 'nn'\n else:\n sct.printv('ERROR: Wrong image type.', 1, 'error')\n # if step>1, apply warp_forward_concat to the src image to be used\n if i_step > 1:\n # sct.run('sct_apply_transfo -i '+src+' -d '+dest+' -w '+','.join(warp_forward)+' -o '+sct.add_suffix(src, '_reg')+' -x '+interp_step, verbose)\n sct.run('sct_apply_transfo -i '+src+' -d '+dest+' -w '+','.join(warp_forward)+' -o '+add_suffix(src, '_reg')+' -x '+interp_step, verbose)\n src = add_suffix(src, '_reg')\n # register src --> dest\n warp_forward_out, warp_inverse_out = register(src, dest, paramreg, param, str(i_step))\n warp_forward.append(warp_forward_out)\n warp_inverse.append(warp_inverse_out)\n\n # Concatenate transformations:\n sct.printv('\\nConcatenate transformations: anat --> template...', verbose)\n sct.run('sct_concat_transfo -w warp_curve2straightAffine.nii.gz,'+','.join(warp_forward)+' -d template.nii -o warp_anat2template.nii.gz', verbose)\n # sct.run('sct_concat_transfo -w warp_curve2straight.nii.gz,straight2templateAffine.txt,'+','.join(warp_forward)+' -d template.nii -o warp_anat2template.nii.gz', verbose)\n sct.printv('\\nConcatenate transformations: template --> anat...', verbose)\n warp_inverse.reverse()\n sct.run('sct_concat_transfo -w '+','.join(warp_inverse)+',-straight2templateAffine.txt,warp_straight2curve.nii.gz -d data.nii -o warp_template2anat.nii.gz', verbose)\n\n # Apply warping fields to anat and template\n if output_type == 1:\n sct.run('sct_apply_transfo -i template.nii -o template2anat.nii.gz -d data.nii -w warp_template2anat.nii.gz -crop 1', verbose)\n sct.run('sct_apply_transfo -i data.nii -o anat2template.nii.gz -d template.nii -w warp_anat2template.nii.gz -crop 1', verbose)\n\n # come back to parent folder\n os.chdir('..')\n\n # Generate output files\n sct.printv('\\nGenerate output files...', verbose)\n sct.generate_output_file(path_tmp+'warp_template2anat.nii.gz', path_output+'warp_template2anat.nii.gz', verbose)\n sct.generate_output_file(path_tmp+'warp_anat2template.nii.gz', path_output+'warp_anat2template.nii.gz', verbose)\n if output_type == 1:\n sct.generate_output_file(path_tmp+'template2anat.nii.gz', path_output+'template2anat'+ext_data, verbose)\n sct.generate_output_file(path_tmp+'anat2template.nii.gz', path_output+'anat2template'+ext_data, verbose)\n\n # Delete temporary files\n if remove_temp_files:\n sct.printv('\\nDelete temporary files...', verbose)\n sct.run('rm -rf '+path_tmp)\n\n # display elapsed time\n elapsed_time = time.time() - start_time\n sct.printv('\\nFinished! Elapsed time: '+str(int(round(elapsed_time)))+'s', verbose)\n\n # to view results\n sct.printv('\\nTo view results, type:', verbose)\n sct.printv('fslview '+fname_data+' '+path_output+'template2anat -b 0,4000 &', verbose, 'info')\n sct.printv('fslview '+fname_template+' -b 0,5000 '+path_output+'anat2template &\\n', verbose, 'info')", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 146 }, { "content": "def resample_labels(fname_labels, fname_dest, fname_output):\n \"\"\"\n This function re-create labels into a space that has been resampled. It works by re-defining the location of each\n label using the old and new voxel size.\n \"\"\"\n # get dimensions of input and destination files\n nx, ny, nz, nt, px, py, pz, pt = Image(fname_labels).dim\n nxd, nyd, nzd, ntd, pxd, pyd, pzd, ptd = Image(fname_dest).dim\n sampling_factor = [float(nx)/nxd, float(ny)/nyd, float(nz)/nzd]\n # read labels\n from sct_label_utils import ProcessLabels\n processor = ProcessLabels(fname_labels)\n label_list = processor.display_voxel()\n label_new_list = []\n for label in label_list:\n label_sub_new = [str(int(round(int(label.x)/sampling_factor[0]))),\n str(int(round(int(label.y)/sampling_factor[1]))),\n str(int(round(int(label.z)/sampling_factor[2]))),\n str(int(float(label.value)))]\n label_new_list.append(','.join(label_sub_new))\n label_new_list = ':'.join(label_new_list)\n # create new labels\n sct.run('sct_label_utils -i '+fname_dest+' -p create -coord '+label_new_list+' -v 1 -o '+fname_output)", "metadata": "root.resample_labels", "header": "['module', '___EOS___']", "index": 517 } ]
[ { "span": "from sct_image import set_orientation", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 37 }, { "span": "from shutil import move", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 23 }, { "span": "from sct_label_utils import ProcessLabels", "start_line": 27, "start_column": 0, "end_line": 27, "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_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "anat", "omic", "al", " ", "image", " ", "to", " ", "the", " ", "template", " ", "usi", "ng", " ", "the", " ", "spin", "al", " ", "cord", " ", "center", "line", "/", "segmentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2013", " ", "Poly", "technique", " ", "Mont", "real", " ", "<", "www", ".", "neuro", ".", "poly", "mt", "l", ".", "ca", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Ben", "jam", "in", " ", "De", " ", "Lee", "ner", ",", " ", "Juli", "en", " ", "Co", "hen", "-", "Ada", "d", ",", " ", "August", "in", " ", "Rou", "x_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modifie", "d", ":", " ", "201", "5", "-0", "3", "-", "31_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Abo", "ut", " ", "the", " ", "license", ":", " ", "see", " ", "the", " ", "file", " ", "LICENSE", ".", "TXT", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "testi", "ng", " ", "script", " ", "for", " ", "all", " ", "cases_", "\\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_", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glob_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sct", "\\u", "utils_", "as_", "sct", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sct", "\\u", "utils_", "import_", "add", "\\u", "suffix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sct", "\\u", "image_", "import_", "set\\u", "orientation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sct", "\\u", "register", "\\u", "multim", "oda", "l_", "import_", "Param", "reg_", ",_", "Param", "reg", "Multi", "Step_", ",_", "register_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "parser_", "import_", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "msc", "t", "\\u", "image_", "import_", "Image_", ",_", "find", "\\u", "zmin", "\\u", "zmax", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "shutil_", "import_", "move_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sct", "\\u", "label", "\\u", "utils_", "import_", "Process", "Labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "path", " ", "of", " ", "the", " ", "toolbox_", "\\u\\u\\uNL\\u\\u\\u_", "status_", ",_", "path", "\\u", "sct", "_", "=_", "commands_", "._", "getstatus", "output_", "(_", "'", "echo", " ", "$", "SC", "T", "\\u", "DIR", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DEF", "AUL", "T", " ", "PARAMETERS", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "default", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "step", "1_", "=_", "Param", "reg_", "(_", "step_", "=_", "'", "1", "'_", ",_", "type_", "=_", "'", "seg", "'_", ",_", "algo_", "=_", "'", "rigid", "'_", ",_", "metric_", "=_", "'", "Mea", "n", "Square", "s", "'_", ",_", "slice", "wise_", "=_", "'", "1", "'_", ",_", "smooth_", "=_", "'", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "step", "2_", "=_", "Param", "reg_", "(_", "step_", "=_", "'", "2", "'_", ",_", "type_", "=_", "'", "seg", "'_", ",_", "algo_", "=_", "'", "bsp", "lines", "yn", "'_", ",_", "metric_", "=_", "'", "Mea", "n", "Square", "s", "'_", ",_", "iter_", "=_", "'", "5", "'_", ",_", "smooth_", "=_", "'", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "step", "3_", "=_", "Param", "reg_", "(_", "step_", "=_", "'", "3", "'_", ",_", "type_", "=_", "'", "im", "'_", ",_", "algo_", "=_", "'", "syn", "'_", ",_", "metric_", "=_", "'", "CC", "'_", ",_", "iter_", "=_", "'", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "reg_", "=_", "Param", "reg", "Multi", "Step_", "(_", "[_", "step", "1_", ",_", "step", "2_", ",_", "step", "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_", "#", " ", "MAIN", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "==============", "==============", "=====", "=_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Res", "ample", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "==============", "==============", "=====", "=_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "START", " ", "PROGRAM", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "==============", "==============", "==============", "==============", "==============", "==============", "=====", "=_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "call", " ", "main", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Param_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "The", " ", "constructor_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Param_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "The", " ", "constructor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "debug_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "remove", "\\u", "temp", "\\u", "files_", "=_", "1_", "#", " ", "remove", " ", "temporar", "y", " ", "files_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "type_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fname", "\\u", "mask_", "=_", "''_", "#", " ", "this", " ", "field", " ", "is", " ", "need", "ed", " ", "in", " ", "the", " ", "function", " ", "register", "@", "sct", "\\u", "register", "\\u", "multim", "oda", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "padding_", "=_", "10_", "#", " ", "this", " ", "field", " ", "is", " ", "need", "ed", " ", "in", " ", "the", " ", "function", " ", "register", "@", "sct", "\\u", "register", "\\u", "multim", "oda", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "speed", " ", "=", " ", "'", "fast", "'", " ", " ", "#", " ", "speed", " ", "of", " ", "registration", ".", " ", "slow", " ", "|", " ", "normal", " ", "|", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "nb", "\\u", "iterati", "ons", " ", "=", " ", "'", "5", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "algo", " ", "=", " ", "'", "Sy", "N", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "gradi", "ent", "Step", " ", "=", " ", "'", "0.", "5", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "metric", " ", "=", " ", "'", "MI", "'_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "verbose_", "=_", "1_", "#", " ", "verbose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "folder", "\\u", "template_", "=_", "'", "template", "/'_", "#", " ", "folder", " ", "where", " ", "template", " ", "files", " ", "are", " ", "store", "d", " ", "(", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "T2", ".", "ni", "i", ".", "gz", ",", " ", "etc", ".)", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "path", "\\u", "template_", "=_", "path", "\\u", "sct", "_", "+_", "'/", "data", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "file", "\\u", "template", " ", "=", " ", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "T2", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "file", "\\u", "template", "\\u", "label_", "=_", "'", "landmarks", "\\u", "center", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "file", "\\u", "template", "\\u", "seg", " ", "=", " ", "'", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "cord", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "zs", "ubs", "ample", "_", "=_", "'", "0.25", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "straight", "en_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "smoothing", "\\u", "sigma", " ", "=", " ", "5", " ", " ", "#", " ", "Smooth", "ing", " ", "along", " ", "center", "line", " ", "to", " ", "improve", " ", "accu", "rac", "y", " ", "and", " ", "remove", " ", "step", " ", "effects_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "parser_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "=_", "Param_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "Parser_", "(_", "\\u\\u", "file\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "usage_", "._", "set\\u", "description_", "(_", "'", "Register", " ", "anat", "omic", "al", " ", "image", " ", "to", " ", "the", " ", "template", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "i", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Ana", "tom", "ical", " ", "image", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "\"", "anat", ".", "ni", "i", ".", "gz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Spin", "al", " ", "cord", " ", "segmentation", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "\"", "anat", "\\u", "seg", ".", "ni", "i", ".", "gz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "file", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Label", "s", ".", " ", "See", ":", " ", "http", "://", "sourcef", "org", "e", ".", "net", "/", "p", "/", "spin", "alc", "ord", "toolb", "ox", "/", "wiki", "/", "create", "\\u", "labels", "/\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "\"", "anat", "\\u", "labels", ".", "ni", "i", ".", "gz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "of", "older", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "folder", "\\u", "creati", "on", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Output", " ", "folder", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "t", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "folder", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Path", " ", "to", " ", "template", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "param_", "._", "path", "\\u", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "'-", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "'", "multiple", "\\u", "choice", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "Contras", "t", " ", "to", " ", "use", " ", "for", " ", "registration", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "'", "t2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "[_", "'", "t1", "'_", ",_", "'", "t2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "param", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "[_", "[_", "':'_", "]_", ",_", "'", "str", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "Parameter", "s", " ", "for", " ", "registration", " ", "(", "see", " ", "sct", "\\u", "register", "\\u", "multim", "oda", "l", ").", " ", "Default", ":", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "n", "--", "\\\\", "nst", "ep", "=", "1", "\\\\", "ntype", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "type_", "+_", "'\\\\", "nal", "go", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "algo_", "+_", "'\\\\", "nme", "tric", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "metric_", "+_", "'\\\\", "nite", "r", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "iter_", "+_", "'\\\\", "nsm", "oot", "h", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "smooth_", "+_", "'\\\\", "ngr", "ad", "Step", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "grad", "Step_", "+_", "'\\\\", "nsl", "ice", "wis", "e", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "slice", "wise_", "+_", "'\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "n", "--", "\\\\", "nst", "ep", "=", "2", "\\\\", "ntype", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "type_", "+_", "'\\\\", "nal", "go", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "algo_", "+_", "'\\\\", "nme", "tric", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "metric_", "+_", "'\\\\", "nite", "r", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "iter_", "+_", "'\\\\", "nsm", "oot", "h", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "smooth_", "+_", "'\\\\", "ngr", "ad", "Step", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "grad", "Step_", "+_", "'\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "n", "--", "\\\\", "nst", "ep", "=", "3", "\\\\", "ntype", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "type_", "+_", "'\\\\", "nal", "go", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "algo_", "+_", "'\\\\", "nme", "tric", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "metric_", "+_", "'\\\\", "nite", "r", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "iter_", "+_", "'\\\\", "nsm", "oot", "h", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "smooth_", "+_", "'\\\\", "ngr", "ad", "Step", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "grad", "Step_", "+_", "'\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "\"", "step", "=", "2", ",", "type", "=", "seg", ",", "algo", "=", "bsp", "lines", "yn", ",", "metric", "=", "Mea", "n", "Square", "s", ",", "iter", "=", "5", ",", "shrink", "=", "2", ":", "step", "=", "3", ",", "type", "=", "im", ",", "algo", "=", "syn", ",", "metric", "=", "MI", ",", "iter", "=", "5", ",", "shrink", "=", "1", ",", "grad", "Step", "=", "0.", "3", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "p", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "Parameter", "s", " ", "for", " ", "registration", " ", "(", "see", " ", "sct", "\\u", "register", "\\u", "multim", "oda", "l", ").", " ", "Default", ":", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "n", "--", "\\\\", "nst", "ep", "=", "1", "\\\\", "ntype", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "type_", "+_", "'\\\\", "nal", "go", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "algo_", "+_", "'\\\\", "nme", "tric", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "metric_", "+_", "'\\\\", "iter", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "iter_", "+_", "'\\\\", "smooth", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "smooth_", "+_", "'\\\\", "grad", "Step", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "grad", "Step_", "+_", "'\\\\", "slice", "wis", "e", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "1", "'_", "]_", "._", "slice", "wise_", "+_", "'\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "n", "--", "\\\\", "nst", "ep", "=", "1", "\\\\", "ntype", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "type_", "+_", "'\\\\", "nal", "go", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "algo_", "+_", "'\\\\", "nme", "tric", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "metric_", "+_", "'\\\\", "iter", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "iter_", "+_", "'\\\\", "smooth", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "smooth_", "+_", "'\\\\", "grad", "Step", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "grad", "Step_", "+_", "'\\\\", "slice", "wis", "e", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "2", "'_", "]_", "._", "slice", "wise_", "+_", "'\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\\\", "n", "--", "\\\\", "nst", "ep", "=", "1", "\\\\", "ntype", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "type_", "+_", "'\\\\", "nal", "go", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "algo_", "+_", "'\\\\", "nme", "tric", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "metric_", "+_", "'\\\\", "iter", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "iter_", "+_", "'\\\\", "smooth", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "smooth_", "+_", "'\\\\", "grad", "Step", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "grad", "Step_", "+_", "'\\\\", "slice", "wis", "e", "='_", "+_", "param", "reg_", "._", "steps_", "[_", "'", "3", "'_", "]_", "._", "slice", "wise_", "+_", "'\\\\", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "depre", "cated", "\\u", "by_", "=_", "'-", "param", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "param", "-", "straight", "en", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "'", "str", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"\"\"", "Parameter", "s", " ", "for", " ", "straight", "eni", "ng", " ", "(", "see", " ", "sct", "\\u", "straight", "en", "\\u", "spin", "alc", "ord", ").\"\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "\"-", "params", " ", "bsp", "line", "\\u", "mesh", "size", "=", "3x", "3x", "5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parser", ".", "add", "\\u", "option", "(", "name", "=\"", "-", "cpu", "-", "nb", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "type", "\\u", "value", "=\"", "int", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "description", "=\"", "Number", " ", "of", " ", "CPU", " ", "used", " ", "for", " ", "straight", "eni", "ng", ".", " ", "0", ":", " ", "no", " ", "multipro", "cess", "ing", ".", " ", "By", " ", "default", ",", " ", "use", "s", " ", "all", " ", "the", " ", "avail", "able", " ", "cores", ".\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mandat", "ory", "=", "Fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "example", "=\"", "8", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "r", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "multiple", "\\u", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"\"\"", "Remove", " ", "temporar", "y", " ", "files", ".\"\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "name_", "=_", "\"-", "v", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type", "\\u", "value_", "=_", "\"", "multiple", "\\u", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"\"\"", "Verbos", "e", ".", " ", "0", ":", " ", "not", "hing", ".", " ", "1", ":", " ", "basic", ".", " ", "2", ":", " ", "extend", "ed", ".\"\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "value_", "=_", "param_", "._", "verbose_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "example_", "=_", "[_", "'", "0", "'_", ",_", "'", "1", "'_", ",_", "'", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "get", "\\u", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param_", "=_", "Param_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arguments_", "=_", "parser_", "._", "parse_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "data_", "=_", "arguments_", "[_", "'-", "i", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname", "\\u", "seg_", "=_", "arguments_", "[_", "'-", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname", "\\u", "landmarks", "_", "=_", "arguments_", "[_", "'-", "l", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'-", "of", "older", "'_", "in_", "arguments_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path", "\\u", "output_", "=_", "arguments_", "[_", "'-", "of", "older", "'_", "]_", "\\u\\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", "\\u", "output_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path", "\\u", "template_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "arguments_", "[_", "'-", "t", "'_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "contrast", "\\u", "template_", "=_", "arguments_", "[_", "'-", "c", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "\\u", "temp", "\\u", "files_", "=_", "int_", "(_", "arguments_", "[_", "'-", "r", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verbose_", "=_", "int_", "(_", "arguments_", "[_", "'-", "v", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'-", "param", "-", "straight", "en", "'_", "in_", "arguments_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "._", "param", "\\u", "straight", "en_", "=_", "arguments_", "[_", "'-", "param", "-", "straight", "en", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "'-", "cpu", "-", "nb", "'", " ", "in", " ", "argu", "ment", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "arg", "\\u", "cpu", " ", "=", " ", "'", " ", "-", "cpu", "-", "nb", " ", "'+", "str", "(", "argu", "ment", "s", "['", "-", "cpu", "-", "nb", "'])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "arg", "\\u", "cpu", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'-", "param", "'_", "in_", "arguments_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "reg", "\\u", "user_", "=_", "arguments_", "[_", "'-", "param", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "registration", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "param", "Step_", "in_", "param", "reg", "\\u", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "reg_", "._", "add", "Step_", "(_", "param", "Step_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "initialize", " ", "other", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "\\u", "template", "\\u", "label_", "=_", "param_", "._", "file", "\\u", "template", "\\u", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "\\u", "type_", "=_", "param_", "._", "output", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zs", "ubs", "ample", "_", "=_", "param_", "._", "zs", "ubs", "ample", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "smoothing", "\\u", "sigma", " ", "=", " ", "param", ".", "smoothing", "\\u", "sigma_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "capitaliz", "e", " ", "letter", "s", " ", "for", " ", "contrast", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "contrast", "\\u", "template_", "==_", "'", "t1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contrast", "\\u", "template_", "=_", "'", "T1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "contrast", "\\u", "template_", "==_", "'", "t2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contrast", "\\u", "template_", "=_", "'", "T2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "retrieve", " ", "file", "\\u", "template", " ", "based", " ", "on", " ", "contrast", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fname", "\\u", "template", "\\u", "list_", "=_", "glob_", "(_", "path", "\\u", "template_", "+_", "param_", "._", "folder", "\\u", "template_", "+_", "'*'_", "+_", "contrast", "\\u", "template_", "+_", "'.", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "make", " ", "sure", " ", "there", " ", "is", " ", "only", " ", "one", " ", "file", " ", "--", " ", "check", " ", "if", " ", "file", " ", "is", " ", "there", " ", "other", "wis", "e", " ", "it", " ", "crashes", "_", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "template_", "=_", "fname", "\\u", "template", "\\u", "list_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "retrieve", " ", "file", "\\u", "template", "\\u", "seg_", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "template", "\\u", "seg", "\\u", "list_", "=_", "glob_", "(_", "path", "\\u", "template_", "+_", "param_", "._", "folder", "\\u", "template_", "+_", "'*", "cord", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "make", " ", "sure", " ", "there", " ", "is", " ", "only", " ", "one", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "template", "\\u", "seg_", "=_", "fname", "\\u", "template", "\\u", "seg", "\\u", "list_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "timer_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "abs", "olute", " ", "path", " ", "-", " ", "TO", " ", "DO", ":", " ", "remove", "!", " ", "NE", "VER", " ", "USE", " ", "ABS", "OLUT", "E", " ", "PATH", "..._", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "template_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "path", "\\u", "template_", "+_", "param_", "._", "folder", "\\u", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "fname", " ", "of", " ", "the", " ", "template", " ", "+", " ", "template", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fname", "\\u", "template", " ", "=", " ", "sct", ".", "slash", "\\u", "at", "\\u", "the", "\\u", "end", "(", "path", "\\u", "template", ",", " ", "1", ")+", "file", "\\u", "template_", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "template", "\\u", "label_", "=_", "sct", "_", "._", "slash", "\\u", "at", "\\u", "the", "\\u", "end_", "(_", "path", "\\u", "template_", ",_", "1_", ")_", "+_", "file", "\\u", "template", "\\u", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "fname", "\\u", "template", "\\u", "seg", " ", "=", " ", "sct", ".", "slash", "\\u", "at", "\\u", "the", "\\u", "end", "(", "path", "\\u", "template", ",", " ", "1", ")+", "file", "\\u", "template", "\\u", "seg_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "file", " ", "existence", "_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Check", " ", "template", " ", "files", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "check", "\\u", "file", "\\u", "exist_", "(_", "fname", "\\u", "template_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "check", "\\u", "file", "\\u", "exist_", "(_", "fname", "\\u", "template", "\\u", "label_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "check", "\\u", "file", "\\u", "exist_", "(_", "fname", "\\u", "template", "\\u", "seg_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Check", " ", "parameter", "s", ":'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Data", ":", " ", " ", " ", " ", " ", "'_", "+_", "fname", "\\u", "data_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Land", "mark", "s", ":", " ", " ", " ", " ", "'_", "+_", "fname", "\\u", "landmarks", "_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Segmentation", ":", " ", " ", " ", " ", " ", "'_", "+_", "fname", "\\u", "seg_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Path", " ", "template", ":", " ", " ", " ", " ", "'_", "+_", "path", "\\u", "template_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Path", " ", "output", ":", " ", " ", "'_", "+_", "path", "\\u", "output_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Output", " ", "type", ":", " ", " ", "'_", "+_", "str_", "(_", "output", "\\u", "type_", ")_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Remove", " ", "temp", " ", "files", ":", " ", " ", " ", " ", "'_", "+_", "str_", "(_", "remove", "\\u", "temp", "\\u", "files_", ")_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Parameter", "s", " ", "for", " ", "registration", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p", "Step_", "in_", "range_", "(_", "1_", ",_", "len_", "(_", "param", "reg_", "._", "steps_", ")_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "Step", " ", "#'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "step_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Type", " ", "#'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "type_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Algorit", "hm", "...........", ".....", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "algo_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Met", "ric", "...........", "........", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "metric_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Number", " ", "of", " ", "iterati", "ons", ".....", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "iter_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Sh", "rin", "k", " ", "factor", "...........", ".", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "shrink", "_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Smooth", "ing", " ", "factor", "........", ".", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "smooth_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Grad", "ient", " ", "step", "...........", ".", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "grad", "Step_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'..", " ", "Deg", "ree", " ", "of", " ", "polynomial", ".....", " ", "'_", "+_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "p", "Step_", ")_", "]_", "._", "poly_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path", "\\u", "data_", ",_", "file", "\\u", "data_", ",_", "ext", "\\u", "data_", "=_", "sct", "_", "._", "extract", "\\u", "fname_", "(_", "fname", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Check", " ", "if", " ", "data", ",", " ", "segmentation", " ", "and", " ", "landmarks", " ", "are", " ", "in", " ", "the", " ", "same", " ", "space", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sct", "_", "._", "check", "\\u", "if", "\\u", "same", "\\u", "space_", "(_", "fname", "\\u", "data_", ",_", "fname", "\\u", "seg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "ERROR", ":", " ", "Data", " ", "image", " ", "and", " ", "segmentation", " ", "are", " ", "not", " ", "in", " ", "the", " ", "same", " ", "space", ".", " ", "Ple", "ase", " ", "check", " ", "space", " ", "and", " ", "orientation", " ", "of", " ", "your", " ", "files", "'_", ",_", "verbose_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "sct", "_", "._", "check", "\\u", "if", "\\u", "same", "\\u", "space_", "(_", "fname", "\\u", "data_", ",_", "fname", "\\u", "landmarks", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "ERROR", ":", " ", "Data", " ", "image", " ", "and", " ", "landmarks", " ", "are", " ", "not", " ", "in", " ", "the", " ", "same", " ", "space", ".", " ", "Ple", "ase", " ", "check", " ", "space", " ", "and", " ", "orientation", " ", "of", " ", "your", " ", "files", "'_", ",_", "verbose_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Check", " ", "input", " ", "labels", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "label", " ", "image", " ", "contain", "s", " ", "coheren", "t", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "label_", "=_", "Image_", "(_", "fname", "\\u", "landmarks", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "->", " ", "all", " ", "labels", " ", "must", " ", "be", " ", "different", "_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "image", "\\u", "label_", "._", "get", "Non", "Zero", "Coordinates_", "(_", "sorting", "_", "=_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "Different", "Labels_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "lab_", "in_", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "other", "label_", "in_", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lab_", "!=_", "other", "label_", "and_", "lab_", "._", "has", "Equal", "Value_", "(_", "other", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "Different", "Labels_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "has", "Different", "Labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "ERROR", ":", " ", "Wro", "ng", " ", "landmarks", " ", "input", ".", " ", "All", " ", "labels", " ", "must", " ", "be", " ", "different", ".'_", ",_", "verbose_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "all", " ", "labels", " ", "must", " ", "be", " ", "avail", "able", " ", "in", " ", "temp", "alt", "e_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "image", "\\u", "label", "\\u", "template_", "=_", "Image_", "(_", "fname", "\\u", "template", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels", "\\u", "template_", "=_", "image", "\\u", "label", "\\u", "template_", "._", "get", "Non", "Zero", "Coordinates_", "(_", "sorting", "_", "=_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "labels_", "[_", "-_", "1_", "]_", "._", "value_", ">_", "labels", "\\u", "template_", "[_", "-_", "1_", "]_", "._", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "ERROR", ":", " ", "Wro", "ng", " ", "landmarks", " ", "input", ".", " ", "Label", "s", " ", "must", " ", "have", " ", "correspond", "ence", " ", "in", " ", "template", " ", "space", ".", " ", "\\\\", "n", "Label", " ", "max", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "provided", ":", " ", "'_", "+_", "str_", "(_", "labels_", "[_", "-_", "1_", "]_", "._", "value_", ")_", "+_", "'\\\\", "n", "Label", " ", "max", " ", "from", " ", "template", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "labels", "\\u", "template_", "[_", "-_", "1_", "]_", "._", "value_", ")_", ",_", "verbose_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "temporar", "y", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "path", "\\u", "tmp_", "=_", "sct", "_", "._", "tmp", "\\u", "create_", "(_", "verbose_", "=_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "temporar", "y", " ", "file", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "ft", "mp", "\\u", "data_", "=_", "'", "data", ".", "ni", "i", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "'", "seg", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "label_", "=_", "'", "label", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template_", "=_", "'", "template", ".", "ni", "i", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template", "\\u", "seg_", "=_", "'", "template", "\\u", "seg", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template", "\\u", "label_", "=_", "'", "template", "\\u", "label", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copy", " ", "files", " ", "to", " ", "temporar", "y", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Copy", "ing", " ", "input", " ", "data", " ", "to", " ", "tmp", " ", "folder", " ", "and", " ", "convert", " ", "to", " ", "ni", "i", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "convert", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "data_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "path", "\\u", "tmp_", "+_", "ft", "mp", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "convert", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "path", "\\u", "tmp_", "+_", "ft", "mp", "\\u", "seg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "convert", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "landmarks", "_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "path", "\\u", "tmp_", "+_", "ft", "mp", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "convert", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "template_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "path", "\\u", "tmp_", "+_", "ft", "mp", "\\u", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "convert", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "template", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "path", "\\u", "tmp_", "+_", "ft", "mp", "\\u", "template", "\\u", "seg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "convert", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "template", "\\u", "label_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "path", "\\u", "tmp_", "+_", "ft", "mp", "\\u", "template", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "go", " ", "to", " ", "tmp", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "chdir_", "(_", "path", "\\u", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "smooth", " ", "segmentation", " ", "(", "jc", "oh", "ena", "dad", ",", " ", "issue", " ", "#", "613", ")_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Smooth", " ", "segmentation", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "smooth", " ", "1.5", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "smooth", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "smooth", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resample", " ", "data", " ", "to", " ", "1", "mm", " ", "isot", "rop", "ic_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Res", "ample", " ", "data", " ", "to", " ", "1", "mm", " ", "isot", "rop", "ic", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "resample", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "data_", "+_", "'", " ", "-", "mm", " ", "1.0", "x1", ".0", "x1", ".0", " ", "-", "x", " ", "linear", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "1", "mm", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "data_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "1", "mm", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "resample", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "mm", " ", "1.0", "x1", ".0", "x1", ".0", " ", "-", "x", " ", "linear", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "1", "mm", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "1", "mm", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "N", ".", "B", ".", " ", "resa", "mpli", "ng", " ", "of", " ", "labels", " ", "is", " ", "more", " ", "compli", "cated", ",", " ", "bec", "aus", "e", " ", "the", "y", " ", "are", " ", "single", "-", "point", " ", "labels", ",", " ", "there", "fore", " ", "resa", "mpli", "ng", " ", "with", " ", "neigh", "rest", " ", "neighbour", " ", "can", " ", "make", " ", "them", " ", "disapp", "ear", ".", " ", "There", "fore", " ", "a", " ", "more", " ", "clev", "er", " ", "appro", "ach", " ", "is", " ", "require", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "resample", "\\u", "labels_", "(_", "ft", "mp", "\\u", "label_", ",_", "ft", "mp", "\\u", "data_", ",_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "1", "mm", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "label_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "1", "mm", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Change", " ", "orientation", " ", "of", " ", "input", " ", "images", " ", "to", " ", "RP", "I_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Change", " ", "orientation", " ", "of", " ", "input", " ", "images", " ", "to", " ", "RP", "I", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "data_", "+_", "'", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "rpi", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "data_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "rpi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "rpi", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "rpi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "label_", "+_", "'", " ", "-", "seto", "rien", "t", " ", "RP", "I", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "rpi", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "label_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "rpi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "landmarks", " ", "in", " ", "nativ", "e", " ", "space_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "crop", " ", "segmentation_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ":", " ", "segmentation", "\\u", "rpi", "\\u", "crop", ".", "ni", "i", ".", "gz_", "\\u\\u\\uNL\\u\\u\\u_", "status", "\\u", "crop_", ",_", "output", "\\u", "crop_", "=_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "crop", "'_", ")_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "bz", "max", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "crop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "crop", "ping", "\\u", "slices_", "=_", "output", "\\u", "crop_", "._", "split_", "(_", "'", "Dimen", "sion", " ", "2", ":", " ", "'_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "[_", "0_", "]_", "._", "split_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "straight", "en", " ", "segmentation_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Strai", "ghte", "n", " ", "the", " ", "spin", "al", " ", "cord", " ", "usi", "ng", " ", "center", "line", "/", "segmentation", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "straight", "en", "\\u", "spin", "alc", "ord", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "s", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "straight", "'_", ")_", "+_", "'", " ", "-", "qc", " ", "0", " ", "-", "r", " ", "0", " ", "-", "v", " ", "'_", "+_", "str_", "(_", "verbose_", ")_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "N", ".", "B", ".", " ", "DO", " ", "NOT", " ", "UPDATE", " ", "VARIABLE", " ", "ft", "mp", "\\u", "seg", " ", "BE", "CAU", "SE", " ", "TEMP", "ORA", "RY", " ", "USED", " ", "LATE", "R_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "re", "-", "defin", "e", " ", "warp", "ing", " ", "field", " ", "usi", "ng", " ", "non", "-", "cropped", " ", "space", " ", "(", "to", " ", "avoid", " ", "issue", " ", "#", "367", ")_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "warp", "\\u", "straight", "2c", "urve", ".", "ni", "i", ".", "gz", " ", "-", "d", " ", "'_", "+_", "ft", "mp", "\\u", "data_", "+_", "'", " ", "-", "o", " ", "warp", "\\u", "straight", "2c", "urve", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Label", " ", "preparation", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "unu", "sed", " ", "label", " ", "on", " ", "template", ".", " ", "Keep", " ", "only", " ", "label", " ", "presen", "t", " ", "in", " ", "the", " ", "input", " ", "label", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Remove", " ", "unu", "sed", " ", "label", " ", "on", " ", "template", ".", " ", "Keep", " ", "only", " ", "label", " ", "presen", "t", " ", "in", " ", "the", " ", "input", " ", "label", " ", "image", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "p", " ", "remove", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "template", "\\u", "label_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "ft", "mp", "\\u", "template", "\\u", "label_", "+_", "'", " ", "-", "r", " ", "'_", "+_", "ft", "mp", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Di", "latin", "g", " ", "the", " ", "input", " ", "label", " ", "so", " ", "the", "y", " ", "can", " ", "be", " ", "straight", "en", " ", "with", "out", " ", "los", "ing", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Di", "latin", "g", " ", "input", " ", "labels", " ", "usi", "ng", " ", "3", "vox", " ", "bal", "l", " ", "radi", "us", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "label_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "dilate", "'_", ")_", "+_", "'", " ", "-", "dilate", " ", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "label_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "dilate", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "straight", "eni", "ng", " ", "to", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Apply", " ", "straight", "eni", "ng", " ", "to", " ", "labels", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "label_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "straight", "'_", ")_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "straight", "'_", ")_", "+_", "'", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz", " ", "-", "x", " ", "nn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "label_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "straight", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "crosse", "s", " ", "for", " ", "the", " ", "template", " ", "labels", " ", "and", " ", "get", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Creat", "e", " ", "a", " ", "15", " ", "mm", " ", "cross", " ", "for", " ", "the", " ", "template", " ", "labels", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "image_", "=_", "Image_", "(_", "ft", "mp", "\\u", "template", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coordinate", "s", "\\u", "input_", "=_", "template", "\\u", "image_", "._", "get", "Non", "Zero", "Coordinates_", "(_", "sorting", "_", "=_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "jc", "oh", "ena", "dad", ",", " ", "issue", " ", "#", "628", " ", "<<<<", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "landmark", "\\u", "template", " ", "=", " ", "Process", "Label", "s", ".", "get", "\\u", "crosse", "s", "\\u", "coordinate", "s", "(", "coordinate", "s", "\\u", "input", ",", " ", "gap", "xy", "=", "15", ")_", "\\u\\u\\uNL\\u\\u\\u_", "landmark", "\\u", "template_", "=_", "coordinate", "s", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", ">>>>>", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "assign", " ", "cross", " ", "to", " ", "image", " ", "bef", "ore", " ", "saving", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "image_", "._", "set", "File", "Name_", "(_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template", "\\u", "label_", ",_", "'\\u", "cross", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "image_", "._", "save_", "(_", "type_", "=_", "'", "minimize", "\\u", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "crosse", "s", " ", "for", " ", "the", " ", "input", " ", "labels", " ", "int", "o", " ", "straight", " ", "space", " ", "and", " ", "get", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Creat", "e", " ", "a", " ", "15", " ", "mm", " ", "cross", " ", "for", " ", "the", " ", "input", " ", "labels", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "straight", "\\u", "image_", "=_", "Image_", "(_", "ft", "mp", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coordinate", "s", "\\u", "input_", "=_", "label", "\\u", "straight", "\\u", "image_", "._", "get", "Coordinat", "es", "Average", "d", "By", "Value_", "(_", ")_", "#", " ", "landmarks", " ", "are", " ", "sorte", "d", " ", "by", " ", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "jc", "oh", "ena", "dad", ",", " ", "issue", " ", "#", "628", " ", "<<<<", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "landmark", "\\u", "straight", " ", "=", " ", "Process", "Label", "s", ".", "get", "\\u", "crosse", "s", "\\u", "coordinate", "s", "(", "coordinate", "s", "\\u", "input", ",", " ", "gap", "xy", "=", "15", ")_", "\\u\\u\\uNL\\u\\u\\u_", "landmark", "\\u", "straight", "_", "=_", "coordinate", "s", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", ">>>>>", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "assign", " ", "cross", " ", "to", " ", "image", " ", "bef", "ore", " ", "saving", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "straight", "\\u", "image_", "._", "set", "File", "Name_", "(_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "label_", ",_", "'\\u", "cross", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "straight", "\\u", "image_", "._", "save_", "(_", "type_", "=_", "'", "minimize", "\\u", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Re", "organize", " ", "landmarks", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "points", "\\u", "fixed_", ",_", "points", "\\u", "movin", "g_", "=_", "[_", "]_", ",_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "coord_", "in_", "landmark", "\\u", "straight", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "point", "\\u", "straight", "_", "=_", "label", "\\u", "straight", "\\u", "image_", "._", "transf", "o", "\\u", "pix", "2p", "hys", "_", "(_", "[_", "[_", "coord_", "._", "x_", ",_", "coord_", "._", "y_", ",_", "coord_", "._", "z_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "points", "\\u", "movin", "g_", "._", "append_", "(_", "[_", "point", "\\u", "straight", "_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "point", "\\u", "straight", "_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "point", "\\u", "straight", "_", "[_", "0_", "]_", "[_", "2_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "coord_", "in_", "landmark", "\\u", "template_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "point", "\\u", "template_", "=_", "template", "\\u", "image_", "._", "transf", "o", "\\u", "pix", "2p", "hys", "_", "(_", "[_", "[_", "coord_", "._", "x_", ",_", "coord_", "._", "y_", ",_", "coord_", "._", "z_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "points", "\\u", "fixed_", "._", "append_", "(_", "[_", "point", "\\u", "template_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "point", "\\u", "template_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "point", "\\u", "template_", "[_", "0_", "]_", "[_", "2_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "curve", "d", " ", "landmarks", " ", "on", " ", "straight", " ", "landmarks", " ", "based", " ", "on", " ", "python", " ", "implementation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Comp", "uti", "ng", " ", "rigid", " ", "transformation", " ", "(", "algo", "=", "translatio", "n", "-", "scal", "ing", "-", "z", ")", " ", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "msc", "t", "\\u", "register", "\\u", "landmarks", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "some", " ", "reason", ",", " ", "the", " ", "movin", "g", " ", "and", " ", "fixed", " ", "points", " ", "are", " ", "inverted", " ", "bet", "ween", " ", "IT", "K", " ", "transform", " ", "and", " ", "our", " ", "python", "-", "based", " ", "transform", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "for", " ", "anot", "her", " ", "unknown", " ", "reason", ",", " ", "x", " ", "and", " ", "y", " ", "dimension", "s", " ", "have", " ", "a", " ", "negati", "ve", " ", "sign", " ", "(", "at", " ", "leas", "t", " ", "for", " ", "translatio", "n", " ", "and", " ", "center", " ", "of", " ", "rotati", "on", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "verbose_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "show", "\\u", "transf", "o_", "=_", "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 ", " _", "show", "\\u", "transf", "o_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "rotati", "on", "\\u", "matrix_", ",_", "translatio", "n", "\\u", "array_", ",_", "points", "\\u", "movin", "g", "\\u", "reg_", ",_", "points", "\\u", "movin", "g", "\\u", "bar", "ycen", "ter_", ")_", "=_", "msc", "t", "\\u", "register", "\\u", "landmarks", "_", "._", "get", "Rig", "id", "Transform", "Fro", "m", "Land", "marks_", "(_", "points", "\\u", "movin", "g_", ",_", "points", "\\u", "fixed_", ",_", "constraints_", "=_", "'", "translatio", "n", "-", "scal", "ing", "-", "z", "'_", ",_", "show_", "=_", "show", "\\u", "transf", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "writ", "ing", " ", "rigid", " ", "transformation", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "text", "\\u", "file_", "=_", "open_", "(_", "\"", "straight", "2te", "mpla", "te", "Affi", "ne", ".", "txt", "\"_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "file_", "._", "write_", "(_", "\"#", "Insi", "ght", " ", "Transform", " ", "File", " ", "V1", ".0", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "file_", "._", "write_", "(_", "\"#", "Transform", " ", "0", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "file_", "._", "write_", "(_", "\"", "Transform", ":", " ", "Affi", "ne", "Transform", "\\u", "double", "\\u", "3", "\\u", "3", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "file_", "._", "write_", "(_", "\"", "Parameter", "s", ":", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", "\\\\", "n", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "rotati", "on", "\\u", "matrix_", "[_", "0_", ",_", "0_", "]_", ",_", "rotati", "on", "\\u", "matrix_", "[_", "0_", ",_", "1_", "]_", ",_", "rotati", "on", "\\u", "matrix_", "[_", "0_", ",_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rotati", "on", "\\u", "matrix_", "[_", "1_", ",_", "0_", "]_", ",_", "rotati", "on", "\\u", "matrix_", "[_", "1_", ",_", "1_", "]_", ",_", "rotati", "on", "\\u", "matrix_", "[_", "1_", ",_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rotati", "on", "\\u", "matrix_", "[_", "2_", ",_", "0_", "]_", ",_", "rotati", "on", "\\u", "matrix_", "[_", "2_", ",_", "1_", "]_", ",_", "rotati", "on", "\\u", "matrix_", "[_", "2_", ",_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "-_", "translatio", "n", "\\u", "array_", "[_", "0_", ",_", "0_", "]_", ",_", "-_", "translatio", "n", "\\u", "array_", "[_", "0_", ",_", "1_", "]_", ",_", "translatio", "n", "\\u", "array_", "[_", "0_", ",_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "file_", "._", "write_", "(_", "\"", "Fix", "ed", "Parameter", "s", ":", " ", "%", ".9", "f", " ", "%", ".9", "f", " ", "%", ".9", "f", "\\\\", "n", "\"_", "%_", "(_", "-_", "points", "\\u", "movin", "g", "\\u", "bar", "ycen", "ter_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "-_", "points", "\\u", "movin", "g", "\\u", "bar", "ycen", "ter_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "points", "\\u", "movin", "g", "\\u", "bar", "ycen", "ter_", "[_", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Concat", "enat", "e", " ", "transformation", "s", ":", " ", "curve", " ", "-->", " ", "straight", " ", "-->", " ", "affine_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Concat", "enat", "e", " ", "transformation", "s", ":", " ", "curve", " ", "-->", " ", "straight", " ", "-->", " ", "affin", "e", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz", ",", "straight", "2te", "mpla", "te", "Affi", "ne", ".", "txt", " ", "-", "d", " ", "template", ".", "ni", "i", " ", "-", "o", " ", "warp", "\\u", "curve", "2s", "tra", "ight", "Affi", "ne", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "transformation_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Apply", " ", "transformation", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "data_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "straight", "Affi", "ne", "'_", ")_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "ft", "mp", "\\u", "template_", "+_", "'", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", "Affi", "ne", ".", "ni", "i", ".", "gz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "data_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "straight", "Affi", "ne", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "straight", "Affi", "ne", "'_", ")_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "ft", "mp", "\\u", "template_", "+_", "'", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", "Affi", "ne", ".", "ni", "i", ".", "gz", " ", "-", "x", " ", "linear", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "straight", "Affi", "ne", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "threshol", "d", " ", "and", " ", "binar", "ize_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Bin", "ari", "ze", " ", "segmentation", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "thr", " ", "0.", "4", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "thr", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "maths", " ", "-", "i", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "thr", "'_", ")_", "+_", "'", " ", "-", "bin", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "thr", "\\u", "bin", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "thr", "\\u", "bin", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "min", "-", "max", " ", "of", " ", "anat", "2te", "mpla", "te", " ", "(", "for", " ", "subsequen", "t", " ", "crop", "ping", ")_", "\\u\\u\\uNL\\u\\u\\u_", "zmin", "\\u", "template_", ",_", "zmax", "\\u", "template_", "=_", "find", "\\u", "zmin", "\\u", "zmax", "_", "(_", "ft", "mp", "\\u", "seg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "crop", " ", "template", " ", "in", " ", "z", "-", "direction", " ", "(", "for", " ", "faste", "r", " ", "process", "ing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Cro", "p", " ", "data", " ", "in", " ", "template", " ", "space", " ", "(", "for", " ", "faste", "r", " ", "process", "ing", ").", "..'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "template_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template_", ",_", "'\\u", "crop", "'_", ")_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "str_", "(_", "zmin", "\\u", "template_", ")_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "zmax", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template_", ",_", "'\\u", "crop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "template", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template", "\\u", "seg_", ",_", "'\\u", "crop", "'_", ")_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "str_", "(_", "zmin", "\\u", "template_", ")_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "zmax", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template", "\\u", "seg_", ",_", "'\\u", "crop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "data_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "crop", "'_", ")_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "str_", "(_", "zmin", "\\u", "template_", ")_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "zmax", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "data_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "crop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "crop", "\\u", "image", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "crop", "'_", ")_", "+_", "'", " ", "-", "dim", " ", "2", " ", "-", "start", " ", "'_", "+_", "str_", "(_", "zmin", "\\u", "template_", ")_", "+_", "'", " ", "-", "end", " ", "'_", "+_", "str_", "(_", "zmax", "\\u", "template_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "crop", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sub", "-", "sample", " ", "in", " ", "z", "-", "direction_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Sub", "-", "sample", " ", "in", " ", "z", "-", "direction", " ", "(", "for", " ", "faste", "r", " ", "process", "ing", ").", "..'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "resample", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "template_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template_", ",_", "'\\u", "sub", "'_", ")_", "+_", "'", " ", "-", "f", " ", "1x", "1x", "'_", "+_", "zs", "ubs", "ample", "_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template_", ",_", "'\\u", "sub", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "resample", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "template", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template", "\\u", "seg_", ",_", "'\\u", "sub", "'_", ")_", "+_", "'", " ", "-", "f", " ", "1x", "1x", "'_", "+_", "zs", "ubs", "ample", "_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "template", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "template", "\\u", "seg_", ",_", "'\\u", "sub", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "resample", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "data_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "sub", "'_", ")_", "+_", "'", " ", "-", "f", " ", "1x", "1x", "'_", "+_", "zs", "ubs", "ample", "_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "data_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "data_", ",_", "'\\u", "sub", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "resample", " ", "-", "i", " ", "'_", "+_", "ft", "mp", "\\u", "seg_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "sub", "'_", ")_", "+_", "'", " ", "-", "f", " ", "1x", "1x", "'_", "+_", "zs", "ubs", "ample", "_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ft", "mp", "\\u", "seg_", "=_", "add", "\\u", "suffix_", "(_", "ft", "mp", "\\u", "seg_", ",_", "'\\u", "sub", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Registration", " ", "straight", " ", "spin", "al", " ", "cord", " ", "to", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Register", " ", "straight", " ", "spin", "al", " ", "cord", " ", "to", " ", "template", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "loop", " ", "acro", "ss", " ", "registration", " ", "steps_", "\\u\\u\\uNL\\u\\u\\u_", "warp", "\\u", "forward_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "inverse_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i", "\\u", "step_", "in_", "range_", "(_", "1_", ",_", "len_", "(_", "param", "reg_", "._", "steps_", ")_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Estimat", "e", " ", "transformation", " ", "for", " ", "step", " ", "#'_", "+_", "str_", "(_", "i", "\\u", "step_", ")_", "+_", "'...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "identify", " ", "whi", "ch", " ", "is", " ", "the", " ", "src", " ", "and", " ", "dest_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "i", "\\u", "step_", ")_", "]_", "._", "type_", "==_", "'", "im", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src_", "=_", "ft", "mp", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest_", "=_", "ft", "mp", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interp", "\\u", "step_", "=_", "'", "linear", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "param", "reg_", "._", "steps_", "[_", "str_", "(_", "i", "\\u", "step_", ")_", "]_", "._", "type_", "==_", "'", "seg", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src_", "=_", "ft", "mp", "\\u", "seg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest_", "=_", "ft", "mp", "\\u", "template", "\\u", "seg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interp", "\\u", "step_", "=_", "'", "nn", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'", "ERROR", ":", " ", "Wro", "ng", " ", "image", " ", "type", ".'_", ",_", "1_", ",_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "step", ">", "1", ",", " ", "appl", "y", " ", "warp", "\\u", "forward", "\\u", "conc", "at", " ", "to", " ", "the", " ", "src", " ", "image", " ", "to", " ", "be", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i", "\\u", "step_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sct", ".", "run", "('", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "'+", "src", "+'", " ", "-", "d", " ", "'+", "dest", "+'", " ", "-", "w", " ", "'+", "','", ".", "join", "(", "warp", "\\u", "forward", ")+", "'", " ", "-", "o", " ", "'+", "sct", ".", "add", "\\u", "suff", "ix", "(", "src", ",", " ", "'\\u", "reg", "')", "+'", " ", "-", "x", " ", "'+", "interp", "\\u", "step", ",", " ", "verbo", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "'_", "+_", "src_", "+_", "'", " ", "-", "d", " ", "'_", "+_", "dest_", "+_", "'", " ", "-", "w", " ", "'_", "+_", "','_", "._", "join_", "(_", "warp", "\\u", "forward_", ")_", "+_", "'", " ", "-", "o", " ", "'_", "+_", "add", "\\u", "suffix_", "(_", "src_", ",_", "'\\u", "reg", "'_", ")_", "+_", "'", " ", "-", "x", " ", "'_", "+_", "interp", "\\u", "step_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src_", "=_", "add", "\\u", "suffix_", "(_", "src_", ",_", "'\\u", "reg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "register", " ", "src", " ", "-->", " ", "dest_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "warp", "\\u", "forward", "\\u", "out_", ",_", "warp", "\\u", "inv", "erse", "\\u", "out_", "=_", "register_", "(_", "src_", ",_", "dest_", ",_", "param", "reg_", ",_", "param_", ",_", "str_", "(_", "i", "\\u", "step_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "forward_", "._", "append_", "(_", "warp", "\\u", "forward", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "inverse_", "._", "append_", "(_", "warp", "\\u", "inv", "erse", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Concat", "enat", "e", " ", "transformation", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Concat", "enat", "e", " ", "transformation", "s", ":", " ", "anat", " ", "-->", " ", "template", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", "Affi", "ne", ".", "ni", "i", ".", "gz", ",'_", "+_", "','_", "._", "join_", "(_", "warp", "\\u", "forward_", ")_", "+_", "'", " ", "-", "d", " ", "template", ".", "ni", "i", " ", "-", "o", " ", "warp", "\\u", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sct", ".", "run", "('", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "warp", "\\u", "curve", "2s", "tra", "ight", ".", "ni", "i", ".", "gz", ",", "straight", "2te", "mpla", "te", "Affi", "ne", ".", "txt", ",'", "+'", ",'", ".", "join", "(", "warp", "\\u", "forward", ")+", "'", " ", "-", "d", " ", "template", ".", "ni", "i", " ", "-", "o", " ", "warp", "\\u", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", "',", " ", "verbo", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Concat", "enat", "e", " ", "transformation", "s", ":", " ", "template", " ", "-->", " ", "anat", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warp", "\\u", "inverse_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "conc", "at", "\\u", "transf", "o", " ", "-", "w", " ", "'_", "+_", "','_", "._", "join_", "(_", "warp", "\\u", "inverse_", ")_", "+_", "',", "-", "straight", "2te", "mpla", "te", "Affi", "ne", ".", "txt", ",", "warp", "\\u", "straight", "2c", "urve", ".", "ni", "i", ".", "gz", " ", "-", "d", " ", "data", ".", "ni", "i", " ", "-", "o", " ", "warp", "\\u", "template", "2a", "nat", ".", "ni", "i", ".", "gz", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "warp", "ing", " ", "fields", " ", "to", " ", "anat", " ", "and", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "output", "\\u", "type_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "template", ".", "ni", "i", " ", "-", "o", " ", "template", "2a", "nat", ".", "ni", "i", ".", "gz", " ", "-", "d", " ", "data", ".", "ni", "i", " ", "-", "w", " ", "warp", "\\u", "template", "2a", "nat", ".", "ni", "i", ".", "gz", " ", "-", "crop", " ", "1", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "appl", "y", "\\u", "transf", "o", " ", "-", "i", " ", "data", ".", "ni", "i", " ", "-", "o", " ", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", " ", "-", "d", " ", "template", ".", "ni", "i", " ", "-", "w", " ", "warp", "\\u", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", " ", "-", "crop", " ", "1", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "come", " ", "back", " ", "to", " ", "parent", " ", "folder_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "'..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "output", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Generate", " ", "output", " ", "files", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "generat", "e\\u", "output", "\\u", "file_", "(_", "path", "\\u", "tmp_", "+_", "'", "warp", "\\u", "template", "2a", "nat", ".", "ni", "i", ".", "gz", "'_", ",_", "path", "\\u", "output_", "+_", "'", "warp", "\\u", "template", "2a", "nat", ".", "ni", "i", ".", "gz", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "generat", "e\\u", "output", "\\u", "file_", "(_", "path", "\\u", "tmp_", "+_", "'", "warp", "\\u", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", "'_", ",_", "path", "\\u", "output_", "+_", "'", "warp", "\\u", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "output", "\\u", "type_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "generat", "e\\u", "output", "\\u", "file_", "(_", "path", "\\u", "tmp_", "+_", "'", "template", "2a", "nat", ".", "ni", "i", ".", "gz", "'_", ",_", "path", "\\u", "output_", "+_", "'", "template", "2a", "nat", "'_", "+_", "ext", "\\u", "data_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "generat", "e\\u", "output", "\\u", "file_", "(_", "path", "\\u", "tmp_", "+_", "'", "anat", "2te", "mpla", "te", ".", "ni", "i", ".", "gz", "'_", ",_", "path", "\\u", "output_", "+_", "'", "anat", "2te", "mpla", "te", "'_", "+_", "ext", "\\u", "data_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "temporar", "y", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "remove", "\\u", "temp", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Delete", " ", "temporar", "y", " ", "files", "...'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "rm", " ", "-", "rf", " ", "'_", "+_", "path", "\\u", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "display", " ", "ela", "pse", "d", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ela", "pse", "d\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "start", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "Finish", "ed", "!", " ", "El", "aps", "ed", " ", "time", ":", " ", "'_", "+_", "str_", "(_", "int_", "(_", "round_", "(_", "ela", "pse", "d\\u", "time_", ")_", ")_", ")_", "+_", "'", "s", "'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "view", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'\\\\", "n", "To", " ", "view", " ", "results", ",", " ", "type", ":'_", ",_", "verbose_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "fs", "lv", "iew", " ", "'_", "+_", "fname", "\\u", "data_", "+_", "'", " ", "'_", "+_", "path", "\\u", "output_", "+_", "'", "template", "2a", "nat", " ", "-", "b", " ", "0", ",", "4000", " ", "&'_", ",_", "verbose_", ",_", "'", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sct", "_", "._", "print", "v_", "(_", "'", "fs", "lv", "iew", " ", "'_", "+_", "fname", "\\u", "template_", "+_", "'", " ", "-", "b", " ", "0", ",", "5000", " ", "'_", "+_", "path", "\\u", "output_", "+_", "'", "anat", "2te", "mpla", "te", " ", "&", "\\\\", "n", "'_", ",_", "verbose_", ",_", "'", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resample", "\\u", "labels_", "(_", "fname", "\\u", "labels_", ",_", "fname", "\\u", "dest_", ",_", "fname", "\\u", "output_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "re", "-", "create", " ", "labels", " ", "int", "o", " ", "a", " ", "space", " ", "tha", "t", " ", "has", " ", "bee", "n", " ", "resample", "d", ".", " ", "It", " ", "works", " ", "by", " ", "re", "-", "defini", "ng", " ", "the", " ", "location", " ", "of", " ", "each", "\\", "10", ";", " ", " ", " ", " ", "label", " ", "usi", "ng", " ", "the", " ", "old", " ", "and", " ", "new", " ", "voxel", " ", "size", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "dimension", "s", " ", "of", " ", "input", " ", "and", " ", "destinat", "ion", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "nx_", ",_", "ny_", ",_", "nz_", ",_", "nt_", ",_", "px_", ",_", "py_", ",_", "pz", "_", ",_", "pt_", "=_", "Image_", "(_", "fname", "\\u", "labels_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nx", "d_", ",_", "ny", "d_", ",_", "nz", "d_", ",_", "nt", "d_", ",_", "px", "d_", ",_", "pyd", "_", ",_", "pz", "d_", ",_", "pt", "d_", "=_", "Image_", "(_", "fname", "\\u", "dest_", ")_", "._", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samp", "ling", "\\u", "factor_", "=_", "[_", "float_", "(_", "nx_", ")_", "/_", "nx", "d_", ",_", "float_", "(_", "ny_", ")_", "/_", "ny", "d_", ",_", "float_", "(_", "nz_", ")_", "/_", "nz", "d_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "read", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sct", "\\u", "label", "\\u", "utils_", "import_", "Process", "Labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "processor_", "=_", "Process", "Labels_", "(_", "fname", "\\u", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "list_", "=_", "processor_", "._", "display", "\\u", "voxel", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "new", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "label_", "in_", "label", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "\\u", "sub\\u", "new_", "=_", "[_", "str_", "(_", "int_", "(_", "round_", "(_", "int_", "(_", "label_", "._", "x_", ")_", "/_", "samp", "ling", "\\u", "factor_", "[_", "0_", "]_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "int_", "(_", "round_", "(_", "int_", "(_", "label_", "._", "y_", ")_", "/_", "samp", "ling", "\\u", "factor_", "[_", "1_", "]_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "int_", "(_", "round_", "(_", "int_", "(_", "label_", "._", "z_", ")_", "/_", "samp", "ling", "\\u", "factor_", "[_", "2_", "]_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "int_", "(_", "float_", "(_", "label_", "._", "value_", ")_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "\\u", "new", "\\u", "list_", "._", "append_", "(_", "','_", "._", "join_", "(_", "label", "\\u", "sub\\u", "new_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "label", "\\u", "new", "\\u", "list_", "=_", "':'_", "._", "join_", "(_", "label", "\\u", "new", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "new", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "sct", "_", "._", "run_", "(_", "'", "sct", "\\u", "label", "\\u", "util", "s", " ", "-", "i", " ", "'_", "+_", "fname", "\\u", "dest_", "+_", "'", " ", "-", "p", " ", "create", " ", "-", "coord", " ", "'_", "+_", "label", "\\u", "new", "\\u", "list_", "+_", "'", " ", "-", "v", " ", "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 ]
Wrong number of arguments in a call
gferreira/hTools2/Lib/hTools2/extras/outline.py
[ { "content": "def interSect((seg1s, seg1e), (seg2s, seg2e)):\n denom = (seg2e.y - seg2s.y)*(seg1e.x - seg1s.x) - (seg2e.x - seg2s.x)*(seg1e.y - seg1s.y)\n if roundFloat(denom) == 0:\n #print 'parallel: %s' % denom\n return None\n uanum = (seg2e.x - seg2s.x)*(seg1s.y - seg2s.y) - (seg2e.y - seg2s.y)*(seg1s.x - seg2s.x)\n ubnum = (seg1e.x - seg1s.x)*(seg1s.y - seg2s.y) - (seg1e.y - seg1s.y)*(seg1s.x - seg2s.x)\n ua = uanum/denom\n ub = ubnum/denom\n x = seg1s.x + ua*(seg1e.x - seg1s.x)\n y = seg1s.y + ua*(seg1e.y - seg1s.y)\n return MathPoint(x, y)", "metadata": "root.interSect", "header": "['module', '___EOS___']", "index": 56 }, { "content": " def connectionSquare(self, first, last, pen, close):\n angle_1 = radians(degrees(self.prevAngle)+90)\n angle_2 = radians(degrees(self.currentAngle)+90)\n\n tempFirst = first - self.pointClass(cos(angle_1), sin(angle_1)) * self.miterLimit\n tempLast = last + self.pointClass(cos(angle_2), sin(angle_2)) * self.miterLimit\n\n newPoint = interSect((first, tempFirst), (last, tempLast))\n if newPoint is not None:\n\n if self._inputmiterLimit is not None and roundFloat(newPoint.distance(first)) > self._inputmiterLimit:\n pen.lineTo(tempFirst)\n pen.lineTo(tempLast)\n else:\n pen.lineTo(newPoint)\n\n if not close:\n pen.lineTo(last)", "metadata": "root.OutlinePen.connectionSquare", "header": "['class', 'OutlinePen', '(', 'BasePen', ')', ':', '___EOS___']", "index": 448 }, { "content": " def connectionRound(self, first, last, pen, close):\n angle_1 = radians(degrees(self.prevAngle)+90)\n angle_2 = radians(degrees(self.currentAngle)+90)\n\n tempFirst = first - self.pointClass(cos(angle_1), sin(angle_1)) * self.miterLimit\n tempLast = last + self.pointClass(cos(angle_2), sin(angle_2)) * self.miterLimit\n\n newPoint = interSect((first, tempFirst), (last, tempLast))\n if newPoint is None:\n pen.lineTo(last)\n return\n distance = newPoint.distance(first)\n\n if roundFloat(distance) > self.miterLimit:\n distance = self.miterLimit + tempFirst.distance(tempLast) * .7\n\n distance *= self.magicCurve\n\n bcp1 = first - self.pointClass(cos(angle_1), sin(angle_1)) * distance\n bcp2 = last + self.pointClass(cos(angle_2), sin(angle_2)) * distance\n pen.curveTo(bcp1, bcp2, last)", "metadata": "root.OutlinePen.connectionRound", "header": "['class', 'OutlinePen', '(', 'BasePen', ')', ':', '___EOS___']", "index": 467 } ]
[ { "span": "interSect((first, tempFirst), (last, tempLast))", "start_line": 455, "start_column": 19, "end_line": 455, "end_column": 66 }, { "span": "interSect((first, tempFirst), (last, tempLast))", "start_line": 474, "start_column": 19, "end_line": 474, "end_column": 66 } ]
[ { "span": "def interSect((seg1s, seg1e), (seg2s, seg2e)):", "start_line": 56, "start_column": 0, "end_line": 56, "end_column": 46 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "inter", "Sect", "_", "(_", "(_", "seg", "1s", "_", ",_", "seg", "1e", "_", ")_", ",_", "(_", "seg", "2s", "_", ",_", "seg", "2e", "_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "denom_", "=_", "(_", "seg", "2e", "_", "._", "y_", "-_", "seg", "2s", "_", "._", "y_", ")_", "*_", "(_", "seg", "1e", "_", "._", "x_", "-_", "seg", "1s", "_", "._", "x_", ")_", "-_", "(_", "seg", "2e", "_", "._", "x_", "-_", "seg", "2s", "_", "._", "x_", ")_", "*_", "(_", "seg", "1e", "_", "._", "y_", "-_", "seg", "1s", "_", "._", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "round", "Float_", "(_", "denom_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "'", "parall", "el", ":", " ", "%", "s", "'", " ", "%", " ", "denom_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uan", "um_", "=_", "(_", "seg", "2e", "_", "._", "x_", "-_", "seg", "2s", "_", "._", "x_", ")_", "*_", "(_", "seg", "1s", "_", "._", "y_", "-_", "seg", "2s", "_", "._", "y_", ")_", "-_", "(_", "seg", "2e", "_", "._", "y_", "-_", "seg", "2s", "_", "._", "y_", ")_", "*_", "(_", "seg", "1s", "_", "._", "x_", "-_", "seg", "2s", "_", "._", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub", "num_", "=_", "(_", "seg", "1e", "_", "._", "x_", "-_", "seg", "1s", "_", "._", "x_", ")_", "*_", "(_", "seg", "1s", "_", "._", "y_", "-_", "seg", "2s", "_", "._", "y_", ")_", "-_", "(_", "seg", "1e", "_", "._", "y_", "-_", "seg", "1s", "_", "._", "y_", ")_", "*_", "(_", "seg", "1s", "_", "._", "x_", "-_", "seg", "2s", "_", "._", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ua_", "=_", "uan", "um_", "/_", "denom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub_", "=_", "ub", "num_", "/_", "denom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "seg", "1s", "_", "._", "x_", "+_", "ua_", "*_", "(_", "seg", "1e", "_", "._", "x_", "-_", "seg", "1s", "_", "._", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "seg", "1s", "_", "._", "y_", "+_", "ua_", "*_", "(_", "seg", "1e", "_", "._", "y_", "-_", "seg", "1s", "_", "._", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Math", "Point_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Outline", "Pen_", "(_", "Base", "Pen_", ")_", ":_", "\\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_", "connecti", "on", "Square_", "(_", "self_", ",_", "first_", ",_", "last_", ",_", "pen_", ",_", "close_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "angle", "\\u", "1_", "=_", "radians_", "(_", "degrees_", "(_", "self_", "._", "prev", "Angle_", ")_", "+_", "90_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "angle", "\\u", "2_", "=_", "radians_", "(_", "degrees_", "(_", "self_", "._", "current", "Angle_", ")_", "+_", "90_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp", "First_", "=_", "first_", "-_", "self_", "._", "point", "Class_", "(_", "cos_", "(_", "angle", "\\u", "1_", ")_", ",_", "sin_", "(_", "angle", "\\u", "1_", ")_", ")_", "*_", "self_", "._", "mite", "r", "Limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "Last_", "=_", "last_", "+_", "self_", "._", "point", "Class_", "(_", "cos_", "(_", "angle", "\\u", "2_", ")_", ",_", "sin_", "(_", "angle", "\\u", "2_", ")_", ")_", "*_", "self_", "._", "mite", "r", "Limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "Point_", "=_", "inter", "Sect", "_", "(_", "(_", "first_", ",_", "temp", "First_", ")_", ",_", "(_", "last_", ",_", "temp", "Last_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "Point_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "input", "mite", "r", "Limit_", "is_", "not_", "None_", "and_", "round", "Float_", "(_", "new", "Point_", "._", "distance_", "(_", "first_", ")_", ")_", ">_", "self_", "._", "\\u", "input", "mite", "r", "Limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pen_", "._", "line", "To_", "(_", "temp", "First_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "line", "To_", "(_", "temp", "Last_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pen_", "._", "line", "To_", "(_", "new", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "close_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pen_", "._", "line", "To_", "(_", "last_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Outline", "Pen_", "(_", "Base", "Pen_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connecti", "on", "Round", "_", "(_", "self_", ",_", "first_", ",_", "last_", ",_", "pen_", ",_", "close_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "angle", "\\u", "1_", "=_", "radians_", "(_", "degrees_", "(_", "self_", "._", "prev", "Angle_", ")_", "+_", "90_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "angle", "\\u", "2_", "=_", "radians_", "(_", "degrees_", "(_", "self_", "._", "current", "Angle_", ")_", "+_", "90_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp", "First_", "=_", "first_", "-_", "self_", "._", "point", "Class_", "(_", "cos_", "(_", "angle", "\\u", "1_", ")_", ",_", "sin_", "(_", "angle", "\\u", "1_", ")_", ")_", "*_", "self_", "._", "mite", "r", "Limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp", "Last_", "=_", "last_", "+_", "self_", "._", "point", "Class_", "(_", "cos_", "(_", "angle", "\\u", "2_", ")_", ",_", "sin_", "(_", "angle", "\\u", "2_", ")_", ")_", "*_", "self_", "._", "mite", "r", "Limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "Point_", "=_", "inter", "Sect", "_", "(_", "(_", "first_", ",_", "temp", "First_", ")_", ",_", "(_", "last_", ",_", "temp", "Last_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "Point_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pen_", "._", "line", "To_", "(_", "last_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "distance_", "=_", "new", "Point_", "._", "distance_", "(_", "first_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "round", "Float_", "(_", "distance_", ")_", ">_", "self_", "._", "mite", "r", "Limit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "distance_", "=_", "self_", "._", "mite", "r", "Limit_", "+_", "temp", "First_", "._", "distance_", "(_", "temp", "Last_", ")_", "*_", ".7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "distance_", "*=_", "self_", "._", "magic", "Curve_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bc", "p1_", "=_", "first_", "-_", "self_", "._", "point", "Class_", "(_", "cos_", "(_", "angle", "\\u", "1_", ")_", ",_", "sin_", "(_", "angle", "\\u", "1_", ")_", ")_", "*_", "distance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bc", "p2_", "=_", "last_", "+_", "self_", "._", "point", "Class_", "(_", "cos_", "(_", "angle", "\\u", "2_", ")_", ",_", "sin_", "(_", "angle", "\\u", "2_", ")_", ")_", "*_", "distance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "curve", "To_", "(_", "bc", "p1_", ",_", "bc", "p2_", ",_", "last_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused local variable
mikrosimage/OpenRenderManagement/src/octopus/worker/worker.py
[ { "content": " def updateCommandWatcher(self, commandWatcher):\n \"\"\"\n | Send info to the dispatcher about currently running command watcher.\n | Called from the mainloop every time a command has been tagged \"modified\"\n | req: PUT /rendernodes/<currentRN>/commands/<commandId>/\n\n :param commandWatcher: the commandWatcher object we will send an update about\n \"\"\"\n\n maxRetry = max(1, config.WORKER_REQUEST_MAX_RETRY_COUNT)\n delayRetry = config.WORKER_REQUEST_DELAY_AFTER_REQUEST_FAILURE\n i = 0\n\n while i < maxRetry:\n url = \"/rendernodes/%s/commands/%d/\" % (self.computerName, commandWatcher.commandId)\n body = json.dumps(self.buildUpdateDict(commandWatcher.command))\n headers = {'Content-Length': len(body)}\n\n try:\n self.httpconn.request('PUT', url, body, headers)\n response = self.httpconn.getresponse()\n except httplib.HTTPException, e:\n LOGGER.error('\"PUT %s\" failed (error:%r)', url, e)\n except socket.error, e:\n LOGGER.error('\"PUT %s\" failed (error:%r)', url, e)\n except Exception, e:\n LOGGER.info('\"PUT %s\" failed (unhandled exception: %r', url, e)\n else:\n if response.status == 200:\n response = response.read()\n commandWatcher.modified = False\n break\n elif response.status == 404:\n LOGGER.warning('removing stale command %d', commandWatcher.commandId)\n response = response.read()\n self.removeCommandWatcher(commandWatcher)\n break\n else:\n data = response.read()\n LOGGER.warning(\"unexpected status %d: %s %s\" % (response.status, response.reason, data))\n finally:\n self.httpconn.close()\n\n LOGGER.warning('Update of command %d failed (attempt %d of %d)', commandWatcher.commandId, i, maxRetry)\n LOGGER.warning('Next retry will occur in %.2f s' % delayRetry)\n time.sleep(delayRetry)\n i += 1\n delayRetry *= 1.5\n\n # Request error encountered \"maxRetry\" times, removing the command watcher to avoid\n # recalling this update in next main loop iter\n # if i == maxRetry:\n # LOGGER.exception('Update of command %d failed repeatedly, removing watcher.', commandWatcher.commandId )\n # self.removeCommandWatcher(commandWatcher)", "metadata": "root.Worker.updateCommandWatcher", "header": "['class', 'Worker', '(', 'MainLoopApplication', ')', ':', '___EOS___']", "index": 413 } ]
[ { "span": "response ", "start_line": 442, "start_column": 20, "end_line": 442, "end_column": 28 }, { "span": "response ", "start_line": 447, "start_column": 20, "end_line": 447, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Worker_", "(_", "Main", "Loop", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "Command", "Watcher", "_", "(_", "self_", ",_", "command", "Watcher", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "Sen", "d", " ", "info", " ", "to", " ", "the", " ", "dispatcher", " ", "abo", "ut", " ", "currentl", "y", " ", "runn", "ing", " ", "command", " ", "watcher", ".", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "Call", "ed", " ", "from", " ", "the", " ", "mainl", "oop", " ", "every", " ", "time", " ", "a", " ", "command", " ", "has", " ", "bee", "n", " ", "tagg", "ed", " ", "\"", "modifi", "ed", "\"", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "req", ":", " ", "PU", "T", " ", "/", "render", "nodes", "/", "<", "current", "RN", ">/", "command", "s", "/", "<", "command", "Id", ">/", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "command", "Watcher", ":", " ", "the", " ", "command", "Watcher", " ", "object", " ", "we", " ", "will", " ", "send", " ", "an", " ", "update", " ", "abo", "ut", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "max", "Retry_", "=_", "max_", "(_", "1_", ",_", "config_", "._", "WORKER", "\\u", "REQUEST", "\\u", "MAX", "\\u", "RETRY", "\\u", "COUNT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dela", "y", "Retry_", "=_", "config_", "._", "WORKER", "\\u", "REQUEST", "\\u", "DELAY", "\\u", "AFTER", "\\u", "REQUEST", "\\u", "FAILURE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "i_", "<_", "max", "Retry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"/", "render", "nodes", "/", "%", "s", "/", "command", "s", "/", "%", "d", "/\"_", "%_", "(_", "self_", "._", "computer", "Name_", ",_", "command", "Watcher", "_", "._", "command", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "json_", "._", "dumps_", "(_", "self_", "._", "build", "Update", "Dict_", "(_", "command", "Watcher", "_", "._", "command_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "{_", "'", "Conten", "t", "-", "Length", "'_", ":_", "len_", "(_", "body_", ")_", "}_", "\\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_", "._", "httpc", "onn", "_", "._", "request_", "(_", "'", "PU", "T", "'_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "httpc", "onn", "_", "._", "getresponse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "httplib_", "._", "HTTP", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOGGER_", "._", "error_", "(_", "'\"", "PU", "T", " ", "%", "s", "\"", " ", "fail", "ed", " ", "(", "error", ":", "%", "r", ")'_", ",_", "url_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOGGER_", "._", "error_", "(_", "'\"", "PU", "T", " ", "%", "s", "\"", " ", "fail", "ed", " ", "(", "error", ":", "%", "r", ")'_", ",_", "url_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOGGER_", "._", "info_", "(_", "'\"", "PU", "T", " ", "%", "s", "\"", " ", "fail", "ed", " ", "(", "unhandled", " ", "exception", ":", " ", "%", "r", "'_", ",_", "url_", ",_", "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 ", " _", "if_", "response_", "._", "status_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "response_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command", "Watcher", "_", "._", "modified_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "response_", "._", "status_", "==_", "404_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "LOGGER_", "._", "warning_", "(_", "'", "remo", "ving", " ", "stale", " ", "command", " ", "%", "d", "'_", ",_", "command", "Watcher", "_", "._", "command", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "remove", "Command", "Watcher", "_", "(_", "command", "Watcher", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "data_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LOGGER_", "._", "warning_", "(_", "\"", "unexpected", " ", "status", " ", "%", "d", ":", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "response_", "._", "status_", ",_", "response_", "._", "reason_", ",_", "data_", ")_", ")_", "\\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 ", " _", "self_", "._", "httpc", "onn", "_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "LOGGER_", "._", "warning_", "(_", "'", "Update", " ", "of", " ", "command", " ", "%", "d", " ", "fail", "ed", " ", "(", "atte", "mpt", " ", "%", "d", " ", "of", " ", "%", "d", ")'_", ",_", "command", "Watcher", "_", "._", "command", "Id_", ",_", "i_", ",_", "max", "Retry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LOGGER_", "._", "warning_", "(_", "'", "Ne", "xt", " ", "retr", "y", " ", "will", " ", "occur", " ", "in", " ", "%", ".2", "f", " ", "s", "'_", "%_", "dela", "y", "Retry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "dela", "y", "Retry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dela", "y", "Retry_", "*=_", "1.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Request", " ", "error", " ", "encounter", "ed", " ", "\"", "max", "Retr", "y", "\"", " ", "times", ",", " ", "remo", "ving", " ", "the", " ", "command", " ", "watcher", " ", "to", " ", "avoid", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reca", "llin", "g", " ", "this", " ", "update", " ", "in", " ", "next", " ", "main", " ", "loop", " ", "iter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "i", " ", "==", " ", "max", "Retr", "y", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LOGGE", "R", ".", "exception", "('", "Update", " ", "of", " ", "command", " ", "%", "d", " ", "fail", "ed", " ", "repeated", "ly", ",", " ", "remo", "ving", " ", "watcher", ".'", ",", " ", "command", "Watcher", ".", "command", "Id", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "remove", "Command", "Watcher", "(", "command", "Watcher", ")_", "\\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, 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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 ]
Except block handles 'BaseException'
mrknow/filmkodi/plugin.video.specto/resources/lib/libraries/cloudflare.py
[ { "content": "def request(url, post=None, headers=None, mobile=False, safe=False, timeout='30'):\n try:\n control.log('[cloudflare] request %s' % url)\n try: headers.update(headers)\n except: headers = {}\n\n agent = cache.get(cloudflareAgent, 168)\n\n if not 'User-Agent' in headers: headers['User-Agent'] = agent\n\n u = '%s://%s' % (urlparse.urlparse(url).scheme, urlparse.urlparse(url).netloc)\n\n cookie = cache.get(cloudflareCookie, 168, u, post, headers, mobile, safe, timeout)\n\n result = client.request(url, cookie=cookie, post=post, headers=headers, mobile=mobile, safe=safe, timeout=timeout, output='response', error=True)\n\n if result[0] == '503':\n agent = cache.get(cloudflareAgent, 0) ; headers['User-Agent'] = agent\n\n cookie = cache.get(cloudflareCookie, 0, u, post, headers, mobile, safe, timeout)\n\n result = client.request(url, cookie=cookie, post=post, headers=headers, mobile=mobile, safe=safe, timeout=timeout)\n else:\n result= result[1]\n #control.log('[cloudflare] result %s' % result)\n\n return result\n except:\n return", "metadata": "root.request", "header": "['module', '___EOS___']", "index": 31 }, { "content": "def cloudflareCookie(url, post, headers, mobile, safe, timeout):\n try:\n result = client.request(url, post=post, headers=headers, mobile=mobile, safe=safe, timeout=timeout, error=True)\n\n jschl = re.compile('name=\"jschl_vc\" value=\"(.+?)\"/>').findall(result)[0]\n init = re.compile('setTimeout\\(function\\(\\){\\s*.*?.*:(.*?)};').findall(result)[0]\n builder = re.compile(r\"challenge-form\\'\\);\\s*(.*)a.v\").findall(result)[0]\n decryptVal = parseJSString(init)\n lines = builder.split(';')\n\n for line in lines:\n if len(line)>0 and '=' in line:\n sections=line.split('=')\n line_val = parseJSString(sections[1])\n decryptVal = int(eval(str(decryptVal)+sections[0][-1]+str(line_val)))\n\n answer = decryptVal + len(urlparse.urlparse(url).netloc)\n\n query = '%s/cdn-cgi/l/chk_jschl?jschl_vc=%s&jschl_answer=%s' % (url, jschl, answer)\n\n if 'type=\"hidden\" name=\"pass\"' in result:\n passval = re.compile('name=\"pass\" value=\"(.*?)\"').findall(result)[0]\n query = '%s/cdn-cgi/l/chk_jschl?pass=%s&jschl_vc=%s&jschl_answer=%s' % (url, urllib.quote_plus(passval), jschl, answer)\n time.sleep(5)\n\n cookie = client.request(query, post=post, headers=headers, mobile=mobile, safe=safe, timeout=timeout, output='cookie', error=True)\n return cookie\n except:\n pass", "metadata": "root.cloudflareCookie", "header": "['module', '___EOS___']", "index": 70 }, { "content": "def parseJSString(s):\n try:\n offset=1 if s[0]=='+' else 0\n val = int(eval(s.replace('!+[]','1').replace('!![]','1').replace('[]','0').replace('(','str(')[offset:]))\n return val\n except:\n pass", "metadata": "root.parseJSString", "header": "['module', '___EOS___']", "index": 101 } ]
[ { "span": "except: ", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 15 }, { "span": "except:", "start_line": 58, "start_column": 4, "end_line": 58, "end_column": 11 }, { "span": "except:", "start_line": 97, "start_column": 4, "end_line": 97, "end_column": 11 }, { "span": "except:", "start_line": 106, "start_column": 4, "end_line": 106, "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_", "request_", "(_", "url_", ",_", "post_", "=_", "None_", ",_", "headers_", "=_", "None_", ",_", "mobile_", "=_", "False_", ",_", "safe_", "=_", "False_", ",_", "timeout_", "=_", "'", "30", "'_", ")_", ":_", "\\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 ", " _", "control_", "._", "log_", "(_", "'[", "cloudf", "lar", "e", "]", " ", "request", " ", "%", "s", "'_", "%_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "headers_", "._", "update_", "(_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "headers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "agent_", "=_", "cache_", "._", "get_", "(_", "cloudf", "lar", "e", "Agent_", ",_", "168_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "'", "User", "-", "Agent", "'_", "in_", "headers_", ":_", "headers_", "[_", "'", "User", "-", "Agent", "'_", "]_", "=_", "agent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "=_", "'%", "s", "://", "%", "s", "'_", "%_", "(_", "urlparse_", "._", "urlparse_", "(_", "url_", ")_", "._", "scheme_", ",_", "urlparse_", "._", "urlparse_", "(_", "url_", ")_", "._", "netloc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cookie_", "=_", "cache_", "._", "get_", "(_", "cloudf", "lar", "e", "Cookie_", ",_", "168_", ",_", "u_", ",_", "post_", ",_", "headers_", ",_", "mobile_", ",_", "safe_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "cookie_", "=_", "cookie_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ",_", "mobile_", "=_", "mobile_", ",_", "safe_", "=_", "safe_", ",_", "timeout_", "=_", "timeout_", ",_", "output_", "=_", "'", "response", "'_", ",_", "error_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "result_", "[_", "0_", "]_", "==_", "'", "503", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "agent_", "=_", "cache_", "._", "get_", "(_", "cloudf", "lar", "e", "Agent_", ",_", "0_", ")_", ";_", "headers_", "[_", "'", "User", "-", "Agent", "'_", "]_", "=_", "agent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cookie_", "=_", "cache_", "._", "get_", "(_", "cloudf", "lar", "e", "Cookie_", ",_", "0_", ",_", "u_", ",_", "post_", ",_", "headers_", ",_", "mobile_", ",_", "safe_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "cookie_", "=_", "cookie_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ",_", "mobile_", "=_", "mobile_", ",_", "safe_", "=_", "safe_", ",_", "timeout_", "=_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "result_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "('", "[", "cloudf", "lar", "e", "]", " ", "result", " ", " ", "%", "s", "'", " ", "%", " ", "result", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cloudf", "lar", "e", "Cookie_", "(_", "url_", ",_", "post_", ",_", "headers_", ",_", "mobile_", ",_", "safe_", ",_", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ",_", "mobile_", "=_", "mobile_", ",_", "safe_", "=_", "safe_", ",_", "timeout_", "=_", "timeout_", ",_", "error_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "jsc", "hl_", "=_", "re_", "._", "compile_", "(_", "'", "name", "=\"", "jsc", "hl", "\\u", "vc", "\"", " ", "value", "=\"(.+?)\"", "/>'_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "init_", "=_", "re_", "._", "compile_", "(_", "'", "set", "Time", "out", "\\\\(", "function", "\\\\(\\\\", "){", "\\\\", "s", "*.", "*?", ".*", ":(", ".*?)", "};", "'_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "re_", "._", "compile_", "(_", "r", "\"", "chall", "enge", "-", "form", "\\\\'\\\\", ");", "\\\\", "s", "*(.", "*)", "a", ".", "v", "\"_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decrypt", "Val_", "=_", "parse", "JS", "String_", "(_", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "builder_", "._", "split_", "(_", "';'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "line_", ")_", ">_", "0_", "and_", "'='_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sections_", "=_", "line_", "._", "split_", "(_", "'='_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "\\u", "val_", "=_", "parse", "JS", "String_", "(_", "sections_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decrypt", "Val_", "=_", "int_", "(_", "eval_", "(_", "str_", "(_", "decrypt", "Val_", ")_", "+_", "sections_", "[_", "0_", "]_", "[_", "-_", "1_", "]_", "+_", "str_", "(_", "line", "\\u", "val_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "answer_", "=_", "decrypt", "Val_", "+_", "len_", "(_", "urlparse_", "._", "urlparse_", "(_", "url_", ")_", "._", "netloc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "'%", "s", "/", "cdn", "-", "cgi", "/", "l", "/", "chk", "\\u", "jsc", "hl", "?", "jsc", "hl", "\\u", "vc", "=", "%", "s", "&", "jsc", "hl", "\\u", "answer", "=", "%", "s", "'_", "%_", "(_", "url_", ",_", "jsc", "hl_", ",_", "answer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "type", "=\"", "hidden", "\"", " ", "name", "=\"", "pass", "\"'_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass", "val_", "=_", "re_", "._", "compile_", "(_", "'", "name", "=\"", "pass", "\"", " ", "value", "=\"(", ".*?)", "\"'_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "'%", "s", "/", "cdn", "-", "cgi", "/", "l", "/", "chk", "\\u", "jsc", "hl", "?", "pass", "=", "%", "s", "&", "jsc", "hl", "\\u", "vc", "=", "%", "s", "&", "jsc", "hl", "\\u", "answer", "=", "%", "s", "'_", "%_", "(_", "url_", ",_", "urllib_", "._", "quote", "\\u", "plus_", "(_", "pass", "val_", ")_", ",_", "jsc", "hl_", ",_", "answer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cookie_", "=_", "client_", "._", "request_", "(_", "query_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ",_", "mobile_", "=_", "mobile_", ",_", "safe_", "=_", "safe_", ",_", "timeout_", "=_", "timeout_", ",_", "output_", "=_", "'", "cookie", "'_", ",_", "error_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "JS", "String_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "1_", "if_", "s_", "[_", "0_", "]_", "==_", "'+'_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "int_", "(_", "eval_", "(_", "s_", "._", "replace_", "(_", "'!", "+[", "]'_", ",_", "'", "1", "'_", ")_", "._", "replace_", "(_", "'!", "![", "]'_", ",_", "'", "1", "'_", ")_", "._", "replace_", "(_", "'[]'_", ",_", "'", "0", "'_", ")_", "._", "replace_", "(_", "'('_", ",_", "'", "str", "('_", ")_", "[_", "offset_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 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, 0, 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, 0, 1, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2 ]
Unused local variable
graphql-python/graphene/graphene/contrib/sqlalchemy/tests/test_schema.py
[ { "content": "def test_should_raise_if_no_model():\n with raises(Exception) as excinfo:\n class Character1(SQLAlchemyObjectType):\n pass\n assert 'model in the Meta' in str(excinfo.value)", "metadata": "root.test_should_raise_if_no_model", "header": "['module', '___EOS___']", "index": 8 }, { "content": "def test_should_raise_if_model_is_invalid():\n with raises(Exception) as excinfo:\n class Character2(SQLAlchemyObjectType):\n\n class Meta:\n model = 1\n assert 'not a SQLAlchemy model' in str(excinfo.value)", "metadata": "root.test_should_raise_if_model_is_invalid", "header": "['module', '___EOS___']", "index": 15 } ]
[ { "span": "Character1(", "start_line": 10, "start_column": 14, "end_line": 10, "end_column": 24 }, { "span": "Character2(", "start_line": 17, "start_column": 14, "end_line": 17, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "raise", "\\u", "if", "\\u", "no", "\\u", "model_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "raises_", "(_", "Exception_", ")_", "as_", "excinfo_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Char", "acte", "r1_", "(_", "SQL", "Al", "chem", "y", "Object", "Type_", ")_", ":_", "\\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_", "assert_", "'", "model", " ", "in", " ", "the", " ", "Meta", "'_", "in_", "str_", "(_", "excinfo_", "._", "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", "shou", "ld", "\\u", "raise", "\\u", "if", "\\u", "model", "\\u", "is", "\\u", "invalid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "raises_", "(_", "Exception_", ")_", "as_", "excinfo_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Char", "acte", "r2_", "(_", "SQL", "Al", "chem", "y", "Object", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "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_", "assert_", "'", "not", " ", "a", " ", "SQL", "Al", "chem", "y", " ", "model", "'_", "in_", "str_", "(_", "excinfo_", "._", "value_", ")_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
openworm/PyOpenWorm/tests/MiscTest.py
[ { "content": "# -*- coding: utf-8 -*-\nimport sys\nsys.path.insert(0,\".\")\nimport unittest\nimport neuroml\nimport neuroml.writers as writers\nimport PyOpenWorm\nfrom PyOpenWorm import *\nimport networkx\nimport rdflib\nimport rdflib as R\nimport pint as Q\nimport os\nimport subprocess as SP\nimport subprocess\nimport tempfile\nimport doctest\n\nfrom glob import glob\n\nfrom GraphDBInit import *\n\nfrom DataTestTemplate import _DataTest\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MiscTest(_DataTest):\n \"\"\"Miscellaneous tests that have cropped up\"\"\"", "metadata": "root.MiscTest", "header": "['module', '___EOS___']", "index": 24 }, { "content": " @unittest.expectedFailure\n def test_generators_do_not_reset(self):\n \"\"\"\n This is for issue #175. For some reason,\n the generators were being reset when called,\n meaning that the second call to len(list(neurons))\n below returned 0.\n \"\"\"\n\n net = Worm().neuron_network()\n neurons = net.neuron_names()\n check1 = len(list(neurons))\n check2 = len(list(neurons))\n self.assertEqual(check1, check2)", "metadata": "root.MiscTest.test_generators_do_not_reset", "header": "['class', 'MiscTest', '(', '_DataTest', ')', ':', '___EOS___']", "index": 26 } ]
[ { "span": "import neuroml", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 14 }, { "span": "import neuroml.writers as writers", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 33 }, { "span": "import PyOpenWorm", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 17 }, { "span": "import networkx", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 15 }, { "span": "import rdflib", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 13 }, { "span": "import rdflib as R", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 18 }, { "span": "import pint as Q", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 16 }, { "span": "import os", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 9 }, { "span": "import subprocess as SP", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 23 }, { "span": "import subprocess", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 17 }, { "span": "import tempfile", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 15 }, { "span": "import doctest", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 14 }, { "span": "from glob import glob", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "\".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "neuro", "ml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "neuro", "ml_", "._", "writers_", "as_", "writers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Py", "Open", "Wor", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Py", "Open", "Wor", "m_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "networkx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rdflib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rdflib_", "as_", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pint", "_", "as_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "as_", "SP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "doctest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "glob_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Graph", "DB", "Init_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Data", "Test", "Template_", "import_", "\\u", "Data", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Mis", "c", "Test_", "(_", "\\u", "Data", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Mis", "cell", "ane", "ous", " ", "tests", " ", "tha", "t", " ", "have", " ", "cropped", " ", "up", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mis", "c", "Test_", "(_", "\\u", "Data", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "unittest_", "._", "expected", "Failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "generat", "ors", "\\u", "do", "\\u", "not", "\\u", "reset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "for", " ", "issue", " ", "#", "175", ".", " ", " ", "For", " ", "some", " ", "reason", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "generat", "ors", " ", "wer", "e", " ", "bei", "ng", " ", "reset", " ", "whe", "n", " ", "call", "ed", ",", "\\", "10", ";", " ", " ", " ", " ", "meaning", " ", "tha", "t", " ", "the", " ", "second", " ", "call", " ", "to", " ", "len", "(", "list", "(", "neuro", "ns", "))\\", "10", ";", " ", " ", " ", " ", "belo", "w", " ", "return", "ed", " ", "0.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "net_", "=_", "Wor", "m_", "(_", ")_", "._", "neuro", "n", "\\u", "network_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neurons_", "=_", "net_", "._", "neuro", "n", "\\u", "names_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "check", "1_", "=_", "len_", "(_", "list_", "(_", "neurons_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "check", "2_", "=_", "len_", "(_", "list_", "(_", "neurons_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "check", "1_", ",_", "check", "2_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
sshwsfc/xadmin/xadmin/views/list.py
[ { "content": " def get_model_method_fields(self):\n \"\"\"\n Return the fields info defined in model. use FakeMethodField class wrap method as a db field.\n \"\"\"\n methods = []\n for name in dir(self):\n try:\n if getattr(getattr(self, name), 'is_column', False):\n methods.append((name, getattr(self, name)))\n except:\n pass\n return [FakeMethodField(name, getattr(method, 'short_description', capfirst(name.replace('_', ' '))))\n for name, method in methods]", "metadata": "root.ListAdminView.get_model_method_fields", "header": "['class', 'ListAdminView', '(', 'ModelAdminView', ')', ':', '___EOS___']", "index": 352 } ]
[ { "span": "except:", "start_line": 361, "start_column": 12, "end_line": 361, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "List", "Admi", "n", "View_", "(_", "Model", "Admi", "n", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "model", "\\u", "method", "\\u", "fields_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "fields", " ", "info", " ", "defin", "ed", " ", "in", " ", "model", ".", " ", "use", " ", "Fake", "Meth", "od", "Field", " ", "class", " ", "wrap", " ", "method", " ", "as", " ", "a", " ", "db", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "methods_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "dir_", "(_", "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 ", " _", "if_", "getattr_", "(_", "getattr_", "(_", "self_", ",_", "name_", ")_", ",_", "'", "is", "\\u", "column", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "methods_", "._", "append_", "(_", "(_", "name_", ",_", "getattr_", "(_", "self_", ",_", "name_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "Fake", "Meth", "od", "Field_", "(_", "name_", ",_", "getattr_", "(_", "method_", ",_", "'", "short", "\\u", "description", "'_", ",_", "cap", "first_", "(_", "name_", "._", "replace_", "(_", "'\\u'_", ",_", "'", " ", "'_", ")_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", ",_", "method_", "in_", "methods_", "]_", "\\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, 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 ]
Unused import
ooici/pyon/pyon/datastore/couchbase/datastore.py
[ { "content": "#!/usr/bin/env python\n\n__author__ = 'Michael Meisinger, Seman Said'\n\nfrom pyon.core.bootstrap import get_obj_registry, CFG\nfrom pyon.core.object import IonObjectBase, IonObjectSerializer, IonObjectDeserializer\nfrom pyon.datastore.datastore import DataStore\nfrom pyon.datastore.couchdb.pyon_store import PyonCouchDataStoreMixin\nfrom pyon.datastore.couchbase.base_store import CouchbaseDataStore\nfrom pyon.util.log import log\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CouchbasePyonDataStore(CouchbaseDataStore, PyonCouchDataStoreMixin):\n \"\"\"\n Pyon specialization of Couchbase datastore.\n This class adds IonObject handling to the underlying base datastore.\n \"\"\"", "metadata": "root.CouchbasePyonDataStore", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, datastore_name=None, profile=None, config=None, scope=None, **kwargs):\n log.debug('__init__(datastore_name=%s, profile=%s, config=%s)', datastore_name, profile, config)\n\n CouchbaseDataStore.__init__(self, datastore_name=datastore_name,\n config=config or CFG.get_safe(\"server.couchdb\"),\n profile=profile or DataStore.DS_PROFILE.BASIC,\n scope=scope)\n\n # IonObject Serializers\n self._io_serializer = IonObjectSerializer()\n self._io_deserializer = IonObjectDeserializer(obj_registry=get_obj_registry())", "metadata": "root.CouchbasePyonDataStore.__init__", "header": "['class', 'CouchbasePyonDataStore', '(', 'CouchbaseDataStore', ',', 'PyonCouchDataStoreMixin', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "from pyon.core.object import IonObjectBase, IonObjectSerializer, IonObjectDeserializer", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 86 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "Mich", "ael", " ", "Me", "ising", "er", ",", " ", "Sem", "an", " ", "Sai", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyo", "n_", "._", "core_", "._", "bootstrap_", "import_", "get", "\\u", "obj", "\\u", "registry_", ",_", "CFG_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "core_", "._", "object_", "import_", "Io", "n", "Object", "Base_", ",_", "Io", "n", "Object", "Serializer_", ",_", "Io", "n", "Object", "Deserializ", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "datastore_", "._", "datastore_", "import_", "Data", "Store_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "datastore_", "._", "couchdb", "_", "._", "pyo", "n", "\\u", "store_", "import_", "Py", "on", "Cou", "ch", "Data", "Stor", "e", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "datastore_", "._", "couch", "base_", "._", "base", "\\u", "store_", "import_", "Cou", "ch", "base", "Data", "Store_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyo", "n_", "._", "util_", "._", "log_", "import_", "log_", "\\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_", "Cou", "ch", "base", "Py", "on", "Data", "Store_", "(_", "Cou", "ch", "base", "Data", "Store_", ",_", "Py", "on", "Cou", "ch", "Data", "Stor", "e", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Py", "on", " ", "special", "izatio", "n", " ", "of", " ", "Cou", "ch", "base", " ", "datast", "ore", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "adds", " ", "Io", "n", "Object", " ", "handling", " ", "to", " ", "the", " ", "underl", "ying", " ", "base", " ", "datast", "ore", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cou", "ch", "base", "Py", "on", "Data", "Store_", "(_", "Cou", "ch", "base", "Data", "Store_", ",_", "Py", "on", "Cou", "ch", "Data", "Stor", "e", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "datast", "ore", "\\u", "name_", "=_", "None_", ",_", "profile_", "=_", "None_", ",_", "config_", "=_", "None_", ",_", "scope_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'\\u", "\\u", "init", "\\u\\u", "(", "datast", "ore", "\\u", "name", "=", "%", "s", ",", " ", "profile", "=", "%", "s", ",", " ", "config", "=", "%", "s", ")'_", ",_", "datast", "ore", "\\u", "name_", ",_", "profile_", ",_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Cou", "ch", "base", "Data", "Store_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "datast", "ore", "\\u", "name_", "=_", "datast", "ore", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "config_", "or_", "CFG_", "._", "get", "\\u", "safe_", "(_", "\"", "server", ".", "couchdb", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "profile_", "=_", "profile_", "or_", "Data", "Store_", "._", "DS", "\\u", "PROFILE", "_", "._", "BASIC", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scope_", "=_", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Io", "n", "Object", " ", "Seriali", "zer", "s_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "io", "\\u", "serializer_", "=_", "Io", "n", "Object", "Serializer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "io", "\\u", "deserializer_", "=_", "Io", "n", "Object", "Deserializ", "er_", "(_", "obj", "\\u", "registry_", "=_", "get", "\\u", "obj", "\\u", "registry_", "(_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
SalesforceEng/Providence/repos/github.py
[ { "content": " def processCommits(self, commits, commit_started_callback, patch_callback, commit_finished_callback):\n if commits is None:\n return None\n\n # Process oldest first\n commits = commits[::-1]\n logger.debug(\"process %d commits\", len(commits))\n for github_commit in commits:\n logger.debug(\"sha: %s\", github_commit.sha)\n if github_commit.sha:\n github_commit = self._github_repo.commit(github_commit.sha)\n\n repo_commit = RepoCommit();\n repo_commit.url = github_commit.html_url\n repo_commit.repo_source = self\n\n if github_commit.date is not None:\n self._last_date = dateutil.parser.parse(github_commit.date)\n\n repo_commit.date = self._last_date\n self._last_date += datetime.timedelta(seconds=1)\n repo_commit.identifier = self._last_date.isoformat()\n\n repo_commit.committer_email = github_commit.committer_email\n repo_commit.committer_name = github_commit.committer_name\n repo_commit.username = github_commit.committer_login\n repo_commit.message = github_commit.message\n \n repo_commit.sha = github_commit.sha\n commit_started_callback(repo_commit)\n\n if github_commit.files:\n for file_info in github_commit.files:\n if file_info.get('patch'):\n filename = committer_username = None\n diff = DiffParser(file_info['patch'])\n repo_patch = RepoPatch(repo_commit=repo_commit)\n repo_patch.diff = diff\n repo_patch.filename = file_info.get(\"filename\")\n patch_callback(repo_patch)\n\n commit_finished_callback(repo_commit)\n logger.debug(\"batch fof files processed\")\n logger.debug(\"done\")", "metadata": "root.GithubSource.processCommits", "header": "['class', 'GithubSource', '(', 'RepoSource', ')', ':', '___EOS___']", "index": 59 } ]
[ { "span": "filename ", "start_line": 93, "start_column": 32, "end_line": 93, "end_column": 40 }, { "span": "committer_username ", "start_line": 93, "start_column": 43, "end_line": 93, "end_column": 61 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Git", "hub", "Source_", "(_", "Rep", "o", "Source_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "Commi", "ts_", "(_", "self_", ",_", "commits_", ",_", "commit", "\\u", "start", "ed", "\\u", "callback_", ",_", "patch", "\\u", "callback_", ",_", "commit", "\\u", "finish", "ed", "\\u", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "commits_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Process", " ", "oldest", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "commits_", "=_", "commits_", "[_", ":_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "debug_", "(_", "\"", "process", " ", "%", "d", " ", "commit", "s", "\"_", ",_", "len_", "(_", "commits_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "git", "hub", "\\u", "commit_", "in_", "commits_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "sha", ":", " ", "%", "s", "\"_", ",_", "git", "hub", "\\u", "commit_", "._", "sha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "git", "hub", "\\u", "commit_", "._", "sha_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "git", "hub", "\\u", "commit_", "=_", "self_", "._", "\\u", "git", "hub", "\\u", "repo_", "._", "commit_", "(_", "git", "hub", "\\u", "commit_", "._", "sha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "repo", "\\u", "commit_", "=_", "Rep", "o", "Commit_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "commit_", "._", "url_", "=_", "git", "hub", "\\u", "commit_", "._", "html", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "commit_", "._", "repo", "\\u", "source_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "git", "hub", "\\u", "commit_", "._", "date_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "last", "\\u", "date_", "=_", "dateutil_", "._", "parser_", "._", "parse_", "(_", "git", "hub", "\\u", "commit_", "._", "date_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "repo", "\\u", "commit_", "._", "date_", "=_", "self_", "._", "\\u", "last", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "last", "\\u", "date_", "+=_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "commit_", "._", "identifier_", "=_", "self_", "._", "\\u", "last", "\\u", "date_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "repo", "\\u", "commit_", "._", "committer", "\\u", "email_", "=_", "git", "hub", "\\u", "commit_", "._", "committer", "\\u", "email_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "commit_", "._", "committer", "\\u", "name_", "=_", "git", "hub", "\\u", "commit_", "._", "committer", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "commit_", "._", "username_", "=_", "git", "hub", "\\u", "commit_", "._", "committer", "\\u", "login_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "commit_", "._", "message_", "=_", "git", "hub", "\\u", "commit_", "._", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "repo", "\\u", "commit_", "._", "sha_", "=_", "git", "hub", "\\u", "commit_", "._", "sha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "commit", "\\u", "start", "ed", "\\u", "callback_", "(_", "repo", "\\u", "commit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "git", "hub", "\\u", "commit_", "._", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "file", "\\u", "info_", "in_", "git", "hub", "\\u", "commit_", "._", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "file", "\\u", "info_", "._", "get_", "(_", "'", "patch", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "filename_", "=_", "committer", "\\u", "username_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "Diff", "Parser_", "(_", "file", "\\u", "info_", "[_", "'", "patch", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "patch_", "=_", "Rep", "o", "Patch_", "(_", "repo", "\\u", "commit_", "=_", "repo", "\\u", "commit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "patch_", "._", "diff_", "=_", "diff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repo", "\\u", "patch_", "._", "filename_", "=_", "file", "\\u", "info_", "._", "get_", "(_", "\"", "filename", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch", "\\u", "callback_", "(_", "repo", "\\u", "patch_", ")_", "\\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_", "commit", "\\u", "finish", "ed", "\\u", "callback_", "(_", "repo", "\\u", "commit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "debug_", "(_", "\"", "batch", " ", "fo", "f", " ", "files", " ", "process", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "debug_", "(_", "\"", "don", "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,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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 ]
Implicit string concatenation in a list
BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/functional/test_server_group.py
[ { "content": " def _get_weight_classes(self):\n return ['nova.scheduler.weights.affinity.'\n 'ServerGroupSoftAffinityWeigher',\n 'nova.scheduler.weights.affinity.'\n 'ServerGroupSoftAntiAffinityWeigher']", "metadata": "root.ServerGroupTestV215._get_weight_classes", "header": "['class', 'ServerGroupTestV215', '(', 'ServerGroupTestV2', ')', ':', '___EOS___']", "index": 565 } ]
[ { "span": "'nova.scheduler.weights.affinity.'\n 'ServerGroupSoftAffinityWeigher',", "start_line": 566, "start_column": 16, "end_line": 567, "end_column": 48 }, { "span": "'nova.scheduler.weights.affinity.'\n 'ServerGroupSoftAntiAffinityWeigher']", "start_line": 568, "start_column": 16, "end_line": 569, "end_column": 52 } ]
[]
1
true
[ "[CLS]_", "Implicit", "_", "string_", "concate", "nation_", "in_", "a_", "list_", "[SEP]_", "class_", "Server", "Group", "Test", "V2", "15_", "(_", "Server", "Group", "Test", "V2_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "weight", "\\u", "classes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "'", "nova", ".", "schedule", "r", ".", "weight", "s", ".", "affinity", ".'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Server", "Group", "Sof", "t", "Affi", "nit", "y", "Weig", "her", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nova", ".", "schedule", "r", ".", "weight", "s", ".", "affinity", ".'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Server", "Group", "Sof", "t", "Anti", "Affi", "nit", "y", "Weig", "her", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
'import *' may pollute namespace
babble/babble/include/jython/Lib/distutils/command/register.py
[ { "content": "\"\"\"distutils.command.register\n\nImplements the Distutils 'register' command (register with the repository).\n\"\"\"\n\n# created 2002/10/21, Richard Jones\n\n__revision__ = \"$Id: register.py 56542 2007-07-25 16:24:08Z martin.v.loewis $\"\n\nimport sys, os, string, urllib2, getpass, urlparse\nimport StringIO, ConfigParser\n\nfrom distutils.core import Command\nfrom distutils.errors import *\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from distutils.errors import *", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 30 } ]
[]
1
true
[ "[CLS]_", "'", "import", " ", "*'_", "may", "_", "poll", "ute", "_", "namespace_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "distutils", ".", "command", ".", "register", "\\", "10", ";", "\\", "10", ";", "Impl", "ement", "s", " ", "the", " ", "Dist", "util", "s", " ", "'", "register", "'", " ", "command", " ", "(", "register", " ", "with", " ", "the", " ", "repos", "itor", "y", ").", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "created", " ", "2002", "/", "10", "/", "21", ",", " ", "Rich", "ard", " ", "Jones", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "revision\\u\\u_", "=_", "\"$", "Id", ":", " ", "register", ".", "py", " ", "565", "4", "2", " ", "2007", "-0", "7", "-", "25", " ", "16", ":", "24", ":", "0", "8", "Z", " ", "mart", "in", ".", "v", ".", "lo", "ew", "is", " ", "$\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", ",_", "string_", ",_", "urllib2_", ",_", "getpass_", ",_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "String", "IO_", ",_", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "distutils_", "._", "core_", "import_", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "distutils_", "._", "errors_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
googlemaps/google-maps-services-python/googlemaps/distance_matrix.py
[ { "content": "#\n# Copyright 2014 Google Inc. All rights reserved.\n#\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# 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, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations under\n# the License.\n#\n\n\"\"\"Performs requests to the Google Maps Distance Matrix API.\"\"\"\n\nfrom googlemaps import convert\nfrom googlemaps.convert import as_list\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def distance_matrix(client, origins, destinations,\n mode=None, language=None, avoid=None, units=None,\n departure_time=None, arrival_time=None, transit_mode=None,\n transit_routing_preference=None, traffic_model=None):\n \"\"\" Gets travel distance and time for a matrix of origins and destinations.\n\n :param origins: One or more locations and/or latitude/longitude values,\n from which to calculate distance and time. If you pass an address as\n a string, the service will geocode the string and convert it to a\n latitude/longitude coordinate to calculate directions.\n :type origins: a single location, or a list of locations, where a\n location is a string, dict, list, or tuple\n\n :param destinations: One or more addresses and/or lat/lng values, to\n which to calculate distance and time. If you pass an address as a\n string, the service will geocode the string and convert it to a\n latitude/longitude coordinate to calculate directions.\n :type destinations: a single location, or a list of locations, where a\n location is a string, dict, list, or tuple\n\n :param mode: Specifies the mode of transport to use when calculating\n directions. Valid values are \"driving\", \"walking\", \"transit\" or\n \"bicycling\".\n :type mode: string\n\n :param language: The language in which to return results.\n :type language: string\n\n :param avoid: Indicates that the calculated route(s) should avoid the\n indicated features. Valid values are \"tolls\", \"highways\" or \"ferries\".\n :type avoid: string\n\n :param units: Specifies the unit system to use when displaying results.\n Valid values are \"metric\" or \"imperial\".\n :type units: string\n\n :param departure_time: Specifies the desired time of departure.\n :type departure_time: int or datetime.datetime\n\n :param arrival_time: Specifies the desired time of arrival for transit\n directions. Note: you can't specify both departure_time and\n arrival_time.\n :type arrival_time: int or datetime.datetime\n\n :param transit_mode: Specifies one or more preferred modes of transit.\n This parameter may only be specified for requests where the mode is\n transit. Valid values are \"bus\", \"subway\", \"train\", \"tram\", \"rail\".\n \"rail\" is equivalent to [\"train\", \"tram\", \"subway\"].\n :type transit_mode: string or list of strings\n\n :param transit_routing_preference: Specifies preferences for transit\n requests. Valid values are \"less_walking\" or \"fewer_transfers\".\n :type transit_routing_preference: string\n\n :param traffic_model: Specifies the predictive travel time model to use.\n Valid values are \"best_guess\" or \"optimistic\" or \"pessimistic\".\n The traffic_model parameter may only be specified for requests where\n the travel mode is driving, and where the request includes a\n departure_time.\n\n :rtype: matrix of distances. Results are returned in rows, each row\n containing one origin paired with each destination.\n \"\"\"\n\n params = {\n \"origins\": convert.location_list(origins),\n \"destinations\": convert.location_list(destinations)\n }\n\n if mode:\n # NOTE(broady): the mode parameter is not validated by the Maps API\n # server. Check here to prevent silent failures.\n if mode not in [\"driving\", \"walking\", \"bicycling\", \"transit\"]:\n raise ValueError(\"Invalid travel mode.\")\n params[\"mode\"] = mode\n\n if language:\n params[\"language\"] = language\n\n if avoid:\n if avoid not in [\"tolls\", \"highways\", \"ferries\"]:\n raise ValueError(\"Invalid route restriction.\")\n params[\"avoid\"] = avoid\n\n if units:\n params[\"units\"] = units\n\n if departure_time:\n params[\"departure_time\"] = convert.time(departure_time)\n\n if arrival_time:\n params[\"arrival_time\"] = convert.time(arrival_time)\n\n if departure_time and arrival_time:\n raise ValueError(\"Should not specify both departure_time and\"\n \"arrival_time.\")\n\n if transit_mode:\n params[\"transit_mode\"] = convert.join_list(\"|\", transit_mode)\n\n if transit_routing_preference:\n params[\"transit_routing_preference\"] = transit_routing_preference\n\n if traffic_model:\n params[\"traffic_model\"] = traffic_model\n\n return client._get(\"/maps/api/distancematrix/json\", params)", "metadata": "root.distance_matrix", "header": "['module', '___EOS___']", "index": 23 } ]
[ { "span": "from googlemaps.convert import as_list", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\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_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "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", ",", " ", "WITH", "OUT_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ation", "s", " ", "under", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Perform", "s", " ", "request", "s", " ", "to", " ", "the", " ", "Goo", "gle", " ", "Map", "s", " ", "Distan", "ce", " ", "Matrix", " ", "API", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google", "maps_", "import_", "convert_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "google", "maps_", "._", "convert_", "import_", "as", "\\u", "list_", "\\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_", "distance", "\\u", "matrix_", "(_", "client_", ",_", "origins", "_", ",_", "destinations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "None_", ",_", "language_", "=_", "None_", ",_", "avoid", "_", "=_", "None_", ",_", "units_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "departure", "\\u", "time_", "=_", "None_", ",_", "arrival", "\\u", "time_", "=_", "None_", ",_", "transit", "\\u", "mode_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transit", "\\u", "routin", "g", "\\u", "preference_", "=_", "None_", ",_", "traffic", "\\u", "model_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", "s", " ", "travel", " ", "distance", " ", "and", " ", "time", " ", "for", " ", "a", " ", "matrix", " ", "of", " ", "origins", " ", "and", " ", "destinat", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "origins", ":", " ", "One", " ", "or", " ", "more", " ", "location", "s", " ", "and", "/", "or", " ", "latitude", "/", "longitude", " ", "values", ",", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "whi", "ch", " ", "to", " ", "calcul", "ate", " ", "distance", " ", "and", " ", "time", ".", " ", "If", " ", "you", " ", "pass", " ", "an", " ", "address", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "string", ",", " ", "the", " ", "service", " ", "will", " ", "geocode", " ", "the", " ", "string", " ", "and", " ", "convert", " ", "it", " ", "to", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "latitude", "/", "longitude", " ", "coordinate", " ", "to", " ", "calcul", "ate", " ", "direction", "s", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "origins", ":", " ", "a", " ", "single", " ", "location", ",", " ", "or", " ", "a", " ", "list", " ", "of", " ", "location", "s", ",", " ", "where", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "location", " ", "is", " ", "a", " ", "string", ",", " ", "dict", ",", " ", "list", ",", " ", "or", " ", "tuple", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "destinat", "ion", "s", ":", " ", "One", " ", "or", " ", "more", " ", "addresse", "s", " ", "and", "/", "or", " ", "lat", "/", "ln", "g", " ", "values", ",", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "to", " ", "calcul", "ate", " ", "distance", " ", "and", " ", "time", ".", " ", "If", " ", "you", " ", "pass", " ", "an", " ", "address", " ", "as", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "string", ",", " ", "the", " ", "service", " ", "will", " ", "geocode", " ", "the", " ", "string", " ", "and", " ", "convert", " ", "it", " ", "to", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "latitude", "/", "longitude", " ", "coordinate", " ", "to", " ", "calcul", "ate", " ", "direction", "s", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "destinat", "ion", "s", ":", " ", "a", " ", "single", " ", "location", ",", " ", "or", " ", "a", " ", "list", " ", "of", " ", "location", "s", ",", " ", "where", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "location", " ", "is", " ", "a", " ", "string", ",", " ", "dict", ",", " ", "list", ",", " ", "or", " ", "tuple", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "mode", ":", " ", "Specifie", "s", " ", "the", " ", "mode", " ", "of", " ", "transport", " ", "to", " ", "use", " ", "whe", "n", " ", "calculati", "ng", "\\", "10", ";", " ", " ", " ", " ", "direction", "s", ".", " ", "Valid", " ", "values", " ", "are", " ", "\"", "dri", "ving", "\",", " ", "\"", "walking", "\",", " ", "\"", "transit", "\"", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "\"", "bic", "yc", "ling", "\".\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "mode", ":", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "language", ":", " ", "The", " ", "language", " ", "in", " ", "whi", "ch", " ", "to", " ", "return", " ", "results", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "language", ":", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "avoid", ":", " ", "Indicat", "es", " ", "tha", "t", " ", "the", " ", "calculated", " ", "route", "(", "s", ")", " ", "shou", "ld", " ", "avoid", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "indicat", "ed", " ", "features", ".", " ", "Valid", " ", "values", " ", "are", " ", "\"", "tol", "ls", "\",", " ", "\"", "highway", "s", "\"", " ", "or", " ", "\"", "ferr", "ies", "\".\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "avoid", ":", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "unit", "s", ":", " ", "Specifie", "s", " ", "the", " ", "unit", " ", "system", " ", "to", " ", "use", " ", "whe", "n", " ", "display", "ing", " ", "results", ".", "\\", "10", ";", " ", " ", " ", " ", "Valid", " ", "values", " ", "are", " ", "\"", "metric", "\"", " ", "or", " ", "\"", "imper", "ial", "\".\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "unit", "s", ":", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "departure", "\\u", "time", ":", " ", "Specifie", "s", " ", "the", " ", "desi", "red", " ", "time", " ", "of", " ", "departure", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "departure", "\\u", "time", ":", " ", "int", " ", "or", " ", "datetime", ".", "datetime", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "arrival", "\\u", "time", ":", " ", "Specifie", "s", " ", "the", " ", "desi", "red", " ", "time", " ", "of", " ", "arrival", " ", "for", " ", "transit", "\\", "10", ";", " ", " ", " ", " ", "direction", "s", ".", " ", "Not", "e", ":", " ", "you", " ", "can", "'", "t", " ", "speci", "fy", " ", "bot", "h", " ", "departure", "\\u", "time", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "arrival", "\\u", "time", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "arrival", "\\u", "time", ":", " ", "int", " ", "or", " ", "datetime", ".", "datetime", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "transit", "\\u", "mode", ":", " ", "Specifie", "s", " ", "one", " ", "or", " ", "more", " ", "prefer", "red", " ", "mode", "s", " ", "of", " ", "transit", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "parameter", " ", "may", " ", "only", " ", "be", " ", "specified", " ", "for", " ", "request", "s", " ", "where", " ", "the", " ", "mode", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "transit", ".", " ", "Valid", " ", "values", " ", "are", " ", "\"", "bus", "\",", " ", "\"", "subw", "ay", "\",", " ", "\"", "train", "\",", " ", "\"", "tram", "\",", " ", "\"", "rail", "\".\\", "10", ";", " ", " ", " ", " ", "\"", "rail", "\"", " ", "is", " ", "equivalent", " ", "to", " ", "[\"", "train", "\",", " ", "\"", "tram", "\",", " ", "\"", "subw", "ay", "\"]", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "transit", "\\u", "mode", ":", " ", "string", " ", "or", " ", "list", " ", "of", " ", "string", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "transit", "\\u", "routin", "g", "\\u", "preference", ":", " ", "Specifie", "s", " ", "preference", "s", " ", "for", " ", "transit", "\\", "10", ";", " ", " ", " ", " ", "request", "s", ".", " ", "Valid", " ", "values", " ", "are", " ", "\"", "less", "\\u", "walking", "\"", " ", "or", " ", "\"", "few", "er", "\\u", "transfers", "\".\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "transit", "\\u", "routin", "g", "\\u", "preference", ":", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "traffic", "\\u", "model", ":", " ", "Specifie", "s", " ", "the", " ", "predicti", "ve", " ", "travel", " ", "time", " ", "model", " ", "to", " ", "use", ".", "\\", "10", ";", " ", " ", " ", " ", "Valid", " ", "values", " ", "are", " ", "\"", "best", "\\u", "guess", "\"", " ", "or", " ", "\"", "optimis", "tic", "\"", " ", "or", " ", "\"", "pes", "simi", "stic", "\".\\", "10", ";", " ", " ", " ", " ", "The", " ", "traffic", "\\u", "model", " ", "parameter", " ", "may", " ", "only", " ", "be", " ", "specified", " ", "for", " ", "request", "s", " ", "where", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "travel", " ", "mode", " ", "is", " ", "dri", "ving", ",", " ", "and", " ", "where", " ", "the", " ", "request", " ", "include", "s", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "departure", "\\u", "time", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "matrix", " ", "of", " ", "distance", "s", ".", " ", "Result", "s", " ", "are", " ", "return", "ed", " ", "in", " ", "rows", ",", " ", "each", " ", "row", "\\", "10", ";", " ", " ", " ", " ", "contain", "ing", " ", "one", " ", "orig", "in", " ", "paired", " ", "with", " ", "each", " ", "destinat", "ion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "origins", "\"_", ":_", "convert_", "._", "location", "\\u", "list_", "(_", "origins", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "destinat", "ion", "s", "\"_", ":_", "convert_", "._", "location", "\\u", "list_", "(_", "destinations_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", "(", "broad", "y", "):", " ", "the", " ", "mode", " ", "parameter", " ", "is", " ", "not", " ", "validat", "ed", " ", "by", " ", "the", " ", "Map", "s", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "server", ".", " ", "Check", " ", "here", " ", "to", " ", "prevent", " ", "sile", "nt", " ", "fail", "ure", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mode_", "not_", "in_", "[_", "\"", "dri", "ving", "\"_", ",_", "\"", "walking", "\"_", ",_", "\"", "bic", "yc", "ling", "\"_", ",_", "\"", "transit", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "travel", " ", "mode", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "params_", "[_", "\"", "mode", "\"_", "]_", "=_", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "language_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "language", "\"_", "]_", "=_", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "avoid", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "avoid", "_", "not_", "in_", "[_", "\"", "tol", "ls", "\"_", ",_", "\"", "highway", "s", "\"_", ",_", "\"", "ferr", "ies", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "route", " ", "restriction", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "params_", "[_", "\"", "avoid", "\"_", "]_", "=_", "avoid", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "units_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "unit", "s", "\"_", "]_", "=_", "units_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "departure", "\\u", "time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "departure", "\\u", "time", "\"_", "]_", "=_", "convert_", "._", "time_", "(_", "departure", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "arrival", "\\u", "time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "arrival", "\\u", "time", "\"_", "]_", "=_", "convert_", "._", "time_", "(_", "arrival", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "departure", "\\u", "time_", "and_", "arrival", "\\u", "time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Sho", "ul", "d", " ", "not", " ", "speci", "fy", " ", "bot", "h", " ", "departure", "\\u", "time", " ", "and", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "arrival", "\\u", "time", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "transit", "\\u", "mode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "transit", "\\u", "mode", "\"_", "]_", "=_", "convert_", "._", "join", "\\u", "list_", "(_", "\"|\"_", ",_", "transit", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "transit", "\\u", "routin", "g", "\\u", "preference_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "transit", "\\u", "routin", "g", "\\u", "preference", "\"_", "]_", "=_", "transit", "\\u", "routin", "g", "\\u", "preference_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "traffic", "\\u", "model_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "\"", "traffic", "\\u", "model", "\"_", "]_", "=_", "traffic", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "client_", "._", "\\u", "get_", "(_", "\"/", "maps", "/", "api", "/", "distance", "matrix", "/", "json", "\"_", ",_", "params_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
Bookworm-project/BookwormDB/bookwormDB/CreateDatabase.py
[ { "content": " def connect(self, setengine=True):\n #These scripts run as the Bookworm _Administrator_ on this machine; defined by the location of this my.cnf file.\n self.conn = MySQLdb.connect(read_default_file=\"~/.my.cnf\",use_unicode='True', charset='utf8', db='', local_infile=1)\n cursor = self.conn.cursor()\n cursor.execute(\"CREATE DATABASE IF NOT EXISTS %s\" % self.dbname)\n #Don't use native query attribute here to avoid infinite loops\n cursor.execute(\"SET NAMES 'utf8'\")\n cursor.execute(\"SET CHARACTER SET 'utf8'\")\n if setengine:\n try:\n cursor.execute(\"SET default_storage_engine=MYISAM\")\n except:\n logging.error(\"Forcing default engine failed. On some versions of Mysql,\\\n you may need to add \\\"default-storage-engine=MYISAM\\\" manually\\\n to the [mysqld] user in /etc/my.cnf. Trying again to connect...\")\n self.connect(setengine=False) \n logging.debug(\"Connecting to %s\" % self.dbname)\n cursor.execute(\"USE %s\" % self.dbname)", "metadata": "root.DB.connect", "header": "['class', 'DB', ':', '___EOS___']", "index": 71 }, { "content": " def query(self, sql):\n \"\"\"\n Billy defined a separate query method here so that the common case of a connection being\n timed out doesn't cause the whole shebang to fall apart: instead, it just reboots\n the connection and starts up nicely again.\n \"\"\"\n logging.debug(\" -- Preparing to execute SQL code -- \" + sql)\n try:\n cursor = self.conn.cursor()\n cursor.execute(sql)\n except:\n try:\n self.connect()\n cursor = self.conn.cursor()\n cursor.execute(sql)\n except:\n logging.error(\"Query failed: \\n\" + sql + \"\\n\")\n raise\n return cursor", "metadata": "root.DB.query", "header": "['class', 'DB', ':', '___EOS___']", "index": 91 }, { "content": " def create_database(self):\n dbname = self.dbname\n dbuser = self.dbuser\n dbpassword = self.dbpassword\n db = self.db\n #This must be run as a MySQL user with create_table privileges\n try:\n db.query(\"CREATE DATABASE \" + dbname)\n except:\n logging.info(\"Database %s already exists: that might be intentional, so not dying\" % dbname)\n\n \"Setting up permissions for web user...\"\n db.query(\"GRANT SELECT ON \" + dbname + \".*\" + \" TO '\" + dbuser + \"'@'localhost' IDENTIFIED BY '\" + dbpassword + \"'\")\n db.query(\"FLUSH PRIVILEGES\")\n try:\n #a field to store stuff we might need later.\n db.query(\"CREATE TABLE IF NOT EXISTS bookworm_information (entry VARCHAR(255), PRIMARY KEY (entry), value VARCHAR(50000))\")\n except:\n raise", "metadata": "root.BookwormSQLDatabase.create_database", "header": "['class', 'BookwormSQLDatabase', ':', '___EOS___']", "index": 185 }, { "content": " def reloadMemoryTables(self,force=False):\n \"\"\"\n Checks to see if memory tables need to be repopulated (by seeing if they are empty)\n and then does so if necessary.\n \"\"\"\n existingCreateCodes = self.db.query(\"SELECT tablename,memoryCode FROM masterTableTable\").fetchall();\n for row in existingCreateCodes:\n \"\"\"\n For each table, it checks to see if the table is currently populated; if not,\n it runs the stored code to repopulate the table. (It checks length because\n memory tables are emptied on a restart).\n \"\"\"\n tablename = row[0]\n try:\n cursor = self.db.query(\"SELECT count(*) FROM %s\" %(tablename))\n currentLength = cursor.fetchall()[0][0]\n logging.debug(\"Current Length is %d\" %currentLength)\n except:\n currentLength = 0\n if currentLength==0 or force:\n for query in splitMySQLcode(row[1]):\n self.db.query(query)", "metadata": "root.BookwormSQLDatabase.reloadMemoryTables", "header": "['class', 'BookwormSQLDatabase', ':', '___EOS___']", "index": 304 }, { "content": " def jsonify_data(self):\n variables = self.variableSet.variables\n dbname = self.dbname\n #This creates a JSON file compliant with the Bookworm web site.\n #Deprecated.\n output = dict()\n output['settings'] = {\n \"dbname\": self.dbname,\n \"itemName\":\" text\",\n \"sourceName\": self.dbname,\n \"sourceURL\": self.dbname\n }\n ui_components = [\n {\n \"type\":\"text\",\n \"dbfield\":\"word\",\n \"name\":\"Word(s)\"\n }\n ]\n for variable in variables:\n newdict = variable.jsonDict()\n if newdict: #(It can be empty, in which case we don't want it for the json)\n ui_components.append(newdict)\n try:\n mytime = [variable.field for variable in variables if variable.datatype=='time'][0]\n output['default_search'] = [\n {\n \"search_limits\": [{\"word\":[\"test\"]}],\n \"time_measure\": mytime,\n \"words_collation\": \"Case_Sensitive\",\n \"counttype\": \"Occurrences_per_Million_Words\",\n \"smoothingSpan\": 0\n }\n ]\n except:\n logging.warning(\"WARNING: Not enough info for a default search (like, no time variable maybe?)--likely to be some big problems with your bookworm.\")\n output['ui_components'] = ui_components\n outfile = open('.bookworm/%s.json' % dbname, 'w')\n outfile.write(json.dumps(output))", "metadata": "root.BookwormSQLDatabase.jsonify_data", "header": "['class', 'BookwormSQLDatabase', ':', '___EOS___']", "index": 354 }, { "content": " def create_API_settings(self):\n db = self.db\n try:\n db.query(\"DROP TABLE IF EXISTS API_settings\")\n db.query(\"CREATE TABLE API_settings (settings VARCHAR(8192));\")\n except:\n pass\n api_info = {\n \"HOST\": \"10.102.15.45\",\n \"database\": self.dbname,\n \"read_default_file\": \"/etc/mysql/my.cnf\",\n }\n addCode = json.dumps(api_info)\n logging.info(addCode)\n db.query(\"INSERT INTO API_settings VALUES ('%s');\" % addCode)", "metadata": "root.BookwormSQLDatabase.create_API_settings", "header": "['class', 'BookwormSQLDatabase', ':', '___EOS___']", "index": 394 } ]
[ { "span": "except:", "start_line": 82, "start_column": 12, "end_line": 82, "end_column": 19 }, { "span": "except:", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 15 }, { "span": "except:", "start_line": 193, "start_column": 8, "end_line": 193, "end_column": 15 }, { "span": "except:", "start_line": 321, "start_column": 12, "end_line": 321, "end_column": 19 }, { "span": "except:", "start_line": 388, "start_column": 8, "end_line": 388, "end_column": 15 }, { "span": "except:", "start_line": 399, "start_column": 8, "end_line": 399, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "DB_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connect_", "(_", "self_", ",_", "sete", "ngin", "e_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "The", "se", " ", "scripts", " ", "run", " ", "as", " ", "the", " ", "Boo", "kw", "orm", " ", "\\u", "Administra", "tor", "\\u", " ", "on", " ", "this", " ", "machine", ";", " ", "defin", "ed", " ", "by", " ", "the", " ", "location", " ", "of", " ", "this", " ", "my", ".", "cnf", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "conn_", "=_", "My", "SQL", "db_", "._", "connect_", "(_", "read", "\\u", "default", "\\u", "file_", "=_", "\"~/", ".", "my", ".", "cnf", "\"_", ",_", "use", "\\u", "unicode_", "=_", "'", "Tru", "e", "'_", ",_", "charset_", "=_", "'", "utf", "8", "'_", ",_", "db_", "=_", "''_", ",_", "local", "\\u", "infile_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "self_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "\"", "CREATE", " ", "DATA", "BASE", " ", "IF", " ", "NOT", " ", "EXIST", "S", " ", "%", "s", "\"_", "%_", "self_", "._", "dbname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Don", "'", "t", " ", "use", " ", "nativ", "e", " ", "query", " ", "attribute", " ", "here", " ", "to", " ", "avoid", " ", "infini", "te", " ", "loops_", "\\u\\u\\uNL\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "\"", "SET", " ", "NAMES", " ", "'", "utf", "8", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "\"", "SET", " ", "CHARACTER", " ", "SET", " ", "'", "utf", "8", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sete", "ngin", "e_", ":_", "\\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 ", " _", "cursor_", "._", "execute_", "(_", "\"", "SET", " ", "default", "\\u", "storage", "\\u", "eng", "ine", "=", "MY", "ISA", "M", "\"_", ")_", "\\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 ", " _", "logging_", "._", "error_", "(_", "\"", "For", "cing", " ", "default", " ", "eng", "ine", " ", "fail", "ed", ".", " ", "On", " ", "some", " ", "version", "s", " ", "of", " ", "Mys", "ql", ",\\\\", "\\", "10", ";", " ", " ", " ", " ", "you", " ", "may", " ", "need", " ", "to", " ", "add", " ", "\\\\\"", "default", "-", "storage", "-", "eng", "ine", "=", "MY", "ISA", "M", "\\\\\"", " ", "manu", "ally", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "[", "mysql", "d", "]", " ", "user", " ", "in", " ", "/", "etc", "/", "my", ".", "cnf", ".", " ", "Tr", "ying", " ", "again", " ", "to", " ", "connect", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connect_", "(_", "sete", "ngin", "e_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "Connect", "ing", " ", "to", " ", "%", "s", "\"_", "%_", "self_", "._", "dbname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "\"", "USE", " ", "%", "s", "\"_", "%_", "self_", "._", "dbname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DB_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query_", "(_", "self_", ",_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Bill", "y", " ", "defin", "ed", " ", "a", " ", "separate", " ", "query", " ", "method", " ", "here", " ", "so", " ", "tha", "t", " ", "the", " ", "common", " ", "case", " ", "of", " ", "a", " ", "connecti", "on", " ", "bei", "ng", "\\", "10", ";", " ", " ", " ", " ", "timed", " ", "out", " ", "doe", "sn", "'", "t", " ", "caus", "e", " ", "the", " ", "whole", " ", "she", "bang", " ", "to", " ", "fall", " ", "apart", ":", " ", "inst", "ead", ",", " ", "it", " ", "just", " ", "rebo", "ots", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "connecti", "on", " ", "and", " ", "starts", " ", "up", " ", "nice", "ly", " ", "again", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", " ", "--", " ", "Prepar", "ing", " ", "to", " ", "execute", " ", "SQL", " ", "code", " ", "--", " ", "\"_", "+_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", "=_", "self_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "sql_", ")_", "\\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 ", " _", "self_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "self_", "._", "conn_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "sql_", ")_", "\\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 ", " _", "logging_", "._", "error_", "(_", "\"", "Query", " ", "fail", "ed", ":", " ", "\\\\", "n", "\"_", "+_", "sql_", "+_", "\"\\\\", "n", "\"_", ")_", "\\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_", "cursor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "kw", "orm", "SQL", "Database_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "database_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbname_", "=_", "self_", "._", "dbname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbus", "er_", "=_", "self_", "._", "dbus", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbpa", "ssword", "_", "=_", "self_", "._", "dbpa", "ssword", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "self_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Thi", "s", " ", "must", " ", "be", " ", "run", " ", "as", " ", "a", " ", "My", "SQL", " ", "user", " ", "with", " ", "create", "\\u", "table", " ", "privilege", "s_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "query_", "(_", "\"", "CREATE", " ", "DATA", "BASE", " ", "\"_", "+_", "dbname_", ")_", "\\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 ", " _", "logging_", "._", "info_", "(_", "\"", "Databa", "se", " ", "%", "s", " ", "alr", "ead", "y", " ", "exist", "s", ":", " ", "tha", "t", " ", "mig", "ht", " ", "be", " ", "intent", "ional", ",", " ", "so", " ", "not", " ", "dy", "ing", "\"_", "%_", "dbname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"", "Sett", "ing", " ", "up", " ", "permissi", "ons", " ", "for", " ", "web", " ", "user", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "query_", "(_", "\"", "GRAN", "T", " ", "SELECT", " ", "ON", " ", "\"_", "+_", "dbname_", "+_", "\".*", "\"_", "+_", "\"", " ", "TO", " ", "'\"_", "+_", "dbus", "er_", "+_", "\"'", "@", "'", "local", "host", "'", " ", "IDENT", "IFIED", " ", "BY", " ", "'\"_", "+_", "dbpa", "ssword", "_", "+_", "\"'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "query_", "(_", "\"", "FLU", "SH", " ", "PRIV", "ILE", "GE", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "a", " ", "field", " ", "to", " ", "store", " ", "stu", "ff", " ", "we", " ", "mig", "ht", " ", "need", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "query_", "(_", "\"", "CREATE", " ", "TAB", "LE", " ", "IF", " ", "NOT", " ", "EXIST", "S", " ", "book", "worm", "\\u", "informati", "on", " ", "(", "entry", " ", "VARCHA", "R", "(", "255", "),", " ", "PRIMA", "RY", " ", "KEY", " ", "(", "entry", "),", " ", "value", " ", "VARCHA", "R", "(", "5000", "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 ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "kw", "orm", "SQL", "Database_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "relo", "ad", "Memo", "ry", "Tables_", "(_", "self_", ",_", "force_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", "s", " ", "to", " ", "see", " ", "if", " ", "memory", " ", "tables", " ", "need", " ", "to", " ", "be", " ", "repo", "pulat", "ed", " ", "(", "by", " ", "see", "ing", " ", "if", " ", "the", "y", " ", "are", " ", "empty", ")", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "then", " ", "doe", "s", " ", "so", " ", "if", " ", "necessar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exist", "ing", "Creat", "e", "Codes_", "=_", "self_", "._", "db_", "._", "query_", "(_", "\"", "SELECT", " ", "tablename", ",", "memory", "Code", " ", "FROM", " ", "master", "Table", "Table", "\"_", ")_", "._", "fetchall_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "exist", "ing", "Creat", "e", "Codes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "each", " ", "table", ",", " ", "it", " ", "checks", " ", "to", " ", "see", " ", "if", " ", "the", " ", "table", " ", "is", " ", "currentl", "y", " ", "populate", "d", ";", " ", "if", " ", "not", ",", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "runs", " ", "the", " ", "store", "d", " ", "code", " ", "to", " ", "repo", "pulat", "e", " ", "the", " ", "table", ".", " ", "(", "It", " ", "checks", " ", "length", " ", "bec", "aus", "e", "\\", "10", ";", " ", " ", " ", " ", "memory", " ", "tables", " ", "are", " ", "emp", "tied", " ", "on", " ", "a", " ", "restart", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tablename_", "=_", "row_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", "=_", "self_", "._", "db_", "._", "query_", "(_", "\"", "SELECT", " ", "count", "(*", ")", " ", "FROM", " ", "%", "s", "\"_", "%_", "(_", "tablename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Length_", "=_", "cursor_", "._", "fetchall_", "(_", ")_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "Curr", "ent", " ", "Length", " ", "is", " ", "%", "d", "\"_", "%_", "current", "Length_", ")_", "\\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 ", " _", "current", "Length_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "Length_", "==_", "0_", "or_", "force_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "query_", "in_", "split", "My", "SQL", "code_", "(_", "row_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "db_", "._", "query_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "kw", "orm", "SQL", "Database_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "json", "if", "y", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variables_", "=_", "self_", "._", "variab", "le", "Set_", "._", "variables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbname_", "=_", "self_", "._", "dbname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Thi", "s", " ", "create", "s", " ", "a", " ", "JSO", "N", " ", "file", " ", "compliant", " ", "with", " ", "the", " ", "Boo", "kw", "orm", " ", "web", " ", "site", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "Dep", "reca", "ted", "._", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "[_", "'", "settings", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "db", "name", "\"_", ":_", "self_", "._", "dbname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "item", "Name", "\"_", ":_", "\"", " ", "text", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "source", "Name", "\"_", ":_", "self_", "._", "dbname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "source", "URL", "\"_", ":_", "self_", "._", "dbname_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ui", "\\u", "components_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "text", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dbf", "iel", "d", "\"_", ":_", "\"", "word", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "\"", "Word", "(", "s", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "variable_", "in_", "variables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newdi", "ct_", "=_", "variable_", "._", "json", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "newdi", "ct_", ":_", "#(", "It", " ", "can", " ", "be", " ", "empty", ",", " ", "in", " ", "whi", "ch", " ", "case", " ", "we", " ", "don", "'", "t", " ", "want", " ", "it", " ", "for", " ", "the", " ", "json", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ui", "\\u", "components_", "._", "append_", "(_", "newdi", "ct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "myt", "ime_", "=_", "[_", "variable_", "._", "field_", "for_", "variable_", "in_", "variables_", "if_", "variable_", "._", "datatype_", "==_", "'", "time", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "[_", "'", "default", "\\u", "search", "'_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "search", "\\u", "limit", "s", "\"_", ":_", "[_", "{_", "\"", "word", "\"_", ":_", "[_", "\"", "test", "\"_", "]_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "time", "\\u", "measure", "\"_", ":_", "myt", "ime_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "words", "\\u", "collatio", "n", "\"_", ":_", "\"", "Case", "\\u", "Sensitiv", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "count", "type", "\"_", ":_", "\"", "Occurrence", "s", "\\u", "per", "\\u", "Milli", "on", "\\u", "Word", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "smoothing", "Span", "\"_", ":_", "0_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warning_", "(_", "\"", "WARN", "ING", ":", " ", "Not", " ", "eno", "ugh", " ", "info", " ", "for", " ", "a", " ", "default", " ", "search", " ", "(", "like", ",", " ", "no", " ", "time", " ", "variab", "le", " ", "may", "be", "?)", "--", "like", "ly", " ", "to", " ", "be", " ", "some", " ", "big", " ", "problem", "s", " ", "with", " ", "your", " ", "book", "worm", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output_", "[_", "'", "ui", "\\u", "component", "s", "'_", "]_", "=_", "ui", "\\u", "components_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "open_", "(_", "'.", "book", "worm", "/", "%", "s", ".", "json", "'_", "%_", "dbname_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "output_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Boo", "kw", "orm", "SQL", "Database_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "API", "\\u", "settings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "self_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "query_", "(_", "\"", "DROP", " ", "TAB", "LE", " ", "IF", " ", "EXIST", "S", " ", "API", "\\u", "settings", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "query_", "(_", "\"", "CREATE", " ", "TAB", "LE", " ", "API", "\\u", "settings", " ", "(", "settings", " ", "VARCHA", "R", "(", "819", "2", "))", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "api", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "HOST", "\"_", ":_", "\"", "10.1", "02", ".1", "5.4", "5", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "databa", "se", "\"_", ":_", "self_", "._", "dbname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "read", "\\u", "default", "\\u", "file", "\"_", ":_", "\"/", "etc", "/", "mysql", "/", "my", ".", "cnf", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "Code_", "=_", "json_", "._", "dumps_", "(_", "api", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "add", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "API", "\\u", "settings", " ", "VALU", "ES", " ", "('", "%", "s", "');", "\"_", "%_", "add", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 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 ]
Variable defined multiple times
DexterInd/GrovePi/Software/Python/grove_barometer_sensors/high_accuracy_hp206c_barometer/KalmanFilter.py
[ { "content": "\tdef Gaussian_Noise_Cov(self):\n\t\tindex = 0\n\t\ttmp=[0.0]*10\n\t\taverage = 0.0\n\t\tsum = 0.0\n\t\t\n\t\t#Get random number */\n\t\tfor i in range(10): \n\t\t\n\t\t\tindex = randint(0,90)\n\t\t\ttmp[i] = Rand_Table[index]\n\t\t\tsum += tmp[i];\t\n\t\t\n\t\t# Calculate average\n\t\taverage = sum/10\n\t\t\n\t\t#Calculate Variance \n\t\tVariance = 0.0\t\n\t\tfor j in range(10):\n\t\t\tVariance += (tmp[j]-average)*(tmp[j]-average)\n\t\tVariance/=10.0\t\n\t\treturn Variance", "metadata": "root.KalmanFilter.Gaussian_Noise_Cov", "header": "['class', 'KalmanFilter', ':', '___EOS___']", "index": 33 }, { "content": "\tdef Filter(self,origin):\n\t\tmodelNoise = 0.0\n\t\tobserveNoise = 0.0\n\t\t\n\t\t# Get model and observe Noise \n\t\tmodelNoise = self.Gaussian_Noise_Cov()\n\t\tobserveNoise = self.Gaussian_Noise_Cov()\n\t\t\n\t\t# Algorithm \n\t\tself.X_pre = self.X_post\n\t\tself.P_pre = self.P_post + modelNoise;\n\t\tself.K_cur = self.P_pre/(self.P_pre + observeNoise);\n\t\tself.P_post = (1 - self.K_cur)*self.P_pre;\n\t\tself.X_post = self.X_pre + self.K_cur*(origin - self.X_pre);\n\t\t\n\t\treturn self.X_post", "metadata": "root.KalmanFilter.Filter", "header": "['class', 'KalmanFilter', ':', '___EOS___']", "index": 56 } ]
[ { "span": "average ", "start_line": 36, "start_column": 2, "end_line": 36, "end_column": 9 }, { "span": "modelNoise ", "start_line": 57, "start_column": 2, "end_line": 57, "end_column": 12 }, { "span": "observeNoise ", "start_line": 58, "start_column": 2, "end_line": 58, "end_column": 14 } ]
[ { "span": "average ", "start_line": 47, "start_column": 2, "end_line": 47, "end_column": 9 }, { "span": "modelNoise ", "start_line": 61, "start_column": 2, "end_line": 61, "end_column": 12 }, { "span": "observeNoise ", "start_line": 62, "start_column": 2, "end_line": 62, "end_column": 14 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Kal", "man", "Filter_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Gaussian", "\\u", "No", "ise", "\\u", "Cov", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "[_", "0.0_", "]_", "*_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "average_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sum_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Get", " ", "random", " ", "number", " ", "*/", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "index_", "=_", "randint_", "(_", "0_", ",_", "90_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "[_", "i_", "]_", "=_", "Ran", "d\\u", "Table_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sum_", "+=_", "tmp_", "[_", "i_", "]_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Calculat", "e", " ", "average_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "average_", "=_", "sum_", "/_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Calculat", "e", " ", "Variance", " _", "\\u\\u\\uNL\\u\\u\\u_", "Variance", "_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "Variance", "_", "+=_", "(_", "tmp_", "[_", "j_", "]_", "-_", "average_", ")_", "*_", "(_", "tmp_", "[_", "j_", "]_", "-_", "average_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Variance", "_", "/=_", "10.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Variance", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Kal", "man", "Filter_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Filter_", "(_", "self_", ",_", "origin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "model", "Noise_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observe", "Noise_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "model", " ", "and", " ", "observe", " ", "No", "ise", " _", "\\u\\u\\uNL\\u\\u\\u_", "model", "Noise_", "=_", "self_", "._", "Gaussian", "\\u", "No", "ise", "\\u", "Cov", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observe", "Noise_", "=_", "self_", "._", "Gaussian", "\\u", "No", "ise", "\\u", "Cov", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Algorit", "hm", " _", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "X", "\\u", "pre_", "=_", "self_", "._", "X", "\\u", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "P", "\\u", "pre_", "=_", "self_", "._", "P", "\\u", "post_", "+_", "model", "Noise_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "K", "\\u", "cur_", "=_", "self_", "._", "P", "\\u", "pre_", "/_", "(_", "self_", "._", "P", "\\u", "pre_", "+_", "observe", "Noise_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "P", "\\u", "post_", "=_", "(_", "1_", "-_", "self_", "._", "K", "\\u", "cur_", ")_", "*_", "self_", "._", "P", "\\u", "pre_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "X", "\\u", "post_", "=_", "self_", "._", "X", "\\u", "pre_", "+_", "self_", "._", "K", "\\u", "cur_", "*_", "(_", "origin_", "-_", "self_", "._", "X", "\\u", "pre_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "X", "\\u", "post_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
iambus/SublimeIPython/sublime_ipython/sublime_utils.py
[ { "content": "# coding: utf-8\nimport os, sys\nfrom sublime import *\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#==============================\nif __name__ == \"__main__\":\n main(sys.argv)\n pass\n#==============================\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_selection(view=None):\n if not view:\n view = active_window().active_view()\n return view.sel()", "metadata": "root.get_selection", "header": "['module', '___EOS___']", "index": 4 }, { "content": "def set_selection(view, region):\n sel = view.sel()\n sel.clear()\n sel.add(region)", "metadata": "root.set_selection", "header": "['module', '___EOS___']", "index": 9 }, { "content": "def redraw_view(view=None):\n if not view:\n view = active_window().active_view()\n pos = view.viewport_position()\n pos = (pos[0], pos[1]+1)\n view.set_viewport_position(pos)\n pos = (pos[0], pos[1]-1)\n view.set_viewport_position(pos)", "metadata": "root.redraw_view", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def select_line(view, line):\n pt = view.text_point(line-1, 0)\n ln = view.line(pt)\n sel = view.sel()\n sel.clear()\n sel.add(ln)\n view.show_at_center(ln)", "metadata": "root.select_line", "header": "['module', '___EOS___']", "index": 23 }, { "content": "def select_all(view):\n size = view.size()\n sel = view.sel()\n sel.clear()\n sel.add( Region(0,size) )", "metadata": "root.select_all", "header": "['module', '___EOS___']", "index": 31 }, { "content": "def get_view_text(view):\n region = Region(0, view.size())\n return view.substr(region)", "metadata": "root.get_view_text", "header": "['module', '___EOS___']", "index": 37 }, { "content": "def set_view_text(view, text):\n if not isinstance(text, unicode):\n text = unicode(text)\n view.settings().set(\"syntax\", \"Packages/Python/Python.tmLanguage\")\n r = Region(0, view.size())\n e = view.begin_edit()\n view.erase(e, r)\n view.insert(e, 0, text)\n # view.show(0)", "metadata": "root.set_view_text", "header": "['module', '___EOS___']", "index": 41 }, { "content": "def flash_select(view, region, callback=None):\n sel = view.sel()\n old_sel = list(sel)\n sel.clear()\n sel.add(region)\n\n def restore():\n sel.clear()\n b = old_sel[0].b\n sel.add(Region(b,b))\n redraw_view(view)\n if callback:\n set_timeout(callback, 10)\n\n set_timeout(restore, 50)", "metadata": "root.flash_select", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def show_panel(name):\n window = active_window()\n window.run_command(\n \"show_panel\", {\"panel\": \"output.\" + name}\n )", "metadata": "root.show_panel", "header": "['module', '___EOS___']", "index": 68 }, { "content": "def hide_panel():\n window = active_window()\n window.run_command(\n \"hide_panel\", { \"cancel\": True }\n )", "metadata": "root.hide_panel", "header": "['module', '___EOS___']", "index": 74 }, { "content": "def show_msg(msg):\n window = active_window()\n panel = window.get_output_panel('flash_message')\n set_view_text(panel, msg)\n show_panel('flash_message')\n # hide after a while\n set_timeout(hide_panel, 1200)", "metadata": "root.show_msg", "header": "['module', '___EOS___']", "index": 80 } ]
[ { "span": "import os, sys", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "codi", "ng", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sublime_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", "sys_", "._", "argv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "==============", "==============", "==_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "selection_", "(_", "view_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "view_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "active", "\\u", "window_", "(_", ")_", "._", "active", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "selection_", "(_", "view_", ",_", "region_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sel_", "=_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "region_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "redraw", "\\u", "view_", "(_", "view_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "view_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "active", "\\u", "window_", "(_", ")_", "._", "active", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pos_", "=_", "view_", "._", "viewport", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "(_", "pos_", "[_", "0_", "]_", ",_", "pos_", "[_", "1_", "]_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "set\\u", "viewport", "\\u", "position_", "(_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "(_", "pos_", "[_", "0_", "]_", ",_", "pos_", "[_", "1_", "]_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "set\\u", "viewport", "\\u", "position_", "(_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select", "\\u", "line_", "(_", "view_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pt_", "=_", "view_", "._", "text", "\\u", "point_", "(_", "line_", "-_", "1_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ln_", "=_", "view_", "._", "line_", "(_", "pt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "=_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "ln_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "show", "\\u", "at", "\\u", "center_", "(_", "ln_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select", "\\u", "all_", "(_", "view_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "view_", "._", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "=_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "Region_", "(_", "0_", ",_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\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", "view", "\\u", "text_", "(_", "view_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "region_", "=_", "Region_", "(_", "0_", ",_", "view_", "._", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "view_", "._", "substr_", "(_", "region_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "view", "\\u", "text_", "(_", "view_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "text_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "unicode_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "view_", "._", "settings_", "(_", ")_", "._", "set_", "(_", "\"", "synta", "x", "\"_", ",_", "\"", "Packa", "ges", "/", "Pyth", "on", "/", "Pyth", "on", ".", "tm", "Lang", "ua", "ge", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "Region_", "(_", "0_", ",_", "view_", "._", "size_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "view_", "._", "begin", "\\u", "edit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "erase_", "(_", "e_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "insert_", "(_", "e_", ",_", "0_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "view", ".", "show", "(", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flash", "\\u", "select_", "(_", "view_", ",_", "region_", ",_", "callback_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sel_", "=_", "view_", "._", "sel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "sel_", "=_", "list_", "(_", "sel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "region_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "restore_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sel_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "old", "\\u", "sel_", "[_", "0_", "]_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "Region_", "(_", "b_", ",_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redraw", "\\u", "view_", "(_", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "callback_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set\\u", "timeout_", "(_", "callback_", ",_", "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_", "set\\u", "timeout_", "(_", "restore_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\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", "panel_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window_", "=_", "active", "\\u", "window_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "run", "\\u", "command_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "show", "\\u", "panel", "\"_", ",_", "{_", "\"", "panel", "\"_", ":_", "\"", "output", ".\"_", "+_", "name_", "}_", "\\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_", "hide", "\\u", "panel_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window_", "=_", "active", "\\u", "window_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "run", "\\u", "command_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hide", "\\u", "panel", "\"_", ",_", "{_", "\"", "cancel", "\"_", ":_", "True_", "}_", "\\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", "msg_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window_", "=_", "active", "\\u", "window_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "panel_", "=_", "window_", "._", "get", "\\u", "output", "\\u", "panel_", "(_", "'", "flash", "\\u", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "view", "\\u", "text_", "(_", "panel_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "\\u", "panel_", "(_", "'", "flash", "\\u", "message", "'_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
chrippa/livestreamer/src/livestreamer/packages/flashmedia/box.py
[ { "content": " @classmethod\n def _deserialize(cls, io):\n version = U8.read(io)\n flags = U24BE.read(io)\n track_id = U32BE.read(io)\n default_sample_description_index = U32BE.read(io)\n default_sample_duration = U32BE.read(io)\n default_sample_size = U32BE.read(io)\n default_sample_flags = SampleFlags.deserialize(io)\n\n return cls(version, track_id,\n default_sample_description_index,\n default_sample_duration, default_sample_size,\n default_sample_flags)", "metadata": "root.BoxPayloadTREX._deserialize", "header": "['class', 'BoxPayloadTREX', '(', 'BoxPayload', ')', ':', '___EOS___']", "index": 349 }, { "content": " @classmethod\n def _deserialize(cls, io):\n version = U8.read(io)\n flags = U24BE.read(io) # Reserved\n\n predefined = U32BE.read(io)\n handler_type = FourCC.read(io)\n\n for i in range(3):\n U32BE.read(io) # Reserved\n\n name = CString.read(io)\n\n return cls(version, predefined, handler_type,\n name)", "metadata": "root.BoxPayloadHDLR._deserialize", "header": "['class', 'BoxPayloadHDLR', '(', 'BoxPayload', ')', ':', '___EOS___']", "index": 522 }, { "content": " @classmethod\n def _deserialize(cls, io):\n version = U8.read(io)\n flags = U24BE.read(io)\n\n entry_count = U32BE.read(io)\n boxes = []\n for i in range(entry_count):\n box = Box.deserialize(io)\n boxes.append(box)\n\n return cls(version, boxes)", "metadata": "root.BoxPayloadDREF._deserialize", "header": "['class', 'BoxPayloadDREF', '(', 'BoxContainer', ')', ':', '___EOS___']", "index": 593 }, { "content": " @classmethod\n def _deserialize(cls, io):\n version = U8.read(io)\n flags = U24BE.read(io)\n count = U32BE.read(io)\n\n descriptions = []\n for i in range(count):\n box = Box.deserialize(io)\n descriptions.append(box)\n\n return cls(version, descriptions)", "metadata": "root.BoxPayloadSTSD._deserialize", "header": "['class', 'BoxPayloadSTSD', '(', 'BoxContainer', ')', ':', '___EOS___']", "index": 652 } ]
[ { "span": "flags ", "start_line": 352, "start_column": 8, "end_line": 352, "end_column": 13 }, { "span": "flags ", "start_line": 525, "start_column": 8, "end_line": 525, "end_column": 13 }, { "span": "flags ", "start_line": 596, "start_column": 8, "end_line": 596, "end_column": 13 }, { "span": "flags ", "start_line": 655, "start_column": 8, "end_line": 655, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Box", "Pay", "load", "TRE", "X_", "(_", "Box", "Payload_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "deserialize_", "(_", "cls_", ",_", "io_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "U", "8_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "U2", "4", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "track", "\\u", "id_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "sample", "\\u", "description", "\\u", "index_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "sample", "\\u", "duration_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "sample", "\\u", "size_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "sample", "\\u", "flags_", "=_", "Sampl", "e", "Flags_", "._", "deserialize_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "cls_", "(_", "version_", ",_", "track", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "sample", "\\u", "description", "\\u", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "sample", "\\u", "duration_", ",_", "default", "\\u", "sample", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "sample", "\\u", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Box", "Pay", "load", "HD", "LR", "_", "(_", "Box", "Payload_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "deserialize_", "(_", "cls_", ",_", "io_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "U", "8_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "U2", "4", "BE_", "._", "read_", "(_", "io_", ")_", "#", " ", "Reserve", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prede", "fined", "_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler", "\\u", "type_", "=_", "Four", "CC_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "#", " ", "Reserve", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "CS", "tring_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "cls_", "(_", "version_", ",_", "prede", "fined", "_", ",_", "handler", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Box", "Pay", "load", "DR", "EF", "_", "(_", "Box", "Container_", ")_", ":_", "\\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_", "\\u", "deserialize_", "(_", "cls_", ",_", "io_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "U", "8_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "U2", "4", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "count_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "boxes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "entry", "\\u", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "box_", "=_", "Box_", "._", "deserialize_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "boxes_", "._", "append_", "(_", "box_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "(_", "version_", ",_", "boxes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Box", "Pay", "load", "ST", "SD_", "(_", "Box", "Container_", ")_", ":_", "\\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_", "\\u", "deserialize_", "(_", "cls_", ",_", "io_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "U", "8_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "U2", "4", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "U3", "2", "BE_", "._", "read_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "descriptions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "box_", "=_", "Box_", "._", "deserialize_", "(_", "io_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptions_", "._", "append_", "(_", "box_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "(_", "version_", ",_", "descriptions_", ")_", "\\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, 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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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
charlesmchen/typefacet-robofont/extension/TypeFacet-RoboFont.roboFontExt/lib/rfscripts/RFMergePoints.py
[ { "content": "'''\nrobofont-extensions-and-scripts\nRFMergePoints.py\n\nhttps://github.com/charlesmchen/robofont-extensions-and-scripts\n\nCopyright (c) 2012 Charles Matthew Chen\[email protected]\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\n\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\n\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n'''\n\n\nimport os\nimport sys\n\nfrom robofab.world import CurrentGlyph, CurrentFont\n\nimport RFUtils\nRFUtils.hackPathIfNecessary()\n\nfrom tfs.common.TFSPath import TFSPath\nfrom tfs.common.TFSSegment import TFSSegment\nfrom tfs.common.TFSPoint import TFSPoint, TFSPoint0\nfrom tfs.common.TFSGlyph import TFSGlyph\n\nimport tfs.common.TFSIntersection as TFSIntersection\n\n\n\n\n\n\n\n\n#mergeSelectedPointsInCurrentGlyph()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def processGlyph(glyph, glyphName, paths, updateControlPoints):\n '''\n Should this algorithm only use end points?\n '''\n\n# print\n# print 'processGlyph'\n# for path in paths:\n# print '\\t', 'path', path.description()\n# for segment in path.segments:\n# print '\\t\\t', 'segment', segment.description()\n\n allPoints = []\n for path in paths:\n for segment in path.segments:\n allPoints.append(segment.startPoint())\n allPoints.append(segment.endPoint())\n# allPoints.extend(segment.points)\n\n selectedPoints = [point for point in allPoints if point.selected]\n selectedPoints = set(selectedPoints)\n\n print 'selectedPoints', selectedPoints\n#\n if len(selectedPoints) < 1:\n raise Exception('No selected points found.')\n# return None\n\n pointSum = TFSPoint0()\n for point in selectedPoints:\n pointSum = pointSum.plus(point)\n pointAverage = pointSum.scale(1.0 / len(selectedPoints))\n\n# print 'pointSum', pointSum\n# print 'pointAverage', pointAverage\n\n pointAverage = pointAverage.roundWithDefaultPrecision()\n\n# print 'pointAverage', pointAverage\n\n def updateSegment(segment):\n startPoint = segment.startPoint()\n# startOffset = TFSPoint0()\n if segment.startPoint() in selectedPoints:\n# startOffset = pointAverage.minus(startPoint)\n startPoint = pointAverage\n\n endPoint = segment.endPoint()\n# endOffset = TFSPoint0()\n if segment.endPoint() in selectedPoints:\n# endOffset = pointAverage.minus(endPoint)\n endPoint = pointAverage\n\n\n if startPoint == endPoint:\n return None\n\n newPoints = [startPoint,]\n\n if len(segment.points) == 2:\n pass\n elif len(segment.points) == 3:\n if updateControlPoints:\n # Preserve the control angles.\n controlPoint0 = TFSIntersection.getIntersectPoint(startPoint,\n startPoint.plus(segment.startTangent()),\n endPoint,\n endPoint.plus(segment.endTangent()))\n else:\n controlPoint0 = segment.points[1]\n newPoints += [controlPoint0,]\n\n# offset = startOffset.blend(endOffset)\n# controlPoint0 = segment.points[1].plus(offset)\n# newPoints += [controlPoint0,]\n elif len(segment.points) == 4:\n if updateControlPoints:\n factor = startPoint.distanceTo(endPoint) / segment.endPointDistance()\n controlPoint0 = startPoint.plus(segment.startTangent().scale(segment.startVector().length() * factor))\n controlPoint1 = endPoint.plus(segment.endTangent().scale(segment.endVector().length() * -factor))\n else:\n controlPoint0 = segment.points[1]\n controlPoint1 = segment.points[2]\n newPoints += [controlPoint0, controlPoint1,]\n\n# controlPoint0 = segment.points[1].plus(startOffset)\n# controlPoint1 = segment.points[2].plus(endOffset)\n# newPoints += [controlPoint0, controlPoint1,]\n else:\n raise Exception('Invalid segment: ' + segment.description())\n\n newPoints += [endPoint,]\n\n return TFSSegment(*newPoints)\n\n\n\n newPaths = []\n for path in paths:\n newSegments = []\n for segment in path.segments:\n if segment.startPoint() in selectedPoints or segment.endPoint() in selectedPoints:\n# print 'segment', segment.description()\n newSegment = updateSegment(segment)\n if newSegment is not None:\n# print 'newSegment', newSegment.description()\n newSegments.append(newSegment)\n else:\n newSegments.append(segment)\n newPaths.append(TFSPath(True, *newSegments))\n return newPaths", "metadata": "root.processGlyph", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def mergeSelectedPointsInGlyph(rfglyph, updateControlPoints):\n\n rfglyph.prepareUndo(\"Merge Points\")\n\n glyph = TFSGlyph(rfglyph)\n glyphName = hex(glyph.unicode) if glyph.unicode is not None else '<None>'\n paths = glyph.getContours(setSelected=True)\n paths = processGlyph(glyph, glyphName, paths, updateControlPoints)\n if paths is not None:\n glyph.setContours(paths)\n\n ## tell the glyph you are done with your actions so it can handle the undo properly\n rfglyph.performUndo()", "metadata": "root.mergeSelectedPointsInGlyph", "header": "['module', '___EOS___']", "index": 196 }, { "content": "def mergeSelectedPointsInCurrentGlyph(updateControlPoints):\n glyph = CurrentGlyph()\n if glyph is None:\n raise Exception('No current glyph.')\n mergeSelectedPointsInGlyph(glyph, updateControlPoints)", "metadata": "root.mergeSelectedPointsInCurrentGlyph", "header": "['module', '___EOS___']", "index": 211 } ]
[ { "span": "import os", "start_line": 67, "start_column": 0, "end_line": 67, "end_column": 9 }, { "span": "import sys", "start_line": 68, "start_column": 0, "end_line": 68, "end_column": 10 }, { "span": "from robofab.world import CurrentGlyph, CurrentFont", "start_line": 70, "start_column": 0, "end_line": 70, "end_column": 51 }, { "span": "from tfs.common.TFSPoint import TFSPoint, TFSPoint0", "start_line": 77, "start_column": 0, "end_line": 77, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "robo", "font", "-", "extensi", "ons", "-", "and", "-", "scripts", "\\", "10", ";", "RF", "Merge", "Point", "s", ".", "py", "\\", "10", ";", "\\", "10", ";", "https", "://", "git", "hub", ".", "com", "/", "charl", "es", "mc", "hen", "/", "robo", "font", "-", "extensi", "ons", "-", "and", "-", "scripts", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2012", " ", "Charl", "es", " ", "Matt", "hew", " ", "Chen", "\\", "10", ";", "charl", "es", "mc", "hen", "@", "gma", "il", ".", "com", "\\", "10", ";", "\\", "10", ";", "Ap", "ache", " ", "License", "\\", "10", ";", "\\", "10", ";", "Version", " ", "2.0", ",", " ", "Januar", "y", " ", "2004", "\\", "10", ";", "\\", "10", ";", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "\\", "10", ";", "\\", "10", ";", "TERM", "S", " ", "AND", " ", "CONDITION", "S", " ", "FOR", " ", "USE", ",", " ", "REP", "RO", "DU", "CTION", ",", " ", "AND", " ", "DISTRI", "BUT", "ION", "\\", "10", ";", "\\", "10", ";", "1", ".", " ", "Definit", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", "\"", "License", "\"", " ", "sha", "ll", " ", "mean", " ", "the", " ", "term", "s", " ", "and", " ", "condition", "s", " ", "for", " ", "use", ",", " ", "repro", "duct", "ion", ",", " ", "and", " ", "distribu", "tion", " ", "as", " ", "defin", "ed", " ", "by", " ", "Sections", " ", "1", " ", "through", " ", "9", " ", "of", " ", "this", " ", "document", ".", "\\", "10", ";", "\\", "10", ";", "\"", "Licen", "sor", "\"", " ", "sha", "ll", " ", "mean", " ", "the", " ", "copyr", "ight", " ", "owner", " ", "or", " ", "entity", " ", "authoriz", "ed", " ", "by", " ", "the", " ", "copyr", "ight", " ", "owner", " ", "tha", "t", " ", "is", " ", "grant", "ing", " ", "the", " ", "License", ".", "\\", "10", ";", "\\", "10", ";", "\"", "Legal", " ", "Entit", "y", "\"", " ", "sha", "ll", " ", "mean", " ", "the", " ", "uni", "on", " ", "of", " ", "the", " ", "actin", "g", " ", "entity", " ", "and", " ", "all", " ", "other", " ", "entit", "ies", " ", "tha", "t", " ", "control", ",", " ", "are", " ", "controlle", "d", " ", "by", ",", " ", "or", " ", "are", " ", "under", " ", "common", " ", "control", " ", "with", " ", "tha", "t", " ", "entity", ".", " ", "For", " ", "the", " ", "purpose", "s", " ", "of", " ", "this", " ", "definit", "ion", ",", " ", "\"", "control", "\"", " ", "means", " ", "(", "i", ")", " ", "the", " ", "power", ",", " ", "direct", " ", "or", " ", "indirect", ",", " ", "to", " ", "caus", "e", " ", "the", " ", "direction", " ", "or", " ", "manage", "ment", " ", "of", " ", "suc", "h", " ", "entity", ",", " ", "whe", "ther", " ", "by", " ", "contract", " ", "or", " ", "other", "wis", "e", ",", " ", "or", " ", "(", "ii", ")", " ", "owner", "ship", " ", "of", " ", "fift", "y", " ", "percent", " ", "(", "50", "%)", " ", "or", " ", "more", " ", "of", " ", "the", " ", "outstanding", " ", "share", "s", ",", " ", "or", " ", "(", "iii", ")", " ", "bene", "ficia", "l", " ", "owner", "ship", " ", "of", " ", "suc", "h", " ", "entity", ".", "\\", "10", ";", "\\", "10", ";", "\"", "You", "\"", " ", "(", "or", " ", "\"", "You", "r", "\")", " ", "sha", "ll", " ", "mean", " ", "an", " ", "individual", " ", "or", " ", "Legal", " ", "Entit", "y", " ", "exe", "rci", "sing", " ", "permissi", "ons", " ", "grant", "ed", " ", "by", " ", "this", " ", "License", ".", "\\", "10", ";", "\\", "10", ";", "\"", "Sou", "rce", "\"", " ", "form", " ", "sha", "ll", " ", "mean", " ", "the", " ", "prefer", "red", " ", "form", " ", "for", " ", "mak", "ing", " ", "modification", "s", ",", " ", "inclu", "ding", " ", "but", " ", "not", " ", "limited", " ", "to", " ", "software", " ", "source", " ", "code", ",", " ", "documentation", " ", "source", ",", " ", "and", " ", "configura", "tion", " ", "files", ".", "\\", "10", ";", "\\", "10", ";", "\"", "Object", "\"", " ", "form", " ", "sha", "ll", " ", "mean", " ", "any", " ", "form", " ", "result", "ing", " ", "from", " ", "mechani", "cal", " ", "transformation", " ", "or", " ", "translatio", "n", " ", "of", " ", "a", " ", "Sou", "rce", " ", "form", ",", " ", "inclu", "ding", " ", "but", " ", "not", " ", "limited", " ", "to", " ", "compile", "d", " ", "object", " ", "code", ",", " ", "generat", "ed", " ", "documentation", ",", " ", "and", " ", "conversions", " ", "to", " ", "other", " ", "media", " ", "types", ".", "\\", "10", ";", "\\", "10", ";", "\"", "Work", "\"", " ", "sha", "ll", " ", "mean", " ", "the", " ", "work", " ", "of", " ", "author", "ship", ",", " ", "whe", "ther", " ", "in", " ", "Sou", "rce", " ", "or", " ", "Object", " ", "form", ",", " ", "made", " ", "avail", "able", " ", "under", " ", "the", " ", "License", ",", " ", "as", " ", "indicat", "ed", " ", "by", " ", "a", " ", "copyr", "ight", " ", "notice", " ", "tha", "t", " ", "is", " ", "include", "d", " ", "in", " ", "or", " ", "attache", "d", " ", "to", " ", "the", " ", "work", " ", "(", "an", " ", "example", " ", "is", " ", "provided", " ", "in", " ", "the", " ", "Append", "ix", " ", "belo", "w", ").", "\\", "10", ";", "\\", "10", ";", "\"", "Derivati", "ve", " ", "Works", "\"", " ", "sha", "ll", " ", "mean", " ", "any", " ", "work", ",", " ", "whe", "ther", " ", "in", " ", "Sou", "rce", " ", "or", " ", "Object", " ", "form", ",", " ", "tha", "t", " ", "is", " ", "based", " ", "on", " ", "(", "or", " ", "derive", "d", " ", "from", ")", " ", "the", " ", "Work", " ", "and", " ", "for", " ", "whi", "ch", " ", "the", " ", "editor", "ial", " ", "revis", "ion", "s", ",", " ", "annot", "ation", "s", ",", " ", "ela", "bora", "tion", "s", ",", " ", "or", " ", "other", " ", "modification", "s", " ", "represent", ",", " ", "as", " ", "a", " ", "whole", ",", " ", "an", " ", "original", " ", "work", " ", "of", " ", "author", "ship", ".", " ", "For", " ", "the", " ", "purpose", "s", " ", "of", " ", "this", " ", "License", ",", " ", "Derivati", "ve", " ", "Works", " ", "sha", "ll", " ", "not", " ", "include", " ", "works", " ", "tha", "t", " ", "rema", "in", " ", "separa", "ble", " ", "from", ",", " ", "or", " ", "mer", "el", "y", " ", "link", " ", "(", "or", " ", "bind", " ", "by", " ", "name", ")", " ", "to", " ", "the", " ", "interface", "s", " ", "of", ",", " ", "the", " ", "Work", " ", "and", " ", "Derivati", "ve", " ", "Works", " ", "there", "of", ".", "\\", "10", ";", "\\", "10", ";", "\"", "Contribution", "\"", " ", "sha", "ll", " ", "mean", " ", "any", " ", "work", " ", "of", " ", "author", "ship", ",", " ", "inclu", "ding", " ", "the", " ", "original", " ", "version", " ", "of", " ", "the", " ", "Work", " ", "and", " ", "any", " ", "modification", "s", " ", "or", " ", "additions", " ", "to", " ", "tha", "t", " ", "Work", " ", "or", " ", "Derivati", "ve", " ", "Works", " ", "there", "of", ",", " ", "tha", "t", " ", "is", " ", "intent", "ional", "ly", " ", "submitted", " ", "to", " ", "Licen", "sor", " ", "for", " ", "inclusion", " ", "in", " ", "the", " ", "Work", " ", "by", " ", "the", " ", "copyr", "ight", " ", "owner", " ", "or", " ", "by", " ", "an", " ", "individual", " ", "or", " ", "Legal", " ", "Entit", "y", " ", "authoriz", "ed", " ", "to", " ", "submit", " ", "on", " ", "beha", "lf", " ", "of", " ", "the", " ", "copyr", "ight", " ", "owner", ".", " ", "For", " ", "the", " ", "purpose", "s", " ", "of", " ", "this", " ", "definit", "ion", ",", " ", "\"", "submitted", "\"", " ", "means", " ", "any", " ", "form", " ", "of", " ", "electronic", ",", " ", "verba", "l", ",", " ", "or", " ", "writt", "en", " ", "communication", " ", "sent", " ", "to", " ", "the", " ", "Licen", "sor", " ", "or", " ", "its", " ", "representative", "s", ",", " ", "inclu", "ding", " ", "but", " ", "not", " ", "limited", " ", "to", " ", "communication", " ", "on", " ", "electronic", " ", "mailing", " ", "lists", ",", " ", "source", " ", "code", " ", "control", " ", "system", "s", ",", " ", "and", " ", "issue", " ", "track", "ing", " ", "system", "s", " ", "tha", "t", " ", "are", " ", "manage", "d", " ", "by", ",", " ", "or", " ", "on", " ", "beha", "lf", " ", "of", ",", " ", "the", " ", "Licen", "sor", " ", "for", " ", "the", " ", "purpose", " ", "of", " ", "discuss", "ing", " ", "and", " ", "impro", "ving", " ", "the", " ", "Work", ",", " ", "but", " ", "excluding", " ", "communication", " ", "tha", "t", " ", "is", " ", "cons", "pic", "uo", "usl", "y", " ", "marked", " ", "or", " ", "other", "wis", "e", " ", "designate", "d", " ", "in", " ", "writ", "ing", " ", "by", " ", "the", " ", "copyr", "ight", " ", "owner", " ", "as", " ", "\"", "Not", " ", "a", " ", "Contribution", ".\"", "\\", "10", ";", "\\", "10", ";", "\"", "Contributor", "\"", " ", "sha", "ll", " ", "mean", " ", "Licen", "sor", " ", "and", " ", "any", " ", "individual", " ", "or", " ", "Legal", " ", "Entit", "y", " ", "on", " ", "beha", "lf", " ", "of", " ", "who", "m", " ", "a", " ", "Contribution", " ", "has", " ", "bee", "n", " ", "receive", "d", " ", "by", " ", "Licen", "sor", " ", "and", " ", "subsequen", "tl", "y", " ", "inco", "rpor", "ated", " ", "within", " ", "the", " ", "Work", ".", "\\", "10", ";", "\\", "10", ";", "2", ".", " ", "Grant", " ", "of", " ", "Copy", "right", " ", "License", ".", " ", "Sub", "ject", " ", "to", " ", "the", " ", "term", "s", " ", "and", " ", "condition", "s", " ", "of", " ", "this", " ", "License", ",", " ", "each", " ", "Contributor", " ", "here", "by", " ", "grants", " ", "to", " ", "You", " ", "a", " ", "perp", "etu", "al", ",", " ", "world", "wide", ",", " ", "non", "-", "exclu", "sive", ",", " ", "no", "-", "charge", ",", " ", "roy", "alty", "-", "free", ",", " ", "irre", "vocab", "le", " ", "copyr", "ight", " ", "license", " ", "to", " ", "reproduce", ",", " ", "prepar", "e", " ", "Derivati", "ve", " ", "Works", " ", "of", ",", " ", "public", "ly", " ", "display", ",", " ", "public", "ly", " ", "perform", ",", " ", "subli", "cens", "e", ",", " ", "and", " ", "distribute", " ", "the", " ", "Work", " ", "and", " ", "suc", "h", " ", "Derivati", "ve", " ", "Works", " ", "in", " ", "Sou", "rce", " ", "or", " ", "Object", " ", "form", ".", "\\", "10", ";", "\\", "10", ";", "3", ".", " ", "Grant", " ", "of", " ", "Pat", "ent", " ", "License", ".", " ", "Sub", "ject", " ", "to", " ", "the", " ", "term", "s", " ", "and", " ", "condition", "s", " ", "of", " ", "this", " ", "License", ",", " ", "each", " ", "Contributor", " ", "here", "by", " ", "grants", " ", "to", " ", "You", " ", "a", " ", "perp", "etu", "al", ",", " ", "world", "wide", ",", " ", "non", "-", "exclu", "sive", ",", " ", "no", "-", "charge", ",", " ", "roy", "alty", "-", "free", ",", " ", "irre", "vocab", "le", " ", "(", "except", " ", "as", " ", "state", "d", " ", "in", " ", "this", " ", "section", ")", " ", "pate", "nt", " ", "license", " ", "to", " ", "make", ",", " ", "have", " ", "made", ",", " ", "use", ",", " ", "off", "er", " ", "to", " ", "sell", ",", " ", "sell", ",", " ", "import", ",", " ", "and", " ", "other", "wis", "e", " ", "transfer", " ", "the", " ", "Work", ",", " ", "where", " ", "suc", "h", " ", "license", " ", "appli", "es", " ", "only", " ", "to", " ", "tho", "se", " ", "pate", "nt", " ", "claim", "s", " ", "lice", "nsa", "ble", " ", "by", " ", "suc", "h", " ", "Contributor", " ", "tha", "t", " ", "are", " ", "necessar", "il", "y", " ", "inf", "ring", "ed", " ", "by", " ", "thei", "r", " ", "Contribution", "(", "s", ")", " ", "alo", "ne", " ", "or", " ", "by", " ", "combinat", "ion", " ", "of", " ", "thei", "r", " ", "Contribution", "(", "s", ")", " ", "with", " ", "the", " ", "Work", " ", "to", " ", "whi", "ch", " ", "suc", "h", " ", "Contribution", "(", "s", ")", " ", "was", " ", "submitted", ".", " ", "If", " ", "You", " ", "institu", "te", " ", "pate", "nt", " ", "lit", "igat", "ion", " ", "against", " ", "any", " ", "entity", " ", "(", "inclu", "ding", " ", "a", " ", "cross", "-", "claim", " ", "or", " ", "counter", "claim", " ", "in", " ", "a", " ", "law", "suit", ")", " ", "alle", "ging", " ", "tha", "t", " ", "the", " ", "Work", " ", "or", " ", "a", " ", "Contribution", " ", "inco", "rpor", "ated", " ", "within", " ", "the", " ", "Work", " ", "constitu", "tes", " ", "direct", " ", "or", " ", "contributor", "y", " ", "pate", "nt", " ", "inf", "ring", "ement", ",", " ", "then", " ", "any", " ", "pate", "nt", " ", "license", "s", " ", "grant", "ed", " ", "to", " ", "You", " ", "under", " ", "this", " ", "License", " ", "for", " ", "tha", "t", " ", "Work", " ", "sha", "ll", " ", "terminate", " ", "as", " ", "of", " ", "the", " ", "date", " ", "suc", "h", " ", "lit", "igat", "ion", " ", "is", " ", "filed", ".", "\\", "10", ";", "\\", "10", ";", "4", ".", " ", "Redistributi", "on", ".", " ", "You", " ", "may", " ", "reproduce", " ", "and", " ", "distribute", " ", "copie", "s", " ", "of", " ", "the", " ", "Work", " ", "or", " ", "Derivati", "ve", " ", "Works", " ", "there", "of", " ", "in", " ", "any", " ", "medium", ",", " ", "with", " ", "or", " ", "with", "out", " ", "modification", "s", ",", " ", "and", " ", "in", " ", "Sou", "rce", " ", "or", " ", "Object", " ", "form", ",", " ", "provided", " ", "tha", "t", " ", "You", " ", "meet", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":", "\\", "10", ";", "\\", "10", ";", "You", " ", "must", " ", "give", " ", "any", " ", "other", " ", "recip", "ients", " ", "of", " ", "the", " ", "Work", " ", "or", " ", "Derivati", "ve", " ", "Works", " ", "a", " ", "copy", " ", "of", " ", "this", " ", "License", ";", " ", "and", "\\", "10", ";", "\\", "10", ";", "You", " ", "must", " ", "caus", "e", " ", "any", " ", "modifi", "ed", " ", "files", " ", "to", " ", "carry", " ", "prom", "inen", "t", " ", "notice", "s", " ", "stati", "ng", " ", "tha", "t", " ", "You", " ", "change", "d", " ", "the", " ", "files", ";", " ", "and", "\\", "10", ";", "\\", "10", ";", "You", " ", "must", " ", "retain", ",", " ", "in", " ", "the", " ", "Sou", "rce", " ", "form", " ", "of", " ", "any", " ", "Derivati", "ve", " ", "Works", " ", "tha", "t", " ", "You", " ", "distribute", ",", " ", "all", " ", "copyr", "ight", ",", " ", "pate", "nt", ",", " ", "trade", "mark", ",", " ", "and", " ", "attribution", " ", "notice", "s", " ", "from", " ", "the", " ", "Sou", "rce", " ", "form", " ", "of", " ", "the", " ", "Work", ",", " ", "excluding", " ", "tho", "se", " ", "notice", "s", " ", "tha", "t", " ", "do", " ", "not", " ", "pert", "ain", " ", "to", " ", "any", " ", "part", " ", "of", " ", "the", " ", "Derivati", "ve", " ", "Works", ";", " ", "and", "\\", "10", ";", "\\", "10", ";", "If", " ", "the", " ", "Work", " ", "include", "s", " ", "a", " ", "\"", "NOTICE", "\"", " ", "text", " ", "file", " ", "as", " ", "part", " ", "of", " ", "its", " ", "distribu", "tion", ",", " ", "then", " ", "any", " ", "Derivati", "ve", " ", "Works", " ", "tha", "t", " ", "You", " ", "distribute", " ", "must", " ", "include", " ", "a", " ", "reada", "ble", " ", "copy", " ", "of", " ", "the", " ", "attribution", " ", "notice", "s", " ", "contain", "ed", " ", "within", " ", "suc", "h", " ", "NOTICE", " ", "file", ",", " ", "excluding", " ", "tho", "se", " ", "notice", "s", " ", "tha", "t", " ", "do", " ", "not", " ", "pert", "ain", " ", "to", " ", "any", " ", "part", " ", "of", " ", "the", " ", "Derivati", "ve", " ", "Works", ",", " ", "in", " ", "at", " ", "leas", "t", " ", "one", " ", "of", " ", "the", " ", "follow", "ing", " ", "place", "s", ":", " ", "within", " ", "a", " ", "NOTICE", " ", "text", " ", "file", " ", "distributed", " ", "as", " ", "part", " ", "of", " ", "the", " ", "Derivati", "ve", " ", "Works", ";", " ", "within", " ", "the", " ", "Sou", "rce", " ", "form", " ", "or", " ", "documentation", ",", " ", "if", " ", "provided", " ", "along", " ", "with", " ", "the", " ", "Derivati", "ve", " ", "Works", ";", " ", "or", ",", " ", "within", " ", "a", " ", "display", " ", "generat", "ed", " ", "by", " ", "the", " ", "Derivati", "ve", " ", "Works", ",", " ", "if", " ", "and", " ", "where", "ver", " ", "suc", "h", " ", "third", "-", "part", "y", " ", "notice", "s", " ", "normal", "ly", " ", "appear", ".", " ", "The", " ", "content", "s", " ", "of", " ", "the", " ", "NOTICE", " ", "file", " ", "are", " ", "for", " ", "informati", "onal", " ", "purpose", "s", " ", "only", " ", "and", " ", "do", " ", "not", " ", "modif", "y", " ", "the", " ", "License", ".", " ", "You", " ", "may", " ", "add", " ", "You", "r", " ", "own", " ", "attribution", " ", "notice", "s", " ", "within", " ", "Derivati", "ve", " ", "Works", " ", "tha", "t", " ", "You", " ", "distribute", ",", " ", "along", "side", " ", "or", " ", "as", " ", "an", " ", "adde", "nd", "um", " ", "to", " ", "the", " ", "NOTICE", " ", "text", " ", "from", " ", "the", " ", "Work", ",", " ", "provided", " ", "tha", "t", " ", "suc", "h", " ", "addition", "al", " ", "attribution", " ", "notice", "s", " ", "cann", "ot", " ", "be", " ", "constr", "ued", " ", "as", " ", "modif", "ying", " ", "the", " ", "License", ".", " ", "You", " ", "may", " ", "add", " ", "You", "r", " ", "own", " ", "copyr", "ight", " ", "statem", "ent", " ", "to", " ", "You", "r", " ", "modification", "s", " ", "and", " ", "may", " ", "provide", " ", "addition", "al", " ", "or", " ", "different", " ", "license", " ", "term", "s", " ", "and", " ", "condition", "s", " ", "for", " ", "use", ",", " ", "repro", "duct", "ion", ",", " ", "or", " ", "distribu", "tion", " ", "of", " ", "You", "r", " ", "modification", "s", ",", " ", "or", " ", "for", " ", "any", " ", "suc", "h", " ", "Derivati", "ve", " ", "Works", " ", "as", " ", "a", " ", "whole", ",", " ", "provided", " ", "You", "r", " ", "use", ",", " ", "repro", "duct", "ion", ",", " ", "and", " ", "distribu", "tion", " ", "of", " ", "the", " ", "Work", " ", "other", "wis", "e", " ", "compli", "es", " ", "with", " ", "the", " ", "condition", "s", " ", "state", "d", " ", "in", " ", "this", " ", "License", ".", "\\", "10", ";", "\\", "10", ";", "5", ".", " ", "Subm", "ission", " ", "of", " ", "Contribution", "s", ".", " ", "Un", "less", " ", "You", " ", "explicit", "ly", " ", "state", " ", "other", "wis", "e", ",", " ", "any", " ", "Contribution", " ", "intent", "ional", "ly", " ", "submitted", " ", "for", " ", "inclusion", " ", "in", " ", "the", " ", "Work", " ", "by", " ", "You", " ", "to", " ", "the", " ", "Licen", "sor", " ", "sha", "ll", " ", "be", " ", "under", " ", "the", " ", "term", "s", " ", "and", " ", "condition", "s", " ", "of", " ", "this", " ", "License", ",", " ", "with", "out", " ", "any", " ", "addition", "al", " ", "term", "s", " ", "or", " ", "condition", "s", ".", " ", "Not", "with", "standing", " ", "the", " ", "above", ",", " ", "not", "hing", " ", "here", "in", " ", "sha", "ll", " ", "supers", "ede", " ", "or", " ", "modif", "y", " ", "the", " ", "term", "s", " ", "of", " ", "any", " ", "separate", " ", "license", " ", "agreement", " ", "you", " ", "may", " ", "have", " ", "executed", " ", "with", " ", "Licen", "sor", " ", "regarding", " ", "suc", "h", " ", "Contribution", "s", ".", "\\", "10", ";", "\\", "10", ";", "6", ".", " ", "Trade", "mark", "s", ".", " ", "Thi", "s", " ", "License", " ", "doe", "s", " ", "not", " ", "grant", " ", "permissi", "on", " ", "to", " ", "use", " ", "the", " ", "trade", " ", "names", ",", " ", "trade", "mark", "s", ",", " ", "service", " ", "mark", "s", ",", " ", "or", " ", "product", " ", "names", " ", "of", " ", "the", " ", "Licen", "sor", ",", " ", "except", " ", "as", " ", "require", "d", " ", "for", " ", "reason", "able", " ", "and", " ", "custom", "ary", " ", "use", " ", "in", " ", "descri", "bing", " ", "the", " ", "orig", "in", " ", "of", " ", "the", " ", "Work", " ", "and", " ", "repro", "duci", "ng", " ", "the", " ", "content", " ", "of", " ", "the", " ", "NOTICE", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", "7", ".", " ", "Disc", "lai", "mer", " ", "of", " ", "War", "rant", "y", ".", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "Licen", "sor", " ", "provide", "s", " ", "the", " ", "Work", " ", "(", "and", " ", "each", " ", "Contributor", " ", "provide", "s", " ", "its", " ", "Contribution", "s", ")", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ",", " ", "inclu", "ding", ",", " ", "with", "out", " ", "limit", "ation", ",", " ", "any", " ", "warr", "anti", "es", " ", "or", " ", "condition", "s", " ", "of", " ", "TIT", "LE", ",", " ", "NON", "-", "INF", "RING", "EME", "NT", ",", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", "You", " ", "are", " ", "sole", "ly", " ", "responsib", "le", " ", "for", " ", "determini", "ng", " ", "the", " ", "appropr", "iate", "ness", " ", "of", " ", "usi", "ng", " ", "or", " ", "redis", "tribut", "ing", " ", "the", " ", "Work", " ", "and", " ", "assume", " ", "any", " ", "risk", "s", " ", "associate", "d", " ", "with", " ", "You", "r", " ", "exercise", " ", "of", " ", "permissi", "ons", " ", "under", " ", "this", " ", "License", ".", "\\", "10", ";", "\\", "10", ";", "8", ".", " ", "Limit", "ation", " ", "of", " ", "Lia", "bilit", "y", ".", " ", "In", " ", "no", " ", "event", " ", "and", " ", "under", " ", "no", " ", "lega", "l", " ", "theory", ",", " ", "whe", "ther", " ", "in", " ", "tor", "t", " ", "(", "inclu", "ding", " ", "neg", "lig", "ence", "),", " ", "contract", ",", " ", "or", " ", "other", "wis", "e", ",", " ", "unl", "ess", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "(", "suc", "h", " ", "as", " ", "deli", "ber", "ate", " ", "and", " ", "gross", "ly", " ", "neg", "lig", "ent", " ", "acts", ")", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "sha", "ll", " ", "any", " ", "Contributor", " ", "be", " ", "lia", "ble", " ", "to", " ", "You", " ", "for", " ", "damage", "s", ",", " ", "inclu", "ding", " ", "any", " ", "direct", ",", " ", "indirect", ",", " ", "special", ",", " ", "incident", "al", ",", " ", "or", " ", "consequ", "ential", " ", "damage", "s", " ", "of", " ", "any", " ", "character", " ", "aris", "ing", " ", "as", " ", "a", " ", "result", " ", "of", " ", "this", " ", "License", " ", "or", " ", "out", " ", "of", " ", "the", " ", "use", " ", "or", " ", "ina", "bilit", "y", " ", "to", " ", "use", " ", "the", " ", "Work", " ", "(", "inclu", "ding", " ", "but", " ", "not", " ", "limited", " ", "to", " ", "damage", "s", " ", "for", " ", "loss", " ", "of", " ", "good", "will", ",", " ", "work", " ", "stopp", "age", ",", " ", "computer", " ", "fail", "ure", " ", "or", " ", "mal", "function", ",", " ", "or", " ", "any", " ", "and", " ", "all", " ", "other", " ", "commerc", "ial", " ", "damage", "s", " ", "or", " ", "loss", "es", "),", " ", "even", " ", "if", " ", "suc", "h", " ", "Contributor", " ", "has", " ", "bee", "n", " ", "advi", "sed", " ", "of", " ", "the", " ", "possibilit", "y", " ", "of", " ", "suc", "h", " ", "damage", "s", ".", "\\", "10", ";", "\\", "10", ";", "9", ".", " ", "Accept", "ing", " ", "War", "rant", "y", " ", "or", " ", "Addition", "al", " ", "Lia", "bilit", "y", ".", " ", "Whi", "le", " ", "redis", "tribut", "ing", " ", "the", " ", "Work", " ", "or", " ", "Derivati", "ve", " ", "Works", " ", "there", "of", ",", " ", "You", " ", "may", " ", "choose", " ", "to", " ", "off", "er", ",", " ", "and", " ", "charge", " ", "a", " ", "fe", "e", " ", "for", ",", " ", "acceptance", " ", "of", " ", "support", ",", " ", "warr", "ant", "y", ",", " ", "inde", "mni", "ty", ",", " ", "or", " ", "other", " ", "lia", "bilit", "y", " ", "obli", "gati", "ons", " ", "and", "/", "or", " ", "rights", " ", "consistent", " ", "with", " ", "this", " ", "License", ".", " ", "Ho", "we", "ver", ",", " ", "in", " ", "accept", "ing", " ", "suc", "h", " ", "obli", "gati", "ons", ",", " ", "You", " ", "may", " ", "act", " ", "only", " ", "on", " ", "You", "r", " ", "own", " ", "beha", "lf", " ", "and", " ", "on", " ", "You", "r", " ", "sole", " ", "responsib", "ilit", "y", ",", " ", "not", " ", "on", " ", "beha", "lf", " ", "of", " ", "any", " ", "other", " ", "Contributor", ",", " ", "and", " ", "only", " ", "if", " ", "You", " ", "agree", " ", "to", " ", "inde", "mni", "fy", ",", " ", "defend", ",", " ", "and", " ", "hold", " ", "each", " ", "Contributor", " ", "harm", "less", " ", "for", " ", "any", " ", "lia", "bilit", "y", " ", "inc", "urr", "ed", " ", "by", ",", " ", "or", " ", "claim", "s", " ", "assert", "ed", " ", "against", ",", " ", "suc", "h", " ", "Contributor", " ", "by", " ", "reason", " ", "of", " ", "your", " ", "accept", "ing", " ", "any", " ", "suc", "h", " ", "warr", "ant", "y", " ", "or", " ", "addition", "al", " ", "lia", "bilit", "y", ".", "\\", "10", ";", "\\", "10", ";", "END", " ", "OF", " ", "TERM", "S", " ", "AND", " ", "CONDITION", "S", "\\", "10", ";'", "''_", "\\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_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "robo", "fab", "_", "._", "world_", "import_", "Curr", "ent", "Glyph_", ",_", "Curr", "ent", "Font_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "RF", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RF", "Utils_", "._", "hack", "Path", "If", "Nec", "essa", "ry_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tfs", "_", "._", "common_", "._", "TF", "SP", "ath_", "import_", "TF", "SP", "ath_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tfs", "_", "._", "common_", "._", "TF", "SS", "eg", "ment_", "import_", "TF", "SS", "eg", "ment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tfs", "_", "._", "common_", "._", "TF", "SP", "oint_", "import_", "TF", "SP", "oint_", ",_", "TF", "SP", "oint", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tfs", "_", "._", "common_", "._", "TF", "SG", "ly", "ph_", "import_", "TF", "SG", "ly", "ph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tfs", "_", "._", "common_", "._", "TF", "SI", "nter", "section_", "as_", "TF", "SI", "nter", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "merge", "Select", "ed", "Point", "s", "In", "Curr", "ent", "Gl", "yp", "h", "()", "_", "\\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_", "process", "Glyph_", "(_", "glyph_", ",_", "glyph", "Name_", ",_", "paths_", ",_", "update", "Control", "Points_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "this", " ", "algo", "rit", "hm", " ", "only", " ", "use", " ", "end", " ", "points", "?", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'", "process", "Gl", "yp", "h", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "path", " ", "in", " ", "path", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'\\\\", "t", "',", " ", "'", "path", "',", " ", "path", ".", "description", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "segment", " ", "in", " ", "path", ".", "segments", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'\\\\", "t", "\\\\", "t", "',", " ", "'", "segment", "',", " ", "segment", ".", "description", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "all", "Points_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "path_", "in_", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "segment_", "in_", "path_", "._", "segments_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "Points_", "._", "append_", "(_", "segment_", "._", "start", "Point_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "Points_", "._", "append_", "(_", "segment_", "._", "end", "Point_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "all", "Point", "s", ".", "extend", "(", "segment", ".", "points", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "selecte", "d", "Points_", "=_", "[_", "point_", "for_", "point_", "in_", "all", "Points_", "if_", "point_", "._", "selected_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selecte", "d", "Points_", "=_", "set_", "(_", "selecte", "d", "Points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "selecte", "d", "Point", "s", "'_", ",_", "selecte", "d", "Points_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "selecte", "d", "Points_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "No", " ", "selecte", "d", " ", "points", " ", "found", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "point", "Sum_", "=_", "TF", "SP", "oint", "0_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "point_", "in_", "selecte", "d", "Points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "point", "Sum_", "=_", "point", "Sum_", "._", "plus_", "(_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "point", "Average", "_", "=_", "point", "Sum_", "._", "scale_", "(_", "1.0_", "/_", "len_", "(_", "selecte", "d", "Points_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'", "point", "Sum", "',", " ", "point", "Sum_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'", "point", "Average", "',", " ", "point", "Average", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "point", "Average", "_", "=_", "point", "Average", "_", "._", "round", "With", "Default", "Precis", "ion_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'", "point", "Average", "',", " ", "point", "Average", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "update", "Segment_", "(_", "segment_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "Point_", "=_", "segment_", "._", "start", "Point_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "start", "Off", "set", " ", "=", " ", "TF", "SP", "oint", "0", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "segment_", "._", "start", "Point_", "(_", ")_", "in_", "selecte", "d", "Points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "start", "Off", "set", " ", "=", " ", "point", "Average", ".", "minu", "s", "(", "start", "Point", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "Point_", "=_", "point", "Average", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "end", "Point_", "=_", "segment_", "._", "end", "Point_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "end", "Off", "set", " ", "=", " ", "TF", "SP", "oint", "0", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "segment_", "._", "end", "Point_", "(_", ")_", "in_", "selecte", "d", "Points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "end", "Off", "set", " ", "=", " ", "point", "Average", ".", "minu", "s", "(", "end", "Point", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end", "Point_", "=_", "point", "Average", "_", "\\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_", "start", "Point_", "==_", "end", "Point_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Points_", "=_", "[_", "start", "Point_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "segment_", "._", "points_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "segment_", "._", "points_", ")_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "update", "Control", "Points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pres", "erve", " ", "the", " ", "control", " ", "angle", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "control", "Point", "0_", "=_", "TF", "SI", "nter", "section_", "._", "get", "Intersect", "Point_", "(_", "start", "Point_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "Point_", "._", "plus_", "(_", "segment_", "._", "start", "Tang", "ent_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "Point_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "Point_", "._", "plus_", "(_", "segment_", "._", "end", "Tang", "ent_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "control", "Point", "0_", "=_", "segment_", "._", "points_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Points_", "+=_", "[_", "control", "Point", "0_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "offset", " ", "=", " ", "start", "Off", "set", ".", "blend", "(", "end", "Off", "set", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "control", "Point", "0", " ", "=", " ", "segment", ".", "points", "[", "1", "].", "plus", "(", "offset", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "new", "Point", "s", " ", "+=", " ", "[", "control", "Point", "0", ",]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "segment_", "._", "points_", ")_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "update", "Control", "Points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factor_", "=_", "start", "Point_", "._", "distance", "To_", "(_", "end", "Point_", ")_", "/_", "segment_", "._", "end", "Point", "Distance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control", "Point", "0_", "=_", "start", "Point_", "._", "plus_", "(_", "segment_", "._", "start", "Tang", "ent_", "(_", ")_", "._", "scale_", "(_", "segment_", "._", "start", "Vector_", "(_", ")_", "._", "length_", "(_", ")_", "*_", "factor_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control", "Point", "1_", "=_", "end", "Point_", "._", "plus_", "(_", "segment_", "._", "end", "Tang", "ent_", "(_", ")_", "._", "scale_", "(_", "segment_", "._", "end", "Vector_", "(_", ")_", "._", "length_", "(_", ")_", "*_", "-_", "factor_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "control", "Point", "0_", "=_", "segment_", "._", "points_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control", "Point", "1_", "=_", "segment_", "._", "points_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Points_", "+=_", "[_", "control", "Point", "0_", ",_", "control", "Point", "1_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "control", "Point", "0", " ", "=", " ", "segment", ".", "points", "[", "1", "].", "plus", "(", "start", "Off", "set", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "control", "Point", "1", " ", "=", " ", "segment", ".", "points", "[", "2", "].", "plus", "(", "end", "Off", "set", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "new", "Point", "s", " ", "+=", " ", "[", "control", "Point", "0", ",", " ", "control", "Point", "1", ",]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Inva", "lid", " ", "segment", ":", " ", "'_", "+_", "segment_", "._", "description_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Points_", "+=_", "[_", "end", "Point_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "TF", "SS", "eg", "ment_", "(_", "*_", "new", "Points_", ")_", "\\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_", "new", "Paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "path_", "in_", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Segments", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "segment_", "in_", "path_", "._", "segments_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "segment_", "._", "start", "Point_", "(_", ")_", "in_", "selecte", "d", "Points_", "or_", "segment_", "._", "end", "Point_", "(_", ")_", "in_", "selecte", "d", "Points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "'", "segment", "',", " ", "segment", ".", "description", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Segment_", "=_", "update", "Segment_", "(_", "segment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "Segment_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "print", " ", "'", "new", "Segme", "nt", "',", " ", "new", "Segme", "nt", ".", "description", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "new", "Segments", "_", "._", "append_", "(_", "new", "Segment_", ")_", "\\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 ", " _", "new", "Segments", "_", "._", "append_", "(_", "segment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Paths_", "._", "append_", "(_", "TF", "SP", "ath_", "(_", "True_", ",_", "*_", "new", "Segments", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "new", "Paths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "merge", "Select", "ed", "Point", "s", "In", "Glyph_", "(_", "rf", "glyph_", ",_", "update", "Control", "Points_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rf", "glyph_", "._", "prepar", "e", "Und", "o_", "(_", "\"", "Merge", " ", "Point", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "glyph_", "=_", "TF", "SG", "ly", "ph_", "(_", "rf", "glyph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "glyph", "Name_", "=_", "hex_", "(_", "glyph_", "._", "unicode_", ")_", "if_", "glyph_", "._", "unicode_", "is_", "not_", "None_", "else_", "'<", "Non", "e", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paths_", "=_", "glyph_", "._", "get", "Contours", "_", "(_", "set", "Selected_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paths_", "=_", "process", "Glyph_", "(_", "glyph_", ",_", "glyph", "Name_", ",_", "paths_", ",_", "update", "Control", "Points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "paths_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "glyph_", "._", "set", "Contours", "_", "(_", "paths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "tell", " ", "the", " ", "glyph", " ", "you", " ", "are", " ", "don", "e", " ", "with", " ", "your", " ", "action", "s", " ", "so", " ", "it", " ", "can", " ", "handle", " ", "the", " ", "undo", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rf", "glyph_", "._", "perform", "Und", "o_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "merge", "Select", "ed", "Point", "s", "In", "Curr", "ent", "Glyph_", "(_", "update", "Control", "Points_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "glyph_", "=_", "Curr", "ent", "Glyph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "glyph_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "No", " ", "current", " ", "glyph", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "merge", "Select", "ed", "Point", "s", "In", "Glyph_", "(_", "glyph_", ",_", "update", "Control", "Points_", ")_", "\\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, 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
HydraChain/hydrachain/hydrachain/tests/test_base.py
[ { "content": "def test_blockproposal():\n s = tester.state()\n\n # block 1\n s.mine(n=1)\n genesis = s.blocks[0]\n assert genesis.header.number == 0\n blk1 = s.blocks[1]\n assert blk1.header.number == 1\n gls = genesis_signing_lockset(genesis, privkeys[0])\n bp = BlockProposal(height=1, round=0, block=blk1, signing_lockset=gls, round_lockset=None)\n assert bp.lockset == gls\n assert isinstance(bp, Proposal)\n bp.sign(tester.k0)\n\n with pytest.raises(InvalidProposalError): # round >0 needs round_lockset\n bp = BlockProposal(height=1, round=1, block=blk1, signing_lockset=gls, round_lockset=None)\n bp.validate_votes(validators, validators[:1])\n\n # block 2\n s.mine(n=1)\n blk2 = s.blocks[2]\n assert blk2.header.number == 2\n\n ls = LockSet(len(validators))\n for privkey in privkeys:\n v = VoteBlock(height=1, round=0, blockhash=blk1.hash)\n v.sign(privkey)\n ls.add(v)\n\n bp = BlockProposal(height=2, round=0, block=blk2, signing_lockset=ls, round_lockset=None)\n assert bp.lockset == ls\n with pytest.raises(InvalidProposalError): # signature missing\n bp.validate_votes(validators, validators)\n\n with pytest.raises(InvalidProposalError):\n bp.sign(privkeys[0]) # privkey doesnt match coinbase\n bp.validate_votes(validators, validators)\n\n with pytest.raises(InvalidSignature): # already signed\n bp.sign(tester.k0)\n\n bp.v = 0 # reset sigcheck hack\n bp.sign(tester.k0)\n\n bp.validate_votes(validators, validators)\n\n with pytest.raises(InvalidProposalError): # round >0 needs round_lockset\n bp = BlockProposal(height=2, round=1, block=blk2, signing_lockset=gls, round_lockset=None)\n\n # block 2 round 1, timeout in round=0\n rls = LockSet(len(validators))\n for privkey in privkeys:\n v = VoteNil(height=2, round=0)\n v.sign(privkey)\n rls.add(v)\n bp = BlockProposal(height=2, round=1, block=blk2, signing_lockset=ls, round_lockset=rls)\n assert bp.lockset == rls\n bp.sign(tester.k0)\n bp.validate_votes(validators, validators)\n\n # serialize\n s = rlp.encode(bp)\n dbp = rlp.decode(s, BlockProposal)\n assert dbp.block == blk2\n\n dbp.validate_votes(validators, validators)\n\n # check quorumpossible lockset failure\n rls = LockSet(len(validators))\n for i, privkey in enumerate(privkeys):\n if i < 4:\n v = VoteBlock(height=2, round=0, blockhash='0' * 32)\n else:\n v = VoteNil(height=2, round=0)\n v.sign(privkey)\n rls.add(v)\n assert not rls.has_noquorum\n assert rls.has_quorum_possible\n with pytest.raises(InvalidProposalError): # NoQuorum necessary R0\n bp = BlockProposal(height=2, round=1, block=blk2, signing_lockset=ls, round_lockset=rls)", "metadata": "root.test_blockproposal", "header": "['module', '___EOS___']", "index": 262 }, { "content": "def test_VotingInstruction():\n rls = LockSet(len(validators))\n bh = '1' * 32\n for i, privkey in enumerate(privkeys):\n if i < 4: # quorum possible\n v = VoteBlock(height=2, round=0, blockhash=bh)\n\n else:\n v = VoteNil(height=2, round=0)\n v.sign(privkey)\n rls.add(v)\n assert rls.has_quorum_possible\n bp = VotingInstruction(height=2, round=1, round_lockset=rls)\n bp.sign(privkeys[0])\n assert bh == bp.blockhash\n\n # noquorum\n rls = LockSet(len(validators))\n for i, privkey in enumerate(privkeys):\n if i < 3: # noquorum possible\n v = VoteBlock(height=2, round=0, blockhash=bh)\n else:\n v = VoteNil(height=2, round=0)\n v.sign(privkey)\n rls.add(v)\n assert not rls.has_quorum_possible\n assert rls.has_noquorum\n with pytest.raises(InvalidProposalError): # QuorumPossiblle necessary R0\n bp = VotingInstruction(height=2, round=1, round_lockset=rls)\n\n # noquorum\n rls = LockSet(len(validators))\n for i, privkey in enumerate(privkeys):\n if i < 3: # noquorum possible\n v = VoteBlock(height=2, round=0, blockhash=bh)\n else:\n v = VoteNil(height=2, round=0)\n\n v.sign(privkey)\n rls.add(v)\n assert not rls.has_quorum_possible\n assert rls.has_noquorum\n with pytest.raises(InvalidProposalError): # QuorumPossiblle necessary R0\n bp = VotingInstruction(height=2, round=1, round_lockset=rls)", "metadata": "root.test_VotingInstruction", "header": "['module', '___EOS___']", "index": 345 } ]
[ { "span": "bp ", "start_line": 310, "start_column": 8, "end_line": 310, "end_column": 10 }, { "span": "bp ", "start_line": 373, "start_column": 8, "end_line": 373, "end_column": 10 } ]
[ { "span": "bp ", "start_line": 318, "start_column": 4, "end_line": 318, "end_column": 6 }, { "span": "bp ", "start_line": 388, "start_column": 8, "end_line": 388, "end_column": 10 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "block", "proposal_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "tester_", "._", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "block", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "mine_", "(_", "n_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "genesi", "s_", "=_", "s_", "._", "blocks_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "genesi", "s_", "._", "header_", "._", "number_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blk", "1_", "=_", "s_", "._", "blocks_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "blk", "1_", "._", "header_", "._", "number_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gls", "_", "=_", "genesi", "s", "\\u", "signin", "g", "\\u", "lock", "set_", "(_", "genesi", "s_", ",_", "priv", "keys_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "=_", "Block", "Propos", "al_", "(_", "height_", "=_", "1_", ",_", "round_", "=_", "0_", ",_", "block_", "=_", "blk", "1_", ",_", "signin", "g", "\\u", "lock", "set_", "=_", "gls", "_", ",_", "round", "\\u", "lock", "set_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "bp_", "._", "lock", "set_", "==_", "gls", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "bp_", ",_", "Propos", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "._", "sign_", "(_", "tester_", "._", "k0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "#", " ", "round", " ", ">", "0", " ", "need", "s", " ", "round", "\\u", "lock", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "=_", "Block", "Propos", "al_", "(_", "height_", "=_", "1_", ",_", "round_", "=_", "1_", ",_", "block_", "=_", "blk", "1_", ",_", "signin", "g", "\\u", "lock", "set_", "=_", "gls", "_", ",_", "round", "\\u", "lock", "set_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bp_", "._", "validat", "e\\u", "votes_", "(_", "validators_", ",_", "validators_", "[_", ":_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "block", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "mine_", "(_", "n_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blk", "2_", "=_", "s_", "._", "blocks_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "blk", "2_", "._", "header_", "._", "number_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ls_", "=_", "Lock", "Set_", "(_", "len_", "(_", "validators_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "privkey_", "in_", "priv", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Block_", "(_", "height_", "=_", "1_", ",_", "round_", "=_", "0_", ",_", "block", "hash_", "=_", "blk", "1_", "._", "hash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "sign_", "(_", "privkey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls_", "._", "add_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bp_", "=_", "Block", "Propos", "al_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ",_", "block_", "=_", "blk", "2_", ",_", "signin", "g", "\\u", "lock", "set_", "=_", "ls_", ",_", "round", "\\u", "lock", "set_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "bp_", "._", "lock", "set_", "==_", "ls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "#", " ", "signa", "ture", " ", "missing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "._", "validat", "e\\u", "votes_", "(_", "validators_", ",_", "validators_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "._", "sign_", "(_", "priv", "keys_", "[_", "0_", "]_", ")_", "#", " ", "priv", "key", " ", "doesnt", " ", "match", " ", "coinbase", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "._", "validat", "e\\u", "votes_", "(_", "validators_", ",_", "validators_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Signature_", ")_", ":_", "#", " ", "alr", "ead", "y", " ", "signed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "._", "sign_", "(_", "tester_", "._", "k0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bp_", "._", "v_", "=_", "0_", "#", " ", "reset", " ", "sig", "check", " ", "hack", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "._", "sign_", "(_", "tester_", "._", "k0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bp_", "._", "validat", "e\\u", "votes_", "(_", "validators_", ",_", "validators_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "#", " ", "round", " ", ">", "0", " ", "need", "s", " ", "round", "\\u", "lock", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "=_", "Block", "Propos", "al_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "1_", ",_", "block_", "=_", "blk", "2_", ",_", "signin", "g", "\\u", "lock", "set_", "=_", "gls", "_", ",_", "round", "\\u", "lock", "set_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "block", " ", "2", " ", "round", " ", "1", ",", " ", "timeo", "ut", " ", "in", " ", "round", "=", "0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rls", "_", "=_", "Lock", "Set_", "(_", "len_", "(_", "validators_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "privkey_", "in_", "priv", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Ni", "l_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "sign_", "(_", "privkey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rls", "_", "._", "add_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bp_", "=_", "Block", "Propos", "al_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "1_", ",_", "block_", "=_", "blk", "2_", ",_", "signin", "g", "\\u", "lock", "set_", "=_", "ls_", ",_", "round", "\\u", "lock", "set_", "=_", "rls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "bp_", "._", "lock", "set_", "==_", "rls", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "._", "sign_", "(_", "tester_", "._", "k0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "._", "validat", "e\\u", "votes_", "(_", "validators_", ",_", "validators_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serialize_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "rlp", "_", "._", "encode_", "(_", "bp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbp", "_", "=_", "rlp", "_", "._", "decode_", "(_", "s_", ",_", "Block", "Propos", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dbp", "_", "._", "block_", "==_", "blk", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dbp", "_", "._", "validat", "e\\u", "votes_", "(_", "validators_", ",_", "validators_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "quorum", "possib", "le", " ", "lock", "set", " ", "failure_", "\\u\\u\\uNL\\u\\u\\u_", "rls", "_", "=_", "Lock", "Set_", "(_", "len_", "(_", "validators_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "privkey_", "in_", "enumerate_", "(_", "priv", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "<_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Block_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ",_", "block", "hash_", "=_", "'", "0", "'_", "*_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Ni", "l_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "._", "sign_", "(_", "privkey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rls", "_", "._", "add_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "not_", "rls", "_", "._", "has", "\\u", "no", "quorum", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rls", "_", "._", "has", "\\u", "quorum", "\\u", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "#", " ", "No", "Qu", "or", "um", " ", "necessar", "y", " ", "R0", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "=_", "Block", "Propos", "al_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "1_", ",_", "block_", "=_", "blk", "2_", ",_", "signin", "g", "\\u", "lock", "set_", "=_", "ls_", ",_", "round", "\\u", "lock", "set_", "=_", "rls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "Vo", "ting", "Instruction_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rls", "_", "=_", "Lock", "Set_", "(_", "len_", "(_", "validators_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bh_", "=_", "'", "1", "'_", "*_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "privkey_", "in_", "enumerate_", "(_", "priv", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "<_", "4_", ":_", "#", " ", "quorum", " ", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Block_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ",_", "block", "hash_", "=_", "bh_", ")_", "\\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 ", " _", "v_", "=_", "Vote", "Ni", "l_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "._", "sign_", "(_", "privkey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rls", "_", "._", "add_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "rls", "_", "._", "has", "\\u", "quorum", "\\u", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "=_", "Vo", "ting", "Instruction_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "1_", ",_", "round", "\\u", "lock", "set_", "=_", "rls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bp_", "._", "sign_", "(_", "priv", "keys_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "bh_", "==_", "bp_", "._", "block", "hash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", "quorum", "_", "\\u\\u\\uNL\\u\\u\\u_", "rls", "_", "=_", "Lock", "Set_", "(_", "len_", "(_", "validators_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "privkey_", "in_", "enumerate_", "(_", "priv", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "<_", "3_", ":_", "#", " ", "no", "quorum", " ", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Block_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ",_", "block", "hash_", "=_", "bh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Ni", "l_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "._", "sign_", "(_", "privkey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rls", "_", "._", "add_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "not_", "rls", "_", "._", "has", "\\u", "quorum", "\\u", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rls", "_", "._", "has", "\\u", "no", "quorum", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "#", " ", "Qu", "or", "um", "Poss", "ibl", "le", " ", "necessar", "y", " ", "R0", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "=_", "Vo", "ting", "Instruction_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "1_", ",_", "round", "\\u", "lock", "set_", "=_", "rls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", "quorum", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rls", "_", "=_", "Lock", "Set_", "(_", "len_", "(_", "validators_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "privkey_", "in_", "enumerate_", "(_", "priv", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "<_", "3_", ":_", "#", " ", "no", "quorum", " ", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Block_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ",_", "block", "hash_", "=_", "bh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "Vote", "Ni", "l_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v_", "._", "sign_", "(_", "privkey_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rls", "_", "._", "add_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "not_", "rls", "_", "._", "has", "\\u", "quorum", "\\u", "possible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rls", "_", "._", "has", "\\u", "no", "quorum", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Inva", "lid", "Propos", "al", "Error_", ")_", ":_", "#", " ", "Qu", "or", "um", "Poss", "ibl", "le", " ", "necessar", "y", " ", "R0", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bp_", "=_", "Vo", "ting", "Instruction_", "(_", "height_", "=_", "2_", ",_", "round_", "=_", "1_", ",_", "round", "\\u", "lock", "set_", "=_", "rls", "_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
cloudera/hue/desktop/core/ext-py/South-1.0.2/south/management/commands/__init__.py
[ { "content": "\n# Common framework for syncdb actions\n\nimport copy\n\nfrom django.core import management\nfrom django.conf import settings\n\n# Make sure the template loader cache is fixed _now_ (#448)\nimport django.template.loaders.app_directories\n\nfrom south.hacks import hacks\nfrom south.management.commands.syncdb import Command as SyncCommand\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MigrateAndSyncCommand(SyncCommand):\n \"\"\"Used for situations where \"syncdb\" is called by test frameworks.\"\"\"\n\n option_list = copy.deepcopy(SyncCommand.option_list)\n\n for opt in option_list:\n if \"--migrate\" == opt.get_opt_string():\n opt.default = True\n break", "metadata": "root.MigrateAndSyncCommand", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def patch_for_test_db_setup():\n # Load the commands cache\n management.get_commands()\n # Repoint to the correct version of syncdb\n if hasattr(settings, \"SOUTH_TESTS_MIGRATE\") and not settings.SOUTH_TESTS_MIGRATE:\n # point at the core syncdb command when creating tests\n # tests should always be up to date with the most recent model structure\n management._commands['syncdb'] = 'django.core'\n else:\n management._commands['syncdb'] = MigrateAndSyncCommand()\n # Avoid flushing data migrations.\n # http://code.djangoproject.com/ticket/14661 introduced change that flushed custom\n # sql during the test database creation (thus flushing the data migrations).\n # we patch flush to be no-op during create_test_db, but still allow flushing\n # after each test for non-transactional backends.\n hacks.patch_flush_during_test_db_creation()", "metadata": "root.patch_for_test_db_setup", "header": "['module', '___EOS___']", "index": 24 } ]
[ { "span": "import django.template.loaders.app_directories", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Common", " ", "frame", "work", " ", "for", " ", "sync", "db", " ", "actions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "import_", "management_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "template", " ", "load", "er", " ", "cache", " ", "is", " ", "fixed", " ", "\\u", "now", "\\u", " ", "(", "#", "448", ")_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "django_", "._", "template_", "._", "loaders_", "._", "app", "\\u", "directories_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "south_", "._", "hack", "s_", "import_", "hack", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "management_", "._", "commands_", "._", "sync", "db_", "import_", "Command_", "as_", "Sync", "Command_", "\\u\\u\\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_", "Migrat", "e", "And", "Sync", "Command_", "(_", "Sync", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Us", "ed", " ", "for", " ", "situation", "s", " ", "where", " ", "\"", "sync", "db", "\"", " ", "is", " ", "call", "ed", " ", "by", " ", "test", " ", "frameworks", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "option", "\\u", "list_", "=_", "copy_", "._", "deepcopy_", "(_", "Sync", "Command_", "._", "option", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "opt_", "in_", "option", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"--", "migr", "ate", "\"_", "==_", "opt_", "._", "get", "\\u", "opt", "\\u", "string_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opt_", "._", "default_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "patch", "\\u", "for", "\\u", "test\\u", "db", "\\u", "setup_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Load", " ", "the", " ", "command", "s", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "management_", "._", "get", "\\u", "commands_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Rep", "oint", " ", "to", " ", "the", " ", "correct", " ", "version", " ", "of", " ", "sync", "db_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "settings_", ",_", "\"", "SOUT", "H", "\\u", "TESTS", "\\u", "MIGRAT", "E", "\"_", ")_", "and_", "not_", "settings_", "._", "SOUT", "H", "\\u", "TESTS", "\\u", "MIGRAT", "E_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "point", " ", "at", " ", "the", " ", "core", " ", "sync", "db", " ", "command", " ", "whe", "n", " ", "creati", "ng", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", " ", "shou", "ld", " ", "alw", "ay", "s", " ", "be", " ", "up", " ", "to", " ", "date", " ", "with", " ", "the", " ", "most", " ", "recent", " ", "model", " ", "structure_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "management_", "._", "\\u", "commands_", "[_", "'", "sync", "db", "'_", "]_", "=_", "'", "django", ".", "core", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "management_", "._", "\\u", "commands_", "[_", "'", "sync", "db", "'_", "]_", "=_", "Migrat", "e", "And", "Sync", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Av", "oid", " ", "flush", "ing", " ", "data", " ", "migrati", "ons", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "code", ".", "django", "project", ".", "com", "/", "tick", "et", "/", "1466", "1", " ", "introduce", "d", " ", "change", " ", "tha", "t", " ", "flush", "ed", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sql", " ", "dur", "ing", " ", "the", " ", "test", " ", "databa", "se", " ", "creati", "on", " ", "(", "thu", "s", " ", "flush", "ing", " ", "the", " ", "data", " ", "migrati", "ons", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "patch", " ", "flush", " ", "to", " ", "be", " ", "no", "-", "op", " ", "dur", "ing", " ", "create", "\\u", "test\\u", "db", ",", " ", "but", " ", "still", " ", "allow", " ", "flush", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "after", " ", "each", " ", "test", " ", "for", " ", "non", "-", "transaction", "al", " ", "back", "ends", "._", "\\u\\u\\uNL\\u\\u\\u_", "hack", "s_", "._", "patch", "\\u", "flush", "\\u", "dur", "ing", "\\u", "test\\u", "db", "\\u", "creation_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 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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\n\"\"\"oauth2client Service account credentials class.\"\"\"\n\nimport base64\nimport copy\nimport datetime\nimport json\nimport time\n\nfrom oauth2client import GOOGLE_REVOKE_URI\nfrom oauth2client import GOOGLE_TOKEN_URI\nfrom oauth2client._helpers import _json_encode\nfrom oauth2client._helpers import _from_bytes\nfrom oauth2client._helpers import _urlsafe_b64encode\nfrom oauth2client import util\nfrom oauth2client.client import AssertionCredentials\nfrom oauth2client.client import EXPIRY_FORMAT\nfrom oauth2client.client import SERVICE_ACCOUNT\nfrom oauth2client import crypt\n\n\n_PASSWORD_DEFAULT = 'notasecret'\n_PKCS12_KEY = '_private_key_pkcs12'\n_PKCS12_ERROR = r\"\"\"\nThis library only implements PKCS#12 support via the pyOpenSSL library.\nEither install pyOpenSSL, or please convert the .p12 file\nto .pem format:\n $ cat key.p12 | \\\n > openssl pkcs12 -nodes -nocerts -passin pass:notasecret | \\\n > openssl rsa > key.pem\n\"\"\"\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ServiceAccountCredentials(AssertionCredentials):\n \"\"\"Service Account credential for OAuth 2.0 signed JWT grants.\n\n Supports\n\n * JSON keyfile (typically contains a PKCS8 key stored as\n PEM text)\n * ``.p12`` key (stores PKCS12 key and certificate)\n\n Makes an assertion to server using a signed JWT assertion in exchange\n for an access token.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens.\n\n Args:\n service_account_email: string, The email associated with the\n service account.\n signer: ``crypt.Signer``, A signer which can be used to sign content.\n scopes: List or string, (Optional) Scopes to use when acquiring\n an access token.\n private_key_id: string, (Optional) Private key identifier. Typically\n only used with a JSON keyfile. Can be sent in the\n header of a JWT token assertion.\n client_id: string, (Optional) Client ID for the project that owns the\n service account.\n user_agent: string, (Optional) User agent to use when sending\n request.\n kwargs: dict, Extra key-value pairs (both strings) to send in the\n payload body when making an assertion.\n \"\"\"\n\n MAX_TOKEN_LIFETIME_SECS = 3600\n \"\"\"Max lifetime of the token (one hour, in seconds).\"\"\"\n\n NON_SERIALIZED_MEMBERS = (\n frozenset(['_signer']) |\n AssertionCredentials.NON_SERIALIZED_MEMBERS)\n \"\"\"Members that aren't serialized when object is converted to JSON.\"\"\"\n\n # Can be over-ridden by factory constructors. Used for\n # serialization/deserialization purposes.\n _private_key_pkcs8_pem = None\n _private_key_pkcs12 = None\n _private_key_password = None\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ServiceAccountCredentials", "header": "['module', '___EOS___']", "index": 46 }, { "content": " def __init__(self,\n service_account_email,\n signer,\n scopes='',\n private_key_id=None,\n client_id=None,\n user_agent=None,\n **kwargs):\n\n super(ServiceAccountCredentials, self).__init__(\n None, user_agent=user_agent)\n\n self._service_account_email = service_account_email\n self._signer = signer\n self._scopes = util.scopes_to_string(scopes)\n self._private_key_id = private_key_id\n self.client_id = client_id\n self._user_agent = user_agent\n self._kwargs = kwargs", "metadata": "root.ServiceAccountCredentials.__init__", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 93 }, { "content": " def _to_json(self, strip, to_serialize=None):\n \"\"\"Utility function that creates JSON repr. of a credentials object.\n\n Over-ride is needed since PKCS#12 keys will not in general be JSON\n serializable.\n\n Args:\n strip: array, An array of names of members to exclude from the\n JSON.\n to_serialize: dict, (Optional) The properties for this object\n that will be serialized. This allows callers to modify\n before serializing.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json().\n \"\"\"\n if to_serialize is None:\n to_serialize = copy.copy(self.__dict__)\n pkcs12_val = to_serialize.get(_PKCS12_KEY)\n if pkcs12_val is not None:\n to_serialize[_PKCS12_KEY] = base64.b64encode(pkcs12_val)\n return super(ServiceAccountCredentials, self)._to_json(\n strip, to_serialize=to_serialize)", "metadata": "root.ServiceAccountCredentials._to_json", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 113 }, { "content": " @classmethod\n def _from_parsed_json_keyfile(cls, keyfile_dict, scopes):\n \"\"\"Helper for factory constructors from JSON keyfile.\n\n Args:\n keyfile_dict: dict-like object, The parsed dictionary-like object\n containing the contents of the JSON keyfile.\n scopes: List or string, Scopes to use when acquiring an\n access token.\n\n Returns:\n ServiceAccountCredentials, a credentials object created from\n the keyfile contents.\n\n Raises:\n ValueError, if the credential type is not :data:`SERVICE_ACCOUNT`.\n KeyError, if one of the expected keys is not present in\n the keyfile.\n \"\"\"\n creds_type = keyfile_dict.get('type')\n if creds_type != SERVICE_ACCOUNT:\n raise ValueError('Unexpected credentials type', creds_type,\n 'Expected', SERVICE_ACCOUNT)\n\n service_account_email = keyfile_dict['client_email']\n private_key_pkcs8_pem = keyfile_dict['private_key']\n private_key_id = keyfile_dict['private_key_id']\n client_id = keyfile_dict['client_id']\n\n signer = crypt.Signer.from_string(private_key_pkcs8_pem)\n credentials = cls(service_account_email, signer, scopes=scopes,\n private_key_id=private_key_id,\n client_id=client_id)\n credentials._private_key_pkcs8_pem = private_key_pkcs8_pem\n return credentials", "metadata": "root.ServiceAccountCredentials._from_parsed_json_keyfile", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 138 }, { "content": " @classmethod\n def from_json_keyfile_name(cls, filename, scopes=''):\n \"\"\"Factory constructor from JSON keyfile by name.\n\n Args:\n filename: string, The location of the keyfile.\n scopes: List or string, (Optional) Scopes to use when acquiring an\n access token.\n\n Returns:\n ServiceAccountCredentials, a credentials object created from\n the keyfile.\n\n Raises:\n ValueError, if the credential type is not :data:`SERVICE_ACCOUNT`.\n KeyError, if one of the expected keys is not present in\n the keyfile.\n \"\"\"\n with open(filename, 'r') as file_obj:\n client_credentials = json.load(file_obj)\n return cls._from_parsed_json_keyfile(client_credentials, scopes)", "metadata": "root.ServiceAccountCredentials.from_json_keyfile_name", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 174 }, { "content": " @classmethod\n def from_json_keyfile_dict(cls, keyfile_dict, scopes=''):\n \"\"\"Factory constructor from parsed JSON keyfile.\n\n Args:\n keyfile_dict: dict-like object, The parsed dictionary-like object\n containing the contents of the JSON keyfile.\n scopes: List or string, (Optional) Scopes to use when acquiring an\n access token.\n\n Returns:\n ServiceAccountCredentials, a credentials object created from\n the keyfile.\n\n Raises:\n ValueError, if the credential type is not :data:`SERVICE_ACCOUNT`.\n KeyError, if one of the expected keys is not present in\n the keyfile.\n \"\"\"\n return cls._from_parsed_json_keyfile(keyfile_dict, scopes)", "metadata": "root.ServiceAccountCredentials.from_json_keyfile_dict", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 196 }, { "content": " @classmethod\n def _from_p12_keyfile_contents(cls, service_account_email,\n private_key_pkcs12,\n private_key_password=None, scopes=''):\n \"\"\"Factory constructor from JSON keyfile.\n\n Args:\n service_account_email: string, The email associated with the\n service account.\n private_key_pkcs12: string, The contents of a PKCS#12 keyfile.\n private_key_password: string, (Optional) Password for PKCS#12\n private key. Defaults to ``notasecret``.\n scopes: List or string, (Optional) Scopes to use when acquiring an\n access token.\n\n Returns:\n ServiceAccountCredentials, a credentials object created from\n the keyfile.\n\n Raises:\n NotImplementedError if pyOpenSSL is not installed / not the\n active crypto library.\n \"\"\"\n if private_key_password is None:\n private_key_password = _PASSWORD_DEFAULT\n if crypt.Signer is not crypt.OpenSSLSigner:\n raise NotImplementedError(_PKCS12_ERROR)\n signer = crypt.Signer.from_string(private_key_pkcs12,\n private_key_password)\n credentials = cls(service_account_email, signer, scopes=scopes)\n credentials._private_key_pkcs12 = private_key_pkcs12\n credentials._private_key_password = private_key_password\n return credentials", "metadata": "root.ServiceAccountCredentials._from_p12_keyfile_contents", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 217 }, { "content": " @classmethod\n def from_p12_keyfile(cls, service_account_email, filename,\n private_key_password=None, scopes=''):\n \"\"\"Factory constructor from JSON keyfile.\n\n Args:\n service_account_email: string, The email associated with the\n service account.\n filename: string, The location of the PKCS#12 keyfile.\n private_key_password: string, (Optional) Password for PKCS#12\n private key. Defaults to ``notasecret``.\n scopes: List or string, (Optional) Scopes to use when acquiring an\n access token.\n\n Returns:\n ServiceAccountCredentials, a credentials object created from\n the keyfile.\n\n Raises:\n NotImplementedError if pyOpenSSL is not installed / not the\n active crypto library.\n \"\"\"\n with open(filename, 'rb') as file_obj:\n private_key_pkcs12 = file_obj.read()\n return cls._from_p12_keyfile_contents(\n service_account_email, private_key_pkcs12,\n private_key_password=private_key_password, scopes=scopes)", "metadata": "root.ServiceAccountCredentials.from_p12_keyfile", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 251 }, { "content": " @classmethod\n def from_p12_keyfile_buffer(cls, service_account_email, file_buffer,\n private_key_password=None, scopes=''):\n \"\"\"Factory constructor from JSON keyfile.\n\n Args:\n service_account_email: string, The email associated with the\n service account.\n file_buffer: stream, A buffer that implements ``read()``\n and contains the PKCS#12 key contents.\n private_key_password: string, (Optional) Password for PKCS#12\n private key. Defaults to ``notasecret``.\n scopes: List or string, (Optional) Scopes to use when acquiring an\n access token.\n\n Returns:\n ServiceAccountCredentials, a credentials object created from\n the keyfile.\n\n Raises:\n NotImplementedError if pyOpenSSL is not installed / not the\n active crypto library.\n \"\"\"\n private_key_pkcs12 = file_buffer.read()\n return cls._from_p12_keyfile_contents(\n service_account_email, private_key_pkcs12,\n private_key_password=private_key_password, scopes=scopes)", "metadata": "root.ServiceAccountCredentials.from_p12_keyfile_buffer", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 279 }, { "content": " def _generate_assertion(self):\n \"\"\"Generate the assertion that will be used in the request.\"\"\"\n now = int(time.time())\n payload = {\n 'aud': self.token_uri,\n 'scope': self._scopes,\n 'iat': now,\n 'exp': now + self.MAX_TOKEN_LIFETIME_SECS,\n 'iss': self._service_account_email,\n }\n payload.update(self._kwargs)\n return crypt.make_signed_jwt(self._signer, payload,\n key_id=self._private_key_id)", "metadata": "root.ServiceAccountCredentials._generate_assertion", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 307 }, { "content": " def sign_blob(self, blob):\n \"\"\"Cryptographically sign a blob (of bytes).\n\n Implements abstract method\n :meth:`oauth2client.client.AssertionCredentials.sign_blob`.\n\n Args:\n blob: bytes, Message to be signed.\n\n Returns:\n tuple, A pair of the private key ID used to sign the blob and\n the signed contents.\n \"\"\"\n return self._private_key_id, self._signer.sign(blob)", "metadata": "root.ServiceAccountCredentials.sign_blob", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 321 }, { "content": " @property\n def service_account_email(self):\n \"\"\"Get the email for the current service account.\n\n Returns:\n string, The email associated with the service account.\n \"\"\"\n return self._service_account_email", "metadata": "root.ServiceAccountCredentials.service_account_email", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 336 }, { "content": " @property\n def serialization_data(self):\n # NOTE: This is only useful for JSON keyfile.\n return {\n 'type': 'service_account',\n 'client_email': self._service_account_email,\n 'private_key_id': self._private_key_id,\n 'private_key': self._private_key_pkcs8_pem,\n 'client_id': self.client_id,\n }", "metadata": "root.ServiceAccountCredentials.serialization_data", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 345 }, { "content": " @classmethod\n def from_json(cls, json_data):\n \"\"\"Deserialize a JSON-serialized instance.\n\n Inverse to :meth:`to_json`.\n\n Args:\n json_data: dict or string, Serialized JSON (as a string or an\n already parsed dictionary) representing a credential.\n\n Returns:\n ServiceAccountCredentials from the serialized data.\n \"\"\"\n if not isinstance(json_data, dict):\n json_data = json.loads(_from_bytes(json_data))\n\n private_key_pkcs8_pem = None\n pkcs12_val = json_data.get(_PKCS12_KEY)\n password = None\n if pkcs12_val is None:\n private_key_pkcs8_pem = json_data['_private_key_pkcs8_pem']\n signer = crypt.Signer.from_string(private_key_pkcs8_pem)\n else:\n # NOTE: This assumes that private_key_pkcs8_pem is not also\n # in the serialized data. This would be very incorrect\n # state.\n pkcs12_val = base64.b64decode(pkcs12_val)\n password = json_data['_private_key_password']\n signer = crypt.Signer.from_string(pkcs12_val, password)\n\n credentials = cls(\n json_data['_service_account_email'],\n signer,\n scopes=json_data['_scopes'],\n private_key_id=json_data['_private_key_id'],\n client_id=json_data['client_id'],\n user_agent=json_data['_user_agent'],\n **json_data['_kwargs']\n )\n if private_key_pkcs8_pem is not None:\n credentials._private_key_pkcs8_pem = private_key_pkcs8_pem\n if pkcs12_val is not None:\n credentials._private_key_pkcs12 = pkcs12_val\n if password is not None:\n credentials._private_key_password = password\n credentials.invalid = json_data['invalid']\n credentials.access_token = json_data['access_token']\n credentials.token_uri = json_data['token_uri']\n credentials.revoke_uri = json_data['revoke_uri']\n token_expiry = json_data.get('token_expiry', None)\n if token_expiry is not None:\n credentials.token_expiry = datetime.datetime.strptime(\n token_expiry, EXPIRY_FORMAT)\n return credentials", "metadata": "root.ServiceAccountCredentials.from_json", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 356 }, { "content": " def create_scoped_required(self):\n return not self._scopes", "metadata": "root.ServiceAccountCredentials.create_scoped_required", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 411 }, { "content": " def create_scoped(self, scopes):\n result = self.__class__(self._service_account_email,\n self._signer,\n scopes=scopes,\n private_key_id=self._private_key_id,\n client_id=self.client_id,\n user_agent=self._user_agent,\n **self._kwargs)\n result.token_uri = self.token_uri\n result.revoke_uri = self.revoke_uri\n result._private_key_pkcs8_pem = self._private_key_pkcs8_pem\n result._private_key_pkcs12 = self._private_key_pkcs12\n result._private_key_password = self._private_key_password\n return result", "metadata": "root.ServiceAccountCredentials.create_scoped", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 414 }, { "content": " def create_delegated(self, sub):\n \"\"\"Create credentials that act as domain-wide delegation of authority.\n\n Use the ``sub`` parameter as the subject to delegate on behalf of\n that user.\n\n For example::\n\n >>> account_sub = '[email protected]'\n >>> delegate_creds = creds.create_delegated(account_sub)\n\n Args:\n sub: string, An email address that this service account will\n act on behalf of (via domain-wide delegation).\n\n Returns:\n ServiceAccountCredentials, a copy of the current service account\n updated to act on behalf of ``sub``.\n \"\"\"\n new_kwargs = dict(self._kwargs)\n new_kwargs['sub'] = sub\n result = self.__class__(self._service_account_email,\n self._signer,\n scopes=self._scopes,\n private_key_id=self._private_key_id,\n client_id=self.client_id,\n user_agent=self._user_agent,\n **new_kwargs)\n result.token_uri = self.token_uri\n result.revoke_uri = self.revoke_uri\n result._private_key_pkcs8_pem = self._private_key_pkcs8_pem\n result._private_key_pkcs12 = self._private_key_pkcs12\n result._private_key_password = self._private_key_password\n return result", "metadata": "root.ServiceAccountCredentials.create_delegated", "header": "['class', 'ServiceAccountCredentials', '(', 'AssertionCredentials', ')', ':', '___EOS___']", "index": 429 } ]
[ { "span": "from oauth2client import GOOGLE_REVOKE_URI", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 42 }, { "span": "from oauth2client import GOOGLE_TOKEN_URI", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 41 }, { "span": "from oauth2client._helpers import _json_encode", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 46 }, { "span": "from oauth2client._helpers import _urlsafe_b64encode", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 52 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\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_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "oauth2", "client", " ", "Service", " ", "account", " ", "cred", "ential", "s", " ", "class", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "oauth2", "client_", "import_", "GO", "OG", "LE", "\\u", "REV", "OKE", "\\u", "URI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "import_", "GO", "OG", "LE", "\\u", "TOKEN", "\\u", "URI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "._", "\\u", "helpers_", "import_", "\\u", "json", "\\u", "encode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "._", "\\u", "helpers_", "import_", "\\u", "from", "\\u", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "._", "\\u", "helpers_", "import_", "\\u", "urlsafe", "\\u", "b64encode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "._", "client_", "import_", "Assert", "ion", "Credentials_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "._", "client_", "import_", "EXP", "IR", "Y", "\\u", "FORMAT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "._", "client_", "import_", "SERV", "ICE", "\\u", "ACCOUNT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oauth2", "client_", "import_", "crypt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "PASS", "WORD", "\\u", "DEFAULT_", "=_", "'", "nota", "secret", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PKC", "S1", "2", "\\u", "KEY_", "=_", "'\\u", "private", "\\u", "key", "\\u", "pkcs", "1", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "PKC", "S1", "2", "\\u", "ERROR_", "=_", "r", "\"\"\"", "\\", "10", ";", "Thi", "s", " ", "librar", "y", " ", "only", " ", "implement", "s", " ", "PKC", "S", "#", "1", "2", " ", "support", " ", "via", " ", "the", " ", "py", "Open", "SS", "L", " ", "librar", "y", ".", "\\", "10", ";", "Ei", "ther", " ", "install", " ", "py", "Open", "SS", "L", ",", " ", "or", " ", "plea", "se", " ", "convert", " ", "the", " ", ".", "p1", "2", " ", "file", "\\", "10", ";", "to", " ", ".", "pe", "m", " ", "format", ":", "\\", "10", ";", " ", " ", " ", " ", "$", " ", "cat", " ", "key", ".", "p1", "2", " ", "|", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", ">", " ", " ", " ", "openss", "l", " ", "pkcs", "1", "2", " ", "-", "nodes", " ", "-", "noc", "ert", "s", " ", "-", "passi", "n", " ", "pass", ":", "nota", "secret", " ", "|", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", ">", " ", " ", " ", "openss", "l", " ", "rsa", " ", ">", " ", "key", ".", "pe", "m", "\\", "10", ";\"\"\"_", "\\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_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Service", " ", "Account", " ", "cred", "ential", " ", "for", " ", "OA", "uth", " ", "2.0", " ", "sign", "ed", " ", "JW", "T", " ", "grants", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Supp", "orts", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "JSO", "N", " ", "keyfile", " ", "(", "typical", "ly", " ", "contain", "s", " ", "a", " ", "PKC", "S", "8", " ", "key", " ", "store", "d", " ", "as", "\\", "10", ";", " ", " ", "PEM", " ", "text", ")", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``.", "p1", "2", "``", " ", "key", " ", "(", "store", "s", " ", "PKC", "S1", "2", " ", "key", " ", "and", " ", "certifica", "te", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Make", "s", " ", "an", " ", "assertion", " ", "to", " ", "server", " ", "usi", "ng", " ", "a", " ", "sign", "ed", " ", "JW", "T", " ", "assertion", " ", "in", " ", "exchange", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "an", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "cred", "ential", " ", "doe", "s", " ", "not", " ", "require", " ", "a", " ", "flow", " ", "to", " ", "instantiate", " ", "bec", "aus", "e", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "represent", "s", " ", "a", " ", "two", " ", "leg", "ged", " ", "flow", ",", " ", "and", " ", "there", "fore", " ", "has", " ", "all", " ", "of", " ", "the", " ", "require", "d", "\\", "10", ";", " ", " ", " ", " ", "informati", "on", " ", "to", " ", "generat", "e", " ", "and", " ", "refre", "sh", " ", "its", " ", "own", " ", "access", " ", "token", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "service", "\\u", "account", "\\u", "email", ":", " ", "string", ",", " ", "The", " ", "email", " ", "associate", "d", " ", "with", " ", "the", "\\", "10", ";", " ", " ", " ", " ", " ", "service", " ", "account", ".", "\\", "10", ";", " ", " ", " ", " ", "signer", ":", " ", "``", "crypt", ".", "Signe", "r", "``", ",", " ", "A", " ", "signer", " ", "whi", "ch", " ", "can", " ", "be", " ", "used", " ", "to", " ", "sign", " ", "content", ".", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "access", " ", "token", ".", "\\", "10", ";", " ", " ", " ", " ", "private", "\\u", "key", "\\u", "id", ":", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Priva", "te", " ", "key", " ", "identifi", "er", ".", " ", "Typical", "ly", "\\", "10", ";", " ", " ", "only", " ", "used", " ", "with", " ", "a", " ", "JSO", "N", " ", "keyfile", ".", " ", "Can", " ", "be", " ", "sent", " ", "in", " ", "the", "\\", "10", ";", " ", " ", "header", " ", "of", " ", "a", " ", "JW", "T", " ", "token", " ", "assertion", ".", "\\", "10", ";", " ", " ", " ", " ", "client", "\\u", "id", ":", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Client", " ", "ID", " ", "for", " ", "the", " ", "project", " ", "tha", "t", " ", "owns", " ", "the", "\\", "10", ";", " ", "service", " ", "account", ".", "\\", "10", ";", " ", " ", " ", " ", "user", "\\u", "agent", ":", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "User", " ", "agent", " ", "to", " ", "use", " ", "whe", "n", " ", "sendin", "g", "\\", "10", ";", " ", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", "kwarg", "s", ":", " ", "dict", ",", " ", "Extra", " ", "key", "-", "value", " ", "pair", "s", " ", "(", "bot", "h", " ", "string", "s", ")", " ", "to", " ", "send", " ", "in", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "payload", " ", "body", " ", "whe", "n", " ", "mak", "ing", " ", "an", " ", "assertion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "MAX", "\\u", "TOKEN", "\\u", "LIF", "ETI", "ME", "\\u", "SEC", "S_", "=_", "3600_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "Max", " ", "life", "time", " ", "of", " ", "the", " ", "token", " ", "(", "one", " ", "hour", ",", " ", "in", " ", "second", "s", ").\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NON", "\\u", "SERIALIZ", "ED", "\\u", "MEMBER", "S_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "frozenset_", "(_", "[_", "'\\u", "signer", "'_", "]_", ")_", "|_", "\\u\\u\\uNL\\u\\u\\u_", "Assert", "ion", "Credentials_", "._", "NON", "\\u", "SERIALIZ", "ED", "\\u", "MEMBER", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "Mem", "bers", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "serialize", "d", " ", "whe", "n", " ", "object", " ", "is", " ", "convert", "ed", " ", "to", " ", "JSO", "N", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", " ", "be", " ", "over", "-", "rid", "den", " ", "by", " ", "factor", "y", " ", "construct", "ors", ".", " ", "Us", "ed", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serializ", "ation", "/", "deser", "iali", "zatio", "n", " ", "purpose", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "private", "\\u", "key", "\\u", "password_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "account", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scopes_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "id_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "agent_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Service", "Account", "Credentials_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "user", "\\u", "agent_", "=_", "user", "\\u", "agent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "service", "\\u", "account", "\\u", "email_", "=_", "service", "\\u", "account", "\\u", "email_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "signer_", "=_", "signer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "scopes_", "=_", "util_", "._", "scope", "s", "\\u", "to", "\\u", "string_", "(_", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "id_", "=_", "private", "\\u", "key", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client", "\\u", "id_", "=_", "client", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "user", "\\u", "agent_", "=_", "user", "\\u", "agent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "kwargs_", "=_", "kwargs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "to", "\\u", "json_", "(_", "self_", ",_", "strip_", ",_", "to", "\\u", "serialize_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Utili", "ty", " ", "function", " ", "tha", "t", " ", "create", "s", " ", "JSO", "N", " ", "repr", ".", " ", "of", " ", "a", " ", "cred", "ential", "s", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Over", "-", "ride", " ", "is", " ", "need", "ed", " ", "sinc", "e", " ", "PKC", "S", "#", "1", "2", " ", "keys", " ", "will", " ", "not", " ", "in", " ", "genera", "l", " ", "be", " ", "JSO", "N", "\\", "10", ";", " ", " ", " ", " ", "serializable", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "strip", ":", " ", "array", ",", " ", "An", " ", "array", " ", "of", " ", "names", " ", "of", " ", "member", "s", " ", "to", " ", "exclu", "de", " ", "from", " ", "the", "\\", "10", ";", " ", "JSO", "N", ".", "\\", "10", ";", " ", " ", " ", " ", "to", "\\u", "serialize", ":", " ", "dict", ",", " ", "(", "Optio", "nal", ")", " ", "The", " ", "proper", "ties", " ", "for", " ", "this", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "will", " ", "be", " ", "serialize", "d", ".", " ", "Thi", "s", " ", "allow", "s", " ", "caller", "s", " ", "to", " ", "modif", "y", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "serializ", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "string", ",", " ", "a", " ", "JSO", "N", " ", "represent", "ation", " ", "of", " ", "this", " ", "instance", ",", " ", "suit", "able", " ", "to", " ", "pass", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "from", "\\u", "json", "()", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "to", "\\u", "serialize_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "to", "\\u", "serialize_", "=_", "copy_", "._", "copy_", "(_", "self_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pkcs", "1", "2", "\\u", "val_", "=_", "to", "\\u", "serialize_", "._", "get_", "(_", "\\u", "PKC", "S1", "2", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pkcs", "1", "2", "\\u", "val_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "to", "\\u", "serialize_", "[_", "\\u", "PKC", "S1", "2", "\\u", "KEY_", "]_", "=_", "base64_", "._", "b64encode_", "(_", "pkcs", "1", "2", "\\u", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Service", "Account", "Credentials_", ",_", "self_", ")_", "._", "\\u", "to", "\\u", "json_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "strip_", ",_", "to", "\\u", "serialize_", "=_", "to", "\\u", "serialize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "from", "\\u", "parsed", "\\u", "json", "\\u", "keyfile_", "(_", "cls_", ",_", "keyfile", "\\u", "dict_", ",_", "scopes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Help", "er", " ", "for", " ", "factor", "y", " ", "construct", "ors", " ", "from", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "keyfile", "\\u", "dict", ":", " ", "dict", "-", "like", " ", "object", ",", " ", "The", " ", "parsed", " ", "dictionar", "y", "-", "like", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "contain", "ing", " ", "the", " ", "content", "s", " ", "of", " ", "the", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", " ", "an", "\\", "10", ";", " ", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "cred", "ential", "s", " ", "object", " ", "created", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", " ", "content", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", " ", " ", "Value", "Error", ",", " ", "if", " ", "the", " ", "cred", "ential", " ", "type", " ", "is", " ", "not", " ", ":", "data", ":`", "SERV", "ICE", "\\u", "ACCOUNT", "`.", "\\", "10", ";", " ", " ", " ", " ", "Key", "Error", ",", " ", "if", " ", "one", " ", "of", " ", "the", " ", "expected", " ", "keys", " ", "is", " ", "not", " ", "presen", "t", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "creds", "\\u", "type_", "=_", "keyfile", "\\u", "dict_", "._", "get_", "(_", "'", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "creds", "\\u", "type_", "!=_", "SERV", "ICE", "\\u", "ACCOUNT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Une", "xpe", "cte", "d", " ", "cred", "ential", "s", " ", "type", "'_", ",_", "creds", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Expect", "ed", "'_", ",_", "SERV", "ICE", "\\u", "ACCOUNT", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "service", "\\u", "account", "\\u", "email_", "=_", "keyfile", "\\u", "dict_", "[_", "'", "client", "\\u", "email", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "keyfile", "\\u", "dict_", "[_", "'", "private", "\\u", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "private", "\\u", "key", "\\u", "id_", "=_", "keyfile", "\\u", "dict_", "[_", "'", "private", "\\u", "key", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client", "\\u", "id_", "=_", "keyfile", "\\u", "dict_", "[_", "'", "client", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "signer_", "=_", "crypt_", "._", "Signe", "r_", "._", "from", "\\u", "string_", "(_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "=_", "cls_", "(_", "service", "\\u", "account", "\\u", "email_", ",_", "signer_", ",_", "scopes_", "=_", "scopes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "id_", "=_", "private", "\\u", "key", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id_", "=_", "client", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "credentials_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "from", "\\u", "json", "\\u", "keyfile", "\\u", "name_", "(_", "cls_", ",_", "filename_", ",_", "scopes_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Factor", "y", " ", "construct", "or", " ", "from", " ", "JSO", "N", " ", "keyfile", " ", "by", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "filename", ":", " ", "string", ",", " ", "The", " ", "location", " ", "of", " ", "the", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", " ", "an", "\\", "10", ";", " ", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "cred", "ential", "s", " ", "object", " ", "created", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", " ", " ", "Value", "Error", ",", " ", "if", " ", "the", " ", "cred", "ential", " ", "type", " ", "is", " ", "not", " ", ":", "data", ":`", "SERV", "ICE", "\\u", "ACCOUNT", "`.", "\\", "10", ";", " ", " ", " ", " ", "Key", "Error", ",", " ", "if", " ", "one", " ", "of", " ", "the", " ", "expected", " ", "keys", " ", "is", " ", "not", " ", "presen", "t", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "file", "\\u", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client", "\\u", "credentials_", "=_", "json_", "._", "load_", "(_", "file", "\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "._", "\\u", "from", "\\u", "parsed", "\\u", "json", "\\u", "keyfile_", "(_", "client", "\\u", "credentials_", ",_", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "from", "\\u", "json", "\\u", "keyfile", "\\u", "dict_", "(_", "cls_", ",_", "keyfile", "\\u", "dict_", ",_", "scopes_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Factor", "y", " ", "construct", "or", " ", "from", " ", "parsed", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "keyfile", "\\u", "dict", ":", " ", "dict", "-", "like", " ", "object", ",", " ", "The", " ", "parsed", " ", "dictionar", "y", "-", "like", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "contain", "ing", " ", "the", " ", "content", "s", " ", "of", " ", "the", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", " ", "an", "\\", "10", ";", " ", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "cred", "ential", "s", " ", "object", " ", "created", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", " ", " ", "Value", "Error", ",", " ", "if", " ", "the", " ", "cred", "ential", " ", "type", " ", "is", " ", "not", " ", ":", "data", ":`", "SERV", "ICE", "\\u", "ACCOUNT", "`.", "\\", "10", ";", " ", " ", " ", " ", "Key", "Error", ",", " ", "if", " ", "one", " ", "of", " ", "the", " ", "expected", " ", "keys", " ", "is", " ", "not", " ", "presen", "t", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "._", "\\u", "from", "\\u", "parsed", "\\u", "json", "\\u", "keyfile_", "(_", "keyfile", "\\u", "dict_", ",_", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "from", "\\u", "p1", "2", "\\u", "keyfile", "\\u", "contents_", "(_", "cls_", ",_", "service", "\\u", "account", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "pkcs", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "password_", "=_", "None_", ",_", "scopes_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Factor", "y", " ", "construct", "or", " ", "from", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "service", "\\u", "account", "\\u", "email", ":", " ", "string", ",", " ", "The", " ", "email", " ", "associate", "d", " ", "with", " ", "the", "\\", "10", ";", " ", " ", " ", " ", " ", "service", " ", "account", ".", "\\", "10", ";", " ", " ", " ", " ", "private", "\\u", "key", "\\u", "pkcs", "1", "2", ":", " ", "string", ",", " ", "The", " ", "content", "s", " ", "of", " ", "a", " ", "PKC", "S", "#", "1", "2", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "private", "\\u", "key", "\\u", "password", ":", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Passw", "ord", " ", "for", " ", "PKC", "S", "#", "1", "2", "\\", "10", ";", " ", " ", " ", " ", "private", " ", "key", ".", " ", "Default", "s", " ", "to", " ", "``", "nota", "secret", "``.", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", " ", "an", "\\", "10", ";", " ", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "cred", "ential", "s", " ", "object", " ", "created", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", " ", " ", "Not", "Impl", "ement", "ed", "Error", " ", "if", " ", "py", "Open", "SS", "L", " ", "is", " ", "not", " ", "install", "ed", " ", "/", " ", "not", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "active", " ", "crypto", " ", "librar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "private", "\\u", "key", "\\u", "password_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "private", "\\u", "key", "\\u", "password_", "=_", "\\u", "PASS", "WORD", "\\u", "DEFAULT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "crypt_", "._", "Signe", "r_", "is_", "not_", "crypt_", "._", "Open", "SS", "LS", "igne", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\\u", "PKC", "S1", "2", "\\u", "ERROR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "signer_", "=_", "crypt_", "._", "Signe", "r_", "._", "from", "\\u", "string_", "(_", "private", "\\u", "key", "\\u", "pkcs", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "=_", "cls_", "(_", "service", "\\u", "account", "\\u", "email_", ",_", "signer_", ",_", "scopes_", "=_", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "private", "\\u", "key", "\\u", "pkcs", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "._", "\\u", "private", "\\u", "key", "\\u", "password_", "=_", "private", "\\u", "key", "\\u", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "credentials_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "from", "\\u", "p1", "2", "\\u", "keyfile_", "(_", "cls_", ",_", "service", "\\u", "account", "\\u", "email_", ",_", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "password_", "=_", "None_", ",_", "scopes_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Factor", "y", " ", "construct", "or", " ", "from", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "service", "\\u", "account", "\\u", "email", ":", " ", "string", ",", " ", "The", " ", "email", " ", "associate", "d", " ", "with", " ", "the", "\\", "10", ";", " ", " ", " ", " ", " ", "service", " ", "account", ".", "\\", "10", ";", " ", " ", " ", " ", "filename", ":", " ", "string", ",", " ", "The", " ", "location", " ", "of", " ", "the", " ", "PKC", "S", "#", "1", "2", " ", "keyfile", ".", "\\", "10", ";", " ", " ", " ", " ", "private", "\\u", "key", "\\u", "password", ":", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Passw", "ord", " ", "for", " ", "PKC", "S", "#", "1", "2", "\\", "10", ";", " ", " ", " ", " ", "private", " ", "key", ".", " ", "Default", "s", " ", "to", " ", "``", "nota", "secret", "``.", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", " ", "an", "\\", "10", ";", " ", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "cred", "ential", "s", " ", "object", " ", "created", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", " ", " ", "Not", "Impl", "ement", "ed", "Error", " ", "if", " ", "py", "Open", "SS", "L", " ", "is", " ", "not", " ", "install", "ed", " ", "/", " ", "not", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "active", " ", "crypto", " ", "librar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "filename_", ",_", "'", "rb", "'_", ")_", "as_", "file", "\\u", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "file", "\\u", "obj_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "._", "\\u", "from", "\\u", "p1", "2", "\\u", "keyfile", "\\u", "contents_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "account", "\\u", "email_", ",_", "private", "\\u", "key", "\\u", "pkcs", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "password_", "=_", "private", "\\u", "key", "\\u", "password_", ",_", "scopes_", "=_", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "from", "\\u", "p1", "2", "\\u", "keyfile", "\\u", "buffer_", "(_", "cls_", ",_", "service", "\\u", "account", "\\u", "email_", ",_", "file", "\\u", "buffer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "password_", "=_", "None_", ",_", "scopes_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Factor", "y", " ", "construct", "or", " ", "from", " ", "JSO", "N", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "service", "\\u", "account", "\\u", "email", ":", " ", "string", ",", " ", "The", " ", "email", " ", "associate", "d", " ", "with", " ", "the", "\\", "10", ";", " ", " ", " ", " ", " ", "service", " ", "account", ".", "\\", "10", ";", " ", " ", " ", " ", "file", "\\u", "buffer", ":", " ", "stream", ",", " ", "A", " ", "buffer", " ", "tha", "t", " ", "implement", "s", " ", "``", "read", "()``", "\\", "10", ";", " ", " ", " ", "and", " ", "contain", "s", " ", "the", " ", "PKC", "S", "#", "1", "2", " ", "key", " ", "content", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "private", "\\u", "key", "\\u", "password", ":", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Passw", "ord", " ", "for", " ", "PKC", "S", "#", "1", "2", "\\", "10", ";", " ", " ", " ", " ", "private", " ", "key", ".", " ", "Default", "s", " ", "to", " ", "``", "nota", "secret", "``.", "\\", "10", ";", " ", " ", " ", " ", "scope", "s", ":", " ", "List", " ", "or", " ", "string", ",", " ", "(", "Optio", "nal", ")", " ", "Sco", "pes", " ", "to", " ", "use", " ", "whe", "n", " ", "acquir", "ing", " ", "an", "\\", "10", ";", " ", " ", "access", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "cred", "ential", "s", " ", "object", " ", "created", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "keyfile", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", " ", " ", "Not", "Impl", "ement", "ed", "Error", " ", "if", " ", "py", "Open", "SS", "L", " ", "is", " ", "not", " ", "install", "ed", " ", "/", " ", "not", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "active", " ", "crypto", " ", "librar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "file", "\\u", "buffer_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "._", "\\u", "from", "\\u", "p1", "2", "\\u", "keyfile", "\\u", "contents_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "account", "\\u", "email_", ",_", "private", "\\u", "key", "\\u", "pkcs", "12_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "password_", "=_", "private", "\\u", "key", "\\u", "password_", ",_", "scopes_", "=_", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "generat", "e\\u", "assertion_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "the", " ", "assertion", " ", "tha", "t", " ", "will", " ", "be", " ", "used", " ", "in", " ", "the", " ", "request", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "int_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "aud", "'_", ":_", "self_", "._", "token", "\\u", "uri_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scope", "'_", ":_", "self_", "._", "\\u", "scopes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "iat", "'_", ":_", "now_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "exp", "'_", ":_", "now_", "+_", "self_", "._", "MAX", "\\u", "TOKEN", "\\u", "LIF", "ETI", "ME", "\\u", "SEC", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "iss", "'_", ":_", "self_", "._", "\\u", "service", "\\u", "account", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "._", "update_", "(_", "self_", "._", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "crypt_", "._", "make", "\\u", "sign", "ed", "\\u", "jwt_", "(_", "self_", "._", "\\u", "signer_", ",_", "payload_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "id_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sign", "\\u", "blob_", "(_", "self_", ",_", "blob_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Crypto", "graphical", "ly", " ", "sign", " ", "a", " ", "blob", " ", "(", "of", " ", "bytes", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Impl", "ement", "s", " ", "abstract", " ", "method", "\\", "10", ";", " ", " ", " ", " ", ":", "meth", ":`", "oauth2", "client", ".", "client", ".", "Assert", "ion", "Cred", "ential", "s", ".", "sign", "\\u", "blob", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "blob", ":", " ", "bytes", ",", " ", "Messag", "e", " ", "to", " ", "be", " ", "sign", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "tuple", ",", " ", "A", " ", "pair", " ", "of", " ", "the", " ", "private", " ", "key", " ", "ID", " ", "used", " ", "to", " ", "sign", " ", "the", " ", "blob", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "sign", "ed", " ", "content", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "id_", ",_", "self_", "._", "\\u", "signer_", "._", "sign_", "(_", "blob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\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_", "service", "\\u", "account", "\\u", "email_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "email", " ", "for", " ", "the", " ", "current", " ", "service", " ", "account", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "string", ",", " ", "The", " ", "email", " ", "associate", "d", " ", "with", " ", "the", " ", "service", " ", "account", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "service", "\\u", "account", "\\u", "email_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\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_", "serializ", "ation", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "Thi", "s", " ", "is", " ", "only", " ", "usef", "ul", " ", "for", " ", "JSO", "N", " ", "keyfile", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "service", "\\u", "account", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "\\u", "email", "'_", ":_", "self_", "._", "\\u", "service", "\\u", "account", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "private", "\\u", "key", "\\u", "id", "'_", ":_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "private", "\\u", "key", "'_", ":_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "\\u", "id", "'_", ":_", "self_", "._", "client", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "from", "\\u", "json_", "(_", "cls_", ",_", "json", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Deserializ", "e", " ", "a", " ", "JSO", "N", "-", "serialize", "d", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Inv", "erse", " ", "to", " ", ":", "meth", ":`", "to", "\\u", "json", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "json", "\\u", "data", ":", " ", "dict", " ", "or", " ", "string", ",", " ", "Seriali", "zed", " ", "JSO", "N", " ", "(", "as", " ", "a", " ", "string", " ", "or", " ", "an", "\\", "10", ";", " ", " ", " ", " ", " ", "alr", "ead", "y", " ", "parsed", " ", "dictionar", "y", ")", " ", "represent", "ing", " ", "a", " ", "cred", "ential", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", " ", "from", " ", "the", " ", "serialize", "d", " ", "data", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "json", "\\u", "data_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "data_", "=_", "json_", "._", "loads_", "(_", "\\u", "from", "\\u", "bytes_", "(_", "json", "\\u", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pkcs", "1", "2", "\\u", "val_", "=_", "json", "\\u", "data_", "._", "get_", "(_", "\\u", "PKC", "S1", "2", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pkcs", "1", "2", "\\u", "val_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "json", "\\u", "data_", "[_", "'\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pe", "m", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signer_", "=_", "crypt_", "._", "Signe", "r_", "._", "from", "\\u", "string_", "(_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "Thi", "s", " ", "assume", "s", " ", "tha", "t", " ", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pe", "m", " ", "is", " ", "not", " ", "als", "o_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "in", " ", "the", " ", "serialize", "d", " ", "data", ".", " ", "Thi", "s", " ", "wou", "ld", " ", "be", " ", "very", " ", "incorrect", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "state", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pkcs", "1", "2", "\\u", "val_", "=_", "base64_", "._", "b64decode_", "(_", "pkcs", "1", "2", "\\u", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "json", "\\u", "data_", "[_", "'\\u", "private", "\\u", "key", "\\u", "password", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signer_", "=_", "crypt_", "._", "Signe", "r_", "._", "from", "\\u", "string_", "(_", "pkcs", "1", "2", "\\u", "val_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "credentials_", "=_", "cls_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "json", "\\u", "data_", "[_", "'\\u", "service", "\\u", "account", "\\u", "email", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scopes_", "=_", "json", "\\u", "data_", "[_", "'\\u", "scope", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "id_", "=_", "json", "\\u", "data_", "[_", "'\\u", "private", "\\u", "key", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id_", "=_", "json", "\\u", "data_", "[_", "'", "client", "\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "agent_", "=_", "json", "\\u", "data_", "[_", "'\\u", "user", "\\u", "agent", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "json", "\\u", "data_", "[_", "'\\u", "kwarg", "s", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "credentials_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pkcs", "1", "2", "\\u", "val_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "credentials_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "pkcs", "1", "2", "\\u", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "password_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "credentials_", "._", "\\u", "private", "\\u", "key", "\\u", "password_", "=_", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "credentials_", "._", "invalid_", "=_", "json", "\\u", "data_", "[_", "'", "invalid", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "._", "access", "\\u", "token_", "=_", "json", "\\u", "data_", "[_", "'", "access", "\\u", "token", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "._", "token", "\\u", "uri_", "=_", "json", "\\u", "data_", "[_", "'", "token", "\\u", "uri", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "._", "revoke", "\\u", "uri_", "=_", "json", "\\u", "data_", "[_", "'", "revoke", "\\u", "uri", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token", "\\u", "expiry_", "=_", "json", "\\u", "data_", "._", "get_", "(_", "'", "token", "\\u", "expir", "y", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "token", "\\u", "expiry_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "credentials_", "._", "token", "\\u", "expiry_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "token", "\\u", "expiry_", ",_", "EXP", "IR", "Y", "\\u", "FORMAT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "credentials_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "scoped", "\\u", "required_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "self_", "._", "\\u", "scopes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "scoped", "_", "(_", "self_", ",_", "scopes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "self_", "._", "\\u", "service", "\\u", "account", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "signer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scopes_", "=_", "scopes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "id_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id_", "=_", "self_", "._", "client", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "agent_", "=_", "self_", "._", "\\u", "user", "\\u", "agent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "self_", "._", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "token", "\\u", "uri_", "=_", "self_", "._", "token", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "revoke", "\\u", "uri_", "=_", "self_", "._", "revoke", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u", "private", "\\u", "key", "\\u", "password_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Account", "Credentials_", "(_", "Assert", "ion", "Credentials_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "delegate", "d_", "(_", "self_", ",_", "sub_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "cred", "ential", "s", " ", "tha", "t", " ", "act", " ", "as", " ", "domain", "-", "wide", " ", "delegat", "ion", " ", "of", " ", "authori", "ty", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "the", " ", "``", "sub", "``", " ", "parameter", " ", "as", " ", "the", " ", "subject", " ", "to", " ", "delegate", " ", "on", " ", "beha", "lf", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "user", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "example", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", ">>>", " ", "account", "\\u", "sub", " ", "=", " ", "'", "foo", "@", "email", ".", "com", "'", "\\", "10", ";", " ", " ", ">>>", " ", "delegate", "\\u", "creds", " ", "=", " ", "creds", ".", "create", "\\u", "delegate", "d", "(", "account", "\\u", "sub", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "sub", ":", " ", "string", ",", " ", "An", " ", "email", " ", "address", " ", "tha", "t", " ", "this", " ", "service", " ", "account", " ", "will", "\\", "10", ";", " ", " ", " ", " ", " ", "act", " ", "on", " ", "beha", "lf", " ", "of", " ", "(", "via", " ", "domain", "-", "wide", " ", "delegat", "ion", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Service", "Account", "Cred", "ential", "s", ",", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "current", " ", "service", " ", "account", "\\", "10", ";", " ", " ", " ", " ", "update", "d", " ", "to", " ", "act", " ", "on", " ", "beha", "lf", " ", "of", " ", "``", "sub", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "kwargs_", "=_", "dict_", "(_", "self_", "._", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "kwargs_", "[_", "'", "sub", "'_", "]_", "=_", "sub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "self_", "._", "\\u", "service", "\\u", "account", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "signer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scopes_", "=_", "self_", "._", "\\u", "scopes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "private", "\\u", "key", "\\u", "id_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id_", "=_", "self_", "._", "client", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "agent_", "=_", "self_", "._", "\\u", "user", "\\u", "agent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "new", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "token", "\\u", "uri_", "=_", "self_", "._", "token", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "revoke", "\\u", "uri_", "=_", "self_", "._", "revoke", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "8", "\\u", "pem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "pkcs", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "\\u", "private", "\\u", "key", "\\u", "password_", "=_", "self_", "._", "\\u", "private", "\\u", "key", "\\u", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
`__init__` method calls overridden method
kivy/kivy/kivy/modules/console.py
[ { "content": "class ConsoleAddon(object):\n \"\"\"Base class for implementing addons\"\"\"\n\n #: Console instance\n console = None\n\n\n\n", "metadata": "root.ConsoleAddon", "header": "['module', '___EOS___']", "index": 330 }, { "content": " def __init__(self, console):\n super(ConsoleAddon, self).__init__()\n self.console = console\n self.init()", "metadata": "root.ConsoleAddon.__init__", "header": "['class', 'ConsoleAddon', '(', 'object', ')', ':', '___EOS___']", "index": 336 }, { "content": " def init(self):\n \"\"\"Method called when the addon is instanciated by the Console\n \"\"\"\n pass", "metadata": "root.ConsoleAddon.init", "header": "['class', 'ConsoleAddon', '(', 'object', ')', ':', '___EOS___']", "index": 341 }, { "content": " def activate(self):\n \"\"\"Method called when the addon is activated by the console\n (when the console is displayed)\"\"\"\n pass", "metadata": "root.ConsoleAddon.activate", "header": "['class', 'ConsoleAddon', '(', 'object', ')', ':', '___EOS___']", "index": 346 }, { "content": " def deactivate(self):\n \"\"\"Method called when the addon is deactivated by the console\n (when the console is hidden)\n \"\"\"\n pass", "metadata": "root.ConsoleAddon.deactivate", "header": "['class', 'ConsoleAddon', '(', 'object', ')', ':', '___EOS___']", "index": 351 }, { "content": "class ConsoleAddonMode(ConsoleAddon):", "metadata": "root.ConsoleAddonMode", "header": "['module', '___EOS___']", "index": 358 }, { "content": " def init(self):\n btn = ConsoleToggleButton(text=u\"Docked\")\n self.console.add_toolbar_widget(btn)", "metadata": "root.ConsoleAddonMode.init", "header": "['class', 'ConsoleAddonMode', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 359 }, { "content": "class ConsoleAddonSelect(ConsoleAddon):\n\n", "metadata": "root.ConsoleAddonSelect", "header": "['module', '___EOS___']", "index": 364 }, { "content": " def init(self):\n self.btn = ConsoleToggleButton(text=u\"Select\")\n self.btn.bind(state=self.on_button_state)\n self.console.add_toolbar_widget(self.btn)\n self.console.bind(inspect_enabled=self.on_inspect_enabled)", "metadata": "root.ConsoleAddonSelect.init", "header": "['class', 'ConsoleAddonSelect', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 365 }, { "content": " def on_inspect_enabled(self, instance, value):\n self.btn.state = \"down\" if value else \"normal\"", "metadata": "root.ConsoleAddonSelect.on_inspect_enabled", "header": "['class', 'ConsoleAddonSelect', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 371 }, { "content": " def on_button_state(self, instance, value):\n self.console.inspect_enabled = (value == \"down\")", "metadata": "root.ConsoleAddonSelect.on_button_state", "header": "['class', 'ConsoleAddonSelect', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 374 }, { "content": "class ConsoleAddonFps(ConsoleAddon):\n\n\n", "metadata": "root.ConsoleAddonFps", "header": "['module', '___EOS___']", "index": 378 }, { "content": " def init(self):\n self.lbl = ConsoleLabel(text=\"0 Fps\")\n self.console.add_toolbar_widget(self.lbl, right=True)", "metadata": "root.ConsoleAddonFps.init", "header": "['class', 'ConsoleAddonFps', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 379 }, { "content": " def activate(self):\n Clock.schedule_interval(self.update_fps, 1 / 2.)", "metadata": "root.ConsoleAddonFps.activate", "header": "['class', 'ConsoleAddonFps', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 383 }, { "content": " def deactivated(self):\n Clock.unschedule(self.update_fps)", "metadata": "root.ConsoleAddonFps.deactivated", "header": "['class', 'ConsoleAddonFps', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 386 }, { "content": " def update_fps(self, *args):\n fps = Clock.get_fps()\n self.lbl.text = \"{} Fps\".format(int(fps))", "metadata": "root.ConsoleAddonFps.update_fps", "header": "['class', 'ConsoleAddonFps', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 389 }, { "content": "class ConsoleAddonBreadcrumb(ConsoleAddon):\n\n\n", "metadata": "root.ConsoleAddonBreadcrumb", "header": "['module', '___EOS___']", "index": 436 }, { "content": " def init(self):\n self.view = ConsoleAddonBreadcrumbView()\n self.view.console = self.console\n self.console.ids.layout.add_widget(self.view)", "metadata": "root.ConsoleAddonBreadcrumb.init", "header": "['class', 'ConsoleAddonBreadcrumb', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 437 }, { "content": " def activate(self):\n self.console.bind(widget=self.update_content)\n self.update_content()", "metadata": "root.ConsoleAddonBreadcrumb.activate", "header": "['class', 'ConsoleAddonBreadcrumb', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 442 }, { "content": " def deactivate(self):\n self.console.unbind(widget=self.update_content)", "metadata": "root.ConsoleAddonBreadcrumb.deactivate", "header": "['class', 'ConsoleAddonBreadcrumb', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 446 }, { "content": " def update_content(self, *args):\n self.view.widget = self.console.widget", "metadata": "root.ConsoleAddonBreadcrumb.update_content", "header": "['class', 'ConsoleAddonBreadcrumb', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 449 }, { "content": "class ConsoleAddonWidgetPanel(ConsoleAddon):\n\n\n\n\n\n\n\n", "metadata": "root.ConsoleAddonWidgetPanel", "header": "['module', '___EOS___']", "index": 453 }, { "content": " def init(self):\n self.console.add_panel(\"Properties\", self.panel_activate,\n self.deactivate)", "metadata": "root.ConsoleAddonWidgetPanel.init", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 454 }, { "content": " def panel_activate(self):\n self.console.bind(widget=self.update_content)\n self.update_content()", "metadata": "root.ConsoleAddonWidgetPanel.panel_activate", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 458 }, { "content": " def deactivate(self):\n self.console.unbind(widget=self.update_content)", "metadata": "root.ConsoleAddonWidgetPanel.deactivate", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 462 }, { "content": " def update_content(self, *args):\n widget = self.console.widget\n if not widget:\n return\n\n from kivy.uix.scrollview import ScrollView\n self.root = root = BoxLayout()\n self.sv = sv = ScrollView(scroll_type=[\"bars\", \"content\"],\n bar_width='10dp')\n treeview = TreeView(hide_root=True, size_hint_y=None)\n treeview.bind(minimum_height=treeview.setter(\"height\"))\n keys = list(widget.properties().keys())\n keys.sort()\n node = None\n wk_widget = weakref.ref(widget)\n for key in keys:\n node = TreeViewProperty(key=key, widget_ref=wk_widget)\n node.bind(is_selected=self.show_property)\n try:\n widget.bind(**{\n key: partial(self.update_node_content, weakref.ref(node))\n })\n except:\n pass\n treeview.add_node(node)\n\n root.add_widget(sv)\n sv.add_widget(treeview)\n self.console.set_content(root)", "metadata": "root.ConsoleAddonWidgetPanel.update_content", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 465 }, { "content": " def show_property(self, instance, value, key=None, index=-1, *l):\n # normal call: (tree node, focus, )\n # nested call: (widget, prop value, prop key, index in dict/list)\n if value is False:\n return\n\n console = self.console\n content = None\n if key is None:\n # normal call\n nested = False\n widget = instance.widget\n key = instance.key\n prop = widget.property(key)\n value = getattr(widget, key)\n else:\n # nested call, we might edit subvalue\n nested = True\n widget = instance\n prop = None\n\n dtype = None\n\n if isinstance(prop, AliasProperty) or nested:\n # trying to resolve type dynamicly\n if type(value) in (str, str):\n dtype = 'string'\n elif type(value) in (int, float):\n dtype = 'numeric'\n elif type(value) in (tuple, list):\n dtype = 'list'\n\n if isinstance(prop, NumericProperty) or dtype == 'numeric':\n content = TextInput(text=str(value) or '', multiline=False)\n content.bind(\n text=partial(self.save_property_numeric, widget, key, index))\n\n elif isinstance(prop, StringProperty) or dtype == 'string':\n content = TextInput(text=value or '', multiline=True)\n content.bind(\n text=partial(self.save_property_text, widget, key, index))\n\n elif (isinstance(prop, ListProperty) or\n isinstance(prop, ReferenceListProperty) or\n isinstance(prop, VariableListProperty) or dtype == 'list'):\n content = GridLayout(cols=1, size_hint_y=None)\n content.bind(minimum_height=content.setter('height'))\n for i, item in enumerate(value):\n button = Button(text=repr(item), size_hint_y=None, height=44)\n if isinstance(item, Widget):\n button.bind(on_release=partial(console.highlight_widget,\n item, False))\n else:\n button.bind(on_release=partial(self.show_property, widget,\n item, key, i))\n content.add_widget(button)\n\n elif isinstance(prop, OptionProperty):\n content = GridLayout(cols=1, size_hint_y=None)\n content.bind(minimum_height=content.setter('height'))\n for option in prop.options:\n button = ToggleButton(\n text=option,\n state='down' if option == value else 'normal',\n group=repr(content.uid),\n size_hint_y=None,\n height=44)\n button.bind(\n on_press=partial(self.save_property_option, widget, key))\n content.add_widget(button)\n\n elif isinstance(prop, ObjectProperty):\n if isinstance(value, Widget):\n content = Button(text=repr(value))\n content.bind(\n on_release=partial(console.highlight_widget, value))\n elif isinstance(value, Texture):\n content = Image(texture=value)\n else:\n content = Label(text=repr(value))\n\n elif isinstance(prop, BooleanProperty):\n state = 'down' if value else 'normal'\n content = ToggleButton(text=key, state=state)\n content.bind(on_release=partial(self.save_property_boolean, widget,\n key, index))\n\n self.root.clear_widgets()\n self.root.add_widget(self.sv)\n if content:\n self.root.add_widget(content)", "metadata": "root.ConsoleAddonWidgetPanel.show_property", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 495 }, { "content": " @ignore_exception\n def save_property_numeric(self, widget, key, index, instance, value):\n if index >= 0:\n getattr(widget, key)[index] = float(instance.text)\n else:\n setattr(widget, key, float(instance.text))", "metadata": "root.ConsoleAddonWidgetPanel.save_property_numeric", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 587 }, { "content": " @ignore_exception\n def save_property_text(self, widget, key, index, instance, value):\n if index >= 0:\n getattr(widget, key)[index] = instance.text\n else:\n setattr(widget, key, instance.text)", "metadata": "root.ConsoleAddonWidgetPanel.save_property_text", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 594 }, { "content": " @ignore_exception\n def save_property_boolean(self, widget, key, index, instance, ):\n value = instance.state == 'down'\n if index >= 0:\n getattr(widget, key)[index] = value\n else:\n setattr(widget, key, value)", "metadata": "root.ConsoleAddonWidgetPanel.save_property_boolean", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 601 }, { "content": " @ignore_exception\n def save_property_option(self, widget, key, instance, *l):\n setattr(widget, key, instance.text)", "metadata": "root.ConsoleAddonWidgetPanel.save_property_option", "header": "['class', 'ConsoleAddonWidgetPanel', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 609 }, { "content": "class ConsoleAddonWidgetTree(ConsoleAddon):\n\n\n\n", "metadata": "root.ConsoleAddonWidgetTree", "header": "['module', '___EOS___']", "index": 719 }, { "content": " def init(self):\n self.content = None\n self.console.add_panel(\"Tree\", self.panel_activate, self.deactivate,\n self.panel_refresh)", "metadata": "root.ConsoleAddonWidgetTree.init", "header": "['class', 'ConsoleAddonWidgetTree', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 720 }, { "content": " def panel_activate(self):\n self.console.bind(widget=self.update_content)\n self.update_content()", "metadata": "root.ConsoleAddonWidgetTree.panel_activate", "header": "['class', 'ConsoleAddonWidgetTree', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 725 }, { "content": " def deactivate(self):\n if self.content:\n self.content.widget = None\n self.content.console = None\n self.console.unbind(widget=self.update_content)", "metadata": "root.ConsoleAddonWidgetTree.deactivate", "header": "['class', 'ConsoleAddonWidgetTree', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 729 }, { "content": " def update_content(self, *args):\n widget = self.console.widget\n if not self.content:\n self.content = ConsoleAddonWidgetTreeView()\n self.content.console = self.console\n self.content.widget = widget\n self.content.update_widget_tree()\n self.console.set_content(self.content)", "metadata": "root.ConsoleAddonWidgetTree.update_content", "header": "['class', 'ConsoleAddonWidgetTree', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 735 }, { "content": " def panel_refresh(self):\n if self.content:\n self.content.update_widget_tree()", "metadata": "root.ConsoleAddonWidgetTree.panel_refresh", "header": "['class', 'ConsoleAddonWidgetTree', '(', 'ConsoleAddon', ')', ':', '___EOS___']", "index": 744 } ]
[ { "span": "self.init()", "start_line": 339, "start_column": 8, "end_line": 339, "end_column": 19 } ]
[ { "span": "def init(self):", "start_line": 341, "start_column": 4, "end_line": 341, "end_column": 19 }, { "span": "def init(self):", "start_line": 359, "start_column": 4, "end_line": 359, "end_column": 19 }, { "span": "def init(self):", "start_line": 365, "start_column": 4, "end_line": 365, "end_column": 19 }, { "span": "def init(self):", "start_line": 379, "start_column": 4, "end_line": 379, "end_column": 19 }, { "span": "def init(self):", "start_line": 437, "start_column": 4, "end_line": 437, "end_column": 19 }, { "span": "def init(self):", "start_line": 454, "start_column": 4, "end_line": 454, "end_column": 19 }, { "span": "def init(self):", "start_line": 720, "start_column": 4, "end_line": 720, "end_column": 19 } ]
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_", "class_", "Cons", "ole", "Addon_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "implement", "ing", " ", "addon", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", ":", " ", "Cons", "ole", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "console_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Addon_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "console_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Cons", "ole", "Addon_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "=_", "console_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Addon_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Meth", "od", " ", "call", "ed", " ", "whe", "n", " ", "the", " ", "addon", " ", "is", " ", "instan", "ciat", "ed", " ", "by", " ", "the", " ", "Cons", "ole", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Addon_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "activate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Meth", "od", " ", "call", "ed", " ", "whe", "n", " ", "the", " ", "addon", " ", "is", " ", "activat", "ed", " ", "by", " ", "the", " ", "console", "\\", "10", ";", " ", " ", " ", " ", "(", "whe", "n", " ", "the", " ", "console", " ", "is", " ", "displaye", "d", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Addon_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deactivate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Meth", "od", " ", "call", "ed", " ", "whe", "n", " ", "the", " ", "addon", " ", "is", " ", "deactivate", "d", " ", "by", " ", "the", " ", "console", "\\", "10", ";", " ", " ", " ", " ", "(", "whe", "n", " ", "the", " ", "console", " ", "is", " ", "hidden", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cons", "ole", "Add", "on", "Mode_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Mode_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "btn_", "=_", "Cons", "ole", "Toggle", "Button_", "(_", "text_", "=_", "u", "\"", "Docke", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "add", "\\u", "toolb", "ar", "\\u", "widget_", "(_", "btn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Cons", "ole", "Add", "on", "Select_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\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_", "Cons", "ole", "Add", "on", "Select_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "btn_", "=_", "Cons", "ole", "Toggle", "Button_", "(_", "text_", "=_", "u", "\"", "Select", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "btn_", "._", "bind_", "(_", "state_", "=_", "self_", "._", "on", "\\u", "button", "\\u", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "add", "\\u", "toolb", "ar", "\\u", "widget_", "(_", "self_", "._", "btn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "bind_", "(_", "inspect", "\\u", "enabled_", "=_", "self_", "._", "on", "\\u", "inspect", "\\u", "enabled_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Select_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "inspect", "\\u", "enabled_", "(_", "self_", ",_", "instance_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "btn_", "._", "state_", "=_", "\"", "down", "\"_", "if_", "value_", "else_", "\"", "normal", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Select_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "button", "\\u", "state_", "(_", "self_", ",_", "instance_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "inspect", "\\u", "enabled_", "=_", "(_", "value_", "==_", "\"", "down", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cons", "ole", "Add", "on", "Fp", "s_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\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_", "Cons", "ole", "Add", "on", "Fp", "s_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lbl_", "=_", "Cons", "ole", "Label_", "(_", "text_", "=_", "\"", "0", " ", "Fp", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "add", "\\u", "toolb", "ar", "\\u", "widget_", "(_", "self_", "._", "lbl_", ",_", "right_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Fp", "s_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "activate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Clock_", "._", "schedule", "\\u", "interval_", "(_", "self_", "._", "update", "\\u", "fps_", ",_", "1_", "/_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Fp", "s_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deactivate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Clock_", "._", "unsc", "hedule", "_", "(_", "self_", "._", "update", "\\u", "fps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Fp", "s_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "fps_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fps_", "=_", "Clock_", "._", "get", "\\u", "fps_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lbl_", "._", "text_", "=_", "\"{}", " ", "Fp", "s", "\"_", "._", "format_", "(_", "int_", "(_", "fps_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Cons", "ole", "Add", "on", "Bre", "adc", "rum", "b_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\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_", "Cons", "ole", "Add", "on", "Bre", "adc", "rum", "b_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "=_", "Cons", "ole", "Add", "on", "Bre", "adc", "rum", "b", "View_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "console_", "=_", "self_", "._", "console_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "ids_", "._", "layout_", "._", "add", "\\u", "widget_", "(_", "self_", "._", "view_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Bre", "adc", "rum", "b_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "activate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "bind_", "(_", "widget_", "=_", "self_", "._", "update", "\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "\\u", "content_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Bre", "adc", "rum", "b_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deactivate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "unbind", "_", "(_", "widget_", "=_", "self_", "._", "update", "\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Bre", "adc", "rum", "b_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "content_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "widget_", "=_", "self_", "._", "console_", "._", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "add", "\\u", "panel_", "(_", "\"", "Proper", "ties", "\"_", ",_", "self_", "._", "panel", "\\u", "activate_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "deactivate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "panel", "\\u", "activate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "bind_", "(_", "widget_", "=_", "self_", "._", "update", "\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "\\u", "content_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deactivate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "unbind", "_", "(_", "widget_", "=_", "self_", "._", "update", "\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "content_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "self_", "._", "console_", "._", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "widget_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "kivy_", "._", "uix_", "._", "scroll", "view_", "import_", "Scroll", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "root_", "=_", "root_", "=_", "Box", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sv_", "=_", "sv_", "=_", "Scroll", "View_", "(_", "scroll", "\\u", "type_", "=_", "[_", "\"", "bar", "s", "\"_", ",_", "\"", "content", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bar", "\\u", "width_", "=_", "'", "10", "dp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "treeview_", "=_", "Tree", "View_", "(_", "hide", "\\u", "root_", "=_", "True_", ",_", "size", "\\u", "hin", "t", "\\u", "y_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "treeview_", "._", "bind_", "(_", "minim", "um", "\\u", "height_", "=_", "treeview_", "._", "setter_", "(_", "\"", "height", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "list_", "(_", "widget_", "._", "properties_", "(_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wk", "\\u", "widget_", "=_", "weakref_", "._", "ref_", "(_", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "Tree", "View", "Property_", "(_", "key_", "=_", "key_", ",_", "widget", "\\u", "ref_", "=_", "wk", "\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "._", "bind_", "(_", "is", "\\u", "selected_", "=_", "self_", "._", "show", "\\u", "property_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "._", "bind_", "(_", "**_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "key_", ":_", "partial_", "(_", "self_", "._", "update", "\\u", "node", "\\u", "content_", ",_", "weakref_", "._", "ref_", "(_", "node_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "treeview_", "._", "add", "\\u", "node_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root_", "._", "add", "\\u", "widget_", "(_", "sv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sv_", "._", "add", "\\u", "widget_", "(_", "treeview_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "set\\u", "content_", "(_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "\\u", "property_", "(_", "self_", ",_", "instance_", ",_", "value_", ",_", "key_", "=_", "None_", ",_", "index_", "=_", "-_", "1_", ",_", "*_", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "normal", " ", "call", ":", " ", "(", "tree", " ", "node", ",", " ", "foc", "us", ",", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nest", "ed", " ", "call", ":", " ", "(", "widget", ",", " ", "prop", " ", "value", ",", " ", "prop", " ", "key", ",", " ", "index", " ", "in", " ", "dict", "/", "list", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "console_", "=_", "self_", "._", "console_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "normal", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nested_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widget_", "=_", "instance_", "._", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "instance_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prop_", "=_", "widget_", "._", "property_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "getattr_", "(_", "widget_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "nest", "ed", " ", "call", ",", " ", "we", " ", "mig", "ht", " ", "edit", " ", "subv", "alue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nested_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widget_", "=_", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prop_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dtype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "prop_", ",_", "Ali", "as", "Property_", ")_", "or_", "nested_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "try", "ing", " ", "to", " ", "resolve", " ", "type", " ", "dynami", "cl", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "value_", ")_", "in_", "(_", "str_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dtype_", "=_", "'", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "value_", ")_", "in_", "(_", "int_", ",_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dtype_", "=_", "'", "numeri", "c", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "value_", ")_", "in_", "(_", "tuple_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dtype_", "=_", "'", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "prop_", ",_", "Numer", "ic", "Property_", ")_", "or_", "dtype_", "==_", "'", "numeri", "c", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Text", "Input_", "(_", "text_", "=_", "str_", "(_", "value_", ")_", "or_", "''_", ",_", "multiline", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "bind_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "partial_", "(_", "self_", "._", "save", "\\u", "property", "\\u", "numeric_", ",_", "widget_", ",_", "key_", ",_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "prop_", ",_", "String", "Property_", ")_", "or_", "dtype_", "==_", "'", "string", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Text", "Input_", "(_", "text_", "=_", "value_", "or_", "''_", ",_", "multiline", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "bind_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "partial_", "(_", "self_", "._", "save", "\\u", "property", "\\u", "text_", ",_", "widget_", ",_", "key_", ",_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "isinstance_", "(_", "prop_", ",_", "List", "Property_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "prop_", ",_", "Reference", "List", "Property_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "prop_", ",_", "Varia", "ble", "List", "Property_", ")_", "or_", "dtype_", "==_", "'", "list", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Grid", "Layout_", "(_", "cols_", "=_", "1_", ",_", "size", "\\u", "hin", "t", "\\u", "y_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "bind_", "(_", "minim", "um", "\\u", "height_", "=_", "content_", "._", "setter_", "(_", "'", "height", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "item_", "in_", "enumerate_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "button_", "=_", "Button_", "(_", "text_", "=_", "repr_", "(_", "item_", ")_", ",_", "size", "\\u", "hin", "t", "\\u", "y_", "=_", "None_", ",_", "height_", "=_", "44_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", ",_", "Widget_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "button_", "._", "bind_", "(_", "on", "\\u", "release_", "=_", "partial_", "(_", "console_", "._", "highlight", "\\u", "widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "item_", ",_", "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 ", " ", "_", "button_", "._", "bind_", "(_", "on", "\\u", "release_", "=_", "partial_", "(_", "self_", "._", "show", "\\u", "property_", ",_", "widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "item_", ",_", "key_", ",_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "._", "add", "\\u", "widget_", "(_", "button_", ")_", "\\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_", "(_", "prop_", ",_", "Optio", "n", "Property_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Grid", "Layout_", "(_", "cols_", "=_", "1_", ",_", "size", "\\u", "hin", "t", "\\u", "y_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "bind_", "(_", "minim", "um", "\\u", "height_", "=_", "content_", "._", "setter_", "(_", "'", "height", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "prop_", "._", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "button_", "=_", "Toggle", "Button_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "option_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "'", "down", "'_", "if_", "option_", "==_", "value_", "else_", "'", "normal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "group_", "=_", "repr_", "(_", "content_", "._", "uid_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size", "\\u", "hin", "t", "\\u", "y_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "height_", "=_", "44_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "button_", "._", "bind_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "press_", "=_", "partial_", "(_", "self_", "._", "save", "\\u", "property", "\\u", "option_", ",_", "widget_", ",_", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "add", "\\u", "widget_", "(_", "button_", ")_", "\\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_", "(_", "prop_", ",_", "Object", "Property_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "Widget_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Button_", "(_", "text_", "=_", "repr_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "bind_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "release_", "=_", "partial_", "(_", "console_", "._", "highlight", "\\u", "widget_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "value_", ",_", "Texture_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Image_", "(_", "texture_", "=_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "Label_", "(_", "text_", "=_", "repr_", "(_", "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_", "elif_", "isinstance_", "(_", "prop_", ",_", "Boo", "lean", "Property_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "'", "down", "'_", "if_", "value_", "else_", "'", "normal", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "Toggle", "Button_", "(_", "text_", "=_", "key_", ",_", "state_", "=_", "state_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "._", "bind_", "(_", "on", "\\u", "release_", "=_", "partial_", "(_", "self_", "._", "save", "\\u", "property", "\\u", "boolean_", ",_", "widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", ",_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "root_", "._", "clear", "\\u", "widgets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "root_", "._", "add", "\\u", "widget_", "(_", "self_", "._", "sv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "root_", "._", "add", "\\u", "widget_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "ignore", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "save", "\\u", "property", "\\u", "numeric_", "(_", "self_", ",_", "widget_", ",_", "key_", ",_", "index_", ",_", "instance_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "index_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "getattr_", "(_", "widget_", ",_", "key_", ")_", "[_", "index_", "]_", "=_", "float_", "(_", "instance_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "widget_", ",_", "key_", ",_", "float_", "(_", "instance_", "._", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "ignore", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "save", "\\u", "property", "\\u", "text_", "(_", "self_", ",_", "widget_", ",_", "key_", ",_", "index_", ",_", "instance_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "index_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "getattr_", "(_", "widget_", ",_", "key_", ")_", "[_", "index_", "]_", "=_", "instance_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "widget_", ",_", "key_", ",_", "instance_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "ignore", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "save", "\\u", "property", "\\u", "boolean_", "(_", "self_", ",_", "widget_", ",_", "key_", ",_", "index_", ",_", "instance_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "instance_", "._", "state_", "==_", "'", "down", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "index_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "getattr_", "(_", "widget_", ",_", "key_", ")_", "[_", "index_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "widget_", ",_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Panel_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "ignore", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "save", "\\u", "property", "\\u", "option_", "(_", "self_", ",_", "widget_", ",_", "key_", ",_", "instance_", ",_", "*_", "l_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "widget_", ",_", "key_", ",_", "instance_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "content_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "add", "\\u", "panel_", "(_", "\"", "Tree", "\"_", ",_", "self_", "._", "panel", "\\u", "activate_", ",_", "self_", "._", "deactivate_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "panel", "\\u", "refresh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "panel", "\\u", "activate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "console_", "._", "bind_", "(_", "widget_", "=_", "self_", "._", "update", "\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "\\u", "content_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deactivate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "content_", "._", "widget_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "content_", "._", "console_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "console_", "._", "unbind", "_", "(_", "widget_", "=_", "self_", "._", "update", "\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "content_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget_", "=_", "self_", "._", "console_", "._", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "content_", "=_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree", "View_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "content_", "._", "console_", "=_", "self_", "._", "console_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "content_", "._", "widget_", "=_", "widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "content_", "._", "update", "\\u", "widget", "\\u", "tree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "console_", "._", "set\\u", "content_", "(_", "self_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cons", "ole", "Add", "on", "Wid", "get", "Tree_", "(_", "Cons", "ole", "Addon_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "panel", "\\u", "refresh_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "content_", "._", "update", "\\u", "widget", "\\u", "tree_", "(_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
priestc/giotto/giotto/programs/tables.py
[ { "content": "import six\nfrom giotto import get_config\nfrom django.core.management import call_command\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def syncdb():\n \"\"\"\n Create all the tables for the models that have been added to the manifest.\n \"\"\"\n call_command('syncdb', traceback=True)", "metadata": "root.syncdb", "header": "['module', '___EOS___']", "index": 4 }, { "content": "def flush():\n \"\"\"\n Drop all existing tables in the database, and then recreate them.\n \"\"\"\n return call_command('flush', traceback=True)", "metadata": "root.flush", "header": "['module', '___EOS___']", "index": 10 } ]
[ { "span": "import six", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 10 }, { "span": "from giotto import get_config", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gio", "tto", "_", "import_", "get", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "management_", "import_", "call", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "sync", "db_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "all", " ", "the", " ", "tables", " ", "for", " ", "the", " ", "model", "s", " ", "tha", "t", " ", "have", " ", "bee", "n", " ", "adde", "d", " ", "to", " ", "the", " ", "manifest", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "command_", "(_", "'", "sync", "db", "'_", ",_", "traceback_", "=_", "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_", "flush_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Drop", " ", "all", " ", "exist", "ing", " ", "tables", " ", "in", " ", "the", " ", "databa", "se", ",", " ", "and", " ", "then", " ", "recreate", " ", "them", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "call", "\\u", "command_", "(_", "'", "flush", "'_", ",_", "traceback_", "=_", "True_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
jakebasile/reap/reap/api/base.py
[ { "content": " def get_request(self, path):\n request = self.__init_request(path)\n try:\n result = urllib2.urlopen(request)\n result_json = json.load(result)\n return result_json\n except:\n return None", "metadata": "root.ReapBase.get_request", "header": "['class', 'ReapBase', ':', '___EOS___']", "index": 36 }, { "content": " def post_request(self, path, data, follow = False):\n request = self.__init_request(path)\n try:\n request.add_data(json.dumps(data))\n result = urllib2.urlopen(request)\n if result.code == 201 and follow:\n return self.get_request(result.headers.getheader('Location')[1:])\n result_json = json.load(result)\n return result_json\n except:\n return None", "metadata": "root.ReapBase.post_request", "header": "['class', 'ReapBase', ':', '___EOS___']", "index": 45 }, { "content": " def delete_request(self, path):\n request = self.__init_request(path)\n request.get_method = lambda: 'DELETE'\n try:\n result = urllib2.urlopen(request)\n if result:\n return True\n else:\n return False\n except:\n return None", "metadata": "root.ReapBase.delete_request", "header": "['class', 'ReapBase', ':', '___EOS___']", "index": 57 } ]
[ { "span": "except:", "start_line": 42, "start_column": 8, "end_line": 42, "end_column": 15 }, { "span": "except:", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 15 }, { "span": "except:", "start_line": 66, "start_column": 8, "end_line": 66, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Rea", "p", "Base_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "request_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "\\u\\u", "init", "\\u", "request_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "urllib2_", "._", "urlopen_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "json_", "=_", "json_", "._", "load_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result", "\\u", "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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rea", "p", "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_", "post", "\\u", "request_", "(_", "self_", ",_", "path_", ",_", "data_", ",_", "follow_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "\\u\\u", "init", "\\u", "request_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "add", "\\u", "data_", "(_", "json_", "._", "dumps_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "urllib2_", "._", "urlopen_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "code_", "==_", "201_", "and_", "follow_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "request_", "(_", "result_", "._", "headers_", "._", "getheader_", "(_", "'", "Locat", "ion", "'_", ")_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result", "\\u", "json_", "=_", "json_", "._", "load_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result", "\\u", "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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rea", "p", "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_", "delete", "\\u", "request_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "\\u\\u", "init", "\\u", "request_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "get", "\\u", "method_", "=_", "lambda_", ":_", "'", "DELET", "E", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "urllib2_", "._", "urlopen_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_" ]
[ 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, 0, 1, 1, 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, 0, 1, 1, 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, 0, 1, 1, 1, 2, 2, 2, 2, 2 ]
Unused local variable
saltstack/salt/salt/modules/smartos_nictagadm.py
[ { "content": "def add(name, mac, mtu=1500):\n '''\n Add a new nictag\n\n name : string\n name of new nictag\n mac : string\n mac of parent interface or 'etherstub' to create a ether stub\n mtu : int\n MTU\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' nictagadm.add storage etherstub\n salt '*' nictagadm.add trunk 'DE:AD:OO:OO:BE:EF' 9000\n '''\n ret = {}\n nictagadm = _check_nictagadm()\n dladm = _check_dladm()\n\n if mtu > 9000 or mtu < 1500:\n return {'Error': 'mtu must be a value between 1500 and 9000.'}\n if mac != 'etherstub':\n cmd = '{dladm} show-phys -m -p -o address'.format(\n dladm=dladm\n )\n res = __salt__['cmd.run_all'](cmd)\n if mac not in res['stdout'].splitlines():\n return {'Error': '{0} is not present on this system.'.format(mac)}\n\n if mac == 'etherstub':\n cmd = '{nictagadm} add -l -p mtu={mtu} {name}'.format(\n nictagadm=nictagadm,\n mtu=mtu,\n name=name\n )\n res = __salt__['cmd.run_all'](cmd)\n else:\n cmd = '{nictagadm} add -p mtu={mtu},mac={mac} {name}'.format(\n nictagadm=nictagadm,\n mtu=mtu,\n mac=mac,\n name=name\n )\n res = __salt__['cmd.run_all'](cmd)\n\n if res['retcode'] == 0:\n return True\n else:\n return {'Error': 'failed to create nictag.' if 'stderr' not in res and res['stderr'] == '' else res['stderr']}", "metadata": "root.add", "header": "['module', '___EOS___']", "index": 159 }, { "content": "def update(name, mac=None, mtu=None):\n '''\n Update a nictag\n\n name : string\n name of nictag\n mac : string\n optional new mac for nictag\n mtu : int\n optional new MTU for nictag\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' nictagadm.update trunk mtu=9000\n '''\n ret = {}\n nictagadm = _check_nictagadm()\n dladm = _check_dladm()\n\n if name not in list_nictags():\n return {'Error': 'nictag {0} does not exists.'.format(name)}\n if not mtu and not mac:\n return {'Error': 'please provide either mac or/and mtu.'}\n if mtu:\n if mtu > 9000 or mtu < 1500:\n return {'Error': 'mtu must be a value between 1500 and 9000.'}\n if mac:\n if mac == 'etherstub':\n return {'Error': 'cannot update a nic with \"etherstub\".'}\n else:\n cmd = '{dladm} show-phys -m -p -o address'.format(\n dladm=dladm\n )\n res = __salt__['cmd.run_all'](cmd)\n if mac not in res['stdout'].splitlines():\n return {'Error': '{0} is not present on this system.'.format(mac)}\n\n if mac and mtu:\n properties = \"mtu={0},mac={1}\".format(mtu, mac)\n elif mac:\n properties = \"mac={0}\".format(mac) if mac else \"\"\n elif mtu:\n properties = \"mtu={0}\".format(mtu) if mtu else \"\"\n\n cmd = '{nictagadm} update -p {properties} {name}'.format(\n nictagadm=nictagadm,\n properties=properties,\n name=name\n )\n res = __salt__['cmd.run_all'](cmd)\n\n if res['retcode'] == 0:\n return True\n else:\n return {'Error': 'failed to update nictag.' if 'stderr' not in res and res['stderr'] == '' else res['stderr']}", "metadata": "root.update", "header": "['module', '___EOS___']", "index": 213 }, { "content": "def delete(name, force=False):\n '''\n Delete nictag\n\n name : string\n nictag to delete\n force : boolean\n force delete even if vms attached\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' nictagadm.exists admin\n '''\n ret = {}\n nictagadm = _check_nictagadm()\n\n if name not in list_nictags():\n return True\n\n cmd = '{nictagadm} delete {force}{name}'.format(\n nictagadm=nictagadm,\n force=\"-f \" if force else \"\",\n name=name\n )\n res = __salt__['cmd.run_all'](cmd)\n\n if res['retcode'] == 0:\n return True\n else:\n return {'Error': 'failed to delete nictag.' if 'stderr' not in res and res['stderr'] == '' else res['stderr']}", "metadata": "root.delete", "header": "['module', '___EOS___']", "index": 272 } ]
[ { "span": "ret ", "start_line": 177, "start_column": 4, "end_line": 177, "end_column": 7 }, { "span": "ret ", "start_line": 230, "start_column": 4, "end_line": 230, "end_column": 7 }, { "span": "ret ", "start_line": 287, "start_column": 4, "end_line": 287, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add_", "(_", "name_", ",_", "mac_", ",_", "mtu_", "=_", "1500_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "a", " ", "new", " ", "nic", "tag", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "name", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "of", " ", "new", " ", "nic", "tag", "\\", "10", ";", " ", " ", " ", " ", "mac", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "mac", " ", "of", " ", "parent", " ", "interface", " ", "or", " ", "'", "ether", "stub", "'", " ", "to", " ", "create", " ", "a", " ", "ether", " ", "stub", "\\", "10", ";", " ", " ", " ", " ", "mtu", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "MT", "U", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "CLI", " ", "Exam", "ple", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "code", "-", "block", "::", " ", "bash", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "salt", " ", "'*", "'", " ", "nic", "tag", "adm", ".", "add", " ", "storage", " ", "ether", "stub", "\\", "10", ";", " ", " ", " ", " ", "salt", " ", "'*", "'", " ", "nic", "tag", "adm", ".", "add", " ", "trunk", " ", "'", "DE", ":", "AD", ":", "OO", ":", "OO", ":", "BE", ":", "EF", "'", " ", "9000", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "\\u", "check", "\\u", "nic", "tag", "adm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dla", "dm_", "=_", "\\u", "check", "\\u", "dla", "dm_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mtu_", ">_", "9000", "_", "or_", "mtu_", "<_", "1500_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'", "mtu", " ", "must", " ", "be", " ", "a", " ", "value", " ", "bet", "ween", " ", "150", "0", " ", "and", " ", "9000", ".'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mac_", "!=_", "'", "ether", "stub", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "'{", "dla", "dm", "}", " ", "show", "-", "phys", " ", "-", "m", " ", "-", "p", " ", "-", "o", " ", "address", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "dla", "dm_", "=_", "dla", "dm_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "\\u\\u", "salt\\u\\u_", "[_", "'", "cmd", ".", "run", "\\u", "all", "'_", "]_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mac_", "not_", "in_", "res_", "[_", "'", "stdout", "'_", "]_", "._", "splitlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'{", "0", "}", " ", "is", " ", "not", " ", "presen", "t", " ", "on", " ", "this", " ", "system", ".'_", "._", "format_", "(_", "mac_", ")_", "}_", "\\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_", "mac_", "==_", "'", "ether", "stub", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "'{", "nic", "tag", "adm", "}", " ", "add", " ", "-", "l", " ", "-", "p", " ", "mtu", "={", "mtu", "}", " ", "{", "name", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "nic", "tag", "adm", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mtu_", "=_", "mtu_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "\\u\\u", "salt\\u\\u_", "[_", "'", "cmd", ".", "run", "\\u", "all", "'_", "]_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "'{", "nic", "tag", "adm", "}", " ", "add", " ", "-", "p", " ", "mtu", "={", "mtu", "},", "mac", "={", "mac", "}", " ", "{", "name", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "nic", "tag", "adm", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mtu_", "=_", "mtu_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mac_", "=_", "mac_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "\\u\\u", "salt\\u\\u_", "[_", "'", "cmd", ".", "run", "\\u", "all", "'_", "]_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "res_", "[_", "'", "ret", "code", "'_", "]_", "==_", "0_", ":_", "\\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_", "{_", "'", "Error", "'_", ":_", "'", "fail", "ed", " ", "to", " ", "create", " ", "nic", "tag", ".'_", "if_", "'", "std", "err", "'_", "not_", "in_", "res_", "and_", "res_", "[_", "'", "std", "err", "'_", "]_", "==_", "''_", "else_", "res_", "[_", "'", "std", "err", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "name_", ",_", "mac_", "=_", "None_", ",_", "mtu_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Update", " ", "a", " ", "nic", "tag", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "name", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "of", " ", "nic", "tag", "\\", "10", ";", " ", " ", " ", " ", "mac", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "new", " ", "mac", " ", "for", " ", "nic", "tag", "\\", "10", ";", " ", " ", " ", " ", "mtu", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "option", "al", " ", "new", " ", "MT", "U", " ", "for", " ", "nic", "tag", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "CLI", " ", "Exam", "ple", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "code", "-", "block", "::", " ", "bash", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "salt", " ", "'*", "'", " ", "nic", "tag", "adm", ".", "update", " ", "trunk", " ", "mtu", "=", "9000", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "\\u", "check", "\\u", "nic", "tag", "adm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dla", "dm_", "=_", "\\u", "check", "\\u", "dla", "dm_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "not_", "in_", "list", "\\u", "nic", "tags_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'", "nic", "tag", " ", "{", "0", "}", " ", "doe", "s", " ", "not", " ", "exist", "s", ".'_", "._", "format_", "(_", "name_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "mtu_", "and_", "not_", "mac_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'", "plea", "se", " ", "provide", " ", "eit", "her", " ", "mac", " ", "or", "/", "and", " ", "mtu", ".'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mtu_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mtu_", ">_", "9000", "_", "or_", "mtu_", "<_", "1500_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'", "mtu", " ", "must", " ", "be", " ", "a", " ", "value", " ", "bet", "ween", " ", "150", "0", " ", "and", " ", "9000", ".'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mac_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mac_", "==_", "'", "ether", "stub", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'", "cann", "ot", " ", "update", " ", "a", " ", "nic", " ", "with", " ", "\"", "ether", "stub", "\".'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "'{", "dla", "dm", "}", " ", "show", "-", "phys", " ", "-", "m", " ", "-", "p", " ", "-", "o", " ", "address", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "dla", "dm_", "=_", "dla", "dm_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "\\u\\u", "salt\\u\\u_", "[_", "'", "cmd", ".", "run", "\\u", "all", "'_", "]_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mac_", "not_", "in_", "res_", "[_", "'", "stdout", "'_", "]_", "._", "splitlines_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "Error", "'_", ":_", "'{", "0", "}", " ", "is", " ", "not", " ", "presen", "t", " ", "on", " ", "this", " ", "system", ".'_", "._", "format_", "(_", "mac_", ")_", "}_", "\\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_", "mac_", "and_", "mtu_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "properties_", "=_", "\"", "mtu", "={", "0", "},", "mac", "={", "1", "}\"_", "._", "format_", "(_", "mtu_", ",_", "mac_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "mac_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "properties_", "=_", "\"", "mac", "={", "0", "}\"_", "._", "format_", "(_", "mac_", ")_", "if_", "mac_", "else_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "mtu_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "properties_", "=_", "\"", "mtu", "={", "0", "}\"_", "._", "format_", "(_", "mtu_", ")_", "if_", "mtu_", "else_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "'{", "nic", "tag", "adm", "}", " ", "update", " ", "-", "p", " ", "{", "proper", "ties", "}", " ", "{", "name", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "nic", "tag", "adm", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "properties_", "=_", "properties_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "\\u\\u", "salt\\u\\u_", "[_", "'", "cmd", ".", "run", "\\u", "all", "'_", "]_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "res_", "[_", "'", "ret", "code", "'_", "]_", "==_", "0_", ":_", "\\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_", "{_", "'", "Error", "'_", ":_", "'", "fail", "ed", " ", "to", " ", "update", " ", "nic", "tag", ".'_", "if_", "'", "std", "err", "'_", "not_", "in_", "res_", "and_", "res_", "[_", "'", "std", "err", "'_", "]_", "==_", "''_", "else_", "res_", "[_", "'", "std", "err", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "name_", ",_", "force_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Delete", " ", "nic", "tag", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "name", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "nic", "tag", " ", "to", " ", "delete", "\\", "10", ";", " ", " ", " ", " ", "force", " ", ":", " ", "boolean", "\\", "10", ";", " ", " ", " ", " ", "force", " ", "delete", " ", "even", " ", "if", " ", "vms", " ", "attache", "d", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "CLI", " ", "Exam", "ple", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "code", "-", "block", "::", " ", "bash", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "salt", " ", "'*", "'", " ", "nic", "tag", "adm", ".", "exist", "s", " ", "admin", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "\\u", "check", "\\u", "nic", "tag", "adm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "not_", "in_", "list", "\\u", "nic", "tags_", "(_", ")_", ":_", "\\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_", "cmd_", "=_", "'{", "nic", "tag", "adm", "}", " ", "delete", " ", "{", "force", "}{", "name", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "nic", "tag", "adm", "_", "=_", "nic", "tag", "adm", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force_", "=_", "\"-", "f", " ", "\"_", "if_", "force_", "else_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "\\u\\u", "salt\\u\\u_", "[_", "'", "cmd", ".", "run", "\\u", "all", "'_", "]_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "res_", "[_", "'", "ret", "code", "'_", "]_", "==_", "0_", ":_", "\\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_", "{_", "'", "Error", "'_", ":_", "'", "fail", "ed", " ", "to", " ", "delete", " ", "nic", "tag", ".'_", "if_", "'", "std", "err", "'_", "not_", "in_", "res_", "and_", "res_", "[_", "'", "std", "err", "'_", "]_", "==_", "''_", "else_", "res_", "[_", "'", "std", "err", "'_", "]_", "}_", "\\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, 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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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 ]
Testing equality to None
open-cloud/xos/xos/core/admin.py
[ { "content": " def setup_selflink(self):\n url = self.get_change_url(0)\n\n # We don't have an admin for this object, so don't create the\n # selflink.\n if (url == None):\n return\n\n # Since we need to add \"selflink\" to the field list, we need to create\n # self.fields if it is None.\n if (self.fields is None):\n self.fields = []\n for f in self.model._meta.fields:\n if f.editable and f.name != \"id\":\n self.fields.append(f.name)\n\n self.fields = tuple(self.fields) + (\"selflink\", )\n\n if self.readonly_fields is None:\n self.readonly_fields = ()\n\n self.readonly_fields = tuple(self.readonly_fields) + (\"selflink\", )", "metadata": "root.XOSTabularInline.setup_selflink", "header": "['class', 'XOSTabularInline', '(', 'admin', '.', 'TabularInline', ')', ':', '___EOS___']", "index": 365 } ]
[ { "span": "url == None)", "start_line": 370, "start_column": 12, "end_line": 370, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "XO", "ST", "abu", "lar", "Inline_", "(_", "admin_", "._", "Tab", "ular", "Inline_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup", "\\u", "self", "link_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "self_", "._", "get", "\\u", "change", "\\u", "url_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "have", " ", "an", " ", "admin", " ", "for", " ", "this", " ", "object", ",", " ", "so", " ", "don", "'", "t", " ", "create", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", "link", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "url_", "==_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sin", "ce", " ", "we", " ", "need", " ", "to", " ", "add", " ", "\"", "self", "link", "\"", " ", "to", " ", "the", " ", "field", " ", "list", ",", " ", "we", " ", "need", " ", "to", " ", "create_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "fields", " ", "if", " ", "it", " ", "is", " ", "Non", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "self_", "._", "fields_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fields_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "self_", "._", "model_", "._", "\\u", "meta_", "._", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "f_", "._", "editable_", "and_", "f_", "._", "name_", "!=_", "\"", "id", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "fields_", "._", "append_", "(_", "f_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fields_", "=_", "tuple_", "(_", "self_", "._", "fields_", ")_", "+_", "(_", "\"", "self", "link", "\"_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "read", "only", "\\u", "fields_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "read", "only", "\\u", "fields_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "read", "only", "\\u", "fields_", "=_", "tuple_", "(_", "self_", "._", "read", "only", "\\u", "fields_", ")_", "+_", "(_", "\"", "self", "link", "\"_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
cloudera/hue/desktop/libs/hadoop/src/hadoop/fs/fsutils.py
[ { "content": "def _do_overwrite(fs, path, copy_data):\n \"\"\"\n Atomically (best-effort) save the specified data to the given path\n on the filesystem.\n \"\"\"\n # TODO(todd) Should probably do an advisory permissions check here to\n # see if we're likely to fail (eg make sure we own the file\n # and can write to the dir)\n\n # First write somewhat-kinda-atomically to a staging file\n # so that if we fail, we don't clobber the old one\n path_dest = path + \"._hue_new\"\n\n # Copy the data to destination\n copy_data(path_dest)\n\n # Try to match the permissions and ownership of the old file\n cur_stats = fs.stats(path)\n try:\n fs.do_as_superuser(fs.chmod, path_dest, stat_module.S_IMODE(cur_stats['mode']))\n except:\n logging.exception(\"Could not chmod new file %s to match old file %s\" % (path_dest, path))\n # but not the end of the world - keep going\n\n try:\n fs.do_as_superuser(fs.chown, path_dest, cur_stats['user'], cur_stats['group'])\n except:\n logging.exception(\"Could not chown new file %s to match old file %s\" % (path_dest, path))\n # but not the end of the world - keep going\n\n # Now delete the old - nothing we can do here to recover\n fs.remove(path, skip_trash=True)\n\n # Now move the new one into place\n # If this fails, then we have no reason to assume\n # we can do anything to recover, since we know the\n # destination shouldn't already exist (we just deleted it above)\n fs.rename(path_dest, path)", "metadata": "root._do_overwrite", "header": "['module', '___EOS___']", "index": 51 } ]
[ { "span": "except:", "start_line": 71, "start_column": 4, "end_line": 71, "end_column": 11 }, { "span": "except:", "start_line": 77, "start_column": 4, "end_line": 77, "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_", "\\u", "do", "\\u", "overwrite_", "(_", "fs_", ",_", "path_", ",_", "copy", "\\u", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Atom", "ical", "ly", " ", "(", "best", "-", "effort", ")", " ", "save", " ", "the", " ", "specified", " ", "data", " ", "to", " ", "the", " ", "give", "n", " ", "path", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "the", " ", "filesystem", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "tod", "d", ")", " ", "Sho", "ul", "d", " ", "probab", "ly", " ", "do", " ", "an", " ", "advisor", "y", " ", "permissi", "ons", " ", "check", " ", "here", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "see", " ", "if", " ", "we", "'", "re", " ", "like", "ly", " ", "to", " ", "fail", " ", "(", "eg", " ", "make", " ", "sure", " ", "we", " ", "own", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "can", " ", "write", " ", "to", " ", "the", " ", "dir", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "write", " ", "some", "what", "-", "kind", "a", "-", "atomi", "call", "y", " ", "to", " ", "a", " ", "staging", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "tha", "t", " ", "if", " ", "we", " ", "fail", ",", " ", "we", " ", "don", "'", "t", " ", "clobber", " ", "the", " ", "old", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "dest_", "=_", "path_", "+_", "\".\\", "uh", "ue", "\\u", "new", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", " ", "the", " ", "data", " ", "to", " ", "destination_", "\\u\\u\\uNL\\u\\u\\u_", "copy", "\\u", "data_", "(_", "path", "\\u", "dest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "match", " ", "the", " ", "permissi", "ons", " ", "and", " ", "owner", "ship", " ", "of", " ", "the", " ", "old", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "cur", "\\u", "stats_", "=_", "fs_", "._", "stats_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "do", "\\u", "as", "\\u", "superuser_", "(_", "fs_", "._", "chmod_", ",_", "path", "\\u", "dest_", ",_", "stat", "\\u", "module_", "._", "S", "\\u", "IMO", "DE_", "(_", "cur", "\\u", "stats_", "[_", "'", "mode", "'_", "]_", ")_", ")_", "\\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 ", " _", "logging_", "._", "exception_", "(_", "\"", "Cou", "ld", " ", "not", " ", "chm", "od", " ", "new", " ", "file", " ", "%", "s", " ", "to", " ", "match", " ", "old", " ", "file", " ", "%", "s", "\"_", "%_", "(_", "path", "\\u", "dest_", ",_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "but", " ", "not", " ", "the", " ", "end", " ", "of", " ", "the", " ", "world", " ", "-", " ", "keep", " ", "goi", "ng_", "\\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 ", " _", "fs_", "._", "do", "\\u", "as", "\\u", "superuser_", "(_", "fs_", "._", "chown", "_", ",_", "path", "\\u", "dest_", ",_", "cur", "\\u", "stats_", "[_", "'", "user", "'_", "]_", ",_", "cur", "\\u", "stats_", "[_", "'", "group", "'_", "]_", ")_", "\\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 ", " _", "logging_", "._", "exception_", "(_", "\"", "Cou", "ld", " ", "not", " ", "chown", " ", "new", " ", "file", " ", "%", "s", " ", "to", " ", "match", " ", "old", " ", "file", " ", "%", "s", "\"_", "%_", "(_", "path", "\\u", "dest_", ",_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "but", " ", "not", " ", "the", " ", "end", " ", "of", " ", "the", " ", "world", " ", "-", " ", "keep", " ", "goi", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "delete", " ", "the", " ", "old", " ", "-", " ", "not", "hing", " ", "we", " ", "can", " ", "do", " ", "here", " ", "to", " ", "recover_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fs_", "._", "remove_", "(_", "path_", ",_", "skip", "\\u", "trash", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "move", " ", "the", " ", "new", " ", "one", " ", "int", "o", " ", "place_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "this", " ", "fail", "s", ",", " ", "then", " ", "we", " ", "have", " ", "no", " ", "reason", " ", "to", " ", "assume", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "can", " ", "do", " ", "anyt", "hing", " ", "to", " ", "recover", ",", " ", "sinc", "e", " ", "we", " ", "know", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "destinat", "ion", " ", "shou", "ld", "n", "'", "t", " ", "alr", "ead", "y", " ", "exist", " ", "(", "we", " ", "just", " ", "delete", "d", " ", "it", " ", "above", ")_", "\\u\\u\\uNL\\u\\u\\u_", "fs_", "._", "rename_", "(_", "path", "\\u", "dest_", ",_", "path_", ")_" ]
[ 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,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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 ]
Unused local variable
kuri65536/python-for-android/python-modules/twisted/twisted/internet/kqreactor.py
[ { "content": " def doKEvent(self, timeout):\n \"\"\"Poll the kqueue for new events.\"\"\"\n if timeout is None:\n timeout = 1000\n else:\n timeout = int(timeout * 1000) # convert seconds to milliseconds\n\n try:\n l = self._kq.kevent([], len(self._selectables), timeout)\n except OSError, e:\n if e[0] == errno.EINTR:\n return\n else:\n raise\n _drdw = self._doWriteOrRead\n for event in l:\n why = None\n fd, filter = event.ident, event.filter\n try:\n selectable = self._selectables[fd]\n except KeyError:\n # Handles the infrequent case where one selectable's\n # handler disconnects another.\n continue\n log.callWithLogger(selectable, _drdw, selectable, fd, filter)", "metadata": "root.KQueueReactor.doKEvent", "header": "['class', 'KQueueReactor', '(', 'posixbase', '.', 'PosixReactorBase', ')', ':', '___EOS___']", "index": 169 } ]
[ { "span": "why ", "start_line": 185, "start_column": 12, "end_line": 185, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "KQ", "ueue", "Reactor", "_", "(_", "posix", "base_", "._", "Posi", "x", "Reactor", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "KE", "vent_", "(_", "self_", ",_", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Poll", " ", "the", " ", "kq", "ueue", " ", "for", " ", "new", " ", "events", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "int_", "(_", "timeout_", "*_", "1000_", ")_", "#", " ", "convert", " ", "second", "s", " ", "to", " ", "milliseconds", "_", "\\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 ", " _", "l_", "=_", "self_", "._", "\\u", "kq", "_", "._", "ke", "vent_", "(_", "[_", "]_", ",_", "len_", "(_", "self_", "._", "\\u", "selectable", "s_", ")_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "[_", "0_", "]_", "==_", "errno_", "._", "EIN", "TR_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "dr", "dw_", "=_", "self_", "._", "\\u", "do", "Write", "Or", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "why_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", ",_", "filter_", "=_", "event_", "._", "ident_", ",_", "event_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "selectable", "_", "=_", "self_", "._", "\\u", "selectable", "s_", "[_", "fd_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Handle", "s", " ", "the", " ", "inf", "reque", "nt", " ", "case", " ", "where", " ", "one", " ", "selectable", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "handler", " ", "discon", "nect", "s", " ", "anot", "her", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "call", "With", "Logger_", "(_", "selectable", "_", ",_", "\\u", "dr", "dw_", ",_", "selectable", "_", ",_", "fd_", ",_", "filter_", ")_", "\\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, 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 ]
Unused local variable
saltstack/salt/salt/proxy/esxi.py
[ { "content": "def grains_refresh():\n '''\n Refresh the grains from the proxy device.\n '''\n GRAINS_CACHE = {}\n return grains()", "metadata": "root.grains_refresh", "header": "['module', '___EOS___']", "index": 336 } ]
[ { "span": "GRAINS_CACHE ", "start_line": 340, "start_column": 4, "end_line": 340, "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_", "grains", "\\u", "refresh_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Refr", "esh", " ", "the", " ", "grains", " ", "from", " ", "the", " ", "proxy", " ", "device", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GRA", "INS", "\\u", "CACHE_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "grains", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
zzzeek/sqlalchemy/examples/performance/__init__.py
[ { "content": " @classmethod\n def main(cls):\n\n parser = argparse.ArgumentParser(\"python -m examples.performance\")\n\n if cls.name is None:\n parser.add_argument(\n \"name\", choices=cls._suite_names(), help=\"suite to run\")\n\n if len(sys.argv) > 1:\n potential_name = sys.argv[1]\n try:\n suite = __import__(__name__ + \".\" + potential_name)\n except ImportError:\n pass\n\n parser.add_argument(\n \"--test\", type=str,\n help=\"run specific test name\"\n )\n\n parser.add_argument(\n '--dburl', type=str, default=\"sqlite:///profile.db\",\n help=\"database URL, default sqlite:///profile.db\"\n )\n parser.add_argument(\n '--num', type=int, default=cls.num,\n help=\"Number of iterations/items/etc for tests; \"\n \"default is %d module-specific\" % cls.num\n )\n parser.add_argument(\n '--profile', action='store_true',\n help='run profiling and dump call counts')\n parser.add_argument(\n '--dump', action='store_true',\n help='dump full call profile (implies --profile)')\n parser.add_argument(\n '--callers', action='store_true',\n help='print callers as well (implies --dump)')\n parser.add_argument(\n '--runsnake', action='store_true',\n help='invoke runsnakerun (implies --profile)')\n parser.add_argument(\n '--echo', action='store_true',\n help=\"Echo SQL output\")\n args = parser.parse_args()\n\n args.dump = args.dump or args.callers\n args.profile = args.profile or args.dump or args.runsnake\n\n if cls.name is None:\n suite = __import__(__name__ + \".\" + args.name)\n\n Profiler(args).run()", "metadata": "root.Profiler.main", "header": "['class', 'Profiler', '(', 'object', ')', ':', '___EOS___']", "index": 321 } ]
[ { "span": "suite ", "start_line": 333, "start_column": 20, "end_line": 333, "end_column": 25 } ]
[ { "span": "suite ", "start_line": 372, "start_column": 12, "end_line": 372, "end_column": 17 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Profiler", "_", "(_", "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_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "main_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "\"", "python", " ", "-", "m", " ", "example", "s", ".", "perform", "anc", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cls_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ",_", "choices_", "=_", "cls_", "._", "\\u", "suit", "e\\u", "names_", "(_", ")_", ",_", "help_", "=_", "\"", "suit", "e", " ", "to", " ", "run", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "potenti", "al", "\\u", "name_", "=_", "sys_", "._", "argv_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "suite_", "=_", "\\u\\u", "import\\u\\u_", "(_", "\\u\\u", "name\\u\\u_", "+_", "\".\"_", "+_", "potenti", "al", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "test", "\"_", ",_", "type_", "=_", "str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "run", " ", "specific", " ", "test", " ", "name", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "dbu", "rl", "'_", ",_", "type_", "=_", "str_", ",_", "default_", "=_", "\"", "sql", "ite", ":///", "profile", ".", "db", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "databa", "se", " ", "URL", ",", " ", "default", " ", "sql", "ite", ":///", "profile", ".", "db", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "num", "'_", ",_", "type_", "=_", "int_", ",_", "default_", "=_", "cls_", "._", "num_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Number", " ", "of", " ", "iterati", "ons", "/", "items", "/", "etc", " ", "for", " ", "tests", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "default", " ", "is", " ", "%", "d", " ", "module", "-", "specific", "\"_", "%_", "cls_", "._", "num_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "profile", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "run", " ", "profiling", " ", "and", " ", "dump", " ", "call", " ", "count", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "dump", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "dump", " ", "full", " ", "call", " ", "profile", " ", "(", "implies", " ", "--", "profile", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "caller", "s", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "print", " ", "caller", "s", " ", "as", " ", "well", " ", "(", "implies", " ", "--", "dump", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "runs", "nak", "e", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "invoke", " ", "runs", "nak", "eru", "n", " ", "(", "implies", " ", "--", "profile", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "echo", "'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Ech", "o", " ", "SQL", " ", "output", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "._", "dump_", "=_", "args_", "._", "dump_", "or_", "args_", "._", "caller", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "profile_", "=_", "args_", "._", "profile_", "or_", "args_", "._", "dump_", "or_", "args_", "._", "runs", "nak", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cls_", "._", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "\\u\\u", "import\\u\\u_", "(_", "\\u\\u", "name\\u\\u_", "+_", "\".\"_", "+_", "args_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Profiler", "_", "(_", "args_", ")_", "._", "run_", "(_", ")_", "\\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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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, 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 ]
Testing equality to None
AppScale/appscale/AppServer/lib/django-1.2/django/middleware/cache.py
[ { "content": " def process_response(self, request, response):\n \"\"\"Sets the cache, if needed.\"\"\"\n if not self._should_update_cache(request, response):\n # We don't need to update the cache, just return.\n return response\n if request.method != 'GET':\n # This is a stronger requirement than above. It is needed\n # because of interactions between this middleware and the\n # HTTPMiddleware, which throws the body of a HEAD-request\n # away before this middleware gets a chance to cache it.\n return response\n if not response.status_code == 200:\n return response\n # Try to get the timeout from the \"max-age\" section of the \"Cache-\n # Control\" header before reverting to using the default cache_timeout\n # length.\n timeout = get_max_age(response)\n if timeout == None:\n timeout = self.cache_timeout\n elif timeout == 0:\n # max-age was set to 0, don't bother caching.\n return response\n patch_response_headers(response, timeout)\n if timeout:\n cache_key = learn_cache_key(request, response, timeout, self.key_prefix)\n cache.set(cache_key, response, timeout)\n return response", "metadata": "root.UpdateCacheMiddleware.process_response", "header": "['class', 'UpdateCacheMiddleware', '(', 'object', ')', ':', '___EOS___']", "index": 79 } ]
[ { "span": "timeout == None:", "start_line": 96, "start_column": 11, "end_line": 96, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Update", "Cache", "Middleware_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "response_", "(_", "self_", ",_", "request_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", "s", " ", "the", " ", "cache", ",", " ", "if", " ", "need", "ed", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "shou", "ld", "\\u", "update", "\\u", "cache_", "(_", "request_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "need", " ", "to", " ", "update", " ", "the", " ", "cache", ",", " ", "just", " ", "return", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "method_", "!=_", "'", "GET", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "strong", "er", " ", "require", "ment", " ", "than", " ", "above", ".", " ", "It", " ", "is", " ", "needed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "of", " ", "interacti", "ons", " ", "bet", "ween", " ", "this", " ", "middle", "ware", " ", "and", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "HTTP", "Mid", "dle", "ware", ",", " ", "whi", "ch", " ", "throw", "s", " ", "the", " ", "body", " ", "of", " ", "a", " ", "HEAD", "-", "request_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "awa", "y", " ", "bef", "ore", " ", "this", " ", "middle", "ware", " ", "gets", " ", "a", " ", "chan", "ce", " ", "to", " ", "cache", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "response_", "._", "status", "\\u", "code_", "==_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "get", " ", "the", " ", "timeo", "ut", " ", "from", " ", "the", " ", "\"", "max", "-", "age", "\"", " ", "section", " ", "of", " ", "the", " ", "\"", "Cache", "-_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Control", "\"", " ", "header", " ", "bef", "ore", " ", "revert", "ing", " ", "to", " ", "usi", "ng", " ", "the", " ", "default", " ", "cache", "\\u", "timeout_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "length", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "timeout_", "=_", "get", "\\u", "max", "\\u", "age_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "self_", "._", "cache", "\\u", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "timeout_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "max", "-", "age", " ", "was", " ", "set", " ", "to", " ", "0", ",", " ", "don", "'", "t", " ", "bot", "her", " ", "caching", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch", "\\u", "response", "\\u", "headers_", "(_", "response_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cache", "\\u", "key_", "=_", "learn", "\\u", "cache", "\\u", "key_", "(_", "request_", ",_", "response_", ",_", "timeout_", ",_", "self_", "._", "key", "\\u", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "._", "set_", "(_", "cache", "\\u", "key_", ",_", "response_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
mikrosimage/OpenRenderManagement/src/octopus/core/communication/__init__.py
[ { "content": "from http import HttpResponse, Http400, Http403, Http404, Http405, HttpConflict, Http411, Http500, JSONResponse\nfrom requestmanager import RequestManager\nfrom decorators import JSONContent, requireContentLength\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from requestmanager import RequestManager", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 41 }, { "span": "from decorators import JSONContent, requireContentLength", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 56 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "http_", "import_", "Http", "Response_", ",_", "Http", "400_", ",_", "Http", "403_", ",_", "Http404_", ",_", "Http", "405_", ",_", "Http", "Conflict_", ",_", "Http", "411", "_", ",_", "Http", "500_", ",_", "JSONR", "esp", "ons", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "request", "manager_", "import_", "Request", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decorators_", "import_", "JSO", "NC", "onte", "nt_", ",_", "require", "Conten", "t", "Length_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unreachable code
pearu/pylibtiff/libtiff/tiff_file.py
[ { "content": " def get_samples(self, subfile_type=0, verbose=False):\n \"\"\"\n Return samples and sample names.\n\n Parameters\n ----------\n subfile_type : {0, 1}\n Specify subfile type. Subfile type 1 corresponds to reduced resolution image.\n verbose : bool\n When True the print out information about samples\n\n Returns\n -------\n samples : list\n List of numpy.memmap arrays of samples\n sample_names : list\n List of the corresponding sample names\n \"\"\"\n l = []\n i = 0\n step = 0\n can_return_memmap = True\n ifd_lst = [ifd for ifd in self.IFD if ifd.get_value('NewSubfileType')==subfile_type]\n\n depth = len(ifd_lst)\n full_l = []\n for ifd in ifd_lst:\n if not ifd.is_contiguous():\n raise NotImplementedError('none contiguous strips')\n\n strip_offsets = ifd.get_value('StripOffsets')\n strip_nbytes = ifd.get_value('StripByteCounts')\n l.append((strip_offsets[0], strip_offsets[-1]+strip_nbytes[-1]))\n for off, nb in zip (strip_offsets, strip_nbytes):\n full_l.append ((off, off+nb))\n\n if i==0:\n compression = ifd.get_value('Compression')\n if compression!=1:\n can_return_memmap = False\n #raise ValueError('Unable to get contiguous samples from compressed data (compression=%s)' % (compression)) \n width = ifd.get_value('ImageWidth')\n length = ifd.get_value('ImageLength')\n samples_per_pixel = ifd.get_value('SamplesPerPixel')\n planar_config = ifd.get_value('PlanarConfiguration')\n bits_per_sample = ifd.get_value('BitsPerSample')\n sample_format = ifd.get_value('SampleFormat')[0]\n photometric_interpretation = ifd.get_value('PhotometricInterpretation')\n if self.is_lsm or not isinstance(strip_offsets, numpy.ndarray):\n strips_per_image = 1\n else:\n strips_per_image = len(strip_offsets)\n format = sample_format_map.get(sample_format)\n if format is None:\n print 'Warning(TIFFfile.get_samples): unsupported sample_format=%s is mapped to uint' % (sample_format)\n format = 'uint'\n\n dtype_lst = []\n bits_per_pixel = 0\n for j in range(samples_per_pixel):\n bits = bits_per_sample[j]\n bits_per_pixel += bits\n dtype = getattr (self.dtypes, '%s%s' % (format, bits))\n dtype_lst.append(dtype)\n bytes_per_pixel = bits_per_pixel // 8\n assert 8*bytes_per_pixel == bits_per_pixel,`bits_per_pixel`\n bytes_per_row = width * bytes_per_pixel\n strip_length = l[-1][1] - l[-1][0]\n strip_length_str = bytes2str(strip_length)\n bytes_per_image = length * bytes_per_row\n\n rows_per_strip = bytes_per_image // (bytes_per_row * strips_per_image)\n if bytes_per_image % (bytes_per_row * strips_per_image):\n rows_per_strip += 1\n assert rows_per_strip == ifd.get_value('RowsPerStrip', rows_per_strip), `rows_per_strip, ifd.get_value('RowsPerStrip'), bytes_per_image, bytes_per_row, strips_per_image, self.filename`\n else:\n assert width == ifd.get_value('ImageWidth', width), `width, ifd.get_value('ImageWidth')`\n assert length == ifd.get_value('ImageLength', length),` length, ifd.get_value('ImageLength')`\n #assert samples_per_pixel == ifd.get('SamplesPerPixel').value, `samples_per_pixel, ifd.get('SamplesPerPixel').value`\n assert planar_config == ifd.get_value('PlanarConfiguration', planar_config)\n if can_return_memmap:\n assert strip_length == l[-1][1] - l[-1][0], `strip_length, l[-1][1] - l[-1][0]`\n else:\n strip_length = max (strip_length, l[-1][1] - l[-1][0])\n strip_length_str = ' < ' + bytes2str(strip_length)\n\n assert (bits_per_sample == ifd.get_value('BitsPerSample', bits_per_sample)).all(),`bits_per_sample, ifd.get_value('BitsPerSample')`\n if i>0:\n if i==1:\n step = l[-1][0] - l[-2][1]\n assert step>=0,`step, l[-2], l[-1]`\n else:\n if step != l[-1][0] - l[-2][1]:\n can_return_memmap = False\n #assert step == l[-1][0] - l[-2][1],`step, l[-2], l[-1], (l[-1][0] - l[-2][1]), i`\n i += 1\n\n if verbose:\n bytes_per_image_str = bytes2str(bytes_per_image)\n print '''\nwidth : %(width)s\nlength : %(length)s\ndepth : %(depth)s\nsample_format : %(format)s\nsamples_per_pixel : %(samples_per_pixel)s\nplanar_config : %(planar_config)s\nbits_per_sample : %(bits_per_sample)s\nbits_per_pixel : %(bits_per_pixel)s\n\nbytes_per_pixel : %(bytes_per_pixel)s\nbytes_per_row : %(bytes_per_row)s\nbytes_per_image : %(bytes_per_image_str)s\n\nstrips_per_image : %(strips_per_image)s\nrows_per_strip : %(rows_per_strip)s\nstrip_length : %(strip_length_str)s\n''' % (locals ())\n\n if photometric_interpretation==2:\n assert samples_per_pixel==3, `samples_per_pixel`\n sample_names = ['red', 'green', 'blue']\n else:\n sample_names = ['sample%s' % (j) for j in range (samples_per_pixel)]\n depth = i\n\n if not can_return_memmap:\n if planar_config==1:\n if samples_per_pixel==1:\n i = 0\n arr = numpy.empty(depth * bytes_per_image, dtype=self.dtypes.uint8)\n bytes_per_strip = rows_per_strip * bytes_per_row\n for start, end in full_l:\n #sys.stdout.write (\"%s:%s,\" % (start, end)); sys.stdout.flush ()\n if compression==1: # none\n d = self.data[start:end]\n elif compression==5: # lzw\n d = self.data[start:end]\n d = tif_lzw.decode(d, bytes_per_strip)\n arr[i:i+d.nbytes] = d\n i += d.nbytes\n arr = arr.view(dtype=dtype_lst[0]).reshape((depth, length, width))\n return [arr], sample_names\n else:\n i = 0\n arr = numpy.empty(depth * bytes_per_image, dtype=self.dtypes.uint8)\n bytes_per_strip = rows_per_strip * bytes_per_row\n for start, end in full_l:\n sys.stdout.write (\"%s:%s,\" % (start, end)); sys.stdout.flush ()\n if compression==1: # none\n d = self.data[start:end]\n elif compression==5: # lzw\n d = self.data[start:end]\n d = tif_lzw.decode(d, bytes_per_strip)\n arr[i:i+d.nbytes] = d\n i += d.nbytes\n dt = numpy.dtype(dict(names=sample_names, formats=dtype_lst))\n arr = arr.view(dtype=dt).reshape((depth, length, width))\n return [arr[n] for n in arr.dtype.names], arr.dtype.names\n raise NotImplementedError(`depth, bytes_per_image, samples_per_pixel`)\n else:\n raise NotImplementedError (`planar_config`)\n\n start = l[0][0]\n end = l[-1][1]\n if start > step:\n arr = self.data[start - step: end].reshape((depth, strip_length + step))\n k = step\n elif end <= self.data.size - step:\n arr = self.data[start: end+step].reshape((depth, strip_length + step))\n k = 0\n else:\n raise NotImplementedError (`start, end, step`)\n sys.stdout.flush()\n if planar_config==2:\n if self.is_lsm:\n # LSM510: one strip per image plane channel\n if subfile_type==0:\n sample_names = self.lsminfo.get('data channel name')\n elif subfile_type==1:\n sample_names = ['red', 'green', 'blue']\n assert samples_per_pixel==3,`samples_per_pixel`\n else:\n raise NotImplementedError (`subfile_type`)\n samples = []\n\n for j in range(samples_per_pixel):\n bytes = bits_per_sample[j] // 8 * width * length\n tmp = arr[:,k:k+bytes]\n tmp = tmp.view(dtype=dtype_lst[j])\n tmp = tmp.reshape((depth, length, width))\n samples.append(tmp)\n k += bytes\n return samples, sample_names\n raise NotImplementedError (`planar_config, self.is_lsm`)\n elif planar_config==1:\n samples = []\n bytes = sum(bits_per_sample[:samples_per_pixel]) // 8 * width * length\n bytes_per_sample = bits_per_sample // 8\n for j in range(samples_per_pixel):\n i0 = k+j*bytes_per_sample[j]\n #print j, i0, i0+bytes, samples_per_pixel, arr.shape\n tmp = arr[:,i0:i0+bytes:samples_per_pixel]\n tmp = numpy.array(tmp.reshape((tmp.size,)))\n tmp = tmp.view(dtype=dtype_lst[j])\n tmp = tmp.reshape((depth, length, width))\n samples.append(tmp)\n #k += bytes\n return samples, sample_names\n else:\n raise NotImplementedError (`planar_config`)", "metadata": "root.TIFFfile.get_samples", "header": "['class', 'TIFFfile', '(', 'TiffBase', ')', ':', '___EOS___']", "index": 381 } ]
[ { "span": "raise NotImplementedError(`depth, bytes_per_image, samples_per_pixel`)", "start_line": 539, "start_column": 20, "end_line": 539, "end_column": 90 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "TIF", "Ff", "ile_", "(_", "Tif", "f", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "samples_", "(_", "self_", ",_", "subf", "ile", "\\u", "type_", "=_", "0_", ",_", "verbose_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "samples", " ", "and", " ", "sample", " ", "names", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "subf", "ile", "\\u", "type", " ", ":", " ", "{", "0", ",", " ", "1", "}", "\\", "10", ";", " ", " ", "Speci", "fy", " ", "subf", "ile", " ", "type", ".", " ", "Sub", "file", " ", "type", " ", "1", " ", "correspond", "s", " ", "to", " ", "reduce", "d", " ", "resolu", "tion", " ", "image", ".", "\\", "10", ";", " ", " ", " ", " ", "verbo", "se", " ", ":", " ", "bool", "\\", "10", ";", " ", " ", "Whe", "n", " ", "Tru", "e", " ", "the", " ", "print", " ", "out", " ", "informati", "on", " ", "abo", "ut", " ", "samples", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "samples", " ", ":", " ", "list", "\\", "10", ";", " ", " ", "List", " ", "of", " ", "nump", "y", ".", "mem", "map", " ", "arrays", " ", "of", " ", "samples", "\\", "10", ";", " ", " ", " ", " ", "sample", "\\u", "names", " ", ":", " ", "list", "\\", "10", ";", " ", " ", "List", " ", "of", " ", "the", " ", "correspond", "ing", " ", "sample", " ", "names", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "step_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "\\u", "return", "\\u", "mem", "map_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if", "d\\u", "lst_", "=_", "[_", "if", "d_", "for_", "if", "d_", "in_", "self_", "._", "IF", "D_", "if_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "New", "Sub", "file", "Type", "'_", ")_", "==_", "subf", "ile", "\\u", "type_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "depth_", "=_", "len_", "(_", "if", "d\\u", "lst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "\\u", "l_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "if", "d_", "in_", "if", "d\\u", "lst_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "if", "d_", "._", "is", "\\u", "contiguous", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "'", "none", " ", "contiguous", " ", "strip", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "strip", "\\u", "offsets_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Strip", "Offsets", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "strip", "\\u", "nbytes_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Strip", "Byte", "Count", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "._", "append_", "(_", "(_", "strip", "\\u", "offsets_", "[_", "0_", "]_", ",_", "strip", "\\u", "offsets_", "[_", "-_", "1_", "]_", "+_", "strip", "\\u", "nbytes_", "[_", "-_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "off_", ",_", "nb_", "in_", "zip_", "(_", "strip", "\\u", "offsets_", ",_", "strip", "\\u", "nbytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "l_", "._", "append_", "(_", "(_", "off_", ",_", "off_", "+_", "nb_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compression_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Compress", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compression_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "can", "\\u", "return", "\\u", "mem", "map_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "raise", " ", "Value", "Error", "('", "Una", "ble", " ", "to", " ", "get", " ", "contiguous", " ", "samples", " ", "from", " ", "compress", "ed", " ", "data", " ", "(", "compress", "ion", "=", "%", "s", ")'", " ", "%", " ", "(", "compress", "ion", "))", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "width_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Image", "Wid", "th", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Image", "Length", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samples", "\\u", "per", "\\u", "pixel_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Sampl", "es", "Per", "Pix", "el", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plan", "ar", "\\u", "config_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Plan", "ar", "Configura", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bits", "\\u", "per", "\\u", "sample_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Bit", "s", "Per", "Sampl", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sample", "\\u", "format_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Sampl", "e", "Format", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "photom", "etric", "\\u", "interpretation", "_", "=_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Photo", "metric", "Interpret", "ation", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "ls", "m_", "or_", "not_", "isinstance_", "(_", "strip", "\\u", "offsets_", ",_", "numpy_", "._", "ndarray_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "strip", "s", "\\u", "per", "\\u", "image_", "=_", "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 ", " ", "_", "strip", "s", "\\u", "per", "\\u", "image_", "=_", "len_", "(_", "strip", "\\u", "offsets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "format_", "=_", "sample", "\\u", "format\\u", "map_", "._", "get_", "(_", "sample", "\\u", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "Warn", "ing", "(", "TIF", "Ff", "ile", ".", "get", "\\u", "samples", "):", " ", "unsup", "porte", "d", " ", "sample", "\\u", "format", "=", "%", "s", " ", "is", " ", "mapp", "ed", " ", "to", " ", "uint", "'_", "%_", "(_", "sample", "\\u", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format_", "=_", "'", "uint", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dt", "ype", "\\u", "lst_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bits", "\\u", "per", "\\u", "pixel_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "samples", "\\u", "per", "\\u", "pixel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bits_", "=_", "bits", "\\u", "per", "\\u", "sample_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bits", "\\u", "per", "\\u", "pixel_", "+=_", "bits_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dtype_", "=_", "getattr_", "(_", "self_", "._", "dtypes_", ",_", "'%", "s", "%", "s", "'_", "%_", "(_", "format_", ",_", "bits_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "ype", "\\u", "lst_", "._", "append_", "(_", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bytes", "\\u", "per", "\\u", "pixel_", "=_", "bits", "\\u", "per", "\\u", "pixel_", "//_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "8_", "*_", "bytes", "\\u", "per", "\\u", "pixel_", "==_", "bits", "\\u", "per", "\\u", "pixel_", ",_", "`_", "bits", "\\u", "per", "\\u", "pixel_", "`_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "per", "\\u", "row_", "=_", "width_", "*_", "bytes", "\\u", "per", "\\u", "pixel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "strip", "\\u", "length_", "=_", "l_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "-_", "l_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "strip", "\\u", "length", "\\u", "str_", "=_", "bytes", "2str_", "(_", "strip", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "per", "\\u", "image_", "=_", "length_", "*_", "bytes", "\\u", "per", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows", "\\u", "per", "\\u", "strip_", "=_", "bytes", "\\u", "per", "\\u", "image_", "//_", "(_", "bytes", "\\u", "per", "\\u", "row_", "*_", "strip", "s", "\\u", "per", "\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "bytes", "\\u", "per", "\\u", "image_", "%_", "(_", "bytes", "\\u", "per", "\\u", "row_", "*_", "strip", "s", "\\u", "per", "\\u", "image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "rows", "\\u", "per", "\\u", "strip_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "rows", "\\u", "per", "\\u", "strip_", "==_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Row", "s", "Per", "Strip", "'_", ",_", "rows", "\\u", "per", "\\u", "strip_", ")_", ",_", " _", "`_", "rows", "\\u", "per", "\\u", "strip_", ",_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Row", "s", "Per", "Strip", "'_", ")_", ",_", "bytes", "\\u", "per", "\\u", "image_", ",_", "bytes", "\\u", "per", "\\u", "row_", ",_", "strip", "s", "\\u", "per", "\\u", "image_", ",_", "self_", "._", "filename_", "`_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "width_", "==_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Image", "Wid", "th", "'_", ",_", "width_", ")_", ",_", " _", "`_", "width_", ",_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Image", "Wid", "th", "'_", ")_", "`_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "length_", "==_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Image", "Length", "'_", ",_", "length_", ")_", ",_", "`_", "length_", ",_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Image", "Length", "'_", ")_", "`_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "assert", " ", "samples", "\\u", "per", "\\u", "pixel", " ", "==", " ", "if", "d", ".", "get", "('", "Sampl", "es", "Per", "Pix", "el", "')", ".", "value", ",", " ", "`", "samples", "\\u", "per", "\\u", "pixel", ",", " ", "if", "d", ".", "get", "('", "Sampl", "es", "Per", "Pix", "el", "')", ".", "value", "`_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "plan", "ar", "\\u", "config_", "==_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Plan", "ar", "Configura", "tion", "'_", ",_", "plan", "ar", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "can", "\\u", "return", "\\u", "mem", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "assert_", "strip", "\\u", "length_", "==_", "l_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "-_", "l_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", ",_", " _", "`_", "strip", "\\u", "length_", ",_", "l_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "-_", "l_", "[_", "-_", "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 ", " ", "_", "strip", "\\u", "length_", "=_", "max_", "(_", "strip", "\\u", "length_", ",_", "l_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "-_", "l_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "strip", "\\u", "length", "\\u", "str_", "=_", "'", " ", "<", " ", "'_", "+_", "bytes", "2str_", "(_", "strip", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "(_", "bits", "\\u", "per", "\\u", "sample_", "==_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Bit", "s", "Per", "Sampl", "e", "'_", ",_", "bits", "\\u", "per", "\\u", "sample_", ")_", ")_", "._", "all_", "(_", ")_", ",_", "`_", "bits", "\\u", "per", "\\u", "sample_", ",_", "if", "d_", "._", "get", "\\u", "value_", "(_", "'", "Bit", "s", "Per", "Sampl", "e", "'_", ")_", "`_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "step_", "=_", "l_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "-_", "l_", "[_", "-_", "2_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "step_", ">=_", "0_", ",_", "`_", "step_", ",_", "l_", "[_", "-_", "2_", "]_", ",_", "l_", "[_", "-_", "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 ", " ", "_", "if_", "step_", "!=_", "l_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "-_", "l_", "[_", "-_", "2_", "]_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "can", "\\u", "return", "\\u", "mem", "map_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "assert", " ", "step", " ", "==", " ", "l", "[-", "1", "][", "0", "]", " ", "-", " ", "l", "[-", "2", "][", "1", "],", "`", "step", ",", " ", "l", "[-", "2", "],", " ", "l", "[-", "1", "],", " ", "(", "l", "[-", "1", "][", "0", "]", " ", "-", " ", "l", "[-", "2", "][", "1", "])", ",", " ", "i", "`_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bytes", "\\u", "per", "\\u", "image", "\\u", "str_", "=_", "bytes", "2str_", "(_", "bytes", "\\u", "per", "\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'''", "\\", "10", ";", "widt", "h", " ", ":", " ", "%", "(", "widt", "h", ")", "s", "\\", "10", ";", "length", " ", ":", " ", "%", "(", "length", ")", "s", "\\", "10", ";", "depth", " ", ":", " ", "%", "(", "depth", ")", "s", "\\", "10", ";", "sample", "\\u", "format", " ", ":", " ", "%", "(", "format", ")", "s", "\\", "10", ";", "samples", "\\u", "per", "\\u", "pixel", " ", ":", " ", "%", "(", "samples", "\\u", "per", "\\u", "pixel", ")", "s", "\\", "10", ";", "plan", "ar", "\\u", "config", " ", ":", " ", "%", "(", "plan", "ar", "\\u", "config", ")", "s", "\\", "10", ";", "bits", "\\u", "per", "\\u", "sample", " ", ":", " ", "%", "(", "bits", "\\u", "per", "\\u", "sample", ")", "s", "\\", "10", ";", "bits", "\\u", "per", "\\u", "pixel", " ", ":", " ", "%", "(", "bits", "\\u", "per", "\\u", "pixel", ")", "s", "\\", "10", ";", "\\", "10", ";", "bytes", "\\u", "per", "\\u", "pixel", " ", ":", " ", "%", "(", "bytes", "\\u", "per", "\\u", "pixel", ")", "s", "\\", "10", ";", "bytes", "\\u", "per", "\\u", "row", " ", ":", " ", "%", "(", "bytes", "\\u", "per", "\\u", "row", ")", "s", "\\", "10", ";", "bytes", "\\u", "per", "\\u", "image", " ", ":", " ", "%", "(", "bytes", "\\u", "per", "\\u", "image", "\\u", "str", ")", "s", "\\", "10", ";", "\\", "10", ";", "strip", "s", "\\u", "per", "\\u", "image", " ", ":", " ", "%", "(", "strip", "s", "\\u", "per", "\\u", "image", ")", "s", "\\", "10", ";", "rows", "\\u", "per", "\\u", "strip", " ", ":", " ", "%", "(", "rows", "\\u", "per", "\\u", "strip", ")", "s", "\\", "10", ";", "strip", "\\u", "length", " ", ":", " ", "%", "(", "strip", "\\u", "length", "\\u", "str", ")", "s", "\\", "10", ";'", "''_", "%_", "(_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "photom", "etric", "\\u", "interpretation", "_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "samples", "\\u", "per", "\\u", "pixel_", "==_", "3_", ",_", " _", "`_", "samples", "\\u", "per", "\\u", "pixel_", "`_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sample", "\\u", "names_", "=_", "[_", "'", "red", "'_", ",_", "'", "green", "'_", ",_", "'", "blue", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sample", "\\u", "names_", "=_", "[_", "'", "sample", "%", "s", "'_", "%_", "(_", "j_", ")_", "for_", "j_", "in_", "range_", "(_", "samples", "\\u", "per", "\\u", "pixel_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "depth_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "can", "\\u", "return", "\\u", "mem", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "plan", "ar", "\\u", "config_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "samples", "\\u", "per", "\\u", "pixel_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr_", "=_", "numpy_", "._", "empty_", "(_", "depth_", "*_", "bytes", "\\u", "per", "\\u", "image_", ",_", "dtype_", "=_", "self_", "._", "dtypes_", "._", "uint8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "per", "\\u", "strip_", "=_", "rows", "\\u", "per", "\\u", "strip_", "*_", "bytes", "\\u", "per", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "start_", ",_", "end_", "in_", "full", "\\u", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "sys", ".", "stdout", ".", "write", " ", "(\"", "%", "s", ":", "%", "s", ",\"", " ", "%", " ", "(", "start", ",", " ", "end", "))", ";", " ", "sys", ".", "stdout", ".", "flush", " ", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "compression_", "==_", "1_", ":_", "#", " ", "none_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "self_", "._", "data_", "[_", "start_", ":_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "compression_", "==_", "5_", ":_", "#", " ", "lz", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "self_", "._", "data_", "[_", "start_", ":_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "tif", "\\u", "lz", "w_", "._", "decode_", "(_", "d_", ",_", "bytes", "\\u", "per", "\\u", "strip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arr_", "[_", "i_", ":_", "i_", "+_", "d_", "._", "nbytes_", "]_", "=_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "d_", "._", "nbytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arr_", "=_", "arr_", "._", "view_", "(_", "dtype_", "=_", "dt", "ype", "\\u", "lst_", "[_", "0_", "]_", ")_", "._", "reshape_", "(_", "(_", "depth_", ",_", "length_", ",_", "width_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "arr_", "]_", ",_", "sample", "\\u", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr_", "=_", "numpy_", "._", "empty_", "(_", "depth_", "*_", "bytes", "\\u", "per", "\\u", "image_", ",_", "dtype_", "=_", "self_", "._", "dtypes_", "._", "uint8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "per", "\\u", "strip_", "=_", "rows", "\\u", "per", "\\u", "strip_", "*_", "bytes", "\\u", "per", "\\u", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "start_", ",_", "end_", "in_", "full", "\\u", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "\"%", "s", ":", "%", "s", ",\"_", "%_", "(_", "start_", ",_", "end_", ")_", ")_", ";_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compression_", "==_", "1_", ":_", "#", " ", "none_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "self_", "._", "data_", "[_", "start_", ":_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "compression_", "==_", "5_", ":_", "#", " ", "lz", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "self_", "._", "data_", "[_", "start_", ":_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "tif", "\\u", "lz", "w_", "._", "decode_", "(_", "d_", ",_", "bytes", "\\u", "per", "\\u", "strip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arr_", "[_", "i_", ":_", "i_", "+_", "d_", "._", "nbytes_", "]_", "=_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "d_", "._", "nbytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dt_", "=_", "numpy_", "._", "dtype_", "(_", "dict_", "(_", "names_", "=_", "sample", "\\u", "names_", ",_", "formats_", "=_", "dt", "ype", "\\u", "lst_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr_", "=_", "arr_", "._", "view_", "(_", "dtype_", "=_", "dt_", ")_", "._", "reshape_", "(_", "(_", "depth_", ",_", "length_", ",_", "width_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "arr_", "[_", "n_", "]_", "for_", "n_", "in_", "arr_", "._", "dtype_", "._", "names_", "]_", ",_", "arr_", "._", "dtype_", "._", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "`_", "depth_", ",_", "bytes", "\\u", "per", "\\u", "image_", ",_", "samples", "\\u", "per", "\\u", "pixel_", "`_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "`_", "plan", "ar", "\\u", "config_", "`_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "l_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "l_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start_", ">_", "step_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arr_", "=_", "self_", "._", "data_", "[_", "start_", "-_", "step_", ":_", "end_", "]_", "._", "reshape_", "(_", "(_", "depth_", ",_", "strip", "\\u", "length_", "+_", "step_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "step_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "end_", "<=_", "self_", "._", "data_", "._", "size_", "-_", "step_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arr_", "=_", "self_", "._", "data_", "[_", "start_", ":_", "end_", "+_", "step_", "]_", "._", "reshape_", "(_", "(_", "depth_", ",_", "strip", "\\u", "length_", "+_", "step_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "`_", "start_", ",_", "end_", ",_", "step_", "`_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "plan", "ar", "\\u", "config_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "ls", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "LS", "M", "510", ":", " ", "one", " ", "strip", " ", "per", " ", "image", " ", "plane", " ", "channel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "subf", "ile", "\\u", "type_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sample", "\\u", "names_", "=_", "self_", "._", "ls", "min", "fo_", "._", "get_", "(_", "'", "data", " ", "channel", " ", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "subf", "ile", "\\u", "type_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sample", "\\u", "names_", "=_", "[_", "'", "red", "'_", ",_", "'", "green", "'_", ",_", "'", "blue", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "samples", "\\u", "per", "\\u", "pixel_", "==_", "3_", ",_", "`_", "samples", "\\u", "per", "\\u", "pixel_", "`_", "\\u\\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_", "Not", "Impl", "ement", "ed", "Error_", "(_", "`_", "subf", "ile", "\\u", "type_", "`_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "samples_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "samples", "\\u", "per", "\\u", "pixel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bytes_", "=_", "bits", "\\u", "per", "\\u", "sample_", "[_", "j_", "]_", "//_", "8_", "*_", "width_", "*_", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "arr_", "[_", ":_", ",_", "k_", ":_", "k_", "+_", "bytes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "tmp_", "._", "view_", "(_", "dtype_", "=_", "dt", "ype", "\\u", "lst_", "[_", "j_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "tmp_", "._", "reshape_", "(_", "(_", "depth_", ",_", "length_", ",_", "width_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samples_", "._", "append_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "+=_", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "samples_", ",_", "sample", "\\u", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "`_", "plan", "ar", "\\u", "config_", ",_", "self_", "._", "is", "\\u", "ls", "m_", "`_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "plan", "ar", "\\u", "config_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "samples_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "sum_", "(_", "bits", "\\u", "per", "\\u", "sample_", "[_", ":_", "samples", "\\u", "per", "\\u", "pixel_", "]_", ")_", "//_", "8_", "*_", "width_", "*_", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "per", "\\u", "sample_", "=_", "bits", "\\u", "per", "\\u", "sample_", "//_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "samples", "\\u", "per", "\\u", "pixel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i0_", "=_", "k_", "+_", "j_", "*_", "bytes", "\\u", "per", "\\u", "sample_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "j", ",", " ", "i", "0", ",", " ", "i", "0", "+", "bytes", ",", " ", "samples", "\\u", "per", "\\u", "pixel", ",", " ", "arr", ".", "shape_", "\\u\\u\\uNL\\u\\u\\u_", "tmp_", "=_", "arr_", "[_", ":_", ",_", "i0_", ":_", "i0_", "+_", "bytes_", ":_", "samples", "\\u", "per", "\\u", "pixel_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "numpy_", "._", "array_", "(_", "tmp_", "._", "reshape_", "(_", "(_", "tmp_", "._", "size_", ",_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "tmp_", "._", "view_", "(_", "dtype_", "=_", "dt", "ype", "\\u", "lst_", "[_", "j_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "tmp_", "._", "reshape_", "(_", "(_", "depth_", ",_", "length_", ",_", "width_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samples_", "._", "append_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "k", " ", "+=", " ", "bytes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "samples_", ",_", "sample", "\\u", "names_", "\\u\\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_", "Not", "Impl", "ement", "ed", "Error_", "(_", "`_", "plan", "ar", "\\u", "config_", "`_", ")_", "\\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, 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]
Unused import
simpeg/simpeg/SimPEG/Mesh/__init__.py
[ { "content": "from TensorMesh import TensorMesh\nfrom CylMesh import CylMesh\nfrom CurvilinearMesh import CurvilinearMesh\nfrom TreeMesh import TreeMesh\nfrom BaseMesh import BaseMesh\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from TensorMesh import TensorMesh", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 33 }, { "span": "from CylMesh import CylMesh", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 27 }, { "span": "from CurvilinearMesh import CurvilinearMesh", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 43 }, { "span": "from TreeMesh import TreeMesh", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 29 }, { "span": "from BaseMesh import BaseMesh", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "Tensor", "Mesh_", "import_", "Tensor", "Mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Cy", "l", "Mesh_", "import_", "Cy", "l", "Mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Cur", "vil", "ine", "ar", "Mesh_", "import_", "Cur", "vil", "ine", "ar", "Mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Tree", "Mesh_", "import_", "Tree", "Mesh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Base", "Mesh_", "import_", "Base", "Mesh_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 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, 1, 1, 2, 0, 1, 1, 1, 1, 1 ]
Unused import
goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/sql/compiler.py
[ { "content": "# sql/compiler.py\n# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors\n# <see AUTHORS file>\n#\n# This module is part of SQLAlchemy and is released under\n# the MIT License: http://www.opensource.org/licenses/mit-license.php\n\n\"\"\"Base SQL and DDL compiler implementations.\n\nClasses provided include:\n\n:class:`.compiler.SQLCompiler` - renders SQL\nstrings\n\n:class:`.compiler.DDLCompiler` - renders DDL\n(data definition language) strings\n\n:class:`.compiler.GenericTypeCompiler` - renders\ntype specification strings.\n\nTo generate user-defined SQL strings, see\n:doc:`/ext/compiler`.\n\n\"\"\"\n\nimport re\nfrom . import schema, sqltypes, operators, functions, \\\n util as sql_util, visitors, elements, selectable, base\nfrom .. import util, exc\nimport decimal\nimport itertools\nimport operator\n\nRESERVED_WORDS = set([\n 'all', 'analyse', 'analyze', 'and', 'any', 'array',\n 'as', 'asc', 'asymmetric', 'authorization', 'between',\n 'binary', 'both', 'case', 'cast', 'check', 'collate',\n 'column', 'constraint', 'create', 'cross', 'current_date',\n 'current_role', 'current_time', 'current_timestamp',\n 'current_user', 'default', 'deferrable', 'desc',\n 'distinct', 'do', 'else', 'end', 'except', 'false',\n 'for', 'foreign', 'freeze', 'from', 'full', 'grant',\n 'group', 'having', 'ilike', 'in', 'initially', 'inner',\n 'intersect', 'into', 'is', 'isnull', 'join', 'leading',\n 'left', 'like', 'limit', 'localtime', 'localtimestamp',\n 'natural', 'new', 'not', 'notnull', 'null', 'off', 'offset',\n 'old', 'on', 'only', 'or', 'order', 'outer', 'overlaps',\n 'placing', 'primary', 'references', 'right', 'select',\n 'session_user', 'set', 'similar', 'some', 'symmetric', 'table',\n 'then', 'to', 'trailing', 'true', 'union', 'unique', 'user',\n 'using', 'verbose', 'when', 'where'])\n\nLEGAL_CHARACTERS = re.compile(r'^[A-Z0-9_$]+$', re.I)\nILLEGAL_INITIAL_CHARACTERS = set([str(x) for x in range(0, 10)]).union(['$'])\n\nBIND_PARAMS = re.compile(r'(?<![:\\w\\$\\x5c]):([\\w\\$]+)(?![:\\w\\$])', re.UNICODE)\nBIND_PARAMS_ESC = re.compile(r'\\x5c(:[\\w\\$]+)(?![:\\w\\$])', re.UNICODE)\n\nBIND_TEMPLATES = {\n 'pyformat': \"%%(%(name)s)s\",\n 'qmark': \"?\",\n 'format': \"%%s\",\n 'numeric': \":[_POSITION]\",\n 'named': \":%(name)s\"\n}\n\nREQUIRED = util.symbol('REQUIRED', \"\"\"\nPlaceholder for the value within a :class:`.BindParameter`\nwhich is required to be present when the statement is passed\nto :meth:`.Connection.execute`.\n\nThis symbol is typically used when a :func:`.expression.insert`\nor :func:`.expression.update` statement is compiled without parameter\nvalues present.\n\n\"\"\")\n\n\nOPERATORS = {\n # binary\n operators.and_: ' AND ',\n operators.or_: ' OR ',\n operators.add: ' + ',\n operators.mul: ' * ',\n operators.sub: ' - ',\n operators.div: ' / ',\n operators.mod: ' % ',\n operators.truediv: ' / ',\n operators.neg: '-',\n operators.lt: ' < ',\n operators.le: ' <= ',\n operators.ne: ' != ',\n operators.gt: ' > ',\n operators.ge: ' >= ',\n operators.eq: ' = ',\n operators.concat_op: ' || ',\n operators.match_op: ' MATCH ',\n operators.in_op: ' IN ',\n operators.notin_op: ' NOT IN ',\n operators.comma_op: ', ',\n operators.from_: ' FROM ',\n operators.as_: ' AS ',\n operators.is_: ' IS ',\n operators.isnot: ' IS NOT ',\n operators.collate: ' COLLATE ',\n\n # unary\n operators.exists: 'EXISTS ',\n operators.distinct_op: 'DISTINCT ',\n operators.inv: 'NOT ',\n\n # modifiers\n operators.desc_op: ' DESC',\n operators.asc_op: ' ASC',\n operators.nullsfirst_op: ' NULLS FIRST',\n operators.nullslast_op: ' NULLS LAST',\n\n}\n\nFUNCTIONS = {\n functions.coalesce: 'coalesce%(expr)s',\n functions.current_date: 'CURRENT_DATE',\n functions.current_time: 'CURRENT_TIME',\n functions.current_timestamp: 'CURRENT_TIMESTAMP',\n functions.current_user: 'CURRENT_USER',\n functions.localtime: 'LOCALTIME',\n functions.localtimestamp: 'LOCALTIMESTAMP',\n functions.random: 'random%(expr)s',\n functions.sysdate: 'sysdate',\n functions.session_user: 'SESSION_USER',\n functions.user: 'USER'\n}\n\nEXTRACT_MAP = {\n 'month': 'month',\n 'day': 'day',\n 'year': 'year',\n 'second': 'second',\n 'hour': 'hour',\n 'doy': 'doy',\n 'minute': 'minute',\n 'quarter': 'quarter',\n 'dow': 'dow',\n 'week': 'week',\n 'epoch': 'epoch',\n 'milliseconds': 'milliseconds',\n 'microseconds': 'microseconds',\n 'timezone_hour': 'timezone_hour',\n 'timezone_minute': 'timezone_minute'\n}\n\nCOMPOUND_KEYWORDS = {\n selectable.CompoundSelect.UNION: 'UNION',\n selectable.CompoundSelect.UNION_ALL: 'UNION ALL',\n selectable.CompoundSelect.EXCEPT: 'EXCEPT',\n selectable.CompoundSelect.EXCEPT_ALL: 'EXCEPT ALL',\n selectable.CompoundSelect.INTERSECT: 'INTERSECT',\n selectable.CompoundSelect.INTERSECT_ALL: 'INTERSECT ALL'\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 Compiled(object):\n\n \"\"\"Represent a compiled SQL or DDL expression.\n\n The ``__str__`` method of the ``Compiled`` object should produce\n the actual text of the statement. ``Compiled`` objects are\n specific to their underlying database dialect, and also may\n or may not be specific to the columns referenced within a\n particular set of bind parameters. In no case should the\n ``Compiled`` object be dependent on the actual values of those\n bind parameters, even though it may reference those values as\n defaults.\n \"\"\"\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Compiled", "header": "['module', '___EOS___']", "index": 161 }, { "content": " def __init__(self, dialect, statement, bind=None,\n compile_kwargs=util.immutabledict()):\n \"\"\"Construct a new ``Compiled`` object.\n\n :param dialect: ``Dialect`` to compile against.\n\n :param statement: ``ClauseElement`` to be compiled.\n\n :param bind: Optional Engine or Connection to compile this\n statement against.\n\n :param compile_kwargs: additional kwargs that will be\n passed to the initial call to :meth:`.Compiled.process`.\n\n .. versionadded:: 0.8\n\n \"\"\"\n\n self.dialect = dialect\n self.bind = bind\n if statement is not None:\n self.statement = statement\n self.can_execute = statement.supports_execution\n self.string = self.process(self.statement, **compile_kwargs)", "metadata": "root.Compiled.__init__", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 175 }, { "content": " @util.deprecated(\"0.7\", \":class:`.Compiled` objects now compile \"\n \"within the constructor.\")\n def compile(self):\n \"\"\"Produce the internal string representation of this element.\n \"\"\"\n pass", "metadata": "root.Compiled.compile", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 200 }, { "content": " def _execute_on_connection(self, connection, multiparams, params):\n return connection._execute_compiled(self, multiparams, params)", "metadata": "root.Compiled._execute_on_connection", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 207 }, { "content": " @property\n def sql_compiler(self):\n \"\"\"Return a Compiled that is capable of processing SQL expressions.\n\n If this compiler is one, it would likely just return 'self'.\n\n \"\"\"\n\n raise NotImplementedError()", "metadata": "root.Compiled.sql_compiler", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 210 }, { "content": " def process(self, obj, **kwargs):\n return obj._compiler_dispatch(self, **kwargs)", "metadata": "root.Compiled.process", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 220 }, { "content": " def __str__(self):\n \"\"\"Return the string text of the generated SQL or DDL.\"\"\"\n\n return self.string or ''", "metadata": "root.Compiled.__str__", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 223 }, { "content": " def construct_params(self, params=None):\n \"\"\"Return the bind params for this compiled object.\n\n :param params: a dict of string/object pairs whose values will\n override bind values compiled in to the\n statement.\n \"\"\"\n\n raise NotImplementedError()", "metadata": "root.Compiled.construct_params", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 228 }, { "content": " @property\n def params(self):\n \"\"\"Return the bind params for this compiled object.\"\"\"\n return self.construct_params()", "metadata": "root.Compiled.params", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 238 }, { "content": " def execute(self, *multiparams, **params):\n \"\"\"Execute this compiled object.\"\"\"\n\n e = self.bind\n if e is None:\n raise exc.UnboundExecutionError(\n \"This Compiled object is not bound to any Engine \"\n \"or Connection.\")\n return e._execute_compiled(self, multiparams, params)", "metadata": "root.Compiled.execute", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 243 }, { "content": " def scalar(self, *multiparams, **params):\n \"\"\"Execute this compiled object and return the result's\n scalar value.\"\"\"\n\n return self.execute(*multiparams, **params).scalar()", "metadata": "root.Compiled.scalar", "header": "['class', 'Compiled', '(', 'object', ')', ':', '___EOS___']", "index": 253 }, { "content": "class TypeCompiler(object):\n\n \"\"\"Produces DDL specification for TypeEngine objects.\"\"\"\n\n", "metadata": "root.TypeCompiler", "header": "['module', '___EOS___']", "index": 260 }, { "content": " def __init__(self, dialect):\n self.dialect = dialect", "metadata": "root.TypeCompiler.__init__", "header": "['class', 'TypeCompiler', '(', 'object', ')', ':', '___EOS___']", "index": 264 }, { "content": " def process(self, type_):\n return type_._compiler_dispatch(self)", "metadata": "root.TypeCompiler.process", "header": "['class', 'TypeCompiler', '(', 'object', ')', ':', '___EOS___']", "index": 267 }, { "content": "class _CompileLabel(visitors.Visitable):\n\n \"\"\"lightweight label object which acts as an expression.Label.\"\"\"\n\n __visit_name__ = 'label'\n __slots__ = 'element', 'name'\n\n\n", "metadata": "root._CompileLabel", "header": "['module', '___EOS___']", "index": 271 }, { "content": " def __init__(self, col, name, alt_names=()):\n self.element = col\n self.name = name\n self._alt_names = (col,) + alt_names", "metadata": "root._CompileLabel.__init__", "header": "['class', '_CompileLabel', '(', 'visitors', '.', 'Visitable', ')', ':', '___EOS___']", "index": 278 }, { "content": " @property\n def proxy_set(self):\n return self.element.proxy_set", "metadata": "root._CompileLabel.proxy_set", "header": "['class', '_CompileLabel', '(', 'visitors', '.', 'Visitable', ')', ':', '___EOS___']", "index": 283 }, { "content": " @property\n def type(self):\n return self.element.type", "metadata": "root._CompileLabel.type", "header": "['class', '_CompileLabel', '(', 'visitors', '.', 'Visitable', ')', ':', '___EOS___']", "index": 287 }, { "content": "class SQLCompiler(Compiled):\n\n \"\"\"Default implementation of Compiled.\n\n Compiles ClauseElements into SQL strings. Uses a similar visit\n paradigm as visitors.ClauseVisitor but implements its own traversal.\n\n \"\"\"\n\n extract_map = EXTRACT_MAP\n\n compound_keywords = COMPOUND_KEYWORDS\n\n isdelete = isinsert = isupdate = False\n \"\"\"class-level defaults which can be set at the instance\n level to define if this Compiled instance represents\n INSERT/UPDATE/DELETE\n \"\"\"\n\n returning = None\n \"\"\"holds the \"returning\" collection of columns if\n the statement is CRUD and defines returning columns\n either implicitly or explicitly\n \"\"\"\n\n returning_precedes_values = False\n \"\"\"set to True classwide to generate RETURNING\n clauses before the VALUES or WHERE clause (i.e. MSSQL)\n \"\"\"\n\n render_table_with_column_in_update_from = False\n \"\"\"set to True classwide to indicate the SET clause\n in a multi-table UPDATE statement should qualify\n columns with the table name (i.e. MySQL only)\n \"\"\"\n\n ansi_bind_rules = False\n \"\"\"SQL 92 doesn't allow bind parameters to be used\n in the columns clause of a SELECT, nor does it allow\n ambiguous expressions like \"? = ?\". A compiler\n subclass can set this flag to False if the target\n driver/DB enforces this\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n _default_stack_entry = util.immutabledict([\n ('iswrapper', False),\n ('correlate_froms', frozenset()),\n ('asfrom_froms', frozenset())\n ])\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.SQLCompiler", "header": "['module', '___EOS___']", "index": 292 }, { "content": " def __init__(self, dialect, statement, column_keys=None,\n inline=False, **kwargs):\n \"\"\"Construct a new ``DefaultCompiler`` object.\n\n dialect\n Dialect to be used\n\n statement\n ClauseElement to be compiled\n\n column_keys\n a list of column names to be compiled into an INSERT or UPDATE\n statement.\n\n \"\"\"\n self.column_keys = column_keys\n\n # compile INSERT/UPDATE defaults/sequences inlined (no pre-\n # execute)\n self.inline = inline or getattr(statement, 'inline', False)\n\n # a dictionary of bind parameter keys to BindParameter\n # instances.\n self.binds = {}\n\n # a dictionary of BindParameter instances to \"compiled\" names\n # that are actually present in the generated SQL\n self.bind_names = util.column_dict()\n\n # stack which keeps track of nested SELECT statements\n self.stack = []\n\n # relates label names in the final SQL to a tuple of local\n # column/label name, ColumnElement object (if any) and\n # TypeEngine. ResultProxy uses this for type processing and\n # column targeting\n self.result_map = {}\n\n # true if the paramstyle is positional\n self.positional = dialect.positional\n if self.positional:\n self.positiontup = []\n self.bindtemplate = BIND_TEMPLATES[dialect.paramstyle]\n\n self.ctes = None\n\n # an IdentifierPreparer that formats the quoting of identifiers\n self.preparer = dialect.identifier_preparer\n self.label_length = dialect.label_length \\\n or dialect.max_identifier_length\n\n # a map which tracks \"anonymous\" identifiers that are created on\n # the fly here\n self.anon_map = util.PopulateDict(self._process_anon)\n\n # a map which tracks \"truncated\" names based on\n # dialect.label_length or dialect.max_identifier_length\n self.truncated_names = {}\n Compiled.__init__(self, dialect, statement, **kwargs)\n\n if self.positional and dialect.paramstyle == 'numeric':\n self._apply_numbered_params()", "metadata": "root.SQLCompiler.__init__", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 336 }, { "content": " @util.memoized_instancemethod\n def _init_cte_state(self):\n \"\"\"Initialize collections related to CTEs only if\n a CTE is located, to save on the overhead of\n these collections otherwise.\n\n \"\"\"\n # collect CTEs to tack on top of a SELECT\n self.ctes = util.OrderedDict()\n self.ctes_by_name = {}\n self.ctes_recursive = False\n if self.positional:\n self.cte_positional = {}", "metadata": "root.SQLCompiler._init_cte_state", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 399 }, { "content": " def _apply_numbered_params(self):\n poscount = itertools.count(1)\n self.string = re.sub(\n r'\\[_POSITION\\]',\n lambda m: str(util.next(poscount)),\n self.string)", "metadata": "root.SQLCompiler._apply_numbered_params", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 413 }, { "content": " @util.memoized_property\n def _bind_processors(self):\n return dict(\n (key, value) for key, value in\n ((self.bind_names[bindparam],\n bindparam.type._cached_bind_processor(self.dialect))\n for bindparam in self.bind_names)\n if value is not None\n )", "metadata": "root.SQLCompiler._bind_processors", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 420 }, { "content": " def is_subquery(self):\n return len(self.stack) > 1", "metadata": "root.SQLCompiler.is_subquery", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 430 }, { "content": " @property\n def sql_compiler(self):\n return self", "metadata": "root.SQLCompiler.sql_compiler", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 433 }, { "content": " def construct_params(self, params=None, _group_number=None, _check=True):\n \"\"\"return a dictionary of bind parameter keys and values\"\"\"\n\n if params:\n pd = {}\n for bindparam, name in self.bind_names.items():\n if bindparam.key in params:\n pd[name] = params[bindparam.key]\n elif name in params:\n pd[name] = params[name]\n elif _check and bindparam.required:\n if _group_number:\n raise exc.InvalidRequestError(\n \"A value is required for bind parameter %r, \"\n \"in parameter group %d\" %\n (bindparam.key, _group_number))\n else:\n raise exc.InvalidRequestError(\n \"A value is required for bind parameter %r\"\n % bindparam.key)\n else:\n pd[name] = bindparam.effective_value\n return pd\n else:\n pd = {}\n for bindparam in self.bind_names:\n if _check and bindparam.required:\n if _group_number:\n raise exc.InvalidRequestError(\n \"A value is required for bind parameter %r, \"\n \"in parameter group %d\" %\n (bindparam.key, _group_number))\n else:\n raise exc.InvalidRequestError(\n \"A value is required for bind parameter %r\"\n % bindparam.key)\n pd[self.bind_names[bindparam]] = bindparam.effective_value\n return pd", "metadata": "root.SQLCompiler.construct_params", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 437 }, { "content": " @property\n def params(self):\n \"\"\"Return the bind param dictionary embedded into this\n compiled object, for those values that are present.\"\"\"\n return self.construct_params(_check=False)", "metadata": "root.SQLCompiler.params", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 476 }, { "content": " def default_from(self):\n \"\"\"Called when a SELECT statement has no froms, and no FROM clause is\n to be appended.\n\n Gives Oracle a chance to tack on a ``FROM DUAL`` to the string output.\n\n \"\"\"\n return \"\"", "metadata": "root.SQLCompiler.default_from", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 482 }, { "content": " def visit_grouping(self, grouping, asfrom=False, **kwargs):\n return \"(\" + grouping.element._compiler_dispatch(self, **kwargs) + \")\"", "metadata": "root.SQLCompiler.visit_grouping", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 491 }, { "content": " def visit_label(self, label,\n add_to_result_map=None,\n within_label_clause=False,\n within_columns_clause=False,\n render_label_as_label=None,\n **kw):\n # only render labels within the columns clause\n # or ORDER BY clause of a select. dialect-specific compilers\n # can modify this behavior.\n render_label_with_as = (within_columns_clause and not\n within_label_clause)\n render_label_only = render_label_as_label is label\n\n if render_label_only or render_label_with_as:\n if isinstance(label.name, elements._truncated_label):\n labelname = self._truncated_identifier(\"colident\", label.name)\n else:\n labelname = label.name\n\n if render_label_with_as:\n if add_to_result_map is not None:\n add_to_result_map(\n labelname,\n label.name,\n (label, labelname, ) + label._alt_names,\n label.type\n )\n\n return label.element._compiler_dispatch(\n self, within_columns_clause=True,\n within_label_clause=True, **kw) + \\\n OPERATORS[operators.as_] + \\\n self.preparer.format_label(label, labelname)\n elif render_label_only:\n return self.preparer.format_label(label, labelname)\n else:\n return label.element._compiler_dispatch(\n self, within_columns_clause=False, **kw)", "metadata": "root.SQLCompiler.visit_label", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 494 }, { "content": " def visit_column(self, column, add_to_result_map=None,\n include_table=True, **kwargs):\n name = orig_name = column.name\n if name is None:\n raise exc.CompileError(\"Cannot compile Column object until \"\n \"its 'name' is assigned.\")\n\n is_literal = column.is_literal\n if not is_literal and isinstance(name, elements._truncated_label):\n name = self._truncated_identifier(\"colident\", name)\n\n if add_to_result_map is not None:\n add_to_result_map(\n name,\n orig_name,\n (column, name, column.key),\n column.type\n )\n\n if is_literal:\n name = self.escape_literal_column(name)\n else:\n name = self.preparer.quote(name)\n\n table = column.table\n if table is None or not include_table or not table.named_with_column:\n return name\n else:\n if table.schema:\n schema_prefix = self.preparer.quote_schema(table.schema) + '.'\n else:\n schema_prefix = ''\n tablename = table.name\n if isinstance(tablename, elements._truncated_label):\n tablename = self._truncated_identifier(\"alias\", tablename)\n\n return schema_prefix + \\\n self.preparer.quote(tablename) + \\\n \".\" + name", "metadata": "root.SQLCompiler.visit_column", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 533 }, { "content": " def escape_literal_column(self, text):\n \"\"\"provide escaping for the literal_column() construct.\"\"\"\n\n # TODO: some dialects might need different behavior here\n return text.replace('%', '%%')", "metadata": "root.SQLCompiler.escape_literal_column", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 573 }, { "content": " def visit_fromclause(self, fromclause, **kwargs):\n return fromclause.name", "metadata": "root.SQLCompiler.visit_fromclause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 579 }, { "content": " def visit_index(self, index, **kwargs):\n return index.name", "metadata": "root.SQLCompiler.visit_index", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 582 }, { "content": " def visit_typeclause(self, typeclause, **kwargs):\n return self.dialect.type_compiler.process(typeclause.type)", "metadata": "root.SQLCompiler.visit_typeclause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 585 }, { "content": " def post_process_text(self, text):\n return text", "metadata": "root.SQLCompiler.post_process_text", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 588 }, { "content": " def visit_textclause(self, textclause, **kw):\n def do_bindparam(m):\n name = m.group(1)\n if name in textclause._bindparams:\n return self.process(textclause._bindparams[name], **kw)\n else:\n return self.bindparam_string(name, **kw)\n\n # un-escape any \\:params\n return BIND_PARAMS_ESC.sub(\n lambda m: m.group(1),\n BIND_PARAMS.sub(\n do_bindparam,\n self.post_process_text(textclause.text))\n )", "metadata": "root.SQLCompiler.visit_textclause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 591 }, { "content": " def visit_text_as_from(self, taf, iswrapper=False,\n compound_index=0, force_result_map=False,\n asfrom=False,\n parens=True, **kw):\n\n toplevel = not self.stack\n entry = self._default_stack_entry if toplevel else self.stack[-1]\n\n populate_result_map = force_result_map or (\n compound_index == 0 and (\n toplevel or\n entry['iswrapper']\n )\n )\n\n if populate_result_map:\n for c in taf.column_args:\n self.process(c, within_columns_clause=True,\n add_to_result_map=self._add_to_result_map)\n\n text = self.process(taf.element, **kw)\n if asfrom and parens:\n text = \"(%s)\" % text\n return text", "metadata": "root.SQLCompiler.visit_text_as_from", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 607 }, { "content": " def visit_null(self, expr, **kw):\n return 'NULL'", "metadata": "root.SQLCompiler.visit_null", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 632 }, { "content": " def visit_true(self, expr, **kw):\n if self.dialect.supports_native_boolean:\n return 'true'\n else:\n return \"1\"", "metadata": "root.SQLCompiler.visit_true", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 635 }, { "content": " def visit_false(self, expr, **kw):\n if self.dialect.supports_native_boolean:\n return 'false'\n else:\n return \"0\"", "metadata": "root.SQLCompiler.visit_false", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 641 }, { "content": " def visit_clauselist(self, clauselist, order_by_select=None, **kw):\n if order_by_select is not None:\n return self._order_by_clauselist(\n clauselist, order_by_select, **kw)\n\n sep = clauselist.operator\n if sep is None:\n sep = \" \"\n else:\n sep = OPERATORS[clauselist.operator]\n return sep.join(\n s for s in\n (\n c._compiler_dispatch(self, **kw)\n for c in clauselist.clauses)\n if s)", "metadata": "root.SQLCompiler.visit_clauselist", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 647 }, { "content": " def _order_by_clauselist(self, clauselist, order_by_select, **kw):\n # look through raw columns collection for labels.\n # note that its OK we aren't expanding tables and other selectables\n # here; we can only add a label in the ORDER BY for an individual\n # label expression in the columns clause.\n\n raw_col = set(l._order_by_label_element.name\n for l in order_by_select._raw_columns\n if l._order_by_label_element is not None)\n\n return \", \".join(\n s for s in\n (\n c._compiler_dispatch(\n self,\n render_label_as_label=c._order_by_label_element if\n c._order_by_label_element is not None and\n c._order_by_label_element.name in raw_col\n else None,\n **kw)\n for c in clauselist.clauses)\n if s)", "metadata": "root.SQLCompiler._order_by_clauselist", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 664 }, { "content": " def visit_case(self, clause, **kwargs):\n x = \"CASE \"\n if clause.value is not None:\n x += clause.value._compiler_dispatch(self, **kwargs) + \" \"\n for cond, result in clause.whens:\n x += \"WHEN \" + cond._compiler_dispatch(\n self, **kwargs\n ) + \" THEN \" + result._compiler_dispatch(\n self, **kwargs) + \" \"\n if clause.else_ is not None:\n x += \"ELSE \" + clause.else_._compiler_dispatch(\n self, **kwargs\n ) + \" \"\n x += \"END\"\n return x", "metadata": "root.SQLCompiler.visit_case", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 687 }, { "content": " def visit_cast(self, cast, **kwargs):\n return \"CAST(%s AS %s)\" % \\\n (cast.clause._compiler_dispatch(self, **kwargs),\n cast.typeclause._compiler_dispatch(self, **kwargs))", "metadata": "root.SQLCompiler.visit_cast", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 703 }, { "content": " def visit_over(self, over, **kwargs):\n return \"%s OVER (%s)\" % (\n over.func._compiler_dispatch(self, **kwargs),\n ' '.join(\n '%s BY %s' % (word, clause._compiler_dispatch(self, **kwargs))\n for word, clause in (\n ('PARTITION', over.partition_by),\n ('ORDER', over.order_by)\n )\n if clause is not None and len(clause)\n )\n )", "metadata": "root.SQLCompiler.visit_over", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 708 }, { "content": " def visit_extract(self, extract, **kwargs):\n field = self.extract_map.get(extract.field, extract.field)\n return \"EXTRACT(%s FROM %s)\" % (\n field, extract.expr._compiler_dispatch(self, **kwargs))", "metadata": "root.SQLCompiler.visit_extract", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 721 }, { "content": " def visit_function(self, func, add_to_result_map=None, **kwargs):\n if add_to_result_map is not None:\n add_to_result_map(\n func.name, func.name, (), func.type\n )\n\n disp = getattr(self, \"visit_%s_func\" % func.name.lower(), None)\n if disp:\n return disp(func, **kwargs)\n else:\n name = FUNCTIONS.get(func.__class__, func.name + \"%(expr)s\")\n return \".\".join(list(func.packagenames) + [name]) % \\\n {'expr': self.function_argspec(func, **kwargs)}", "metadata": "root.SQLCompiler.visit_function", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 726 }, { "content": " def visit_next_value_func(self, next_value, **kw):\n return self.visit_sequence(next_value.sequence)", "metadata": "root.SQLCompiler.visit_next_value_func", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 740 }, { "content": " def visit_sequence(self, sequence):\n raise NotImplementedError(\n \"Dialect '%s' does not support sequence increments.\" %\n self.dialect.name\n )", "metadata": "root.SQLCompiler.visit_sequence", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 743 }, { "content": " def function_argspec(self, func, **kwargs):\n return func.clause_expr._compiler_dispatch(self, **kwargs)", "metadata": "root.SQLCompiler.function_argspec", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 749 }, { "content": " def visit_compound_select(self, cs, asfrom=False,\n parens=True, compound_index=0, **kwargs):\n toplevel = not self.stack\n entry = self._default_stack_entry if toplevel else self.stack[-1]\n\n self.stack.append(\n {\n 'correlate_froms': entry['correlate_froms'],\n 'iswrapper': toplevel,\n 'asfrom_froms': entry['asfrom_froms']\n })\n\n keyword = self.compound_keywords.get(cs.keyword)\n\n text = (\" \" + keyword + \" \").join(\n (c._compiler_dispatch(self,\n asfrom=asfrom, parens=False,\n compound_index=i, **kwargs)\n for i, c in enumerate(cs.selects))\n )\n\n group_by = cs._group_by_clause._compiler_dispatch(\n self, asfrom=asfrom, **kwargs)\n if group_by:\n text += \" GROUP BY \" + group_by\n\n text += self.order_by_clause(cs, **kwargs)\n text += (cs._limit is not None or cs._offset is not None) and \\\n self.limit_clause(cs) or \"\"\n\n if self.ctes and \\\n compound_index == 0 and toplevel:\n text = self._render_cte_clause() + text\n\n self.stack.pop(-1)\n if asfrom and parens:\n return \"(\" + text + \")\"\n else:\n return text", "metadata": "root.SQLCompiler.visit_compound_select", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 752 }, { "content": " def visit_unary(self, unary, **kw):\n if unary.operator:\n if unary.modifier:\n raise exc.CompileError(\n \"Unary expression does not support operator \"\n \"and modifier simultaneously\")\n disp = getattr(self, \"visit_%s_unary_operator\" %\n unary.operator.__name__, None)\n if disp:\n return disp(unary, unary.operator, **kw)\n else:\n return self._generate_generic_unary_operator(\n unary, OPERATORS[unary.operator], **kw)\n elif unary.modifier:\n disp = getattr(self, \"visit_%s_unary_modifier\" %\n unary.modifier.__name__, None)\n if disp:\n return disp(unary, unary.modifier, **kw)\n else:\n return self._generate_generic_unary_modifier(\n unary, OPERATORS[unary.modifier], **kw)\n else:\n raise exc.CompileError(\n \"Unary expression has no operator or modifier\")", "metadata": "root.SQLCompiler.visit_unary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 792 }, { "content": " def visit_istrue_unary_operator(self, element, operator, **kw):\n if self.dialect.supports_native_boolean:\n return self.process(element.element, **kw)\n else:\n return \"%s = 1\" % self.process(element.element, **kw)", "metadata": "root.SQLCompiler.visit_istrue_unary_operator", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 817 }, { "content": " def visit_isfalse_unary_operator(self, element, operator, **kw):\n if self.dialect.supports_native_boolean:\n return \"NOT %s\" % self.process(element.element, **kw)\n else:\n return \"%s = 0\" % self.process(element.element, **kw)", "metadata": "root.SQLCompiler.visit_isfalse_unary_operator", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 823 }, { "content": " def visit_binary(self, binary, **kw):\n # don't allow \"? = ?\" to render\n if self.ansi_bind_rules and \\\n isinstance(binary.left, elements.BindParameter) and \\\n isinstance(binary.right, elements.BindParameter):\n kw['literal_binds'] = True\n\n operator = binary.operator\n disp = getattr(self, \"visit_%s_binary\" % operator.__name__, None)\n if disp:\n return disp(binary, operator, **kw)\n else:\n try:\n opstring = OPERATORS[operator]\n except KeyError:\n raise exc.UnsupportedCompilationError(self, operator)\n else:\n return self._generate_generic_binary(binary, opstring, **kw)", "metadata": "root.SQLCompiler.visit_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 829 }, { "content": " def visit_custom_op_binary(self, element, operator, **kw):\n return self._generate_generic_binary(\n element, \" \" + operator.opstring + \" \", **kw)", "metadata": "root.SQLCompiler.visit_custom_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 848 }, { "content": " def visit_custom_op_unary_operator(self, element, operator, **kw):\n return self._generate_generic_unary_operator(\n element, operator.opstring + \" \", **kw)", "metadata": "root.SQLCompiler.visit_custom_op_unary_operator", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 852 }, { "content": " def visit_custom_op_unary_modifier(self, element, operator, **kw):\n return self._generate_generic_unary_modifier(\n element, \" \" + operator.opstring, **kw)", "metadata": "root.SQLCompiler.visit_custom_op_unary_modifier", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 856 }, { "content": " def _generate_generic_binary(self, binary, opstring, **kw):\n return binary.left._compiler_dispatch(self, **kw) + \\\n opstring + \\\n binary.right._compiler_dispatch(self, **kw)", "metadata": "root.SQLCompiler._generate_generic_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 860 }, { "content": " def _generate_generic_unary_operator(self, unary, opstring, **kw):\n return opstring + unary.element._compiler_dispatch(self, **kw)", "metadata": "root.SQLCompiler._generate_generic_unary_operator", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 865 }, { "content": " def _generate_generic_unary_modifier(self, unary, opstring, **kw):\n return unary.element._compiler_dispatch(self, **kw) + opstring", "metadata": "root.SQLCompiler._generate_generic_unary_modifier", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 868 }, { "content": " @util.memoized_property\n def _like_percent_literal(self):\n return elements.literal_column(\"'%'\", type_=sqltypes.STRINGTYPE)", "metadata": "root.SQLCompiler._like_percent_literal", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 871 }, { "content": " def visit_contains_op_binary(self, binary, operator, **kw):\n binary = binary._clone()\n percent = self._like_percent_literal\n binary.right = percent.__add__(binary.right).__add__(percent)\n return self.visit_like_op_binary(binary, operator, **kw)", "metadata": "root.SQLCompiler.visit_contains_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 875 }, { "content": " def visit_notcontains_op_binary(self, binary, operator, **kw):\n binary = binary._clone()\n percent = self._like_percent_literal\n binary.right = percent.__add__(binary.right).__add__(percent)\n return self.visit_notlike_op_binary(binary, operator, **kw)", "metadata": "root.SQLCompiler.visit_notcontains_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 881 }, { "content": " def visit_startswith_op_binary(self, binary, operator, **kw):\n binary = binary._clone()\n percent = self._like_percent_literal\n binary.right = percent.__radd__(\n binary.right\n )\n return self.visit_like_op_binary(binary, operator, **kw)", "metadata": "root.SQLCompiler.visit_startswith_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 887 }, { "content": " def visit_notstartswith_op_binary(self, binary, operator, **kw):\n binary = binary._clone()\n percent = self._like_percent_literal\n binary.right = percent.__radd__(\n binary.right\n )\n return self.visit_notlike_op_binary(binary, operator, **kw)", "metadata": "root.SQLCompiler.visit_notstartswith_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 895 }, { "content": " def visit_endswith_op_binary(self, binary, operator, **kw):\n binary = binary._clone()\n percent = self._like_percent_literal\n binary.right = percent.__add__(binary.right)\n return self.visit_like_op_binary(binary, operator, **kw)", "metadata": "root.SQLCompiler.visit_endswith_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 903 }, { "content": " def visit_notendswith_op_binary(self, binary, operator, **kw):\n binary = binary._clone()\n percent = self._like_percent_literal\n binary.right = percent.__add__(binary.right)\n return self.visit_notlike_op_binary(binary, operator, **kw)", "metadata": "root.SQLCompiler.visit_notendswith_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 909 }, { "content": " def visit_like_op_binary(self, binary, operator, **kw):\n escape = binary.modifiers.get(\"escape\", None)\n\n # TODO: use ternary here, not \"and\"/ \"or\"\n return '%s LIKE %s' % (\n binary.left._compiler_dispatch(self, **kw),\n binary.right._compiler_dispatch(self, **kw)) \\\n + (\n ' ESCAPE ' +\n self.render_literal_value(escape, sqltypes.STRINGTYPE)\n if escape else ''\n )", "metadata": "root.SQLCompiler.visit_like_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 915 }, { "content": " def visit_notlike_op_binary(self, binary, operator, **kw):\n escape = binary.modifiers.get(\"escape\", None)\n return '%s NOT LIKE %s' % (\n binary.left._compiler_dispatch(self, **kw),\n binary.right._compiler_dispatch(self, **kw)) \\\n + (\n ' ESCAPE ' +\n self.render_literal_value(escape, sqltypes.STRINGTYPE)\n if escape else ''\n )", "metadata": "root.SQLCompiler.visit_notlike_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 928 }, { "content": " def visit_ilike_op_binary(self, binary, operator, **kw):\n escape = binary.modifiers.get(\"escape\", None)\n return 'lower(%s) LIKE lower(%s)' % (\n binary.left._compiler_dispatch(self, **kw),\n binary.right._compiler_dispatch(self, **kw)) \\\n + (\n ' ESCAPE ' +\n self.render_literal_value(escape, sqltypes.STRINGTYPE)\n if escape else ''\n )", "metadata": "root.SQLCompiler.visit_ilike_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 939 }, { "content": " def visit_notilike_op_binary(self, binary, operator, **kw):\n escape = binary.modifiers.get(\"escape\", None)\n return 'lower(%s) NOT LIKE lower(%s)' % (\n binary.left._compiler_dispatch(self, **kw),\n binary.right._compiler_dispatch(self, **kw)) \\\n + (\n ' ESCAPE ' +\n self.render_literal_value(escape, sqltypes.STRINGTYPE)\n if escape else ''\n )", "metadata": "root.SQLCompiler.visit_notilike_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 950 }, { "content": " def visit_between_op_binary(self, binary, operator, **kw):\n symmetric = binary.modifiers.get(\"symmetric\", False)\n return self._generate_generic_binary(\n binary, \" BETWEEN SYMMETRIC \"\n if symmetric else \" BETWEEN \", **kw)", "metadata": "root.SQLCompiler.visit_between_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 961 }, { "content": " def visit_notbetween_op_binary(self, binary, operator, **kw):\n symmetric = binary.modifiers.get(\"symmetric\", False)\n return self._generate_generic_binary(\n binary, \" NOT BETWEEN SYMMETRIC \"\n if symmetric else \" NOT BETWEEN \", **kw)", "metadata": "root.SQLCompiler.visit_notbetween_op_binary", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 967 }, { "content": " def visit_bindparam(self, bindparam, within_columns_clause=False,\n literal_binds=False,\n skip_bind_expression=False,\n **kwargs):\n if not skip_bind_expression and bindparam.type._has_bind_expression:\n bind_expression = bindparam.type.bind_expression(bindparam)\n return self.process(bind_expression,\n skip_bind_expression=True)\n\n if literal_binds or \\\n (within_columns_clause and\n self.ansi_bind_rules):\n if bindparam.value is None and bindparam.callable is None:\n raise exc.CompileError(\"Bind parameter '%s' without a \"\n \"renderable value not allowed here.\"\n % bindparam.key)\n return self.render_literal_bindparam(\n bindparam, within_columns_clause=True, **kwargs)\n\n name = self._truncate_bindparam(bindparam)\n\n if name in self.binds:\n existing = self.binds[name]\n if existing is not bindparam:\n if (existing.unique or bindparam.unique) and \\\n not existing.proxy_set.intersection(\n bindparam.proxy_set):\n raise exc.CompileError(\n \"Bind parameter '%s' conflicts with \"\n \"unique bind parameter of the same name\" %\n bindparam.key\n )\n elif existing._is_crud or bindparam._is_crud:\n raise exc.CompileError(\n \"bindparam() name '%s' is reserved \"\n \"for automatic usage in the VALUES or SET \"\n \"clause of this \"\n \"insert/update statement. Please use a \"\n \"name other than column name when using bindparam() \"\n \"with insert() or update() (for example, 'b_%s').\" %\n (bindparam.key, bindparam.key)\n )\n\n self.binds[bindparam.key] = self.binds[name] = bindparam\n\n return self.bindparam_string(name, **kwargs)", "metadata": "root.SQLCompiler.visit_bindparam", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 973 }, { "content": " def render_literal_bindparam(self, bindparam, **kw):\n value = bindparam.effective_value\n return self.render_literal_value(value, bindparam.type)", "metadata": "root.SQLCompiler.render_literal_bindparam", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1020 }, { "content": " def render_literal_value(self, value, type_):\n \"\"\"Render the value of a bind parameter as a quoted literal.\n\n This is used for statement sections that do not accept bind parameters\n on the target driver/database.\n\n This should be implemented by subclasses using the quoting services\n of the DBAPI.\n\n \"\"\"\n\n processor = type_._cached_literal_processor(self.dialect)\n if processor:\n return processor(value)\n else:\n raise NotImplementedError(\n \"Don't know how to literal-quote value %r\" % value)", "metadata": "root.SQLCompiler.render_literal_value", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1024 }, { "content": " def _truncate_bindparam(self, bindparam):\n if bindparam in self.bind_names:\n return self.bind_names[bindparam]\n\n bind_name = bindparam.key\n if isinstance(bind_name, elements._truncated_label):\n bind_name = self._truncated_identifier(\"bindparam\", bind_name)\n\n # add to bind_names for translation\n self.bind_names[bindparam] = bind_name\n\n return bind_name", "metadata": "root.SQLCompiler._truncate_bindparam", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1042 }, { "content": " def _truncated_identifier(self, ident_class, name):\n if (ident_class, name) in self.truncated_names:\n return self.truncated_names[(ident_class, name)]\n\n anonname = name.apply_map(self.anon_map)\n\n if len(anonname) > self.label_length:\n counter = self.truncated_names.get(ident_class, 1)\n truncname = anonname[0:max(self.label_length - 6, 0)] + \\\n \"_\" + hex(counter)[2:]\n self.truncated_names[ident_class] = counter + 1\n else:\n truncname = anonname\n self.truncated_names[(ident_class, name)] = truncname\n return truncname", "metadata": "root.SQLCompiler._truncated_identifier", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1055 }, { "content": " def _anonymize(self, name):\n return name % self.anon_map", "metadata": "root.SQLCompiler._anonymize", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1071 }, { "content": " def _process_anon(self, key):\n (ident, derived) = key.split(' ', 1)\n anonymous_counter = self.anon_map.get(derived, 1)\n self.anon_map[derived] = anonymous_counter + 1\n return derived + \"_\" + str(anonymous_counter)", "metadata": "root.SQLCompiler._process_anon", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1074 }, { "content": " def bindparam_string(self, name, positional_names=None, **kw):\n if self.positional:\n if positional_names is not None:\n positional_names.append(name)\n else:\n self.positiontup.append(name)\n return self.bindtemplate % {'name': name}", "metadata": "root.SQLCompiler.bindparam_string", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1080 }, { "content": " def visit_cte(self, cte, asfrom=False, ashint=False,\n fromhints=None,\n **kwargs):\n self._init_cte_state()\n\n if isinstance(cte.name, elements._truncated_label):\n cte_name = self._truncated_identifier(\"alias\", cte.name)\n else:\n cte_name = cte.name\n\n if cte_name in self.ctes_by_name:\n existing_cte = self.ctes_by_name[cte_name]\n # we've generated a same-named CTE that we are enclosed in,\n # or this is the same CTE. just return the name.\n if cte in existing_cte._restates or cte is existing_cte:\n return self.preparer.format_alias(cte, cte_name)\n elif existing_cte in cte._restates:\n # we've generated a same-named CTE that is\n # enclosed in us - we take precedence, so\n # discard the text for the \"inner\".\n del self.ctes[existing_cte]\n else:\n raise exc.CompileError(\n \"Multiple, unrelated CTEs found with \"\n \"the same name: %r\" %\n cte_name)\n\n self.ctes_by_name[cte_name] = cte\n\n if cte._cte_alias is not None:\n orig_cte = cte._cte_alias\n if orig_cte not in self.ctes:\n self.visit_cte(orig_cte, **kwargs)\n cte_alias_name = cte._cte_alias.name\n if isinstance(cte_alias_name, elements._truncated_label):\n cte_alias_name = self._truncated_identifier(\n \"alias\", cte_alias_name)\n else:\n orig_cte = cte\n cte_alias_name = None\n if not cte_alias_name and cte not in self.ctes:\n if cte.recursive:\n self.ctes_recursive = True\n text = self.preparer.format_alias(cte, cte_name)\n if cte.recursive:\n if isinstance(cte.original, selectable.Select):\n col_source = cte.original\n elif isinstance(cte.original, selectable.CompoundSelect):\n col_source = cte.original.selects[0]\n else:\n assert False\n recur_cols = [c for c in\n util.unique_list(col_source.inner_columns)\n if c is not None]\n\n text += \"(%s)\" % (\", \".join(\n self.preparer.format_column(ident)\n for ident in recur_cols))\n\n if self.positional:\n kwargs['positional_names'] = self.cte_positional[cte] = []\n\n text += \" AS \\n\" + \\\n cte.original._compiler_dispatch(\n self, asfrom=True, **kwargs\n )\n\n self.ctes[cte] = text\n\n if asfrom:\n if cte_alias_name:\n text = self.preparer.format_alias(cte, cte_alias_name)\n text += \" AS \" + cte_name\n else:\n return self.preparer.format_alias(cte, cte_name)\n return text", "metadata": "root.SQLCompiler.visit_cte", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1088 }, { "content": " def visit_alias(self, alias, asfrom=False, ashint=False,\n iscrud=False,\n fromhints=None, **kwargs):\n if asfrom or ashint:\n if isinstance(alias.name, elements._truncated_label):\n alias_name = self._truncated_identifier(\"alias\", alias.name)\n else:\n alias_name = alias.name\n\n if ashint:\n return self.preparer.format_alias(alias, alias_name)\n elif asfrom:\n ret = alias.original._compiler_dispatch(self,\n asfrom=True, **kwargs) + \\\n \" AS \" + \\\n self.preparer.format_alias(alias, alias_name)\n\n if fromhints and alias in fromhints:\n ret = self.format_from_hint_text(ret, alias,\n fromhints[alias], iscrud)\n\n return ret\n else:\n return alias.original._compiler_dispatch(self, **kwargs)", "metadata": "root.SQLCompiler.visit_alias", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1165 }, { "content": " def _add_to_result_map(self, keyname, name, objects, type_):\n if not self.dialect.case_sensitive:\n keyname = keyname.lower()\n\n if keyname in self.result_map:\n # conflicting keyname, just double up the list\n # of objects. this will cause an \"ambiguous name\"\n # error if an attempt is made by the result set to\n # access.\n e_name, e_obj, e_type = self.result_map[keyname]\n self.result_map[keyname] = e_name, e_obj + objects, e_type\n else:\n self.result_map[keyname] = name, objects, type_", "metadata": "root.SQLCompiler._add_to_result_map", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1190 }, { "content": " def _label_select_column(self, select, column,\n populate_result_map,\n asfrom, column_clause_args,\n name=None,\n within_columns_clause=True):\n \"\"\"produce labeled columns present in a select().\"\"\"\n\n if column.type._has_column_expression and \\\n populate_result_map:\n col_expr = column.type.column_expression(column)\n add_to_result_map = lambda keyname, name, objects, type_: \\\n self._add_to_result_map(\n keyname, name,\n objects + (column,), type_)\n else:\n col_expr = column\n if populate_result_map:\n add_to_result_map = self._add_to_result_map\n else:\n add_to_result_map = None\n\n if not within_columns_clause:\n result_expr = col_expr\n elif isinstance(column, elements.Label):\n if col_expr is not column:\n result_expr = _CompileLabel(\n col_expr,\n column.name,\n alt_names=(column.element,)\n )\n else:\n result_expr = col_expr\n\n elif select is not None and name:\n result_expr = _CompileLabel(\n col_expr,\n name,\n alt_names=(column._key_label,)\n )\n\n elif \\\n asfrom and \\\n isinstance(column, elements.ColumnClause) and \\\n not column.is_literal and \\\n column.table is not None and \\\n not isinstance(column.table, selectable.Select):\n result_expr = _CompileLabel(col_expr,\n elements._as_truncated(column.name),\n alt_names=(column.key,))\n elif not isinstance(column,\n (elements.UnaryExpression, elements.TextClause)) \\\n and (not hasattr(column, 'name') or\n isinstance(column, functions.Function)):\n result_expr = _CompileLabel(col_expr, column.anon_label)\n elif col_expr is not column:\n # TODO: are we sure \"column\" has a .name and .key here ?\n # assert isinstance(column, elements.ColumnClause)\n result_expr = _CompileLabel(col_expr,\n elements._as_truncated(column.name),\n alt_names=(column.key,))\n else:\n result_expr = col_expr\n\n column_clause_args.update(\n within_columns_clause=within_columns_clause,\n add_to_result_map=add_to_result_map\n )\n return result_expr._compiler_dispatch(\n self,\n **column_clause_args\n )", "metadata": "root.SQLCompiler._label_select_column", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1204 }, { "content": " def format_from_hint_text(self, sqltext, table, hint, iscrud):\n hinttext = self.get_from_hint_text(table, hint)\n if hinttext:\n sqltext += \" \" + hinttext\n return sqltext", "metadata": "root.SQLCompiler.format_from_hint_text", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1276 }, { "content": " def get_select_hint_text(self, byfroms):\n return None", "metadata": "root.SQLCompiler.get_select_hint_text", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1282 }, { "content": " def get_from_hint_text(self, table, text):\n return None", "metadata": "root.SQLCompiler.get_from_hint_text", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1285 }, { "content": " def get_crud_hint_text(self, table, text):\n return None", "metadata": "root.SQLCompiler.get_crud_hint_text", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1288 }, { "content": " def _transform_select_for_nested_joins(self, select):\n \"\"\"Rewrite any \"a JOIN (b JOIN c)\" expression as\n \"a JOIN (select * from b JOIN c) AS anon\", to support\n databases that can't parse a parenthesized join correctly\n (i.e. sqlite the main one).\n\n \"\"\"\n cloned = {}\n column_translate = [{}]\n\n def visit(element, **kw):\n if element in column_translate[-1]:\n return column_translate[-1][element]\n\n elif element in cloned:\n return cloned[element]\n\n newelem = cloned[element] = element._clone()\n\n if newelem.is_selectable and newelem._is_join and \\\n isinstance(newelem.right, selectable.FromGrouping):\n\n newelem._reset_exported()\n newelem.left = visit(newelem.left, **kw)\n\n right = visit(newelem.right, **kw)\n\n selectable_ = selectable.Select(\n [right.element],\n use_labels=True).alias()\n\n for c in selectable_.c:\n c._key_label = c.key\n c._label = c.name\n\n translate_dict = dict(\n zip(newelem.right.element.c, selectable_.c)\n )\n\n # translating from both the old and the new\n # because different select() structures will lead us\n # to traverse differently\n translate_dict[right.element.left] = selectable_\n translate_dict[right.element.right] = selectable_\n translate_dict[newelem.right.element.left] = selectable_\n translate_dict[newelem.right.element.right] = selectable_\n\n # propagate translations that we've gained\n # from nested visit(newelem.right) outwards\n # to the enclosing select here. this happens\n # only when we have more than one level of right\n # join nesting, i.e. \"a JOIN (b JOIN (c JOIN d))\"\n for k, v in list(column_translate[-1].items()):\n if v in translate_dict:\n # remarkably, no current ORM tests (May 2013)\n # hit this condition, only test_join_rewriting\n # does.\n column_translate[-1][k] = translate_dict[v]\n\n column_translate[-1].update(translate_dict)\n\n newelem.right = selectable_\n\n newelem.onclause = visit(newelem.onclause, **kw)\n\n elif newelem._is_from_container:\n # if we hit an Alias, CompoundSelect or ScalarSelect, put a\n # marker in the stack.\n kw['transform_clue'] = 'select_container'\n newelem._copy_internals(clone=visit, **kw)\n elif newelem.is_selectable and newelem._is_select:\n barrier_select = kw.get('transform_clue', None) == \\\n 'select_container'\n # if we're still descended from an\n # Alias/CompoundSelect/ScalarSelect, we're\n # in a FROM clause, so start with a new translate collection\n if barrier_select:\n column_translate.append({})\n kw['transform_clue'] = 'inside_select'\n newelem._copy_internals(clone=visit, **kw)\n if barrier_select:\n del column_translate[-1]\n else:\n newelem._copy_internals(clone=visit, **kw)\n\n return newelem\n\n return visit(select)", "metadata": "root.SQLCompiler._transform_select_for_nested_joins", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1291 }, { "content": " def _transform_result_map_for_nested_joins(\n self, select, transformed_select):\n inner_col = dict((c._key_label, c) for\n c in transformed_select.inner_columns)\n\n d = dict(\n (inner_col[c._key_label], c)\n for c in select.inner_columns\n )\n for key, (name, objs, typ) in list(self.result_map.items()):\n objs = tuple([d.get(col, col) for col in objs])\n self.result_map[key] = (name, objs, typ)", "metadata": "root.SQLCompiler._transform_result_map_for_nested_joins", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1380 }, { "content": " def _display_froms_for_select(self, select, asfrom):\n # utility method to help external dialects\n # get the correct from list for a select.\n # specifically the oracle dialect needs this feature\n # right now.\n toplevel = not self.stack\n entry = self._default_stack_entry if toplevel else self.stack[-1]\n\n correlate_froms = entry['correlate_froms']\n asfrom_froms = entry['asfrom_froms']\n\n if asfrom:\n froms = select._get_display_froms(\n explicit_correlate_froms=correlate_froms.difference(\n asfrom_froms),\n implicit_correlate_froms=())\n else:\n froms = select._get_display_froms(\n explicit_correlate_froms=correlate_froms,\n implicit_correlate_froms=asfrom_froms)\n return froms", "metadata": "root.SQLCompiler._display_froms_for_select", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1399 }, { "content": " def visit_select(self, select, asfrom=False, parens=True,\n iswrapper=False, fromhints=None,\n compound_index=0,\n force_result_map=False,\n nested_join_translation=False,\n **kwargs):\n\n needs_nested_translation = \\\n select.use_labels and \\\n not nested_join_translation and \\\n not self.stack and \\\n not self.dialect.supports_right_nested_joins\n\n if needs_nested_translation:\n transformed_select = self._transform_select_for_nested_joins(\n select)\n text = self.visit_select(\n transformed_select, asfrom=asfrom, parens=parens,\n iswrapper=iswrapper, fromhints=fromhints,\n compound_index=compound_index,\n force_result_map=force_result_map,\n nested_join_translation=True, **kwargs\n )\n\n toplevel = not self.stack\n entry = self._default_stack_entry if toplevel else self.stack[-1]\n\n populate_result_map = force_result_map or (\n compound_index == 0 and (\n toplevel or\n entry['iswrapper']\n )\n )\n\n if needs_nested_translation:\n if populate_result_map:\n self._transform_result_map_for_nested_joins(\n select, transformed_select)\n return text\n\n correlate_froms = entry['correlate_froms']\n asfrom_froms = entry['asfrom_froms']\n\n if asfrom:\n froms = select._get_display_froms(\n explicit_correlate_froms=correlate_froms.difference(\n asfrom_froms),\n implicit_correlate_froms=())\n else:\n froms = select._get_display_froms(\n explicit_correlate_froms=correlate_froms,\n implicit_correlate_froms=asfrom_froms)\n\n new_correlate_froms = set(selectable._from_objects(*froms))\n all_correlate_froms = new_correlate_froms.union(correlate_froms)\n\n new_entry = {\n 'asfrom_froms': new_correlate_froms,\n 'iswrapper': iswrapper,\n 'correlate_froms': all_correlate_froms\n }\n self.stack.append(new_entry)\n\n column_clause_args = kwargs.copy()\n column_clause_args.update({\n 'within_label_clause': False,\n 'within_columns_clause': False\n })\n\n text = \"SELECT \" # we're off to a good start !\n\n if select._hints:\n byfrom = dict([\n (from_, hinttext % {\n 'name': from_._compiler_dispatch(\n self, ashint=True)\n })\n for (from_, dialect), hinttext in\n select._hints.items()\n if dialect in ('*', self.dialect.name)\n ])\n hint_text = self.get_select_hint_text(byfrom)\n if hint_text:\n text += hint_text + \" \"\n\n if select._prefixes:\n text += self._generate_prefixes(\n select, select._prefixes, **kwargs)\n\n text += self.get_select_precolumns(select)\n\n # the actual list of columns to print in the SELECT column list.\n inner_columns = [\n c for c in [\n self._label_select_column(select,\n column,\n populate_result_map, asfrom,\n column_clause_args,\n name=name)\n for name, column in select._columns_plus_names\n ]\n if c is not None\n ]\n\n text += ', '.join(inner_columns)\n\n if froms:\n text += \" \\nFROM \"\n\n if select._hints:\n text += ', '.join(\n [f._compiler_dispatch(self, asfrom=True,\n fromhints=byfrom, **kwargs)\n for f in froms])\n else:\n text += ', '.join(\n [f._compiler_dispatch(self, asfrom=True, **kwargs)\n for f in froms])\n else:\n text += self.default_from()\n\n if select._whereclause is not None:\n t = select._whereclause._compiler_dispatch(self, **kwargs)\n if t:\n text += \" \\nWHERE \" + t\n\n if select._group_by_clause.clauses:\n group_by = select._group_by_clause._compiler_dispatch(\n self, **kwargs)\n if group_by:\n text += \" GROUP BY \" + group_by\n\n if select._having is not None:\n t = select._having._compiler_dispatch(self, **kwargs)\n if t:\n text += \" \\nHAVING \" + t\n\n if select._order_by_clause.clauses:\n if self.dialect.supports_simple_order_by_label:\n order_by_select = select\n else:\n order_by_select = None\n\n text += self.order_by_clause(\n select, order_by_select=order_by_select, **kwargs)\n\n if select._limit is not None or select._offset is not None:\n text += self.limit_clause(select)\n\n if select._for_update_arg is not None:\n text += self.for_update_clause(select)\n\n if self.ctes and \\\n compound_index == 0 and toplevel:\n text = self._render_cte_clause() + text\n\n self.stack.pop(-1)\n\n if asfrom and parens:\n return \"(\" + text + \")\"\n else:\n return text", "metadata": "root.SQLCompiler.visit_select", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1421 }, { "content": " def _generate_prefixes(self, stmt, prefixes, **kw):\n clause = \" \".join(\n prefix._compiler_dispatch(self, **kw)\n for prefix, dialect_name in prefixes\n if dialect_name is None or\n dialect_name == self.dialect.name\n )\n if clause:\n clause += \" \"\n return clause", "metadata": "root.SQLCompiler._generate_prefixes", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1584 }, { "content": " def _render_cte_clause(self):\n if self.positional:\n self.positiontup = sum([\n self.cte_positional[cte]\n for cte in self.ctes], []) + \\\n self.positiontup\n cte_text = self.get_cte_preamble(self.ctes_recursive) + \" \"\n cte_text += \", \\n\".join(\n [txt for txt in self.ctes.values()]\n )\n cte_text += \"\\n \"\n return cte_text", "metadata": "root.SQLCompiler._render_cte_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1595 }, { "content": " def get_cte_preamble(self, recursive):\n if recursive:\n return \"WITH RECURSIVE\"\n else:\n return \"WITH\"", "metadata": "root.SQLCompiler.get_cte_preamble", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1608 }, { "content": " def get_select_precolumns(self, select):\n \"\"\"Called when building a ``SELECT`` statement, position is just\n before column list.\n\n \"\"\"\n return select._distinct and \"DISTINCT \" or \"\"", "metadata": "root.SQLCompiler.get_select_precolumns", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1614 }, { "content": " def order_by_clause(self, select, **kw):\n order_by = select._order_by_clause._compiler_dispatch(self, **kw)\n if order_by:\n return \" ORDER BY \" + order_by\n else:\n return \"\"", "metadata": "root.SQLCompiler.order_by_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1621 }, { "content": " def for_update_clause(self, select):\n return \" FOR UPDATE\"", "metadata": "root.SQLCompiler.for_update_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1628 }, { "content": " def returning_clause(self, stmt, returning_cols):\n raise exc.CompileError(\n \"RETURNING is not supported by this \"\n \"dialect's statement compiler.\")", "metadata": "root.SQLCompiler.returning_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1631 }, { "content": " def limit_clause(self, select):\n text = \"\"\n if select._limit is not None:\n text += \"\\n LIMIT \" + self.process(elements.literal(select._limit))\n if select._offset is not None:\n if select._limit is None:\n text += \"\\n LIMIT -1\"\n text += \" OFFSET \" + self.process(elements.literal(select._offset))\n return text", "metadata": "root.SQLCompiler.limit_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1636 }, { "content": " def visit_table(self, table, asfrom=False, iscrud=False, ashint=False,\n fromhints=None, **kwargs):\n if asfrom or ashint:\n if getattr(table, \"schema\", None):\n ret = self.preparer.quote_schema(table.schema) + \\\n \".\" + self.preparer.quote(table.name)\n else:\n ret = self.preparer.quote(table.name)\n if fromhints and table in fromhints:\n ret = self.format_from_hint_text(ret, table,\n fromhints[table], iscrud)\n return ret\n else:\n return \"\"", "metadata": "root.SQLCompiler.visit_table", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1646 }, { "content": " def visit_join(self, join, asfrom=False, **kwargs):\n return (\n join.left._compiler_dispatch(self, asfrom=True, **kwargs) +\n (join.isouter and \" LEFT OUTER JOIN \" or \" JOIN \") +\n join.right._compiler_dispatch(self, asfrom=True, **kwargs) +\n \" ON \" +\n join.onclause._compiler_dispatch(self, **kwargs)\n )", "metadata": "root.SQLCompiler.visit_join", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1661 }, { "content": " def visit_insert(self, insert_stmt, **kw):\n self.isinsert = True\n colparams = self._get_colparams(insert_stmt, **kw)\n\n if not colparams and \\\n not self.dialect.supports_default_values and \\\n not self.dialect.supports_empty_insert:\n raise exc.CompileError(\"The '%s' dialect with current database \"\n \"version settings does not support empty \"\n \"inserts.\" %\n self.dialect.name)\n\n if insert_stmt._has_multi_parameters:\n if not self.dialect.supports_multivalues_insert:\n raise exc.CompileError(\n \"The '%s' dialect with current database \"\n \"version settings does not support \"\n \"in-place multirow inserts.\" %\n self.dialect.name)\n colparams_single = colparams[0]\n else:\n colparams_single = colparams\n\n preparer = self.preparer\n supports_default_values = self.dialect.supports_default_values\n\n text = \"INSERT \"\n\n if insert_stmt._prefixes:\n text += self._generate_prefixes(insert_stmt,\n insert_stmt._prefixes, **kw)\n\n text += \"INTO \"\n table_text = preparer.format_table(insert_stmt.table)\n\n if insert_stmt._hints:\n dialect_hints = dict([\n (table, hint_text)\n for (table, dialect), hint_text in\n insert_stmt._hints.items()\n if dialect in ('*', self.dialect.name)\n ])\n if insert_stmt.table in dialect_hints:\n table_text = self.format_from_hint_text(\n table_text,\n insert_stmt.table,\n dialect_hints[insert_stmt.table],\n True\n )\n\n text += table_text\n\n if colparams_single or not supports_default_values:\n text += \" (%s)\" % ', '.join([preparer.format_column(c[0])\n for c in colparams_single])\n\n if self.returning or insert_stmt._returning:\n self.returning = self.returning or insert_stmt._returning\n returning_clause = self.returning_clause(\n insert_stmt, self.returning)\n\n if self.returning_precedes_values:\n text += \" \" + returning_clause\n\n if insert_stmt.select is not None:\n text += \" %s\" % self.process(insert_stmt.select, **kw)\n elif not colparams and supports_default_values:\n text += \" DEFAULT VALUES\"\n elif insert_stmt._has_multi_parameters:\n text += \" VALUES %s\" % (\n \", \".join(\n \"(%s)\" % (\n ', '.join(c[1] for c in colparam_set)\n )\n for colparam_set in colparams\n )\n )\n else:\n text += \" VALUES (%s)\" % \\\n ', '.join([c[1] for c in colparams])\n\n if self.returning and not self.returning_precedes_values:\n text += \" \" + returning_clause\n\n return text", "metadata": "root.SQLCompiler.visit_insert", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1670 }, { "content": " def update_limit_clause(self, update_stmt):\n \"\"\"Provide a hook for MySQL to add LIMIT to the UPDATE\"\"\"\n return None", "metadata": "root.SQLCompiler.update_limit_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1756 }, { "content": " def update_tables_clause(self, update_stmt, from_table,\n extra_froms, **kw):\n \"\"\"Provide a hook to override the initial table clause\n in an UPDATE statement.\n\n MySQL overrides this.\n\n \"\"\"\n return from_table._compiler_dispatch(self, asfrom=True,\n iscrud=True, **kw)", "metadata": "root.SQLCompiler.update_tables_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1760 }, { "content": " def update_from_clause(self, update_stmt,\n from_table, extra_froms,\n from_hints,\n **kw):\n \"\"\"Provide a hook to override the generation of an\n UPDATE..FROM clause.\n\n MySQL and MSSQL override this.\n\n \"\"\"\n return \"FROM \" + ', '.join(\n t._compiler_dispatch(self, asfrom=True,\n fromhints=from_hints, **kw)\n for t in extra_froms)", "metadata": "root.SQLCompiler.update_from_clause", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1771 }, { "content": " def visit_update(self, update_stmt, **kw):\n self.stack.append(\n {'correlate_froms': set([update_stmt.table]),\n \"iswrapper\": False,\n \"asfrom_froms\": set([update_stmt.table])})\n\n self.isupdate = True\n\n extra_froms = update_stmt._extra_froms\n\n text = \"UPDATE \"\n\n if update_stmt._prefixes:\n text += self._generate_prefixes(update_stmt,\n update_stmt._prefixes, **kw)\n\n table_text = self.update_tables_clause(update_stmt, update_stmt.table,\n extra_froms, **kw)\n\n colparams = self._get_colparams(update_stmt, **kw)\n\n if update_stmt._hints:\n dialect_hints = dict([\n (table, hint_text)\n for (table, dialect), hint_text in\n update_stmt._hints.items()\n if dialect in ('*', self.dialect.name)\n ])\n if update_stmt.table in dialect_hints:\n table_text = self.format_from_hint_text(\n table_text,\n update_stmt.table,\n dialect_hints[update_stmt.table],\n True\n )\n else:\n dialect_hints = None\n\n text += table_text\n\n text += ' SET '\n include_table = extra_froms and \\\n self.render_table_with_column_in_update_from\n text += ', '.join(\n c[0]._compiler_dispatch(self,\n include_table=include_table) +\n '=' + c[1] for c in colparams\n )\n\n if self.returning or update_stmt._returning:\n if not self.returning:\n self.returning = update_stmt._returning\n if self.returning_precedes_values:\n text += \" \" + self.returning_clause(\n update_stmt, self.returning)\n\n if extra_froms:\n extra_from_text = self.update_from_clause(\n update_stmt,\n update_stmt.table,\n extra_froms,\n dialect_hints, **kw)\n if extra_from_text:\n text += \" \" + extra_from_text\n\n if update_stmt._whereclause is not None:\n t = self.process(update_stmt._whereclause)\n if t:\n text += \" WHERE \" + t\n\n limit_clause = self.update_limit_clause(update_stmt)\n if limit_clause:\n text += \" \" + limit_clause\n\n if self.returning and not self.returning_precedes_values:\n text += \" \" + self.returning_clause(\n update_stmt, self.returning)\n\n self.stack.pop(-1)\n\n return text", "metadata": "root.SQLCompiler.visit_update", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1786 }, { "content": " def _create_crud_bind_param(self, col, value, required=False, name=None):\n if name is None:\n name = col.key\n bindparam = elements.BindParameter(name, value,\n type_=col.type, required=required)\n bindparam._is_crud = True\n return bindparam._compiler_dispatch(self)", "metadata": "root.SQLCompiler._create_crud_bind_param", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1868 }, { "content": " @util.memoized_property\n def _key_getters_for_crud_column(self):\n if self.isupdate and self.statement._extra_froms:\n # when extra tables are present, refer to the columns\n # in those extra tables as table-qualified, including in\n # dictionaries and when rendering bind param names.\n # the \"main\" table of the statement remains unqualified,\n # allowing the most compatibility with a non-multi-table\n # statement.\n _et = set(self.statement._extra_froms)\n\n def _column_as_key(key):\n str_key = elements._column_as_key(key)\n if hasattr(key, 'table') and key.table in _et:\n return (key.table.name, str_key)\n else:\n return str_key\n\n def _getattr_col_key(col):\n if col.table in _et:\n return (col.table.name, col.key)\n else:\n return col.key\n\n def _col_bind_name(col):\n if col.table in _et:\n return \"%s_%s\" % (col.table.name, col.key)\n else:\n return col.key\n\n else:\n _column_as_key = elements._column_as_key\n _getattr_col_key = _col_bind_name = operator.attrgetter(\"key\")\n\n return _column_as_key, _getattr_col_key, _col_bind_name", "metadata": "root.SQLCompiler._key_getters_for_crud_column", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1876 }, { "content": " def _get_colparams(self, stmt, **kw):\n \"\"\"create a set of tuples representing column/string pairs for use\n in an INSERT or UPDATE statement.\n\n Also generates the Compiled object's postfetch, prefetch, and\n returning column collections, used for default handling and ultimately\n populating the ResultProxy's prefetch_cols() and postfetch_cols()\n collections.\n\n \"\"\"\n\n self.postfetch = []\n self.prefetch = []\n self.returning = []\n\n # no parameters in the statement, no parameters in the\n # compiled params - return binds for all columns\n if self.column_keys is None and stmt.parameters is None:\n return [\n (c, self._create_crud_bind_param(c,\n None, required=True))\n for c in stmt.table.columns\n ]\n\n if stmt._has_multi_parameters:\n stmt_parameters = stmt.parameters[0]\n else:\n stmt_parameters = stmt.parameters\n\n # getters - these are normally just column.key,\n # but in the case of mysql multi-table update, the rules for\n # .key must conditionally take tablename into account\n _column_as_key, _getattr_col_key, _col_bind_name = \\\n self._key_getters_for_crud_column\n\n # if we have statement parameters - set defaults in the\n # compiled params\n if self.column_keys is None:\n parameters = {}\n else:\n parameters = dict((_column_as_key(key), REQUIRED)\n for key in self.column_keys\n if not stmt_parameters or\n key not in stmt_parameters)\n\n # create a list of column assignment clauses as tuples\n values = []\n\n if stmt_parameters is not None:\n for k, v in stmt_parameters.items():\n colkey = _column_as_key(k)\n if colkey is not None:\n parameters.setdefault(colkey, v)\n else:\n # a non-Column expression on the left side;\n # add it to values() in an \"as-is\" state,\n # coercing right side to bound param\n if elements._is_literal(v):\n v = self.process(\n elements.BindParameter(None, v, type_=k.type),\n **kw)\n else:\n v = self.process(v.self_group(), **kw)\n\n values.append((k, v))\n\n need_pks = self.isinsert and \\\n not self.inline and \\\n not stmt._returning\n\n implicit_returning = need_pks and \\\n self.dialect.implicit_returning and \\\n stmt.table.implicit_returning\n\n if self.isinsert:\n implicit_return_defaults = (implicit_returning and\n stmt._return_defaults)\n elif self.isupdate:\n implicit_return_defaults = (self.dialect.implicit_returning and\n stmt.table.implicit_returning and\n stmt._return_defaults)\n else:\n implicit_return_defaults = False\n\n if implicit_return_defaults:\n if stmt._return_defaults is True:\n implicit_return_defaults = set(stmt.table.c)\n else:\n implicit_return_defaults = set(stmt._return_defaults)\n\n postfetch_lastrowid = need_pks and self.dialect.postfetch_lastrowid\n\n check_columns = {}\n\n # special logic that only occurs for multi-table UPDATE\n # statements\n if self.isupdate and stmt._extra_froms and stmt_parameters:\n normalized_params = dict(\n (elements._clause_element_as_expr(c), param)\n for c, param in stmt_parameters.items()\n )\n affected_tables = set()\n for t in stmt._extra_froms:\n for c in t.c:\n if c in normalized_params:\n affected_tables.add(t)\n check_columns[_getattr_col_key(c)] = c\n value = normalized_params[c]\n if elements._is_literal(value):\n value = self._create_crud_bind_param(\n c, value, required=value is REQUIRED,\n name=_col_bind_name(c))\n else:\n self.postfetch.append(c)\n value = self.process(value.self_group(), **kw)\n values.append((c, value))\n # determine tables which are actually\n # to be updated - process onupdate and\n # server_onupdate for these\n for t in affected_tables:\n for c in t.c:\n if c in normalized_params:\n continue\n elif (c.onupdate is not None and not\n c.onupdate.is_sequence):\n if c.onupdate.is_clause_element:\n values.append(\n (c, self.process(\n c.onupdate.arg.self_group(),\n **kw)\n )\n )\n self.postfetch.append(c)\n else:\n values.append(\n (c, self._create_crud_bind_param(\n c, None, name=_col_bind_name(c)\n )\n )\n )\n self.prefetch.append(c)\n elif c.server_onupdate is not None:\n self.postfetch.append(c)\n\n if self.isinsert and stmt.select_names:\n # for an insert from select, we can only use names that\n # are given, so only select for those names.\n cols = (stmt.table.c[_column_as_key(name)]\n for name in stmt.select_names)\n else:\n # iterate through all table columns to maintain\n # ordering, even for those cols that aren't included\n cols = stmt.table.columns\n\n for c in cols:\n col_key = _getattr_col_key(c)\n if col_key in parameters and col_key not in check_columns:\n value = parameters.pop(col_key)\n if elements._is_literal(value):\n value = self._create_crud_bind_param(\n c, value, required=value is REQUIRED,\n name=_col_bind_name(c)\n if not stmt._has_multi_parameters\n else \"%s_0\" % _col_bind_name(c)\n )\n else:\n if isinstance(value, elements.BindParameter) and \\\n value.type._isnull:\n value = value._clone()\n value.type = c.type\n\n if c.primary_key and implicit_returning:\n self.returning.append(c)\n value = self.process(value.self_group(), **kw)\n elif implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n value = self.process(value.self_group(), **kw)\n else:\n self.postfetch.append(c)\n value = self.process(value.self_group(), **kw)\n values.append((c, value))\n\n elif self.isinsert:\n if c.primary_key and \\\n need_pks and \\\n (\n implicit_returning or\n not postfetch_lastrowid or\n c is not stmt.table._autoincrement_column\n ):\n\n if implicit_returning:\n if c.default is not None:\n if c.default.is_sequence:\n if self.dialect.supports_sequences and \\\n (not c.default.optional or\n not self.dialect.sequences_optional):\n proc = self.process(c.default, **kw)\n values.append((c, proc))\n self.returning.append(c)\n elif c.default.is_clause_element:\n values.append(\n (c, self.process(\n c.default.arg.self_group(), **kw))\n )\n self.returning.append(c)\n else:\n values.append(\n (c, self._create_crud_bind_param(c, None))\n )\n self.prefetch.append(c)\n else:\n self.returning.append(c)\n else:\n if (\n (c.default is not None and\n (not c.default.is_sequence or\n self.dialect.supports_sequences)) or\n c is stmt.table._autoincrement_column and\n (self.dialect.supports_sequences or\n self.dialect.\n preexecute_autoincrement_sequences)\n ):\n\n values.append(\n (c, self._create_crud_bind_param(c, None))\n )\n\n self.prefetch.append(c)\n\n elif c.default is not None:\n if c.default.is_sequence:\n if self.dialect.supports_sequences and \\\n (not c.default.optional or\n not self.dialect.sequences_optional):\n proc = self.process(c.default, **kw)\n values.append((c, proc))\n if implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n elif not c.primary_key:\n self.postfetch.append(c)\n elif c.default.is_clause_element:\n values.append(\n (c, self.process(\n c.default.arg.self_group(), **kw))\n )\n\n if implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n elif not c.primary_key:\n # don't add primary key column to postfetch\n self.postfetch.append(c)\n else:\n values.append(\n (c, self._create_crud_bind_param(c, None))\n )\n self.prefetch.append(c)\n elif c.server_default is not None:\n if implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n elif not c.primary_key:\n self.postfetch.append(c)\n elif implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n\n elif self.isupdate:\n if c.onupdate is not None and not c.onupdate.is_sequence:\n if c.onupdate.is_clause_element:\n values.append(\n (c, self.process(\n c.onupdate.arg.self_group(), **kw))\n )\n if implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n else:\n self.postfetch.append(c)\n else:\n values.append(\n (c, self._create_crud_bind_param(c, None))\n )\n self.prefetch.append(c)\n elif c.server_onupdate is not None:\n if implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n else:\n self.postfetch.append(c)\n elif implicit_return_defaults and \\\n c in implicit_return_defaults:\n self.returning.append(c)\n\n if parameters and stmt_parameters:\n check = set(parameters).intersection(\n _column_as_key(k) for k in stmt.parameters\n ).difference(check_columns)\n if check:\n raise exc.CompileError(\n \"Unconsumed column names: %s\" %\n (\", \".join(\"%s\" % c for c in check))\n )\n\n if stmt._has_multi_parameters:\n values_0 = values\n values = [values]\n\n values.extend(\n [\n (\n c,\n (self._create_crud_bind_param(\n c, row[c.key],\n name=\"%s_%d\" % (c.key, i + 1)\n ) if elements._is_literal(row[c.key])\n else self.process(\n row[c.key].self_group(), **kw))\n if c.key in row else param\n )\n for (c, param) in values_0\n ]\n for i, row in enumerate(stmt.parameters[1:])\n )\n\n return values", "metadata": "root.SQLCompiler._get_colparams", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 1912 }, { "content": " def visit_delete(self, delete_stmt, **kw):\n self.stack.append({'correlate_froms': set([delete_stmt.table]),\n \"iswrapper\": False,\n \"asfrom_froms\": set([delete_stmt.table])})\n self.isdelete = True\n\n text = \"DELETE \"\n\n if delete_stmt._prefixes:\n text += self._generate_prefixes(delete_stmt,\n delete_stmt._prefixes, **kw)\n\n text += \"FROM \"\n table_text = delete_stmt.table._compiler_dispatch(\n self, asfrom=True, iscrud=True)\n\n if delete_stmt._hints:\n dialect_hints = dict([\n (table, hint_text)\n for (table, dialect), hint_text in\n delete_stmt._hints.items()\n if dialect in ('*', self.dialect.name)\n ])\n if delete_stmt.table in dialect_hints:\n table_text = self.format_from_hint_text(\n table_text,\n delete_stmt.table,\n dialect_hints[delete_stmt.table],\n True\n )\n\n else:\n dialect_hints = None\n\n text += table_text\n\n if delete_stmt._returning:\n self.returning = delete_stmt._returning\n if self.returning_precedes_values:\n text += \" \" + self.returning_clause(\n delete_stmt, delete_stmt._returning)\n\n if delete_stmt._whereclause is not None:\n t = delete_stmt._whereclause._compiler_dispatch(self)\n if t:\n text += \" WHERE \" + t\n\n if self.returning and not self.returning_precedes_values:\n text += \" \" + self.returning_clause(\n delete_stmt, delete_stmt._returning)\n\n self.stack.pop(-1)\n\n return text", "metadata": "root.SQLCompiler.visit_delete", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2242 }, { "content": " def visit_savepoint(self, savepoint_stmt):\n return \"SAVEPOINT %s\" % self.preparer.format_savepoint(savepoint_stmt)", "metadata": "root.SQLCompiler.visit_savepoint", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2297 }, { "content": " def visit_rollback_to_savepoint(self, savepoint_stmt):\n return \"ROLLBACK TO SAVEPOINT %s\" % \\\n self.preparer.format_savepoint(savepoint_stmt)", "metadata": "root.SQLCompiler.visit_rollback_to_savepoint", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2300 }, { "content": " def visit_release_savepoint(self, savepoint_stmt):\n return \"RELEASE SAVEPOINT %s\" % \\\n self.preparer.format_savepoint(savepoint_stmt)", "metadata": "root.SQLCompiler.visit_release_savepoint", "header": "['class', 'SQLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2304 }, { "content": "class DDLCompiler(Compiled):\n\n\n\n\n\n\n\n\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.DDLCompiler", "header": "['module', '___EOS___']", "index": 2309 }, { "content": " @util.memoized_property\n def sql_compiler(self):\n return self.dialect.statement_compiler(self.dialect, None)", "metadata": "root.DDLCompiler.sql_compiler", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2311 }, { "content": " @util.memoized_property\n def type_compiler(self):\n return self.dialect.type_compiler", "metadata": "root.DDLCompiler.type_compiler", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2315 }, { "content": " @property\n def preparer(self):\n return self.dialect.identifier_preparer", "metadata": "root.DDLCompiler.preparer", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2319 }, { "content": " def construct_params(self, params=None):\n return None", "metadata": "root.DDLCompiler.construct_params", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2323 }, { "content": " def visit_ddl(self, ddl, **kwargs):\n # table events can substitute table and schema name\n context = ddl.context\n if isinstance(ddl.target, schema.Table):\n context = context.copy()\n\n preparer = self.dialect.identifier_preparer\n path = preparer.format_table_seq(ddl.target)\n if len(path) == 1:\n table, sch = path[0], ''\n else:\n table, sch = path[-1], path[0]\n\n context.setdefault('table', table)\n context.setdefault('schema', sch)\n context.setdefault('fullname', preparer.format_table(ddl.target))\n\n return self.sql_compiler.post_process_text(ddl.statement % context)", "metadata": "root.DDLCompiler.visit_ddl", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2326 }, { "content": " def visit_create_schema(self, create):\n schema = self.preparer.format_schema(create.element)\n return \"CREATE SCHEMA \" + schema", "metadata": "root.DDLCompiler.visit_create_schema", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2345 }, { "content": " def visit_drop_schema(self, drop):\n schema = self.preparer.format_schema(drop.element)\n text = \"DROP SCHEMA \" + schema\n if drop.cascade:\n text += \" CASCADE\"\n return text", "metadata": "root.DDLCompiler.visit_drop_schema", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2349 }, { "content": " def visit_create_table(self, create):\n table = create.element\n preparer = self.dialect.identifier_preparer\n\n text = \"\\n\" + \" \".join(['CREATE'] +\n table._prefixes +\n ['TABLE',\n preparer.format_table(table),\n \"(\"])\n separator = \"\\n\"\n\n # if only one primary key, specify it along with the column\n first_pk = False\n for create_column in create.columns:\n column = create_column.element\n try:\n processed = self.process(create_column,\n first_pk=column.primary_key\n and not first_pk)\n if processed is not None:\n text += separator\n separator = \", \\n\"\n text += \"\\t\" + processed\n if column.primary_key:\n first_pk = True\n except exc.CompileError as ce:\n util.raise_from_cause(\n exc.CompileError(\n util.u(\"(in table '%s', column '%s'): %s\") %\n (table.description, column.name, ce.args[0])\n ))\n\n const = self.create_table_constraints(table)\n if const:\n text += \", \\n\\t\" + const\n\n text += \"\\n)%s\\n\\n\" % self.post_create_table(table)\n return text", "metadata": "root.DDLCompiler.visit_create_table", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2356 }, { "content": " def visit_create_column(self, create, first_pk=False):\n column = create.element\n\n if column.system:\n return None\n\n text = self.get_column_specification(\n column,\n first_pk=first_pk\n )\n const = \" \".join(self.process(constraint)\n for constraint in column.constraints)\n if const:\n text += \" \" + const\n\n return text", "metadata": "root.DDLCompiler.visit_create_column", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2395 }, { "content": " def create_table_constraints(self, table):\n\n # On some DB order is significant: visit PK first, then the\n # other constraints (engine.ReflectionTest.testbasic failed on FB2)\n constraints = []\n if table.primary_key:\n constraints.append(table.primary_key)\n\n constraints.extend([c for c in table._sorted_constraints\n if c is not table.primary_key])\n\n return \", \\n\\t\".join(p for p in\n (self.process(constraint)\n for constraint in constraints\n if (\n constraint._create_rule is None or\n constraint._create_rule(self))\n and (\n not self.dialect.supports_alter or\n not getattr(constraint, 'use_alter', False)\n )) if p is not None\n )", "metadata": "root.DDLCompiler.create_table_constraints", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2412 }, { "content": " def visit_drop_table(self, drop):\n return \"\\nDROP TABLE \" + self.preparer.format_table(drop.element)", "metadata": "root.DDLCompiler.visit_drop_table", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2435 }, { "content": " def visit_drop_view(self, drop):\n return \"\\nDROP VIEW \" + self.preparer.format_table(drop.element)", "metadata": "root.DDLCompiler.visit_drop_view", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2438 }, { "content": " def _verify_index_table(self, index):\n if index.table is None:\n raise exc.CompileError(\"Index '%s' is not associated \"\n \"with any table.\" % index.name)", "metadata": "root.DDLCompiler._verify_index_table", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2441 }, { "content": " def visit_create_index(self, create, include_schema=False,\n include_table_schema=True):\n index = create.element\n self._verify_index_table(index)\n preparer = self.preparer\n text = \"CREATE \"\n if index.unique:\n text += \"UNIQUE \"\n text += \"INDEX %s ON %s (%s)\" \\\n % (\n self._prepared_index_name(index,\n include_schema=include_schema),\n preparer.format_table(index.table,\n use_schema=include_table_schema),\n ', '.join(\n self.sql_compiler.process(\n expr, include_table=False, literal_binds=True) for\n expr in index.expressions)\n )\n return text", "metadata": "root.DDLCompiler.visit_create_index", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2446 }, { "content": " def visit_drop_index(self, drop):\n index = drop.element\n return \"\\nDROP INDEX \" + self._prepared_index_name(\n index, include_schema=True)", "metadata": "root.DDLCompiler.visit_drop_index", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2467 }, { "content": " def _prepared_index_name(self, index, include_schema=False):\n if include_schema and index.table is not None and index.table.schema:\n schema = index.table.schema\n schema_name = self.preparer.quote_schema(schema)\n else:\n schema_name = None\n\n ident = index.name\n if isinstance(ident, elements._truncated_label):\n max_ = self.dialect.max_index_name_length or \\\n self.dialect.max_identifier_length\n if len(ident) > max_:\n ident = ident[0:max_ - 8] + \\\n \"_\" + util.md5_hex(ident)[-4:]\n else:\n self.dialect.validate_identifier(ident)\n\n index_name = self.preparer.quote(ident)\n\n if schema_name:\n index_name = schema_name + \".\" + index_name\n return index_name", "metadata": "root.DDLCompiler._prepared_index_name", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2472 }, { "content": " def visit_add_constraint(self, create):\n return \"ALTER TABLE %s ADD %s\" % (\n self.preparer.format_table(create.element.table),\n self.process(create.element)\n )", "metadata": "root.DDLCompiler.visit_add_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2495 }, { "content": " def visit_create_sequence(self, create):\n text = \"CREATE SEQUENCE %s\" % \\\n self.preparer.format_sequence(create.element)\n if create.element.increment is not None:\n text += \" INCREMENT BY %d\" % create.element.increment\n if create.element.start is not None:\n text += \" START WITH %d\" % create.element.start\n return text", "metadata": "root.DDLCompiler.visit_create_sequence", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2501 }, { "content": " def visit_drop_sequence(self, drop):\n return \"DROP SEQUENCE %s\" % \\\n self.preparer.format_sequence(drop.element)", "metadata": "root.DDLCompiler.visit_drop_sequence", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2510 }, { "content": " def visit_drop_constraint(self, drop):\n return \"ALTER TABLE %s DROP CONSTRAINT %s%s\" % (\n self.preparer.format_table(drop.element.table),\n self.preparer.format_constraint(drop.element),\n drop.cascade and \" CASCADE\" or \"\"\n )", "metadata": "root.DDLCompiler.visit_drop_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2514 }, { "content": " def get_column_specification(self, column, **kwargs):\n colspec = self.preparer.format_column(column) + \" \" + \\\n self.dialect.type_compiler.process(column.type)\n default = self.get_column_default_string(column)\n if default is not None:\n colspec += \" DEFAULT \" + default\n\n if not column.nullable:\n colspec += \" NOT NULL\"\n return colspec", "metadata": "root.DDLCompiler.get_column_specification", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2521 }, { "content": " def post_create_table(self, table):\n return ''", "metadata": "root.DDLCompiler.post_create_table", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2532 }, { "content": " def get_column_default_string(self, column):\n if isinstance(column.server_default, schema.DefaultClause):\n if isinstance(column.server_default.arg, util.string_types):\n return \"'%s'\" % column.server_default.arg\n else:\n return self.sql_compiler.process(column.server_default.arg)\n else:\n return None", "metadata": "root.DDLCompiler.get_column_default_string", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2535 }, { "content": " def visit_check_constraint(self, constraint):\n text = \"\"\n if constraint.name is not None:\n formatted_name = self.preparer.format_constraint(constraint)\n if formatted_name is not None:\n text += \"CONSTRAINT %s \" % formatted_name\n text += \"CHECK (%s)\" % self.sql_compiler.process(constraint.sqltext,\n include_table=False,\n literal_binds=True)\n text += self.define_constraint_deferrability(constraint)\n return text", "metadata": "root.DDLCompiler.visit_check_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2544 }, { "content": " def visit_column_check_constraint(self, constraint):\n text = \"\"\n if constraint.name is not None:\n formatted_name = self.preparer.format_constraint(constraint)\n if formatted_name is not None:\n text += \"CONSTRAINT %s \" % formatted_name\n text += \"CHECK (%s)\" % constraint.sqltext\n text += self.define_constraint_deferrability(constraint)\n return text", "metadata": "root.DDLCompiler.visit_column_check_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2556 }, { "content": " def visit_primary_key_constraint(self, constraint):\n if len(constraint) == 0:\n return ''\n text = \"\"\n if constraint.name is not None:\n formatted_name = self.preparer.format_constraint(constraint)\n if formatted_name is not None:\n text += \"CONSTRAINT %s \" % formatted_name\n text += \"PRIMARY KEY \"\n text += \"(%s)\" % ', '.join(self.preparer.quote(c.name)\n for c in constraint)\n text += self.define_constraint_deferrability(constraint)\n return text", "metadata": "root.DDLCompiler.visit_primary_key_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2566 }, { "content": " def visit_foreign_key_constraint(self, constraint):\n preparer = self.dialect.identifier_preparer\n text = \"\"\n if constraint.name is not None:\n formatted_name = self.preparer.format_constraint(constraint)\n if formatted_name is not None:\n text += \"CONSTRAINT %s \" % formatted_name\n remote_table = list(constraint._elements.values())[0].column.table\n text += \"FOREIGN KEY(%s) REFERENCES %s (%s)\" % (\n ', '.join(preparer.quote(f.parent.name)\n for f in constraint._elements.values()),\n self.define_constraint_remote_table(\n constraint, remote_table, preparer),\n ', '.join(preparer.quote(f.column.name)\n for f in constraint._elements.values())\n )\n text += self.define_constraint_match(constraint)\n text += self.define_constraint_cascades(constraint)\n text += self.define_constraint_deferrability(constraint)\n return text", "metadata": "root.DDLCompiler.visit_foreign_key_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2580 }, { "content": " def define_constraint_remote_table(self, constraint, table, preparer):\n \"\"\"Format the remote table clause of a CREATE CONSTRAINT clause.\"\"\"\n\n return preparer.format_table(table)", "metadata": "root.DDLCompiler.define_constraint_remote_table", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2601 }, { "content": " def visit_unique_constraint(self, constraint):\n if len(constraint) == 0:\n return ''\n text = \"\"\n if constraint.name is not None:\n formatted_name = self.preparer.format_constraint(constraint)\n text += \"CONSTRAINT %s \" % formatted_name\n text += \"UNIQUE (%s)\" % (\n ', '.join(self.preparer.quote(c.name)\n for c in constraint))\n text += self.define_constraint_deferrability(constraint)\n return text", "metadata": "root.DDLCompiler.visit_unique_constraint", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2606 }, { "content": " def define_constraint_cascades(self, constraint):\n text = \"\"\n if constraint.ondelete is not None:\n text += \" ON DELETE %s\" % constraint.ondelete\n if constraint.onupdate is not None:\n text += \" ON UPDATE %s\" % constraint.onupdate\n return text", "metadata": "root.DDLCompiler.define_constraint_cascades", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2619 }, { "content": " def define_constraint_deferrability(self, constraint):\n text = \"\"\n if constraint.deferrable is not None:\n if constraint.deferrable:\n text += \" DEFERRABLE\"\n else:\n text += \" NOT DEFERRABLE\"\n if constraint.initially is not None:\n text += \" INITIALLY %s\" % constraint.initially\n return text", "metadata": "root.DDLCompiler.define_constraint_deferrability", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2627 }, { "content": " def define_constraint_match(self, constraint):\n text = \"\"\n if constraint.match is not None:\n text += \" MATCH %s\" % constraint.match\n return text", "metadata": "root.DDLCompiler.define_constraint_match", "header": "['class', 'DDLCompiler', '(', 'Compiled', ')', ':', '___EOS___']", "index": 2638 }, { "content": "class GenericTypeCompiler(TypeCompiler):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.GenericTypeCompiler", "header": "['module', '___EOS___']", "index": 2645 }, { "content": " def visit_FLOAT(self, type_):\n return \"FLOAT\"", "metadata": "root.GenericTypeCompiler.visit_FLOAT", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2647 }, { "content": " def visit_REAL(self, type_):\n return \"REAL\"", "metadata": "root.GenericTypeCompiler.visit_REAL", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2650 }, { "content": " def visit_NUMERIC(self, type_):\n if type_.precision is None:\n return \"NUMERIC\"\n elif type_.scale is None:\n return \"NUMERIC(%(precision)s)\" % \\\n {'precision': type_.precision}\n else:\n return \"NUMERIC(%(precision)s, %(scale)s)\" % \\\n {'precision': type_.precision,\n 'scale': type_.scale}", "metadata": "root.GenericTypeCompiler.visit_NUMERIC", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2653 }, { "content": " def visit_DECIMAL(self, type_):\n if type_.precision is None:\n return \"DECIMAL\"\n elif type_.scale is None:\n return \"DECIMAL(%(precision)s)\" % \\\n {'precision': type_.precision}\n else:\n return \"DECIMAL(%(precision)s, %(scale)s)\" % \\\n {'precision': type_.precision,\n 'scale': type_.scale}", "metadata": "root.GenericTypeCompiler.visit_DECIMAL", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2664 }, { "content": " def visit_INTEGER(self, type_):\n return \"INTEGER\"", "metadata": "root.GenericTypeCompiler.visit_INTEGER", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2675 }, { "content": " def visit_SMALLINT(self, type_):\n return \"SMALLINT\"", "metadata": "root.GenericTypeCompiler.visit_SMALLINT", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2678 }, { "content": " def visit_BIGINT(self, type_):\n return \"BIGINT\"", "metadata": "root.GenericTypeCompiler.visit_BIGINT", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2681 }, { "content": " def visit_TIMESTAMP(self, type_):\n return 'TIMESTAMP'", "metadata": "root.GenericTypeCompiler.visit_TIMESTAMP", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2684 }, { "content": " def visit_DATETIME(self, type_):\n return \"DATETIME\"", "metadata": "root.GenericTypeCompiler.visit_DATETIME", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2687 }, { "content": " def visit_DATE(self, type_):\n return \"DATE\"", "metadata": "root.GenericTypeCompiler.visit_DATE", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2690 }, { "content": " def visit_TIME(self, type_):\n return \"TIME\"", "metadata": "root.GenericTypeCompiler.visit_TIME", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2693 }, { "content": " def visit_CLOB(self, type_):\n return \"CLOB\"", "metadata": "root.GenericTypeCompiler.visit_CLOB", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2696 }, { "content": " def visit_NCLOB(self, type_):\n return \"NCLOB\"", "metadata": "root.GenericTypeCompiler.visit_NCLOB", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2699 }, { "content": " def _render_string_type(self, type_, name):\n\n text = name\n if type_.length:\n text += \"(%d)\" % type_.length\n if type_.collation:\n text += ' COLLATE \"%s\"' % type_.collation\n return text", "metadata": "root.GenericTypeCompiler._render_string_type", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2702 }, { "content": " def visit_CHAR(self, type_):\n return self._render_string_type(type_, \"CHAR\")", "metadata": "root.GenericTypeCompiler.visit_CHAR", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2711 }, { "content": " def visit_NCHAR(self, type_):\n return self._render_string_type(type_, \"NCHAR\")", "metadata": "root.GenericTypeCompiler.visit_NCHAR", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2714 }, { "content": " def visit_VARCHAR(self, type_):\n return self._render_string_type(type_, \"VARCHAR\")", "metadata": "root.GenericTypeCompiler.visit_VARCHAR", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2717 }, { "content": " def visit_NVARCHAR(self, type_):\n return self._render_string_type(type_, \"NVARCHAR\")", "metadata": "root.GenericTypeCompiler.visit_NVARCHAR", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2720 }, { "content": " def visit_TEXT(self, type_):\n return self._render_string_type(type_, \"TEXT\")", "metadata": "root.GenericTypeCompiler.visit_TEXT", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2723 }, { "content": " def visit_BLOB(self, type_):\n return \"BLOB\"", "metadata": "root.GenericTypeCompiler.visit_BLOB", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2726 }, { "content": " def visit_BINARY(self, type_):\n return \"BINARY\" + (type_.length and \"(%d)\" % type_.length or \"\")", "metadata": "root.GenericTypeCompiler.visit_BINARY", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2729 }, { "content": " def visit_VARBINARY(self, type_):\n return \"VARBINARY\" + (type_.length and \"(%d)\" % type_.length or \"\")", "metadata": "root.GenericTypeCompiler.visit_VARBINARY", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2732 }, { "content": " def visit_BOOLEAN(self, type_):\n return \"BOOLEAN\"", "metadata": "root.GenericTypeCompiler.visit_BOOLEAN", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2735 }, { "content": " def visit_large_binary(self, type_):\n return self.visit_BLOB(type_)", "metadata": "root.GenericTypeCompiler.visit_large_binary", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2738 }, { "content": " def visit_boolean(self, type_):\n return self.visit_BOOLEAN(type_)", "metadata": "root.GenericTypeCompiler.visit_boolean", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2741 }, { "content": " def visit_time(self, type_):\n return self.visit_TIME(type_)", "metadata": "root.GenericTypeCompiler.visit_time", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2744 }, { "content": " def visit_datetime(self, type_):\n return self.visit_DATETIME(type_)", "metadata": "root.GenericTypeCompiler.visit_datetime", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2747 }, { "content": " def visit_date(self, type_):\n return self.visit_DATE(type_)", "metadata": "root.GenericTypeCompiler.visit_date", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2750 }, { "content": " def visit_big_integer(self, type_):\n return self.visit_BIGINT(type_)", "metadata": "root.GenericTypeCompiler.visit_big_integer", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2753 }, { "content": " def visit_small_integer(self, type_):\n return self.visit_SMALLINT(type_)", "metadata": "root.GenericTypeCompiler.visit_small_integer", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2756 }, { "content": " def visit_integer(self, type_):\n return self.visit_INTEGER(type_)", "metadata": "root.GenericTypeCompiler.visit_integer", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2759 }, { "content": " def visit_real(self, type_):\n return self.visit_REAL(type_)", "metadata": "root.GenericTypeCompiler.visit_real", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2762 }, { "content": " def visit_float(self, type_):\n return self.visit_FLOAT(type_)", "metadata": "root.GenericTypeCompiler.visit_float", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2765 }, { "content": " def visit_numeric(self, type_):\n return self.visit_NUMERIC(type_)", "metadata": "root.GenericTypeCompiler.visit_numeric", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2768 }, { "content": " def visit_string(self, type_):\n return self.visit_VARCHAR(type_)", "metadata": "root.GenericTypeCompiler.visit_string", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2771 }, { "content": " def visit_unicode(self, type_):\n return self.visit_VARCHAR(type_)", "metadata": "root.GenericTypeCompiler.visit_unicode", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2774 }, { "content": " def visit_text(self, type_):\n return self.visit_TEXT(type_)", "metadata": "root.GenericTypeCompiler.visit_text", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2777 }, { "content": " def visit_unicode_text(self, type_):\n return self.visit_TEXT(type_)", "metadata": "root.GenericTypeCompiler.visit_unicode_text", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2780 }, { "content": " def visit_enum(self, type_):\n return self.visit_VARCHAR(type_)", "metadata": "root.GenericTypeCompiler.visit_enum", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2783 }, { "content": " def visit_null(self, type_):\n raise exc.CompileError(\"Can't generate DDL for %r; \"\n \"did you forget to specify a \"\n \"type on this Column?\" % type_)", "metadata": "root.GenericTypeCompiler.visit_null", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2786 }, { "content": " def visit_type_decorator(self, type_):\n return self.process(type_.type_engine(self.dialect))", "metadata": "root.GenericTypeCompiler.visit_type_decorator", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2791 }, { "content": " def visit_user_defined(self, type_):\n return type_.get_col_spec()", "metadata": "root.GenericTypeCompiler.visit_user_defined", "header": "['class', 'GenericTypeCompiler', '(', 'TypeCompiler', ')', ':', '___EOS___']", "index": 2794 }, { "content": "class IdentifierPreparer(object):\n\n \"\"\"Handle quoting and case-folding of identifiers based on options.\"\"\"\n\n reserved_words = RESERVED_WORDS\n\n legal_characters = LEGAL_CHARACTERS\n\n illegal_initial_characters = ILLEGAL_INITIAL_CHARACTERS\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.IdentifierPreparer", "header": "['module', '___EOS___']", "index": 2798 }, { "content": " def __init__(self, dialect, initial_quote='\"',\n final_quote=None, escape_quote='\"', omit_schema=False):\n \"\"\"Construct a new ``IdentifierPreparer`` object.\n\n initial_quote\n Character that begins a delimited identifier.\n\n final_quote\n Character that ends a delimited identifier. Defaults to\n `initial_quote`.\n\n omit_schema\n Prevent prepending schema name. Useful for databases that do\n not support schemae.\n \"\"\"\n\n self.dialect = dialect\n self.initial_quote = initial_quote\n self.final_quote = final_quote or self.initial_quote\n self.escape_quote = escape_quote\n self.escape_to_quote = self.escape_quote * 2\n self.omit_schema = omit_schema\n self._strings = {}", "metadata": "root.IdentifierPreparer.__init__", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2808 }, { "content": " def _escape_identifier(self, value):\n \"\"\"Escape an identifier.\n\n Subclasses should override this to provide database-dependent\n escaping behavior.\n \"\"\"\n\n return value.replace(self.escape_quote, self.escape_to_quote)", "metadata": "root.IdentifierPreparer._escape_identifier", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2832 }, { "content": " def _unescape_identifier(self, value):\n \"\"\"Canonicalize an escaped identifier.\n\n Subclasses should override this to provide database-dependent\n unescaping behavior that reverses _escape_identifier.\n \"\"\"\n\n return value.replace(self.escape_to_quote, self.escape_quote)", "metadata": "root.IdentifierPreparer._unescape_identifier", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2841 }, { "content": " def quote_identifier(self, value):\n \"\"\"Quote an identifier.\n\n Subclasses should override this to provide database-dependent\n quoting behavior.\n \"\"\"\n\n return self.initial_quote + \\\n self._escape_identifier(value) + \\\n self.final_quote", "metadata": "root.IdentifierPreparer.quote_identifier", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2850 }, { "content": " def _requires_quotes(self, value):\n \"\"\"Return True if the given identifier requires quoting.\"\"\"\n lc_value = value.lower()\n return (lc_value in self.reserved_words\n or value[0] in self.illegal_initial_characters\n or not self.legal_characters.match(util.text_type(value))\n or (lc_value != value))", "metadata": "root.IdentifierPreparer._requires_quotes", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2861 }, { "content": " def quote_schema(self, schema, force=None):\n \"\"\"Conditionally quote a schema.\n\n Subclasses can override this to provide database-dependent\n quoting behavior for schema names.\n\n the 'force' flag should be considered deprecated.\n\n \"\"\"\n return self.quote(schema, force)", "metadata": "root.IdentifierPreparer.quote_schema", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2869 }, { "content": " def quote(self, ident, force=None):\n \"\"\"Conditionally quote an identifier.\n\n the 'force' flag should be considered deprecated.\n \"\"\"\n\n force = getattr(ident, \"quote\", None)\n\n if force is None:\n if ident in self._strings:\n return self._strings[ident]\n else:\n if self._requires_quotes(ident):\n self._strings[ident] = self.quote_identifier(ident)\n else:\n self._strings[ident] = ident\n return self._strings[ident]\n elif force:\n return self.quote_identifier(ident)\n else:\n return ident", "metadata": "root.IdentifierPreparer.quote", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2880 }, { "content": " def format_sequence(self, sequence, use_schema=True):\n name = self.quote(sequence.name)\n if (not self.omit_schema and use_schema and\n sequence.schema is not None):\n name = self.quote_schema(sequence.schema) + \".\" + name\n return name", "metadata": "root.IdentifierPreparer.format_sequence", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2902 }, { "content": " def format_label(self, label, name=None):\n return self.quote(name or label.name)", "metadata": "root.IdentifierPreparer.format_label", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2909 }, { "content": " def format_alias(self, alias, name=None):\n return self.quote(name or alias.name)", "metadata": "root.IdentifierPreparer.format_alias", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2912 }, { "content": " def format_savepoint(self, savepoint, name=None):\n return self.quote(name or savepoint.ident)", "metadata": "root.IdentifierPreparer.format_savepoint", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2915 }, { "content": " @util.dependencies(\"sqlalchemy.sql.naming\")\n def format_constraint(self, naming, constraint):\n if isinstance(constraint.name, elements._defer_name):\n name = naming._constraint_name_for_table(\n constraint, constraint.table)\n if name:\n return self.quote(name)\n elif isinstance(constraint.name, elements._defer_none_name):\n return None\n return self.quote(constraint.name)", "metadata": "root.IdentifierPreparer.format_constraint", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2918 }, { "content": " def format_table(self, table, use_schema=True, name=None):\n \"\"\"Prepare a quoted table and schema name.\"\"\"\n\n if name is None:\n name = table.name\n result = self.quote(name)\n if not self.omit_schema and use_schema \\\n and getattr(table, \"schema\", None):\n result = self.quote_schema(table.schema) + \".\" + result\n return result", "metadata": "root.IdentifierPreparer.format_table", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2929 }, { "content": " def format_schema(self, name, quote=None):\n \"\"\"Prepare a quoted schema name.\"\"\"\n\n return self.quote(name, quote)", "metadata": "root.IdentifierPreparer.format_schema", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2940 }, { "content": " def format_column(self, column, use_table=False,\n name=None, table_name=None):\n \"\"\"Prepare a quoted column name.\"\"\"\n\n if name is None:\n name = column.name\n if not getattr(column, 'is_literal', False):\n if use_table:\n return self.format_table(\n column.table, use_schema=False,\n name=table_name) + \".\" + self.quote(name)\n else:\n return self.quote(name)\n else:\n # literal textual elements get stuck into ColumnClause a lot,\n # which shouldn't get quoted\n\n if use_table:\n return self.format_table(\n column.table, use_schema=False,\n name=table_name) + '.' + name\n else:\n return name", "metadata": "root.IdentifierPreparer.format_column", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2945 }, { "content": " def format_table_seq(self, table, use_schema=True):\n \"\"\"Format table name and schema as a tuple.\"\"\"\n\n # Dialects with more levels in their fully qualified references\n # ('database', 'owner', etc.) could override this and return\n # a longer sequence.\n\n if not self.omit_schema and use_schema and \\\n getattr(table, 'schema', None):\n return (self.quote_schema(table.schema),\n self.format_table(table, use_schema=False))\n else:\n return (self.format_table(table, use_schema=False), )", "metadata": "root.IdentifierPreparer.format_table_seq", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2969 }, { "content": " @util.memoized_property\n def _r_identifiers(self):\n initial, final, escaped_final = \\\n [re.escape(s) for s in\n (self.initial_quote, self.final_quote,\n self._escape_identifier(self.final_quote))]\n r = re.compile(\n r'(?:'\n r'(?:%(initial)s((?:%(escaped)s|[^%(final)s])+)%(final)s'\n r'|([^\\.]+))(?=\\.|$))+' %\n {'initial': initial,\n 'final': final,\n 'escaped': escaped_final})\n return r", "metadata": "root.IdentifierPreparer._r_identifiers", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2983 }, { "content": " def unformat_identifiers(self, identifiers):\n \"\"\"Unpack 'schema.table.column'-like strings into components.\"\"\"\n\n r = self._r_identifiers\n return [self._unescape_identifier(i)\n for i in [a or b for a, b in r.findall(identifiers)]]", "metadata": "root.IdentifierPreparer.unformat_identifiers", "header": "['class', 'IdentifierPreparer', '(', 'object', ')', ':', '___EOS___']", "index": 2998 } ]
[ { "span": "import decimal", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "sql", "/", "compiler", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2005", "-", "2014", " ", "the", " ", "SQL", "Al", "chem", "y", " ", "author", "s", " ", "and", " ", "contributor", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "see", " ", "AUTHOR", "S", " ", "file", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "module", " ", "is", " ", "part", " ", "of", " ", "SQL", "Al", "chem", "y", " ", "and", " ", "is", " ", "released", " ", "under", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "MIT", " ", "License", ":", " ", "http", "://", "www", ".", "opens", "ource", ".", "org", "/", "license", "s", "/", "mit", "-", "license", ".", "php", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Base", " ", "SQL", " ", "and", " ", "DD", "L", " ", "compiler", " ", "implementation", "s", ".", "\\", "10", ";", "\\", "10", ";", "Class", "es", " ", "provided", " ", "include", ":", "\\", "10", ";", "\\", "10", ";", ":", "class", ":`", ".", "compiler", ".", "SQL", "Compil", "er", "`", " ", "-", " ", "render", "s", " ", "SQL", "\\", "10", ";", "string", "s", "\\", "10", ";", "\\", "10", ";", ":", "class", ":`", ".", "compiler", ".", "DD", "LC", "omp", "iler", "`", " ", "-", " ", "render", "s", " ", "DD", "L", "\\", "10", ";", "(", "data", " ", "definit", "ion", " ", "language", ")", " ", "string", "s", "\\", "10", ";", "\\", "10", ";", ":", "class", ":`", ".", "compiler", ".", "Gene", "ric", "Type", "Compil", "er", "`", " ", "-", " ", "render", "s", "\\", "10", ";", "type", " ", "specifica", "tion", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", "To", " ", "generat", "e", " ", "user", "-", "defin", "ed", " ", "SQL", " ", "string", "s", ",", " ", "see", "\\", "10", ";", ":", "doc", ":`", "/", "ext", "/", "compiler", "`.", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "schema_", ",_", "sql", "types_", ",_", "operators_", ",_", "functions_", ",_", "util_", "as_", "sql", "\\u", "util_", ",_", "visitor", "s_", ",_", "elements_", ",_", "selectable", "_", ",_", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "util_", ",_", "exc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RESERVED", "\\u", "WORDS_", "=_", "set_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "all", "'_", ",_", "'", "analyse", "'_", ",_", "'", "analyze", "'_", ",_", "'", "and", "'_", ",_", "'", "any", "'_", ",_", "'", "array", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "as", "'_", ",_", "'", "asc", "'_", ",_", "'", "asymmetr", "ic", "'_", ",_", "'", "authoriz", "ation", "'_", ",_", "'", "bet", "ween", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "binar", "y", "'_", ",_", "'", "bot", "h", "'_", ",_", "'", "case", "'_", ",_", "'", "cast", "'_", ",_", "'", "check", "'_", ",_", "'", "collate", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "column", "'_", ",_", "'", "constraint", "'_", ",_", "'", "create", "'_", ",_", "'", "cross", "'_", ",_", "'", "current", "\\u", "date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "role", "'_", ",_", "'", "current", "\\u", "time", "'_", ",_", "'", "current", "\\u", "timestamp", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "user", "'_", ",_", "'", "default", "'_", ",_", "'", "defer", "rab", "le", "'_", ",_", "'", "desc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "distinct", "'_", ",_", "'", "do", "'_", ",_", "'", "else", "'_", ",_", "'", "end", "'_", ",_", "'", "except", "'_", ",_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "for", "'_", ",_", "'", "foreign", "'_", ",_", "'", "freez", "e", "'_", ",_", "'", "from", "'_", ",_", "'", "full", "'_", ",_", "'", "grant", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "'_", ",_", "'", "hav", "ing", "'_", ",_", "'", "ili", "ke", "'_", ",_", "'", "in", "'_", ",_", "'", "initially", "'_", ",_", "'", "inner", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intersect", "'_", ",_", "'", "int", "o", "'_", ",_", "'", "is", "'_", ",_", "'", "isn", "ull", "'_", ",_", "'", "join", "'_", ",_", "'", "lead", "ing", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "left", "'_", ",_", "'", "like", "'_", ",_", "'", "limit", "'_", ",_", "'", "localt", "ime", "'_", ",_", "'", "localt", "imes", "tamp", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "natur", "al", "'_", ",_", "'", "new", "'_", ",_", "'", "not", "'_", ",_", "'", "notnull", "'_", ",_", "'", "null", "'_", ",_", "'", "off", "'_", ",_", "'", "offset", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "old", "'_", ",_", "'", "on", "'_", ",_", "'", "only", "'_", ",_", "'", "or", "'_", ",_", "'", "order", "'_", ",_", "'", "outer", "'_", ",_", "'", "overlaps", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pla", "cing", "'_", ",_", "'", "primary", "'_", ",_", "'", "reference", "s", "'_", ",_", "'", "right", "'_", ",_", "'", "select", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "session", "\\u", "user", "'_", ",_", "'", "set", "'_", ",_", "'", "similar", "'_", ",_", "'", "some", "'_", ",_", "'", "symmetric", "'_", ",_", "'", "table", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "then", "'_", ",_", "'", "to", "'_", ",_", "'", "trail", "ing", "'_", ",_", "'", "true", "'_", ",_", "'", "uni", "on", "'_", ",_", "'", "unique", "'_", ",_", "'", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "usi", "ng", "'_", ",_", "'", "verbo", "se", "'_", ",_", "'", "whe", "n", "'_", ",_", "'", "where", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LEGA", "L", "\\u", "CHARACTER", "S_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "[", "A", "-", "Z", "0", "-", "9", "\\u$", "]+$", "'_", ",_", "re_", "._", "I_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ILL", "EGA", "L", "\\u", "INITIAL", "\\u", "CHARACTER", "S_", "=_", "set_", "(_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "range_", "(_", "0_", ",_", "10_", ")_", "]_", ")_", "._", "union_", "(_", "[_", "'$'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "BIND", "\\u", "PARAMS_", "=_", "re_", "._", "compile_", "(_", "r", "'(?<", "![", ":\\\\", "w", "\\\\$", "\\\\", "x5", "c", "])", ":(", "[\\\\", "w", "\\\\$", "]+)", "(?!", "[:", "\\\\", "w", "\\\\$", "])'_", ",_", "re_", "._", "UNICODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BIND", "\\u", "PARAM", "S", "\\u", "ESC", "_", "=_", "re_", "._", "compile_", "(_", "r", "'\\\\", "x5", "c", "(:", "[\\\\", "w", "\\\\$", "]+)", "(?!", "[:", "\\\\", "w", "\\\\$", "])'_", ",_", "re_", "._", "UNICODE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "BIND", "\\u", "TEMPLATES_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pyf", "ormat", "'_", ":_", "\"%%", "(%", "(", "name", ")", "s", ")", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "qma", "rk", "'_", ":_", "\"?\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "format", "'_", ":_", "\"%%", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "numeri", "c", "'_", ":_", "\":[", "\\u", "POSITION", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "named", "'_", ":_", "\":", "%", "(", "name", ")", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "REQUIRED_", "=_", "util_", "._", "symbol_", "(_", "'", "REQUIRE", "D", "'_", ",_", "\"\"\"", "\\", "10", ";", "Place", "holder", " ", "for", " ", "the", " ", "value", " ", "within", " ", "a", " ", ":", "class", ":`", ".", "Bind", "Parameter", "`", "\\", "10", ";", "whi", "ch", " ", "is", " ", "require", "d", " ", "to", " ", "be", " ", "presen", "t", " ", "whe", "n", " ", "the", " ", "statem", "ent", " ", "is", " ", "pass", "ed", "\\", "10", ";", "to", " ", ":", "meth", ":`", ".", "Connect", "ion", ".", "execute", "`.", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "symbol", " ", "is", " ", "typical", "ly", " ", "used", " ", "whe", "n", " ", "a", " ", ":", "func", ":`", ".", "express", "ion", ".", "insert", "`", "\\", "10", ";", "or", " ", ":", "func", ":`", ".", "express", "ion", ".", "update", "`", " ", "statem", "ent", " ", "is", " ", "compile", "d", " ", "with", "out", " ", "parameter", "\\", "10", ";", "values", " ", "presen", "t", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "OPERATOR", "S_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "binary_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "and\\u_", ":_", "'", " ", "AND", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "or\\u_", ":_", "'", " ", "OR", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "add_", ":_", "'", " ", "+", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "mul_", ":_", "'", " ", "*", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "sub_", ":_", "'", " ", "-", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "div_", ":_", "'", " ", "/", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "mod_", ":_", "'", " ", "%", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "true", "div_", ":_", "'", " ", "/", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "neg_", ":_", "'-'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "lt_", ":_", "'", " ", "<", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "le_", ":_", "'", " ", "<=", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "ne_", ":_", "'", " ", "!=", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "gt_", ":_", "'", " ", ">", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "ge_", ":_", "'", " ", ">=", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "eq_", ":_", "'", " ", "=", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "conc", "at", "\\u", "op_", ":_", "'", " ", "||", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "match", "\\u", "op_", ":_", "'", " ", "MATCH", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "in", "\\u", "op_", ":_", "'", " ", "IN", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "noti", "n", "\\u", "op_", ":_", "'", " ", "NOT", " ", "IN", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "comma", "\\u", "op_", ":_", "',", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "from\\u_", ":_", "'", " ", "FROM", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "as", "\\u_", ":_", "'", " ", "AS", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "is\\u_", ":_", "'", " ", "IS", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "isn", "ot_", ":_", "'", " ", "IS", " ", "NOT", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "collate", "_", ":_", "'", " ", "COLL", "ATE", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unary_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "exists_", ":_", "'", "EXIST", "S", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "distinct", "\\u", "op_", ":_", "'", "DIST", "INC", "T", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "inv_", ":_", "'", "NOT", " ", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modifiers_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "desc", "\\u", "op_", ":_", "'", " ", "DESC", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "asc", "\\u", "op_", ":_", "'", " ", "ASC", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "null", "sfi", "rst", "\\u", "op_", ":_", "'", " ", "NULL", "S", " ", "FIR", "ST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operators_", "._", "null", "sla", "st", "\\u", "op_", ":_", "'", " ", "NULL", "S", " ", "LAS", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "FUNCTIONS", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "coalesce", "_", ":_", "'", "coalesce", "%", "(", "expr", ")", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "current", "\\u", "date_", ":_", "'", "CURREN", "T", "\\u", "DAT", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "current", "\\u", "time_", ":_", "'", "CURREN", "T", "\\u", "TIME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "current", "\\u", "timestamp_", ":_", "'", "CURREN", "T", "\\u", "TIMES", "TAM", "P", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "current", "\\u", "user_", ":_", "'", "CURREN", "T", "\\u", "USER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "localtime_", ":_", "'", "LOCAL", "TIME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "localt", "imes", "tamp", "_", ":_", "'", "LOCAL", "TIMES", "TAM", "P", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "random_", ":_", "'", "random", "%", "(", "expr", ")", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "sys", "date_", ":_", "'", "sys", "date", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "session", "\\u", "user_", ":_", "'", "SES", "SION", "\\u", "USER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "functions_", "._", "user_", ":_", "'", "USER", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "EXTRACT", "\\u", "MAP_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "month", "'_", ":_", "'", "month", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "day", "'_", ":_", "'", "day", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "'_", ":_", "'", "year", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "second", "'_", ":_", "'", "second", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hour", "'_", ":_", "'", "hour", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "do", "y", "'_", ":_", "'", "do", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "minute", "'_", ":_", "'", "minute", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "quarter", "'_", ":_", "'", "quarter", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dow", "'_", ":_", "'", "dow", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "week", "'_", ":_", "'", "week", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "epoch", "'_", ":_", "'", "epoch", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "milliseconds", "'_", ":_", "'", "milliseconds", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "microsecond", "s", "'_", ":_", "'", "microsecond", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e\\u", "hour", "'_", ":_", "'", "timezon", "e\\u", "hour", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timezon", "e\\u", "minute", "'_", ":_", "'", "timezon", "e\\u", "minute", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "COMPO", "UND", "\\u", "KEYWORDS", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "._", "Compo", "und", "Select_", "._", "UNION", "_", ":_", "'", "UNION", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "._", "Compo", "und", "Select_", "._", "UNION", "\\u", "ALL_", ":_", "'", "UNION", " ", "ALL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "._", "Compo", "und", "Select_", "._", "EXCE", "PT_", ":_", "'", "EXCE", "PT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "._", "Compo", "und", "Select_", "._", "EXCE", "PT", "\\u", "ALL_", ":_", "'", "EXCE", "PT", " ", "ALL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "._", "Compo", "und", "Select_", "._", "INTER", "SEC", "T_", ":_", "'", "INTER", "SEC", "T", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "_", "._", "Compo", "und", "Select_", "._", "INTER", "SEC", "T", "\\u", "ALL_", ":_", "'", "INTER", "SEC", "T", " ", "ALL", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Represent", " ", "a", " ", "compile", "d", " ", "SQL", " ", "or", " ", "DD", "L", " ", "express", "ion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "``", "\\u\\u", "str", "\\u\\u``", " ", "method", " ", "of", " ", "the", " ", "``", "Compiled", "``", " ", "object", " ", "shou", "ld", " ", "produce", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "actual", " ", "text", " ", "of", " ", "the", " ", "statem", "ent", ".", " ", " ", "``", "Compiled", "``", " ", "object", "s", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "specific", " ", "to", " ", "thei", "r", " ", "underl", "ying", " ", "databa", "se", " ", "dialect", ",", " ", "and", " ", "als", "o", " ", "may", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "may", " ", "not", " ", "be", " ", "specific", " ", "to", " ", "the", " ", "column", "s", " ", "referenced", " ", "within", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "partic", "ular", " ", "set", " ", "of", " ", "bind", " ", "parameter", "s", ".", " ", " ", "In", " ", "no", " ", "case", " ", "shou", "ld", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "``", "Compiled", "``", " ", "object", " ", "be", " ", "dependent", " ", "on", " ", "the", " ", "actual", " ", "values", " ", "of", " ", "tho", "se", "\\", "10", ";", " ", " ", " ", " ", "bind", " ", "parameter", "s", ",", " ", "even", " ", "tho", "ugh", " ", "it", " ", "may", " ", "reference", " ", "tho", "se", " ", "values", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "default", "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_", "\\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_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dialect_", ",_", "statement_", ",_", "bind_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compile", "\\u", "kwargs_", "=_", "util_", "._", "immutable", "dict_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Construct", " ", "a", " ", "new", " ", "``", "Compiled", "``", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "dialect", ":", " ", "``", "Dial", "ect", "``", " ", "to", " ", "compile", " ", "against", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "statem", "ent", ":", " ", "``", "Cla", "use", "Element", "``", " ", "to", " ", "be", " ", "compile", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "bind", ":", " ", "Optio", "nal", " ", "Engine", " ", "or", " ", "Connect", "ion", " ", "to", " ", "compile", " ", "this", "\\", "10", ";", " ", " ", "statem", "ent", " ", "against", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "compile", "\\u", "kwarg", "s", ":", " ", "addition", "al", " ", "kwarg", "s", " ", "tha", "t", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", " ", "pass", "ed", " ", "to", " ", "the", " ", "initial", " ", "call", " ", "to", " ", ":", "meth", ":`", ".", "Compiled", ".", "process", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", " ", "..", " ", "version", "adde", "d", "::", " ", "0.", "8", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "=_", "dialect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bind_", "=_", "bind_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "statement_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "statement_", "=_", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "can", "\\u", "execute_", "=_", "statement_", "._", "support", "s", "\\u", "execution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "string_", "=_", "self_", "._", "process_", "(_", "self_", "._", "statement_", ",_", "**_", "compile", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "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_", "@_", "util_", "._", "deprecated_", "(_", "\"", "0.", "7", "\"_", ",_", "\":", "class", ":`", ".", "Compiled", "`", " ", "object", "s", " ", "now", " ", "compile", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "within", " ", "the", " ", "construct", "or", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "compile_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Produce", " ", "the", " ", "internal", " ", "string", " ", "represent", "ation", " ", "of", " ", "this", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "execute", "\\u", "on", "\\u", "connection_", "(_", "self_", ",_", "connection_", ",_", "multip", "arams_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "connection_", "._", "\\u", "execute", "\\u", "compiled_", "(_", "self_", ",_", "multip", "arams_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "\\u", "compiler_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "a", " ", "Compiled", " ", "tha", "t", " ", "is", " ", "capable", " ", "of", " ", "process", "ing", " ", "SQL", " ", "express", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "this", " ", "compiler", " ", "is", " ", "one", ",", " ", "it", " ", "wou", "ld", " ", "like", "ly", " ", "just", " ", "return", " ", "'", "self", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "obj_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "obj_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "string", " ", "text", " ", "of", " ", "the", " ", "generat", "ed", " ", "SQL", " ", "or", " ", "DD", "L", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "string_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "construct", "\\u", "params_", "(_", "self_", ",_", "params_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "bind", " ", "params", " ", "for", " ", "this", " ", "compile", "d", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "params", ":", " ", "a", " ", "dict", " ", "of", " ", "string", "/", "object", " ", "pair", "s", " ", "who", "se", " ", "values", " ", "will", "\\", "10", ";", " ", " ", " ", " ", " ", "override", " ", "bind", " ", "values", " ", "compile", "d", " ", "in", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", " ", "statem", "ent", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "bind", " ", "params", " ", "for", " ", "this", " ", "compile", "d", " ", "object", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "construct", "\\u", "params_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "*_", "multip", "arams_", ",_", "**_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "this", " ", "compile", "d", " ", "object", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "self_", "._", "bind_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "e_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Unb", "ound", "Execut", "ion", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Thi", "s", " ", "Compiled", " ", "object", " ", "is", " ", "not", " ", "bound", " ", "to", " ", "any", " ", "Engine", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "or", " ", "Connect", "ion", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "e_", "._", "\\u", "execute", "\\u", "compiled_", "(_", "self_", ",_", "multip", "arams_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Compiled", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scalar_", "(_", "self_", ",_", "*_", "multip", "arams_", ",_", "**_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "this", " ", "compile", "d", " ", "object", " ", "and", " ", "return", " ", "the", " ", "result", "'", "s", "\\", "10", ";", " ", " ", " ", " ", "scala", "r", " ", "value", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "execute_", "(_", "*_", "multip", "arams_", ",_", "**_", "params_", ")_", "._", "scalar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Type", "Compiler_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Produce", "s", " ", "DD", "L", " ", "specifica", "tion", " ", "for", " ", "Type", "Engine", " ", "object", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Type", "Compiler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dialect_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dialect_", "=_", "dialect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Type", "Compiler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "type\\u_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Compil", "e", "Label_", "(_", "visitor", "s_", "._", "Visit", "able_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "light", "weight", " ", "label", " ", "object", " ", "whi", "ch", " ", "acts", " ", "as", " ", "an", " ", "express", "ion", ".", "Label", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "visit", "\\u", "name\\u\\u_", "=_", "'", "label", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "slots\\u\\u_", "=_", "'", "element", "'_", ",_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Compil", "e", "Label_", "(_", "visitor", "s_", "._", "Visit", "able_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "col_", ",_", "name_", ",_", "alt", "\\u", "names_", "=_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "element_", "=_", "col_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "alt", "\\u", "names_", "=_", "(_", "col_", ",_", ")_", "+_", "alt", "\\u", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Compil", "e", "Label_", "(_", "visitor", "s_", "._", "Visit", "able_", ")_", ":_", "\\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_", "proxy", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "element_", "._", "proxy", "\\u", "set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Compil", "e", "Label_", "(_", "visitor", "s_", "._", "Visit", "able_", ")_", ":_", "\\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_", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "element_", "._", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Default", " ", "implementation", " ", "of", " ", "Compiled", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Compil", "es", " ", "Cla", "use", "Element", "s", " ", "int", "o", " ", "SQL", " ", "string", "s", ".", " ", " ", " ", "Us", "es", " ", "a", " ", "similar", " ", "visit", "\\", "10", ";", " ", " ", " ", " ", "parad", "igm", " ", "as", " ", "visitor", "s", ".", "Cla", "use", "Visit", "or", " ", "but", " ", "implement", "s", " ", "its", " ", "own", " ", "traversal", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extract", "\\u", "map_", "=_", "EXTRACT", "\\u", "MAP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "keywords_", "=_", "COMPO", "UND", "\\u", "KEYWORDS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "isd", "ele", "te_", "=_", "isin", "ser", "t_", "=_", "isu", "pdate_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "class", "-", "level", " ", "default", "s", " ", "whi", "ch", " ", "can", " ", "be", " ", "set", " ", "at", " ", "the", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "level", " ", "to", " ", "defin", "e", " ", "if", " ", "this", " ", "Compiled", " ", "instance", " ", "represent", "s", "\\", "10", ";", " ", " ", " ", " ", "INSERT", "/", "UPDATE", "/", "DELET", "E", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return", "ing_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "hold", "s", " ", "the", " ", "\"", "return", "ing", "\"", " ", "collection", " ", "of", " ", "column", "s", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "statem", "ent", " ", "is", " ", "CRUD", " ", "and", " ", "defin", "es", " ", "return", "ing", " ", "column", "s", "\\", "10", ";", " ", " ", " ", " ", "eit", "her", " ", "implicit", "ly", " ", "or", " ", "explicit", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return", "ing", "\\u", "prece", "des", "\\u", "values_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "set", " ", "to", " ", "Tru", "e", " ", "class", "wide", " ", "to", " ", "generat", "e", " ", "RETURN", "ING", "\\", "10", ";", " ", " ", " ", " ", "clause", "s", " ", "bef", "ore", " ", "the", " ", "VALU", "ES", " ", "or", " ", "WHE", "RE", " ", "clause", " ", "(", "i", ".", "e", ".", " ", "MS", "SQL", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "render", "\\u", "table", "\\u", "with", "\\u", "column", "\\u", "in", "\\u", "update", "\\u", "from_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "set", " ", "to", " ", "Tru", "e", " ", "class", "wide", " ", "to", " ", "indicat", "e", " ", "the", " ", "SET", " ", "clause", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "a", " ", "multi", "-", "table", " ", "UPDATE", " ", "statem", "ent", " ", "shou", "ld", " ", "quali", "fy", "\\", "10", ";", " ", " ", " ", " ", "column", "s", " ", "with", " ", "the", " ", "table", " ", "name", " ", "(", "i", ".", "e", ".", " ", "My", "SQL", " ", "only", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ansi", "\\u", "bind", "\\u", "rules_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "SQL", " ", "9", "2", " ", "doe", "sn", "'", "t", " ", "allow", " ", "bind", " ", "parameter", "s", " ", "to", " ", "be", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "column", "s", " ", "clause", " ", "of", " ", "a", " ", "SELECT", ",", " ", "nor", " ", "doe", "s", " ", "it", " ", "allow", "\\", "10", ";", " ", " ", " ", " ", "ambiguous", " ", "express", "ion", "s", " ", "like", " ", "\"?", " ", "=", " ", "?\"", ".", " ", " ", "A", " ", "compiler", "\\", "10", ";", " ", " ", " ", " ", "subclass", " ", "can", " ", "set", " ", "this", " ", "flag", " ", "to", " ", "Fal", "se", " ", "if", " ", "the", " ", "target", "\\", "10", ";", " ", " ", " ", " ", "driver", "/", "DB", " ", "enforce", "s", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u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\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "default", "\\u", "stack", "\\u", "entry_", "=_", "util_", "._", "immutable", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "is", "wrapp", "er", "'_", ",_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "correlate", "\\u", "froms", "'_", ",_", "frozenset_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "asf", "rom", "\\u", "froms", "'_", ",_", "frozenset_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dialect_", ",_", "statement_", ",_", "column", "\\u", "keys_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inline_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Construct", " ", "a", " ", "new", " ", "``", "Default", "Compil", "er", "``", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "dialect", "\\", "10", ";", " ", " ", "Dial", "ect", " ", "to", " ", "be", " ", "used", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "statem", "ent", "\\", "10", ";", " ", " ", "Cla", "use", "Element", " ", "to", " ", "be", " ", "compile", "d", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "column", "\\u", "keys", "\\", "10", ";", " ", " ", "a", " ", "list", " ", "of", " ", "column", " ", "names", " ", "to", " ", "be", " ", "compile", "d", " ", "int", "o", " ", "an", " ", "INSERT", " ", "or", " ", "UPDATE", "\\", "10", ";", " ", " ", "statem", "ent", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "column", "\\u", "keys_", "=_", "column", "\\u", "keys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compile", " ", "INSERT", "/", "UPDATE", " ", "default", "s", "/", "sequence", "s", " ", "inline", "d", " ", "(", "no", " ", "pre", "-_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "execute", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "inline_", "=_", "inline_", "or_", "getattr_", "(_", "statement_", ",_", "'", "inline", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "dictionar", "y", " ", "of", " ", "bind", " ", "parameter", " ", "keys", " ", "to", " ", "Bind", "Parameter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instance", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "binds_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "dictionar", "y", " ", "of", " ", "Bind", "Parameter", " ", "instance", "s", " ", "to", " ", "\"", "compile", "d", "\"", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "are", " ", "actual", "ly", " ", "presen", "t", " ", "in", " ", "the", " ", "generat", "ed", " ", "SQL_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "bind", "\\u", "names_", "=_", "util_", "._", "column", "\\u", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", " ", "whi", "ch", " ", "keep", "s", " ", "track", " ", "of", " ", "nest", "ed", " ", "SELECT", " ", "statements_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "stack_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relate", "s", " ", "label", " ", "names", " ", "in", " ", "the", " ", "final", " ", "SQL", " ", "to", " ", "a", " ", "tuple", " ", "of", " ", "local_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "column", "/", "label", " ", "name", ",", " ", "Colum", "n", "Element", " ", "object", " ", "(", "if", " ", "any", ")", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Type", "Engine", ".", " ", "Result", "Pro", "xy", " ", "use", "s", " ", "this", " ", "for", " ", "type", " ", "process", "ing", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "column", " ", "targeti", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "result", "\\u", "map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "true", " ", "if", " ", "the", " ", "params", "tyl", "e", " ", "is", " ", "positional", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "positional", "_", "=_", "dialect_", "._", "positional", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "positional", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "position", "tup_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "bind", "template_", "=_", "BIND", "\\u", "TEMPLATES_", "[_", "dialect_", "._", "params", "tyle_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cte", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "Identifie", "r", "Prepare", "r", " ", "tha", "t", " ", "formats", " ", "the", " ", "quoting", " ", "of", " ", "identifiers_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prepar", "er_", "=_", "dialect_", "._", "identifi", "er", "\\u", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "label", "\\u", "length_", "=_", "dialect_", "._", "label", "\\u", "length_", "or_", "dialect_", "._", "max", "\\u", "identifi", "er", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "map", " ", "whi", "ch", " ", "tracks", " ", "\"", "anonym", "ous", "\"", " ", "identifi", "ers", " ", "tha", "t", " ", "are", " ", "created", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "fly", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "anon", "\\u", "map_", "=_", "util_", "._", "Populate", "Dict_", "(_", "self_", "._", "\\u", "process", "\\u", "anon", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "map", " ", "whi", "ch", " ", "tracks", " ", "\"", "truncat", "ed", "\"", " ", "names", " ", "based", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dialect", ".", "label", "\\u", "length", " ", "or", " ", "dialect", ".", "max", "\\u", "identifi", "er", "\\u", "length_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "truncat", "ed", "\\u", "names_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Compiled", "_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dialect_", ",_", "statement_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "positional", "_", "and_", "dialect_", "._", "params", "tyle_", "==_", "'", "numeri", "c", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "appl", "y", "\\u", "numbered", "\\u", "params_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "util_", "._", "memoized", "\\u", "instance", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "init", "\\u", "cte", "\\u", "state_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "e", " ", "collection", "s", " ", "relate", "d", " ", "to", " ", "CT", "Es", " ", "only", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "CT", "E", " ", "is", " ", "located", ",", " ", "to", " ", "save", " ", "on", " ", "the", " ", "overhead", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "these", " ", "collection", "s", " ", "other", "wis", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "collect", " ", "CT", "Es", " ", "to", " ", "tack", " ", "on", " ", "top", " ", "of", " ", "a", " ", "SELECT", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cte", "s_", "=_", "util_", "._", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cte", "s", "\\u", "by", "\\u", "name_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cte", "s", "\\u", "recursive_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "positional", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cte", "\\u", "positional", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\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", "appl", "y", "\\u", "numbered", "\\u", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos", "count_", "=_", "itertools_", "._", "count_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "string_", "=_", "re_", "._", "sub_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'\\\\[", "\\u", "POSITION", "\\\\]", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "m_", ":_", "str_", "(_", "util_", "._", "next_", "(_", "pos", "count_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "util_", "._", "memoized", "\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "bind", "\\u", "processors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "key_", ",_", "value_", ")_", "for_", "key_", ",_", "value_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "self_", "._", "bind", "\\u", "names_", "[_", "bind", "param_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bind", "param_", "._", "type_", "._", "\\u", "cache", "d\\u", "bind", "\\u", "processor_", "(_", "self_", "._", "dialect_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "bind", "param_", "in_", "self_", "._", "bind", "\\u", "names_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "value_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "subquery", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "self_", "._", "stack_", ")_", ">_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\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_", "sql", "\\u", "compiler_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "construct", "\\u", "params_", "(_", "self_", ",_", "params_", "=_", "None_", ",_", "\\u", "group", "\\u", "number_", "=_", "None_", ",_", "\\u", "check_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "a", " ", "dictionar", "y", " ", "of", " ", "bind", " ", "parameter", " ", "keys", " ", "and", " ", "values", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pd_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bind", "param_", ",_", "name_", "in_", "self_", "._", "bind", "\\u", "names_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bind", "param_", "._", "key_", "in_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pd_", "[_", "name_", "]_", "=_", "params_", "[_", "bind", "param_", "._", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "name_", "in_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pd_", "[_", "name_", "]_", "=_", "params_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "check_", "and_", "bind", "param_", "._", "required_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "\\u", "group", "\\u", "number_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "exc_", "._", "Inva", "lid", "Request", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "A", " ", "value", " ", "is", " ", "require", "d", " ", "for", " ", "bind", " ", "parameter", " ", "%", "r", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "in", " ", "parameter", " ", "group", " ", "%", "d", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "bind", "param_", "._", "key_", ",_", "\\u", "group", "\\u", "number_", ")_", ")_", "\\u\\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_", "exc_", "._", "Inva", "lid", "Request", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "A", " ", "value", " ", "is", " ", "require", "d", " ", "for", " ", "bind", " ", "parameter", " ", "%", "r", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "bind", "param_", "._", "key_", ")_", "\\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 ", " ", "_", "pd_", "[_", "name_", "]_", "=_", "bind", "param_", "._", "effective", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pd_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bind", "param_", "in_", "self_", "._", "bind", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\\u", "check_", "and_", "bind", "param_", "._", "required_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "\\u", "group", "\\u", "number_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "exc_", "._", "Inva", "lid", "Request", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "A", " ", "value", " ", "is", " ", "require", "d", " ", "for", " ", "bind", " ", "parameter", " ", "%", "r", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "in", " ", "parameter", " ", "group", " ", "%", "d", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "bind", "param_", "._", "key_", ",_", "\\u", "group", "\\u", "number_", ")_", ")_", "\\u\\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_", "exc_", "._", "Inva", "lid", "Request", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "A", " ", "value", " ", "is", " ", "require", "d", " ", "for", " ", "bind", " ", "parameter", " ", "%", "r", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "bind", "param_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pd_", "[_", "self_", "._", "bind", "\\u", "names_", "[_", "bind", "param_", "]_", "]_", "=_", "bind", "param_", "._", "effective", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "bind", " ", "param", " ", "dictionar", "y", " ", "embedde", "d", " ", "int", "o", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "compile", "d", " ", "object", ",", " ", "for", " ", "tho", "se", " ", "values", " ", "tha", "t", " ", "are", " ", "presen", "t", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "construct", "\\u", "params_", "(_", "\\u", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "default", "\\u", "from_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "whe", "n", " ", "a", " ", "SELECT", " ", "statem", "ent", " ", "has", " ", "no", " ", "froms", ",", " ", "and", " ", "no", " ", "FROM", " ", "clause", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "be", " ", "append", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Give", "s", " ", "Ora", "cle", " ", "a", " ", "chan", "ce", " ", "to", " ", "tack", " ", "on", " ", "a", " ", "``", "FROM", " ", "DU", "AL", "``", " ", "to", " ", "the", " ", "string", " ", "output", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "grouping_", "(_", "self_", ",_", "grouping_", ",_", "asf", "rom_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"(\"_", "+_", "grouping_", "._", "element_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "+_", "\")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "label_", "(_", "self_", ",_", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "within", "\\u", "label", "\\u", "clause_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "render", "\\u", "label", "\\u", "as", "\\u", "label_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "render", " ", "labels", " ", "within", " ", "the", " ", "column", "s", " ", "clause_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "ORDE", "R", " ", "BY", " ", "clause", " ", "of", " ", "a", " ", "select", ".", " ", " ", "dialect", "-", "specific", " ", "compiler", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "can", " ", "modif", "y", " ", "this", " ", "behavior", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "render", "\\u", "label", "\\u", "with", "\\u", "as_", "=_", "(_", "within", "\\u", "column", "s", "\\u", "clause_", "and_", "not_", "\\u\\u\\uNL\\u\\u\\u_", "within", "\\u", "label", "\\u", "clause_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render", "\\u", "label", "\\u", "only_", "=_", "render", "\\u", "label", "\\u", "as", "\\u", "label_", "is_", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "render", "\\u", "label", "\\u", "only_", "or_", "render", "\\u", "label", "\\u", "with", "\\u", "as_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "label_", "._", "name_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label", "name_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\"", "coli", "dent", "\"_", ",_", "label_", "._", "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 ", " _", "label", "name_", "=_", "label_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "render", "\\u", "label", "\\u", "with", "\\u", "as_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "label", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "label_", ",_", "label", "name_", ",_", ")_", "+_", "label_", "._", "\\u", "alt", "\\u", "names_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "._", "type_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "label_", "._", "element_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "within", "\\u", "label", "\\u", "clause_", "=_", "True_", ",_", "**_", "kw_", ")_", "+_", "OPERATOR", "S_", "[_", "operators_", "._", "as", "\\u_", "]_", "+_", "self_", "._", "prepar", "er_", "._", "format\\u", "label_", "(_", "label_", ",_", "label", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "render", "\\u", "label", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "prepar", "er_", "._", "format\\u", "label_", "(_", "label_", ",_", "label", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "label_", "._", "element_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "False_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "column_", "(_", "self_", ",_", "column_", ",_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "table_", "=_", "True_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "orig", "\\u", "name_", "=_", "column_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\"", "Cann", "ot", " ", "compile", " ", "Colum", "n", " ", "object", " ", "unti", "l", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "its", " ", "'", "name", "'", " ", "is", " ", "assign", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "\\u", "literal_", "=_", "column_", "._", "is", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "is", "\\u", "literal_", "and_", "isinstance_", "(_", "name_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\"", "coli", "dent", "\"_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "orig", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "column_", ",_", "name_", ",_", "column_", "._", "key_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "column_", "._", "type_", "\\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_", "is", "\\u", "literal_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "self_", "._", "escape", "\\u", "literal", "\\u", "column_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "table_", "=_", "column_", "._", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "table_", "is_", "None_", "or_", "not_", "include", "\\u", "table_", "or_", "not_", "table_", "._", "named", "\\u", "with", "\\u", "column_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "if_", "table_", "._", "schema_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema", "\\u", "prefix_", "=_", "self_", "._", "prepar", "er_", "._", "quote", "\\u", "schema_", "(_", "table_", "._", "schema_", ")_", "+_", "'.'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema", "\\u", "prefix_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tablename_", "=_", "table_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "tablename_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tablename_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\"", "alias", "\"_", ",_", "tablename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "schema", "\\u", "prefix_", "+_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "tablename_", ")_", "+_", "\".\"_", "+_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "escape", "\\u", "literal", "\\u", "column_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "provide", " ", "esca", "ping", " ", "for", " ", "the", " ", "literal", "\\u", "column", "()", " ", "construct", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "some", " ", "dialect", "s", " ", "mig", "ht", " ", "need", " ", "different", " ", "behavior", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "text_", "._", "replace_", "(_", "'%'_", ",_", "'%%", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "from", "clause_", "(_", "self_", ",_", "from", "clause_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "from", "clause_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "index_", "(_", "self_", ",_", "index_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "index_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "typec", "lau", "se_", "(_", "self_", ",_", "typec", "lau", "se_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dialect_", "._", "type", "\\u", "compiler_", "._", "process_", "(_", "typec", "lau", "se_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post", "\\u", "process", "\\u", "text_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "text", "clause_", "(_", "self_", ",_", "text", "clause_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "do", "\\u", "bind", "param_", "(_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "m_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", "in_", "text", "clause_", "._", "\\u", "bind", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "process_", "(_", "text", "clause_", "._", "\\u", "bind", "params_", "[_", "name_", "]_", ",_", "**_", "kw_", ")_", "\\u\\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_", "._", "bind", "param", "\\u", "string_", "(_", "name_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "un", "-", "escape", " ", "any", " ", "\\\\:", "params_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "BIND", "\\u", "PARAM", "S", "\\u", "ESC", "_", "._", "sub_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "m_", ":_", "m_", "._", "group_", "(_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "BIND", "\\u", "PARAMS_", "._", "sub_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "do", "\\u", "bind", "param_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "post", "\\u", "process", "\\u", "text_", "(_", "text", "clause_", "._", "text_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "text", "\\u", "as", "\\u", "from_", "(_", "self_", ",_", "ta", "f_", ",_", "is", "wrapper_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "index_", "=_", "0_", ",_", "force", "\\u", "result", "\\u", "map_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "asf", "rom_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "paren", "s_", "=_", "True_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toplevel_", "=_", "not_", "self_", "._", "stack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entry_", "=_", "self_", "._", "\\u", "default", "\\u", "stack", "\\u", "entry_", "if_", "toplevel_", "else_", "self_", "._", "stack_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "populate", "\\u", "result", "\\u", "map_", "=_", "force", "\\u", "result", "\\u", "map_", "or_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "index_", "==_", "0_", "and_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "toplevel_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "entry_", "[_", "'", "is", "wrapp", "er", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "populate", "\\u", "result", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c_", "in_", "ta", "f_", "._", "column", "\\u", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "process_", "(_", "c_", ",_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "self_", "._", "\\u", "add", "\\u", "to", "\\u", "result", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "self_", "._", "process_", "(_", "ta", "f_", "._", "element_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "asf", "rom_", "and_", "paren", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"(", "%", "s", ")\"_", "%_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "null_", "(_", "self_", ",_", "expr_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "NULL", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "true_", "(_", "self_", ",_", "expr_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "nativ", "e\\u", "boolean_", ":_", "\\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_", "\"", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "false_", "(_", "self_", ",_", "expr_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "nativ", "e\\u", "boolean_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "clause", "list_", "(_", "self_", ",_", "clause", "list_", ",_", "order", "\\u", "by", "\\u", "select_", "=_", "None_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "order", "\\u", "by", "\\u", "select_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "order", "\\u", "by", "\\u", "clause", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "clause", "list_", ",_", "order", "\\u", "by", "\\u", "select_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sep_", "=_", "clause", "list_", "._", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sep_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sep_", "=_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sep_", "=_", "OPERATOR", "S_", "[_", "clause", "list_", "._", "operator_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sep_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "for_", "s_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "clause", "list_", "._", "clauses_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "order", "\\u", "by", "\\u", "clause", "list_", "(_", "self_", ",_", "clause", "list_", ",_", "order", "\\u", "by", "\\u", "select_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "look", " ", "through", " ", "raw", " ", "column", "s", " ", "collection", " ", "for", " ", "labels", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "note", " ", "tha", "t", " ", "its", " ", "OK", " ", "we", " ", "are", "n", "'", "t", " ", "expand", "ing", " ", "tables", " ", "and", " ", "other", " ", "selectable", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "here", ";", " ", "we", " ", "can", " ", "only", " ", "add", " ", "a", " ", "label", " ", "in", " ", "the", " ", "ORDE", "R", " ", "BY", " ", "for", " ", "an", " ", "individual_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "label", " ", "express", "ion", " ", "in", " ", "the", " ", "column", "s", " ", "clause", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "col_", "=_", "set_", "(_", "l_", "._", "\\u", "order", "\\u", "by", "\\u", "label", "\\u", "element_", "._", "name_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "l_", "in_", "order", "\\u", "by", "\\u", "select_", "._", "\\u", "raw", "\\u", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "l_", "._", "\\u", "order", "\\u", "by", "\\u", "label", "\\u", "element_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\",", " ", "\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "for_", "s_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "render", "\\u", "label", "\\u", "as", "\\u", "label_", "=_", "c_", "._", "\\u", "order", "\\u", "by", "\\u", "label", "\\u", "element_", "if_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "\\u", "order", "\\u", "by", "\\u", "label", "\\u", "element_", "is_", "not_", "None_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "\\u", "order", "\\u", "by", "\\u", "label", "\\u", "element_", "._", "name_", "in_", "raw", "\\u", "col_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kw_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "clause", "list_", "._", "clauses_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "case_", "(_", "self_", ",_", "clause_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "\"", "CASE", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "clause_", "._", "value_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "+=_", "clause_", "._", "value_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "cond_", ",_", "result_", "in_", "clause_", "._", "whe", "ns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "+=_", "\"", "WHE", "N", " ", "\"_", "+_", "cond_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "**_", "kwargs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "+_", "\"", " ", "THE", "N", " ", "\"_", "+_", "result_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "**_", "kwargs_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "clause_", "._", "else", "\\u_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "+=_", "\"", "ELS", "E", " ", "\"_", "+_", "clause_", "._", "else", "\\u_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "**_", "kwargs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "+=_", "\"", "END", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "cast_", "(_", "self_", ",_", "cast_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "CAST", "(%", "s", " ", "AS", " ", "%", "s", ")\"_", "%_", "(_", "cast_", "._", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cast_", "._", "typec", "lau", "se_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "over_", "(_", "self_", ",_", "over_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", " ", "OVER", " ", "(%", "s", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "over_", "._", "func_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'%", "s", " ", "BY", " ", "%", "s", "'_", "%_", "(_", "word_", ",_", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "word_", ",_", "clause_", "in_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "PARTITION", "'_", ",_", "over_", "._", "partit", "ion", "\\u", "by_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "ORDE", "R", "'_", ",_", "over_", "._", "order", "\\u", "by_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "clause_", "is_", "not_", "None_", "and_", "len_", "(_", "clause_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "extract_", "(_", "self_", ",_", "extract_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "self_", "._", "extract", "\\u", "map_", "._", "get_", "(_", "extract_", "._", "field_", ",_", "extract_", "._", "field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", "EXTRACT", "(%", "s", " ", "FROM", " ", "%", "s", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "field_", ",_", "extract_", "._", "expr_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "function_", "(_", "self_", ",_", "func_", ",_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "func_", "._", "name_", ",_", "func_", "._", "name_", ",_", "(_", ")_", ",_", "func_", "._", "type_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "disp_", "=_", "getattr_", "(_", "self_", ",_", "\"", "visit", "\\u", "%", "s", "\\u", "func", "\"_", "%_", "func_", "._", "name_", "._", "lower_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "disp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "disp_", "(_", "func_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "FUNCTIONS", "_", "._", "get_", "(_", "func_", "._", "\\u\\u", "class\\u\\u_", ",_", "func_", "._", "name_", "+_", "\"%", "(", "expr", ")", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\".\"_", "._", "join_", "(_", "list_", "(_", "func_", "._", "package", "names_", ")_", "+_", "[_", "name_", "]_", ")_", "%_", "{_", "'", "expr", "'_", ":_", "self_", "._", "function", "\\u", "argspec_", "(_", "func_", ",_", "**_", "kwargs_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "next", "\\u", "value", "\\u", "func_", "(_", "self_", ",_", "next", "\\u", "value_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "sequence_", "(_", "next", "\\u", "value_", "._", "sequence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "sequence_", "(_", "self_", ",_", "sequence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Dial", "ect", " ", "'%", "s", "'", " ", "doe", "s", " ", "not", " ", "support", " ", "sequence", " ", "increment", "s", ".\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "._", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "function", "\\u", "argspec_", "(_", "self_", ",_", "func_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "func_", "._", "clause", "\\u", "expr_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "compo", "und", "\\u", "select_", "(_", "self_", ",_", "cs_", ",_", "asf", "rom_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "paren", "s_", "=_", "True_", ",_", "compo", "und", "\\u", "index_", "=_", "0_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toplevel_", "=_", "not_", "self_", "._", "stack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entry_", "=_", "self_", "._", "\\u", "default", "\\u", "stack", "\\u", "entry_", "if_", "toplevel_", "else_", "self_", "._", "stack_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "stack_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "correlate", "\\u", "froms", "'_", ":_", "entry_", "[_", "'", "correlate", "\\u", "froms", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "wrapp", "er", "'_", ":_", "toplevel_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "asf", "rom", "\\u", "froms", "'_", ":_", "entry_", "[_", "'", "asf", "rom", "\\u", "froms", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "keyword_", "=_", "self_", "._", "compo", "und", "\\u", "keywords_", "._", "get_", "(_", "cs_", "._", "keyword_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "(_", "\"", " ", "\"_", "+_", "keyword_", "+_", "\"", " ", "\"_", ")_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "asf", "rom_", "=_", "asf", "rom_", ",_", "paren", "s_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "index_", "=_", "i_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "c_", "in_", "enumerate_", "(_", "cs_", "._", "select", "s_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "group", "\\u", "by_", "=_", "cs_", "._", "\\u", "group", "\\u", "by", "\\u", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "asf", "rom_", "=_", "asf", "rom_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "group", "\\u", "by_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "GROU", "P", " ", "BY", " ", "\"_", "+_", "group", "\\u", "by_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "self_", "._", "order", "\\u", "by", "\\u", "clause_", "(_", "cs_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "(_", "cs_", "._", "\\u", "limit_", "is_", "not_", "None_", "or_", "cs_", "._", "\\u", "offset_", "is_", "not_", "None_", ")_", "and_", "self_", "._", "limit", "\\u", "clause_", "(_", "cs_", ")_", "or_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "cte", "s_", "and_", "compo", "und", "\\u", "index_", "==_", "0_", "and_", "toplevel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "\\u", "render", "\\u", "cte", "\\u", "clause_", "(_", ")_", "+_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stack_", "._", "pop_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "asf", "rom_", "and_", "paren", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"(\"_", "+_", "text_", "+_", "\")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "unary_", "(_", "self_", ",_", "unary_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "unary_", "._", "operator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "unary_", "._", "modifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Una", "ry", " ", "express", "ion", " ", "doe", "s", " ", "not", " ", "support", " ", "opera", "tor", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "and", " ", "modifier", " ", "simultaneous", "ly", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "disp_", "=_", "getattr_", "(_", "self_", ",_", "\"", "visit", "\\u", "%", "s", "\\u", "una", "ry", "\\u", "opera", "tor", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "unary_", "._", "operator_", "._", "\\u\\u", "name\\u\\u_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "disp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "disp_", "(_", "unary_", ",_", "unary_", "._", "operator_", ",_", "**_", "kw_", ")_", "\\u\\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", "generat", "e\\u", "gener", "ic", "\\u", "una", "ry", "\\u", "operator_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unary_", ",_", "OPERATOR", "S_", "[_", "unary_", "._", "operator_", "]_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "unary_", "._", "modifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "disp_", "=_", "getattr_", "(_", "self_", ",_", "\"", "visit", "\\u", "%", "s", "\\u", "una", "ry", "\\u", "modifier", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "unary_", "._", "modifier_", "._", "\\u\\u", "name\\u\\u_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "disp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "disp_", "(_", "unary_", ",_", "unary_", "._", "modifier_", ",_", "**_", "kw_", ")_", "\\u\\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", "generat", "e\\u", "gener", "ic", "\\u", "una", "ry", "\\u", "modifier_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "unary_", ",_", "OPERATOR", "S_", "[_", "unary_", "._", "modifier_", "]_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Una", "ry", " ", "express", "ion", " ", "has", " ", "no", " ", "opera", "tor", " ", "or", " ", "modifier", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "istr", "ue", "\\u", "una", "ry", "\\u", "operator_", "(_", "self_", ",_", "element_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "nativ", "e\\u", "boolean_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "process_", "(_", "element_", "._", "element_", ",_", "**_", "kw_", ")_", "\\u\\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_", "\"%", "s", " ", "=", " ", "1", "\"_", "%_", "self_", "._", "process_", "(_", "element_", "._", "element_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "isf", "als", "e\\u", "una", "ry", "\\u", "operator_", "(_", "self_", ",_", "element_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "nativ", "e\\u", "boolean_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "NOT", " ", "%", "s", "\"_", "%_", "self_", "._", "process_", "(_", "element_", "._", "element_", ",_", "**_", "kw_", ")_", "\\u\\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_", "\"%", "s", " ", "=", " ", "0", "\"_", "%_", "self_", "._", "process_", "(_", "element_", "._", "element_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "allow", " ", "\"?", " ", "=", " ", "?\"", " ", "to", " ", "render_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "ansi", "\\u", "bind", "\\u", "rules_", "and_", "isinstance_", "(_", "binary_", "._", "left_", ",_", "elements_", "._", "Bind", "Parameter_", ")_", "and_", "isinstance_", "(_", "binary_", "._", "right_", ",_", "elements_", "._", "Bind", "Parameter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kw_", "[_", "'", "literal", "\\u", "bind", "s", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "operator_", "=_", "binary_", "._", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disp_", "=_", "getattr_", "(_", "self_", ",_", "\"", "visit", "\\u", "%", "s", "\\u", "binar", "y", "\"_", "%_", "operator_", "._", "\\u\\u", "name\\u\\u_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "disp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "disp_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\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 ", " _", "ops", "tring_", "=_", "OPERATOR", "S_", "[_", "operator_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Unsu", "ppo", "rted", "Compil", "ation", "Error_", "(_", "self_", ",_", "operator_", ")_", "\\u\\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", "generat", "e\\u", "gener", "ic", "\\u", "binary_", "(_", "binary_", ",_", "ops", "tring_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "custom", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "element_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "binary_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "element_", ",_", "\"", " ", "\"_", "+_", "operator_", "._", "ops", "tring_", "+_", "\"", " ", "\"_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "custom", "\\u", "op", "\\u", "una", "ry", "\\u", "operator_", "(_", "self_", ",_", "element_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "una", "ry", "\\u", "operator_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "element_", ",_", "operator_", "._", "ops", "tring_", "+_", "\"", " ", "\"_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "custom", "\\u", "op", "\\u", "una", "ry", "\\u", "modifier_", "(_", "self_", ",_", "element_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "una", "ry", "\\u", "modifier_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "element_", ",_", "\"", " ", "\"_", "+_", "operator_", "._", "ops", "tring_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "ops", "tring_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "binary_", "._", "left_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "+_", "ops", "tring_", "+_", "binary_", "._", "right_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "una", "ry", "\\u", "operator_", "(_", "self_", ",_", "unary_", ",_", "ops", "tring_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ops", "tring_", "+_", "unary_", "._", "element_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "una", "ry", "\\u", "modifier_", "(_", "self_", ",_", "unary_", ",_", "ops", "tring_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unary_", "._", "element_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "+_", "ops", "tring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "util_", "._", "memoized", "\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "like", "\\u", "percent", "\\u", "literal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "elements_", "._", "literal", "\\u", "column_", "(_", "\"'", "%'", "\"_", ",_", "type\\u_", "=_", "sql", "types_", "._", "STRING", "TYPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "contain", "s", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binary_", "=_", "binary_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "self_", "._", "\\u", "like", "\\u", "percent", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "._", "right_", "=_", "percent_", "._", "\\u\\u", "add\\u\\u_", "(_", "binary_", "._", "right_", ")_", "._", "\\u\\u", "add\\u\\u_", "(_", "percent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "visit", "\\u", "like", "\\u", "op", "\\u", "binary_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "not", "contain", "s", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binary_", "=_", "binary_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "self_", "._", "\\u", "like", "\\u", "percent", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "._", "right_", "=_", "percent_", "._", "\\u\\u", "add\\u\\u_", "(_", "binary_", "._", "right_", ")_", "._", "\\u\\u", "add\\u\\u_", "(_", "percent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "visit", "\\u", "not", "like", "\\u", "op", "\\u", "binary_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "startswith", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binary_", "=_", "binary_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "self_", "._", "\\u", "like", "\\u", "percent", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "._", "right_", "=_", "percent_", "._", "\\u\\u", "rad", "d\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "right_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "visit", "\\u", "like", "\\u", "op", "\\u", "binary_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "not", "startswith", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binary_", "=_", "binary_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "self_", "._", "\\u", "like", "\\u", "percent", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "._", "right_", "=_", "percent_", "._", "\\u\\u", "rad", "d\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "right_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "visit", "\\u", "not", "like", "\\u", "op", "\\u", "binary_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "ends", "with", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binary_", "=_", "binary_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "self_", "._", "\\u", "like", "\\u", "percent", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "._", "right_", "=_", "percent_", "._", "\\u\\u", "add\\u\\u_", "(_", "binary_", "._", "right_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "visit", "\\u", "like", "\\u", "op", "\\u", "binary_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "note", "nd", "swi", "th", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binary_", "=_", "binary_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent_", "=_", "self_", "._", "\\u", "like", "\\u", "percent", "\\u", "literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binary_", "._", "right_", "=_", "percent_", "._", "\\u\\u", "add\\u\\u_", "(_", "binary_", "._", "right_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "visit", "\\u", "not", "like", "\\u", "op", "\\u", "binary_", "(_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "like", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "escape_", "=_", "binary_", "._", "modifiers_", "._", "get_", "(_", "\"", "escape", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "use", " ", "tern", "ary", " ", "here", ",", " ", "not", " ", "\"", "and", "\"/", " ", "\"", "or", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'%", "s", " ", "LI", "KE", " ", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "left_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "right_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ")_", "+_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "ESCAPE", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "render", "\\u", "literal", "\\u", "value_", "(_", "escape_", ",_", "sql", "types_", "._", "STRING", "TYPE_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "escape_", "else_", "''_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "not", "like", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "escape_", "=_", "binary_", "._", "modifiers_", "._", "get_", "(_", "\"", "escape", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'%", "s", " ", "NOT", " ", "LI", "KE", " ", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "left_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "right_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ")_", "+_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "ESCAPE", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "render", "\\u", "literal", "\\u", "value_", "(_", "escape_", ",_", "sql", "types_", "._", "STRING", "TYPE_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "escape_", "else_", "''_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "ili", "ke", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "escape_", "=_", "binary_", "._", "modifiers_", "._", "get_", "(_", "\"", "escape", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", "lower", "(%", "s", ")", " ", "LI", "KE", " ", "lower", "(%", "s", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "left_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "right_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ")_", "+_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "ESCAPE", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "render", "\\u", "literal", "\\u", "value_", "(_", "escape_", ",_", "sql", "types_", "._", "STRING", "TYPE_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "escape_", "else_", "''_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "noti", "like", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "escape_", "=_", "binary_", "._", "modifiers_", "._", "get_", "(_", "\"", "escape", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", "lower", "(%", "s", ")", " ", "NOT", " ", "LI", "KE", " ", "lower", "(%", "s", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "left_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", "._", "right_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", ")_", "+_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", "ESCAPE", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "render", "\\u", "literal", "\\u", "value_", "(_", "escape_", ",_", "sql", "types_", "._", "STRING", "TYPE_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "escape_", "else_", "''_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "bet", "ween", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "symmetric", "_", "=_", "binary_", "._", "modifiers_", "._", "get_", "(_", "\"", "symmetric", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "binary_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", ",_", "\"", " ", "BETWEEN", " ", "SYM", "METRIC", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "symmetric", "_", "else_", "\"", " ", "BETWEEN", " ", "\"_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "not", "bet", "ween", "\\u", "op", "\\u", "binary_", "(_", "self_", ",_", "binary_", ",_", "operator_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "symmetric", "_", "=_", "binary_", "._", "modifiers_", "._", "get_", "(_", "\"", "symmetric", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "generat", "e\\u", "gener", "ic", "\\u", "binary_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "binary_", ",_", "\"", " ", "NOT", " ", "BETWEEN", " ", "SYM", "METRIC", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "symmetric", "_", "else_", "\"", " ", "NOT", " ", "BETWEEN", " ", "\"_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "bind", "param_", "(_", "self_", ",_", "bind", "param_", ",_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "literal", "\\u", "binds_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "\\u", "bind", "\\u", "expression_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "skip", "\\u", "bind", "\\u", "expression_", "and_", "bind", "param_", "._", "type_", "._", "\\u", "has", "\\u", "bind", "\\u", "expression_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bind", "\\u", "expression_", "=_", "bind", "param_", "._", "type_", "._", "bind", "\\u", "expression_", "(_", "bind", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "process_", "(_", "bind", "\\u", "expression_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "skip", "\\u", "bind", "\\u", "expression_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "literal", "\\u", "binds_", "or_", "(_", "within", "\\u", "column", "s", "\\u", "clause_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ansi", "\\u", "bind", "\\u", "rules_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bind", "param_", "._", "value_", "is_", "None_", "and_", "bind", "param_", "._", "callable_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\"", "Bind", " ", "parameter", " ", "'%", "s", "'", " ", "with", "out", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "render", "able", " ", "value", " ", "not", " ", "allow", "ed", " ", "here", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "bind", "param_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "render", "\\u", "literal", "\\u", "bind", "param_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bind", "param_", ",_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "True_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "self_", "._", "\\u", "truncat", "e\\u", "bind", "param_", "(_", "bind", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "in_", "self_", "._", "binds_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "existing_", "=_", "self_", "._", "binds_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "existing_", "is_", "not_", "bind", "param_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "existing_", "._", "unique_", "or_", "bind", "param_", "._", "unique_", ")_", "and_", "not_", "existing_", "._", "proxy", "\\u", "set_", "._", "intersection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "bind", "param_", "._", "proxy", "\\u", "set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Bind", " ", "parameter", " ", "'%", "s", "'", " ", "confl", "icts", " ", "with", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unique", " ", "bind", " ", "parameter", " ", "of", " ", "the", " ", "same", " ", "name", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "bind", "param_", "._", "key_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "existing_", "._", "\\u", "is", "\\u", "crud", "_", "or_", "bind", "param_", "._", "\\u", "is", "\\u", "crud", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bind", "param", "()", " ", "name", " ", "'%", "s", "'", " ", "is", " ", "reserve", "d", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "for", " ", "automati", "c", " ", "usage", " ", "in", " ", "the", " ", "VALU", "ES", " ", "or", " ", "SET", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "clause", " ", "of", " ", "this", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "insert", "/", "update", " ", "statem", "ent", ".", " ", " ", " ", "Ple", "ase", " ", "use", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", " ", "other", " ", "than", " ", "column", " ", "name", " ", "whe", "n", " ", "usi", "ng", " ", "bind", "param", "()", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "with", " ", "insert", "()", " ", "or", " ", "update", "()", " ", "(", "for", " ", "example", ",", " ", "'", "b", "\\u", "%", "s", "')", ".\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "bind", "param_", "._", "key_", ",_", "bind", "param_", "._", "key_", ")_", "\\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_", "self_", "._", "binds_", "[_", "bind", "param_", "._", "key_", "]_", "=_", "self_", "._", "binds_", "[_", "name_", "]_", "=_", "bind", "param_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "bind", "param", "\\u", "string_", "(_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render", "\\u", "literal", "\\u", "bind", "param_", "(_", "self_", ",_", "bind", "param_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "bind", "param_", "._", "effective", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "render", "\\u", "literal", "\\u", "value_", "(_", "value_", ",_", "bind", "param_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render", "\\u", "literal", "\\u", "value_", "(_", "self_", ",_", "value_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Render", " ", "the", " ", "value", " ", "of", " ", "a", " ", "bind", " ", "parameter", " ", "as", " ", "a", " ", "quoted", " ", "literal", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "for", " ", "statem", "ent", " ", "section", "s", " ", "tha", "t", " ", "do", " ", "not", " ", "accept", " ", "bind", " ", "parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "the", " ", "target", " ", "driver", "/", "databa", "se", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "shou", "ld", " ", "be", " ", "implemented", " ", "by", " ", "subclasses", " ", "usi", "ng", " ", "the", " ", "quoting", " ", "service", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "DBA", "PI", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "processor_", "=_", "type\\u_", "._", "\\u", "cache", "d\\u", "literal", "\\u", "processor_", "(_", "self_", "._", "dialect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "processor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "processor_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Don", "'", "t", " ", "know", " ", "how", " ", "to", " ", "literal", "-", "quote", " ", "value", " ", "%", "r", "\"_", "%_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\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", "truncat", "e\\u", "bind", "param_", "(_", "self_", ",_", "bind", "param_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bind", "param_", "in_", "self_", "._", "bind", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "bind", "\\u", "names_", "[_", "bind", "param_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bind", "\\u", "name_", "=_", "bind", "param_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "bind", "\\u", "name_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bind", "\\u", "name_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\"", "bind", "param", "\"_", ",_", "bind", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "to", " ", "bind", "\\u", "names", " ", "for", " ", "translation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "bind", "\\u", "names_", "[_", "bind", "param_", "]_", "=_", "bind", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "bind", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "self_", ",_", "ident", "\\u", "class_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "ident", "\\u", "class_", ",_", "name_", ")_", "in_", "self_", "._", "truncat", "ed", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "truncat", "ed", "\\u", "names_", "[_", "(_", "ident", "\\u", "class_", ",_", "name_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "anon", "name_", "=_", "name_", "._", "appl", "y", "\\u", "map_", "(_", "self_", "._", "anon", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "anon", "name_", ")_", ">_", "self_", "._", "label", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counter_", "=_", "self_", "._", "truncat", "ed", "\\u", "names_", "._", "get_", "(_", "ident", "\\u", "class_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trunc", "name_", "=_", "anon", "name_", "[_", "0_", ":_", "max_", "(_", "self_", "._", "label", "\\u", "length_", "-_", "6_", ",_", "0_", ")_", "]_", "+_", "\"\\u\"_", "+_", "hex_", "(_", "counter_", ")_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "truncat", "ed", "\\u", "names_", "[_", "ident", "\\u", "class_", "]_", "=_", "counter_", "+_", "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 ", " _", "trunc", "name_", "=_", "anon", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "truncat", "ed", "\\u", "names_", "[_", "(_", "ident", "\\u", "class_", ",_", "name_", ")_", "]_", "=_", "trunc", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "trunc", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "anonym", "ize_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "name_", "%_", "self_", "._", "anon", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "process", "\\u", "anon", "_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "ident_", ",_", "derive", "d_", ")_", "=_", "key_", "._", "split_", "(_", "'", " ", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anonym", "ous", "\\u", "counter_", "=_", "self_", "._", "anon", "\\u", "map_", "._", "get_", "(_", "derive", "d_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "anon", "\\u", "map_", "[_", "derive", "d_", "]_", "=_", "anonym", "ous", "\\u", "counter_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "derive", "d_", "+_", "\"\\u\"_", "+_", "str_", "(_", "anonym", "ous", "\\u", "counter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bind", "param", "\\u", "string_", "(_", "self_", ",_", "name_", ",_", "positional", "\\u", "names_", "=_", "None_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "positional", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "positional", "\\u", "names_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "positional", "\\u", "names_", "._", "append_", "(_", "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 ", " _", "self_", "._", "position", "tup_", "._", "append_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "bind", "template_", "%_", "{_", "'", "name", "'_", ":_", "name_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "cte", "_", "(_", "self_", ",_", "cte", "_", ",_", "asf", "rom_", "=_", "False_", ",_", "ash", "int_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "init", "\\u", "cte", "\\u", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "cte", "_", "._", "name_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cte", "\\u", "name_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\"", "alias", "\"_", ",_", "cte", "_", "._", "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 ", " _", "cte", "\\u", "name_", "=_", "cte", "_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cte", "\\u", "name_", "in_", "self_", "._", "cte", "s", "\\u", "by", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exist", "ing", "\\u", "cte", "_", "=_", "self_", "._", "cte", "s", "\\u", "by", "\\u", "name_", "[_", "cte", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", "'", "ve", " ", "generat", "ed", " ", "a", " ", "same", "-", "named", " ", "CT", "E", " ", "tha", "t", " ", "we", " ", "are", " ", "enclose", "d", " ", "in", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "this", " ", "is", " ", "the", " ", "same", " ", "CT", "E", ".", " ", " ", "just", " ", "return", " ", "the", " ", "name", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cte", "_", "in_", "exist", "ing", "\\u", "cte", "_", "._", "\\u", "resta", "tes_", "or_", "cte", "_", "is_", "exist", "ing", "\\u", "cte", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "prepar", "er_", "._", "format\\u", "alias_", "(_", "cte", "_", ",_", "cte", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "exist", "ing", "\\u", "cte", "_", "in_", "cte", "_", "._", "\\u", "resta", "tes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", "'", "ve", " ", "generat", "ed", " ", "a", " ", "same", "-", "named", " ", "CT", "E", " ", "tha", "t", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "enclose", "d", " ", "in", " ", "us", " ", "-", " ", "we", " ", "take", " ", "preceden", "ce", ",", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "discard", " ", "the", " ", "text", " ", "for", " ", "the", " ", "\"", "inner", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "cte", "s_", "[_", "exist", "ing", "\\u", "cte", "_", "]_", "\\u\\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_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Multipl", "e", ",", " ", "unre", "late", "d", " ", "CT", "Es", " ", "found", " ", "with", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", " ", "same", " ", "name", ":", " ", "%", "r", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "cte", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "cte", "s", "\\u", "by", "\\u", "name_", "[_", "cte", "\\u", "name_", "]_", "=_", "cte", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cte", "_", "._", "\\u", "cte", "\\u", "alias_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "orig", "\\u", "cte", "_", "=_", "cte", "_", "._", "\\u", "cte", "\\u", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "orig", "\\u", "cte", "_", "not_", "in_", "self_", "._", "cte", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "visit", "\\u", "cte", "_", "(_", "orig", "\\u", "cte", "_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cte", "\\u", "alias", "\\u", "name_", "=_", "cte", "_", "._", "\\u", "cte", "\\u", "alias_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "cte", "\\u", "alias", "\\u", "name_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cte", "\\u", "alias", "\\u", "name_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "alias", "\"_", ",_", "cte", "\\u", "alias", "\\u", "name_", ")_", "\\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 ", " _", "orig", "\\u", "cte", "_", "=_", "cte", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cte", "\\u", "alias", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "cte", "\\u", "alias", "\\u", "name_", "and_", "cte", "_", "not_", "in_", "self_", "._", "cte", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cte", "_", "._", "recursive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cte", "s", "\\u", "recursive_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "alias_", "(_", "cte", "_", ",_", "cte", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cte", "_", "._", "recursive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "cte", "_", "._", "original_", ",_", "selectable", "_", "._", "Select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "col", "\\u", "source_", "=_", "cte", "_", "._", "original_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "cte", "_", "._", "original_", ",_", "selectable", "_", "._", "Compo", "und", "Select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "col", "\\u", "source_", "=_", "cte", "_", "._", "original_", "._", "select", "s_", "[_", "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 ", " ", "_", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "recu", "r", "\\u", "cols_", "=_", "[_", "c_", "for_", "c_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "util_", "._", "unique", "\\u", "list_", "(_", "col", "\\u", "source_", "._", "inner", "\\u", "columns_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "c_", "is_", "not_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "+=_", "\"(", "%", "s", ")\"_", "%_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prepar", "er_", "._", "format\\u", "column_", "(_", "ident_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ident_", "in_", "recu", "r", "\\u", "cols_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "positional", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "positional", "\\u", "names", "'_", "]_", "=_", "self_", "._", "cte", "\\u", "positional", "_", "[_", "cte", "_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", " ", "AS", " ", "\\\\", "n", "\"_", "+_", "cte", "_", "._", "original_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "**_", "kwargs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cte", "s_", "[_", "cte", "_", "]_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "asf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cte", "\\u", "alias", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "alias_", "(_", "cte", "_", ",_", "cte", "\\u", "alias", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "\"", " ", "AS", " ", "\"_", "+_", "cte", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "prepar", "er_", "._", "format\\u", "alias_", "(_", "cte", "_", ",_", "cte", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "alias_", "(_", "self_", ",_", "alias_", ",_", "asf", "rom_", "=_", "False_", ",_", "ash", "int_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "isc", "ru", "d_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "asf", "rom_", "or_", "ash", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "alias_", "._", "name_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alias", "\\u", "name_", "=_", "self_", "._", "\\u", "truncat", "ed", "\\u", "identifier_", "(_", "\"", "alias", "\"_", ",_", "alias_", "._", "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 ", " _", "alias", "\\u", "name_", "=_", "alias_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ash", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "prepar", "er_", "._", "format\\u", "alias_", "(_", "alias_", ",_", "alias", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "asf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "alias_", "._", "original_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "asf", "rom_", "=_", "True_", ",_", "**_", "kwargs_", ")_", "+_", "\"", " ", "AS", " ", "\"_", "+_", "self_", "._", "prepar", "er_", "._", "format\\u", "alias_", "(_", "alias_", ",_", "alias", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "from", "hints_", "and_", "alias_", "in_", "from", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "format\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "ret_", ",_", "alias_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "[_", "alias_", "]_", ",_", "isc", "ru", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "alias_", "._", "original_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\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", "to", "\\u", "result", "\\u", "map_", "(_", "self_", ",_", "keyname_", ",_", "name_", ",_", "objects_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "dialect_", "._", "case", "\\u", "sensitive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyname_", "=_", "keyname_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "keyname_", "in_", "self_", "._", "result", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "conflicting", " ", "keyn", "ame", ",", " ", "just", " ", "double", " ", "up", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "object", "s", ".", " ", " ", "this", " ", "will", " ", "caus", "e", " ", "an", " ", "\"", "ambiguous", " ", "name", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "error", " ", "if", " ", "an", " ", "atte", "mpt", " ", "is", " ", "made", " ", "by", " ", "the", " ", "result", " ", "set", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "access", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e\\u", "name_", ",_", "e\\u", "obj_", ",_", "e\\u", "type_", "=_", "self_", "._", "result", "\\u", "map_", "[_", "keyname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "result", "\\u", "map_", "[_", "keyname_", "]_", "=_", "e\\u", "name_", ",_", "e\\u", "obj_", "+_", "objects_", ",_", "e\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "result", "\\u", "map_", "[_", "keyname_", "]_", "=_", "name_", ",_", "objects_", ",_", "type\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\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", "label", "\\u", "select", "\\u", "column_", "(_", "self_", ",_", "select_", ",_", "column_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "populate", "\\u", "result", "\\u", "map_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "asf", "rom_", ",_", "column", "\\u", "clause", "\\u", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "produce", " ", "label", "ed", " ", "column", "s", " ", "presen", "t", " ", "in", " ", "a", " ", "select", "().\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "column_", "._", "type_", "._", "\\u", "has", "\\u", "column", "\\u", "expression_", "and_", "populate", "\\u", "result", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "\\u", "expr_", "=_", "column_", "._", "type_", "._", "column", "\\u", "expression_", "(_", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "lambda_", "keyname_", ",_", "name_", ",_", "objects_", ",_", "type\\u_", ":_", "self_", "._", "\\u", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "keyname_", ",_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "objects_", "+_", "(_", "column_", ",_", ")_", ",_", "type\\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 ", " _", "col", "\\u", "expr_", "=_", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "populate", "\\u", "result", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "self_", "._", "\\u", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "within", "\\u", "column", "s", "\\u", "clause_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "col", "\\u", "expr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "column_", ",_", "elements_", "._", "Label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "col", "\\u", "expr_", "is_", "not_", "column_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "\\u", "Compil", "e", "Label_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "col", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "column_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alt", "\\u", "names_", "=_", "(_", "column_", "._", "element_", ",_", ")_", "\\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 ", " _", "result", "\\u", "expr_", "=_", "col", "\\u", "expr_", "\\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_", "select_", "is_", "not_", "None_", "and_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "\\u", "Compil", "e", "Label_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "col", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alt", "\\u", "names_", "=_", "(_", "column_", "._", "\\u", "key", "\\u", "label_", ",_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "asf", "rom_", "and_", "isinstance_", "(_", "column_", ",_", "elements_", "._", "Colum", "n", "Clause_", ")_", "and_", "not_", "column_", "._", "is", "\\u", "literal_", "and_", "column_", "._", "table_", "is_", "not_", "None_", "and_", "not_", "isinstance_", "(_", "column_", "._", "table_", ",_", "selectable", "_", "._", "Select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "\\u", "Compil", "e", "Label_", "(_", "col", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "elements_", "._", "\\u", "as", "\\u", "truncat", "ed_", "(_", "column_", "._", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alt", "\\u", "names_", "=_", "(_", "column_", "._", "key_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "isinstance_", "(_", "column_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "elements_", "._", "Una", "ry", "Expression_", ",_", "elements_", "._", "Text", "Clause_", ")_", ")_", "and_", "(_", "not_", "hasattr_", "(_", "column_", ",_", "'", "name", "'_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "column_", ",_", "functions_", "._", "Function_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "\\u", "Compil", "e", "Label_", "(_", "col", "\\u", "expr_", ",_", "column_", "._", "anon", "\\u", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "col", "\\u", "expr_", "is_", "not_", "column_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "are", " ", "we", " ", "sure", " ", "\"", "column", "\"", " ", "has", " ", "a", " ", ".", "name", " ", "and", " ", ".", "key", " ", "here", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assert", " ", "isin", "stance", "(", "column", ",", " ", "element", "s", ".", "Colum", "n", "Cla", "use", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "\\u", "Compil", "e", "Label_", "(_", "col", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "elements_", "._", "\\u", "as", "\\u", "truncat", "ed_", "(_", "column_", "._", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alt", "\\u", "names_", "=_", "(_", "column_", "._", "key_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "\\u", "expr_", "=_", "col", "\\u", "expr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "column", "\\u", "clause", "\\u", "args_", "._", "update_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "within", "\\u", "column", "s", "\\u", "clause_", "=_", "within", "\\u", "column", "s", "\\u", "clause_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "=_", "add", "\\u", "to", "\\u", "result", "\\u", "map_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result", "\\u", "expr_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "column", "\\u", "clause", "\\u", "args_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "self_", ",_", "sql", "text_", ",_", "table_", ",_", "hint_", ",_", "isc", "ru", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hin", "ttext", "_", "=_", "self_", "._", "get", "\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "table_", ",_", "hint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hin", "ttext", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql", "text_", "+=_", "\"", " ", "\"_", "+_", "hin", "ttext", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sql", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "select", "\\u", "hin", "t", "\\u", "text_", "(_", "self_", ",_", "by", "froms", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "self_", ",_", "table_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "crud", "\\u", "hin", "t", "\\u", "text_", "(_", "self_", ",_", "table_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "transform", "\\u", "select", "\\u", "for", "\\u", "nest", "ed", "\\u", "joins", "_", "(_", "self_", ",_", "select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Rewrite", " ", "any", " ", "\"", "a", " ", "JOIN", " ", "(", "b", " ", "JOIN", " ", "c", ")\"", " ", "express", "ion", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "\"", "a", " ", "JOIN", " ", "(", "select", " ", "*", " ", "from", " ", "b", " ", "JOIN", " ", "c", ")", " ", "AS", " ", "anon", "\",", " ", "to", " ", "support", "\\", "10", ";", " ", " ", " ", " ", "databa", "ses", " ", "tha", "t", " ", "can", "'", "t", " ", "parse", " ", "a", " ", "parenthes", "ize", "d", " ", "join", " ", "correct", "ly", "\\", "10", ";", " ", " ", " ", " ", "(", "i", ".", "e", ".", " ", "sql", "ite", " ", "the", " ", "main", " ", "one", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cloned", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "\\u", "translate_", "=_", "[_", "{_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "visit_", "(_", "element_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "in_", "column", "\\u", "translate_", "[_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "column", "\\u", "translate_", "[_", "-_", "1_", "]_", "[_", "element_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "element_", "in_", "cloned", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cloned", "_", "[_", "element_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newe", "lem", "_", "=_", "cloned", "_", "[_", "element_", "]_", "=_", "element_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "newe", "lem", "_", "._", "is", "\\u", "selectable", "_", "and_", "newe", "lem", "_", "._", "\\u", "is", "\\u", "join_", "and_", "isinstance_", "(_", "newe", "lem", "_", "._", "right_", ",_", "selectable", "_", "._", "Fro", "m", "Group", "ing_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newe", "lem", "_", "._", "\\u", "reset", "\\u", "exported", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newe", "lem", "_", "._", "left_", "=_", "visit_", "(_", "newe", "lem", "_", "._", "left_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "right_", "=_", "visit_", "(_", "newe", "lem", "_", "._", "right_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "selectable", "\\u_", "=_", "selectable", "_", "._", "Select_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "right_", "._", "element_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "labels_", "=_", "True_", ")_", "._", "alias_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "selectable", "\\u_", "._", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "c_", "._", "\\u", "key", "\\u", "label_", "=_", "c_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "\\u", "label_", "=_", "c_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "translat", "e\\u", "dict_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "zip_", "(_", "newe", "lem", "_", "._", "right_", "._", "element_", "._", "c_", ",_", "selectable", "\\u_", "._", "c_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "translat", "ing", " ", "from", " ", "bot", "h", " ", "the", " ", "old", " ", "and", " ", "the", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "different", " ", "select", "()", " ", "structure", "s", " ", "will", " ", "lead", " ", "us_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "traverse", " ", "different", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "translat", "e\\u", "dict_", "[_", "right_", "._", "element_", "._", "left_", "]_", "=_", "selectable", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translat", "e\\u", "dict_", "[_", "right_", "._", "element_", "._", "right_", "]_", "=_", "selectable", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translat", "e\\u", "dict_", "[_", "newe", "lem", "_", "._", "right_", "._", "element_", "._", "left_", "]_", "=_", "selectable", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translat", "e\\u", "dict_", "[_", "newe", "lem", "_", "._", "right_", "._", "element_", "._", "right_", "]_", "=_", "selectable", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "propagate", " ", "translatio", "ns", " ", "tha", "t", " ", "we", "'", "ve", " ", "gain", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "nest", "ed", " ", "visit", "(", "newe", "lem", ".", "right", ")", " ", "out", "ward", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "encl", "osin", "g", " ", "select", " ", "here", ".", " ", " ", "this", " ", "happ", "ens_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "only", " ", "whe", "n", " ", "we", " ", "have", " ", "more", " ", "than", " ", "one", " ", "level", " ", "of", " ", "right_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "join", " ", "nesting", ",", " ", "i", ".", "e", ".", " ", "\"", "a", " ", "JOIN", " ", "(", "b", " ", "JOIN", " ", "(", "c", " ", "JOIN", " ", "d", "))\"_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "list_", "(_", "column", "\\u", "translate_", "[_", "-_", "1_", "]_", "._", "items_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "v_", "in_", "translat", "e\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remark", "abl", "y", ",", " ", "no", " ", "current", " ", "ORM", " ", "tests", " ", "(", "Ma", "y", " ", "2013", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hit", " ", "this", " ", "condition", ",", " ", "only", " ", "test\\u", "join", "\\u", "rew", "riti", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "column", "\\u", "translate_", "[_", "-_", "1_", "]_", "[_", "k_", "]_", "=_", "translat", "e\\u", "dict_", "[_", "v_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "column", "\\u", "translate_", "[_", "-_", "1_", "]_", "._", "update_", "(_", "translat", "e\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newe", "lem", "_", "._", "right_", "=_", "selectable", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "newe", "lem", "_", "._", "onc", "lau", "se_", "=_", "visit_", "(_", "newe", "lem", "_", "._", "onc", "lau", "se_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "newe", "lem", "_", "._", "\\u", "is", "\\u", "from", "\\u", "container_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "hit", " ", "an", " ", "Ali", "as", ",", " ", "Compo", "und", "Select", " ", "or", " ", "Scala", "r", "Select", ",", " ", "put", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "marker", " ", "in", " ", "the", " ", "stack", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kw_", "[_", "'", "transform", "\\u", "clue", "'_", "]_", "=_", "'", "select", "\\u", "container", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newe", "lem", "_", "._", "\\u", "copy", "\\u", "internals", "_", "(_", "clone_", "=_", "visit_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "newe", "lem", "_", "._", "is", "\\u", "selectable", "_", "and_", "newe", "lem", "_", "._", "\\u", "is", "\\u", "select_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "barrier", "\\u", "select_", "=_", "kw_", "._", "get_", "(_", "'", "transform", "\\u", "clue", "'_", ",_", "None_", ")_", "==_", "'", "select", "\\u", "container", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", "'", "re", " ", "still", " ", "descend", "ed", " ", "from", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ali", "as", "/", "Compo", "und", "Select", "/", "Scala", "r", "Select", ",", " ", "we", "'", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "a", " ", "FROM", " ", "clause", ",", " ", "so", " ", "start", " ", "with", " ", "a", " ", "new", " ", "translat", "e", " ", "collection_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "barrier", "\\u", "select_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "column", "\\u", "translate_", "._", "append_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kw_", "[_", "'", "transform", "\\u", "clue", "'_", "]_", "=_", "'", "insi", "de", "\\u", "select", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newe", "lem", "_", "._", "\\u", "copy", "\\u", "internals", "_", "(_", "clone_", "=_", "visit_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "barrier", "\\u", "select_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "del_", "column", "\\u", "translate_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "newe", "lem", "_", "._", "\\u", "copy", "\\u", "internals", "_", "(_", "clone_", "=_", "visit_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "newe", "lem", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "visit_", "(_", "select_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "transform", "\\u", "result", "\\u", "map", "\\u", "for", "\\u", "nest", "ed", "\\u", "joins", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "select_", ",_", "transforme", "d\\u", "select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inner", "\\u", "col_", "=_", "dict_", "(_", "(_", "c_", "._", "\\u", "key", "\\u", "label_", ",_", "c_", ")_", "for_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "in_", "transforme", "d\\u", "select_", "._", "inner", "\\u", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "inner", "\\u", "col_", "[_", "c_", "._", "\\u", "key", "\\u", "label_", "]_", ",_", "c_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "select_", "._", "inner", "\\u", "columns_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "(_", "name_", ",_", "objs_", ",_", "typ_", ")_", "in_", "list_", "(_", "self_", "._", "result", "\\u", "map_", "._", "items_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "objs_", "=_", "tuple_", "(_", "[_", "d_", "._", "get_", "(_", "col_", ",_", "col_", ")_", "for_", "col_", "in_", "objs_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "result", "\\u", "map_", "[_", "key_", "]_", "=_", "(_", "name_", ",_", "objs_", ",_", "typ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "display", "\\u", "froms", "\\u", "for", "\\u", "select_", "(_", "self_", ",_", "select_", ",_", "asf", "rom_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "utility", " ", "method", " ", "to", " ", "help", " ", "external", " ", "dialect", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "correct", " ", "from", " ", "list", " ", "for", " ", "a", " ", "select", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specifica", "ll", "y", " ", "the", " ", "oracle", " ", "dialect", " ", "need", "s", " ", "this", " ", "feature_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "right", " ", "now", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "toplevel_", "=_", "not_", "self_", "._", "stack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entry_", "=_", "self_", "._", "\\u", "default", "\\u", "stack", "\\u", "entry_", "if_", "toplevel_", "else_", "self_", "._", "stack_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "correlate", "\\u", "froms", "_", "=_", "entry_", "[_", "'", "correlate", "\\u", "froms", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "asf", "rom", "\\u", "froms", "_", "=_", "entry_", "[_", "'", "asf", "rom", "\\u", "froms", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "asf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "froms", "_", "=_", "select_", "._", "\\u", "get", "\\u", "display", "\\u", "froms", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "explicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "correlate", "\\u", "froms", "_", "._", "difference_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "asf", "rom", "\\u", "froms", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "froms", "_", "=_", "select_", "._", "\\u", "get", "\\u", "display", "\\u", "froms", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "explicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "correlate", "\\u", "froms", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "asf", "rom", "\\u", "froms", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "froms", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "select_", "(_", "self_", ",_", "select_", ",_", "asf", "rom_", "=_", "False_", ",_", "paren", "s_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "wrapper_", "=_", "False_", ",_", "from", "hints_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "index_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "result", "\\u", "map_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nest", "ed", "\\u", "join", "\\u", "translation_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "need", "s", "\\u", "nest", "ed", "\\u", "translation_", "=_", "select_", "._", "use", "\\u", "labels_", "and_", "not_", "nest", "ed", "\\u", "join", "\\u", "translation_", "and_", "not_", "self_", "._", "stack_", "and_", "not_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "right", "\\u", "nest", "ed", "\\u", "joins", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "need", "s", "\\u", "nest", "ed", "\\u", "translation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transforme", "d\\u", "select_", "=_", "self_", "._", "\\u", "transform", "\\u", "select", "\\u", "for", "\\u", "nest", "ed", "\\u", "joins", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "select_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "self_", "._", "visit", "\\u", "select_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "transforme", "d\\u", "select_", ",_", "asf", "rom_", "=_", "asf", "rom_", ",_", "paren", "s_", "=_", "paren", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "wrapper_", "=_", "is", "wrapper_", ",_", "from", "hints_", "=_", "from", "hints_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "index_", "=_", "compo", "und", "\\u", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "result", "\\u", "map_", "=_", "force", "\\u", "result", "\\u", "map_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nest", "ed", "\\u", "join", "\\u", "translation_", "=_", "True_", ",_", "**_", "kwargs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "toplevel_", "=_", "not_", "self_", "._", "stack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entry_", "=_", "self_", "._", "\\u", "default", "\\u", "stack", "\\u", "entry_", "if_", "toplevel_", "else_", "self_", "._", "stack_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "populate", "\\u", "result", "\\u", "map_", "=_", "force", "\\u", "result", "\\u", "map_", "or_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "compo", "und", "\\u", "index_", "==_", "0_", "and_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "toplevel_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "entry_", "[_", "'", "is", "wrapp", "er", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "need", "s", "\\u", "nest", "ed", "\\u", "translation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "populate", "\\u", "result", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "transform", "\\u", "result", "\\u", "map", "\\u", "for", "\\u", "nest", "ed", "\\u", "joins", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "select_", ",_", "transforme", "d\\u", "select_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "correlate", "\\u", "froms", "_", "=_", "entry_", "[_", "'", "correlate", "\\u", "froms", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "asf", "rom", "\\u", "froms", "_", "=_", "entry_", "[_", "'", "asf", "rom", "\\u", "froms", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "asf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "froms", "_", "=_", "select_", "._", "\\u", "get", "\\u", "display", "\\u", "froms", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "explicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "correlate", "\\u", "froms", "_", "._", "difference_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "asf", "rom", "\\u", "froms", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "froms", "_", "=_", "select_", "._", "\\u", "get", "\\u", "display", "\\u", "froms", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "explicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "correlate", "\\u", "froms", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "correlate", "\\u", "froms", "_", "=_", "asf", "rom", "\\u", "froms", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "correlate", "\\u", "froms", "_", "=_", "set_", "(_", "selectable", "_", "._", "\\u", "from", "\\u", "objects_", "(_", "*_", "froms", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "correlate", "\\u", "froms", "_", "=_", "new", "\\u", "correlate", "\\u", "froms", "_", "._", "union_", "(_", "correlate", "\\u", "froms", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "entry_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "asf", "rom", "\\u", "froms", "'_", ":_", "new", "\\u", "correlate", "\\u", "froms", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "wrapp", "er", "'_", ":_", "is", "wrapper_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "correlate", "\\u", "froms", "'_", ":_", "all", "\\u", "correlate", "\\u", "froms", "_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stack_", "._", "append_", "(_", "new", "\\u", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "column", "\\u", "clause", "\\u", "args_", "=_", "kwargs_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column", "\\u", "clause", "\\u", "args_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "within", "\\u", "label", "\\u", "clause", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "within", "\\u", "column", "s", "\\u", "clause", "'_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "\"", "SELECT", " ", "\"_", "#", " ", "we", "'", "re", " ", "off", " ", "to", " ", "a", " ", "good", " ", "start", " ", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "select_", "._", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "by", "from_", "=_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "from\\u_", ",_", "hin", "ttext", "_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "from\\u_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "ash", "int_", "=_", "True_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "from\\u_", ",_", "dialect_", ")_", ",_", "hin", "ttext", "_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "select_", "._", "\\u", "hints_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dialect_", "in_", "(_", "'*'_", ",_", "self_", "._", "dialect_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hin", "t", "\\u", "text_", "=_", "self_", "._", "get", "\\u", "select", "\\u", "hin", "t", "\\u", "text_", "(_", "by", "from_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hin", "t", "\\u", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "hin", "t", "\\u", "text_", "+_", "\"", " ", "\"_", "\\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_", "select_", "._", "\\u", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "self_", "._", "\\u", "generat", "e\\u", "prefixes_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "select_", ",_", "select_", "._", "\\u", "prefixes_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "self_", "._", "get", "\\u", "select", "\\u", "prec", "olu", "mn", "s_", "(_", "select_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "actual", " ", "list", " ", "of", " ", "column", "s", " ", "to", " ", "print", " ", "in", " ", "the", " ", "SELECT", " ", "column", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "inner", "\\u", "columns_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "for_", "c_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "label", "\\u", "select", "\\u", "column_", "(_", "select_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "column_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "populate", "\\u", "result", "\\u", "map_", ",_", "asf", "rom_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "column", "\\u", "clause", "\\u", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", ",_", "column_", "in_", "select_", "._", "\\u", "column", "s", "\\u", "plus", "\\u", "names_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "c_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "+=_", "',", " ", "'_", "._", "join_", "(_", "inner", "\\u", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "froms", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\\\\", "n", "FROM", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "select_", "._", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "',", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "f_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "=_", "by", "from_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "f_", "in_", "froms", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "',", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "f_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "f_", "in_", "froms", "_", "]_", ")_", "\\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 ", " _", "text_", "+=_", "self_", "._", "default", "\\u", "from_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "select_", "._", "\\u", "where", "clause_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "select_", "._", "\\u", "where", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\\\\", "n", "WHE", "RE", " ", "\"_", "+_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "select_", "._", "\\u", "group", "\\u", "by", "\\u", "clause_", "._", "clauses_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "by_", "=_", "select_", "._", "\\u", "group", "\\u", "by", "\\u", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "group", "\\u", "by_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "GROU", "P", " ", "BY", " ", "\"_", "+_", "group", "\\u", "by_", "\\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_", "select_", "._", "\\u", "hav", "ing_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "select_", "._", "\\u", "hav", "ing_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\\\\", "n", "HA", "VING", " ", "\"_", "+_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "select_", "._", "\\u", "order", "\\u", "by", "\\u", "clause_", "._", "clauses_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "simple", "\\u", "order", "\\u", "by", "\\u", "label_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "by", "\\u", "select_", "=_", "select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "by", "\\u", "select_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "self_", "._", "order", "\\u", "by", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "select_", ",_", "order", "\\u", "by", "\\u", "select_", "=_", "order", "\\u", "by", "\\u", "select_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "select_", "._", "\\u", "limit_", "is_", "not_", "None_", "or_", "select_", "._", "\\u", "offset_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "self_", "._", "limit", "\\u", "clause_", "(_", "select_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "select_", "._", "\\u", "for", "\\u", "update", "\\u", "arg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "self_", "._", "for", "\\u", "update", "\\u", "clause_", "(_", "select_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "cte", "s_", "and_", "compo", "und", "\\u", "index_", "==_", "0_", "and_", "toplevel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "\\u", "render", "\\u", "cte", "\\u", "clause_", "(_", ")_", "+_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stack_", "._", "pop_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "asf", "rom_", "and_", "paren", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"(\"_", "+_", "text_", "+_", "\")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\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", "generat", "e\\u", "prefixes_", "(_", "self_", ",_", "stmt_", ",_", "prefixes_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clause_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "prefix_", ",_", "dialect", "\\u", "name_", "in_", "prefixes_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dialect", "\\u", "name_", "is_", "None_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "dialect", "\\u", "name_", "==_", "self_", "._", "dialect_", "._", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "clause_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clause_", "+=_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "clause_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "render", "\\u", "cte", "\\u", "clause_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "positional", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "position", "tup_", "=_", "sum_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cte", "\\u", "positional", "_", "[_", "cte", "_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cte", "_", "in_", "self_", "._", "cte", "s_", "]_", ",_", "[_", "]_", ")_", "+_", "self_", "._", "position", "tup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cte", "\\u", "text_", "=_", "self_", "._", "get", "\\u", "cte", "\\u", "preamble_", "(_", "self_", "._", "cte", "s", "\\u", "recursive_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cte", "\\u", "text_", "+=_", "\",", " ", "\\\\", "n", "\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "txt_", "for_", "txt_", "in_", "self_", "._", "cte", "s_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cte", "\\u", "text_", "+=_", "\"\\\\", "n", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cte", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "cte", "\\u", "preamble_", "(_", "self_", ",_", "recursive_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "recursive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "WITH", " ", "REC", "URS", "IV", "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 ", " _", "return_", "\"", "WITH", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\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", "select", "\\u", "prec", "olu", "mn", "s_", "(_", "self_", ",_", "select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "whe", "n", " ", "buildi", "ng", " ", "a", " ", "``", "SELECT", "``", " ", "statem", "ent", ",", " ", "position", " ", "is", " ", "just", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "column", " ", "list", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "select_", "._", "\\u", "distinct_", "and_", "\"", "DIST", "INC", "T", " ", "\"_", "or_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "order", "\\u", "by", "\\u", "clause_", "(_", "self_", ",_", "select_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "by_", "=_", "select_", "._", "\\u", "order", "\\u", "by", "\\u", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "order", "\\u", "by_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", " ", "ORDE", "R", " ", "BY", " ", "\"_", "+_", "order", "\\u", "by_", "\\u\\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_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "for", "\\u", "update", "\\u", "clause_", "(_", "self_", ",_", "select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", " ", "FOR", " ", "UPDATE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "return", "ing", "\\u", "clause_", "(_", "self_", ",_", "stmt_", ",_", "return", "ing", "\\u", "cols_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "RETURN", "ING", " ", "is", " ", "not", " ", "support", "ed", " ", "by", " ", "this", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dialect", "'", "s", " ", "statem", "ent", " ", "compiler", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "limit", "\\u", "clause_", "(_", "self_", ",_", "select_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "select_", "._", "\\u", "limit_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"\\\\", "n", " ", "LIMIT", " ", "\"_", "+_", "self_", "._", "process_", "(_", "elements_", "._", "literal_", "(_", "select_", "._", "\\u", "limit_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "select_", "._", "\\u", "offset_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "select_", "._", "\\u", "limit_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"\\\\", "n", " ", "LIMIT", " ", "-1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", " ", "OFFSET", " ", "\"_", "+_", "self_", "._", "process_", "(_", "elements_", "._", "literal_", "(_", "select_", "._", "\\u", "offset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "table_", "(_", "self_", ",_", "table_", ",_", "asf", "rom_", "=_", "False_", ",_", "isc", "ru", "d_", "=_", "False_", ",_", "ash", "int_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "asf", "rom_", "or_", "ash", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "getattr_", "(_", "table_", ",_", "\"", "schema", "\"_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "prepar", "er_", "._", "quote", "\\u", "schema_", "(_", "table_", "._", "schema_", ")_", "+_", "\".\"_", "+_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "table_", "._", "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 ", " _", "ret_", "=_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "table_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "from", "hints_", "and_", "table_", "in_", "from", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "format\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "ret_", ",_", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "[_", "table_", "]_", ",_", "isc", "ru", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", "\\u\\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_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "join_", "(_", "self_", ",_", "join_", ",_", "asf", "rom_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "join_", "._", "left_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "**_", "kwargs_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "join_", "._", "iso", "uter", "_", "and_", "\"", " ", "LEF", "T", " ", "OUTE", "R", " ", "JOIN", " ", "\"_", "or_", "\"", " ", "JOIN", " ", "\"_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "join_", "._", "right_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "**_", "kwargs_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "ON", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "join_", "._", "onc", "lau", "se_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "insert_", "(_", "self_", ",_", "insert", "\\u", "stmt_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "isin", "ser", "t_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "params_", "=_", "self_", "._", "\\u", "get", "\\u", "col", "params_", "(_", "insert", "\\u", "stmt_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "col", "params_", "and_", "not_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "default", "\\u", "values_", "and_", "not_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "empty", "\\u", "insert_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\"", "The", " ", "'%", "s", "'", " ", "dialect", " ", "with", " ", "current", " ", "databa", "se", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", " ", "settings", " ", "doe", "s", " ", "not", " ", "support", " ", "empty", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "inserts", ".\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "insert", "\\u", "stmt_", "._", "\\u", "has", "\\u", "multi", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "multiv", "alues", "\\u", "insert_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "'%", "s", "'", " ", "dialect", " ", "with", " ", "current", " ", "databa", "se", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", " ", "settings", " ", "doe", "s", " ", "not", " ", "support", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "in", "-", "place", " ", "multi", "row", " ", "inserts", ".\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "col", "params", "\\u", "single_", "=_", "col", "params_", "[_", "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 ", " _", "col", "params", "\\u", "single_", "=_", "col", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prepar", "er_", "=_", "self_", "._", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "support", "s", "\\u", "default", "\\u", "values_", "=_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "default", "\\u", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "\"", "INSERT", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "insert", "\\u", "stmt_", "._", "\\u", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "self_", "._", "\\u", "generat", "e\\u", "prefixes_", "(_", "insert", "\\u", "stmt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "insert", "\\u", "stmt_", "._", "\\u", "prefixes_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "INT", "O", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "\\u", "text_", "=_", "prepar", "er_", "._", "format\\u", "table_", "(_", "insert", "\\u", "stmt_", "._", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "insert", "\\u", "stmt_", "._", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dialect", "\\u", "hints_", "=_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "table_", ",_", "hin", "t", "\\u", "text_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "table_", ",_", "dialect_", ")_", ",_", "hin", "t", "\\u", "text_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "insert", "\\u", "stmt_", "._", "\\u", "hints_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dialect_", "in_", "(_", "'*'_", ",_", "self_", "._", "dialect_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "insert", "\\u", "stmt_", "._", "table_", "in_", "dialect", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "text_", "=_", "self_", "._", "format\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "insert", "\\u", "stmt_", "._", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dialect", "\\u", "hints_", "[_", "insert", "\\u", "stmt_", "._", "table_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "table", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "col", "params", "\\u", "single_", "or_", "not_", "support", "s", "\\u", "default", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "(%", "s", ")\"_", "%_", "',", " ", "'_", "._", "join_", "(_", "[_", "prepar", "er_", "._", "format\\u", "column_", "(_", "c_", "[_", "0_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "col", "params", "\\u", "single_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "return", "ing_", "or_", "insert", "\\u", "stmt_", "._", "\\u", "return", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "return", "ing_", "=_", "self_", "._", "return", "ing_", "or_", "insert", "\\u", "stmt_", "._", "\\u", "return", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "ing", "\\u", "clause_", "=_", "self_", "._", "return", "ing", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "insert", "\\u", "stmt_", ",_", "self_", "._", "return", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "return", "ing", "\\u", "prece", "des", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "return", "ing", "\\u", "clause_", "\\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_", "insert", "\\u", "stmt_", "._", "select_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "%", "s", "\"_", "%_", "self_", "._", "process_", "(_", "insert", "\\u", "stmt_", "._", "select_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "col", "params_", "and_", "support", "s", "\\u", "default", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "DEF", "AUL", "T", " ", "VALU", "ES", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "insert", "\\u", "stmt_", "._", "\\u", "has", "\\u", "multi", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "VALU", "ES", " ", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\",", " ", "\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "%", "s", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "c_", "[_", "1_", "]_", "for_", "c_", "in_", "col", "param", "\\u", "set_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "col", "param", "\\u", "set_", "in_", "col", "params_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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 ", " _", "text_", "+=_", "\"", " ", "VALU", "ES", " ", "(%", "s", ")\"_", "%_", "',", " ", "'_", "._", "join_", "(_", "[_", "c_", "[_", "1_", "]_", "for_", "c_", "in_", "col", "params_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "return", "ing_", "and_", "not_", "self_", "._", "return", "ing", "\\u", "prece", "des", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "return", "ing", "\\u", "clause_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "limit", "\\u", "clause_", "(_", "self_", ",_", "update", "\\u", "stmt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ide", " ", "a", " ", "hook", " ", "for", " ", "My", "SQL", " ", "to", " ", "add", " ", "LIMIT", " ", "to", " ", "the", " ", "UPDATE", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "tables", "\\u", "clause_", "(_", "self_", ",_", "update", "\\u", "stmt_", ",_", "from", "\\u", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "froms", "_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ide", " ", "a", " ", "hook", " ", "to", " ", "override", " ", "the", " ", "initial", " ", "table", " ", "clause", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "an", " ", "UPDATE", " ", "statem", "ent", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "My", "SQL", " ", "override", "s", " ", "this", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "from", "\\u", "table_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "isc", "ru", "d_", "=_", "True_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "from", "\\u", "clause_", "(_", "self_", ",_", "update", "\\u", "stmt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "\\u", "table_", ",_", "extra", "\\u", "froms", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "\\u", "hints_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ide", " ", "a", " ", "hook", " ", "to", " ", "override", " ", "the", " ", "generat", "ion", " ", "of", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "UPDATE", "..", "FROM", " ", "clause", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "My", "SQL", " ", "and", " ", "MS", "SQL", " ", "override", " ", "this", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", "FROM", " ", "\"_", "+_", "',", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "from", "hints_", "=_", "from", "\\u", "hints_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "extra", "\\u", "froms", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "update_", "(_", "self_", ",_", "update", "\\u", "stmt_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stack_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "correlate", "\\u", "froms", "'_", ":_", "set_", "(_", "[_", "update", "\\u", "stmt_", "._", "table_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "is", "wrapp", "er", "\"_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "asf", "rom", "\\u", "froms", "\"_", ":_", "set_", "(_", "[_", "update", "\\u", "stmt_", "._", "table_", "]_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "isu", "pdate_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "froms", "_", "=_", "update", "\\u", "stmt_", "._", "\\u", "extra", "\\u", "froms", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "\"", "UPDATE", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "update", "\\u", "stmt_", "._", "\\u", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "self_", "._", "\\u", "generat", "e\\u", "prefixes_", "(_", "update", "\\u", "stmt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", "._", "\\u", "prefixes_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "table", "\\u", "text_", "=_", "self_", "._", "update", "\\u", "tables", "\\u", "clause_", "(_", "update", "\\u", "stmt_", ",_", "update", "\\u", "stmt_", "._", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "froms", "_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "col", "params_", "=_", "self_", "._", "\\u", "get", "\\u", "col", "params_", "(_", "update", "\\u", "stmt_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "update", "\\u", "stmt_", "._", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dialect", "\\u", "hints_", "=_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "table_", ",_", "hin", "t", "\\u", "text_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "table_", ",_", "dialect_", ")_", ",_", "hin", "t", "\\u", "text_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", "._", "\\u", "hints_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dialect_", "in_", "(_", "'*'_", ",_", "self_", "._", "dialect_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "update", "\\u", "stmt_", "._", "table_", "in_", "dialect", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "text_", "=_", "self_", "._", "format\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", "._", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dialect", "\\u", "hints_", "[_", "update", "\\u", "stmt_", "._", "table_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", "\\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 ", " _", "dialect", "\\u", "hints_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "table", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "+=_", "'", " ", "SET", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "include", "\\u", "table_", "=_", "extra", "\\u", "froms", "_", "and_", "self_", "._", "render", "\\u", "table", "\\u", "with", "\\u", "column", "\\u", "in", "\\u", "update", "\\u", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "',", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "[_", "0_", "]_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "table_", "=_", "include", "\\u", "table_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'='_", "+_", "c_", "[_", "1_", "]_", "for_", "c_", "in_", "col", "params_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "return", "ing_", "or_", "update", "\\u", "stmt_", "._", "\\u", "return", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "return", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "return", "ing_", "=_", "update", "\\u", "stmt_", "._", "\\u", "return", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "return", "ing", "\\u", "prece", "des", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "self_", "._", "return", "ing", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", ",_", "self_", "._", "return", "ing_", ")_", "\\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_", "extra", "\\u", "froms", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra", "\\u", "from", "\\u", "text_", "=_", "self_", "._", "update", "\\u", "from", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", "._", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "froms", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dialect", "\\u", "hints_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "extra", "\\u", "from", "\\u", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "extra", "\\u", "from", "\\u", "text_", "\\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_", "update", "\\u", "stmt_", "._", "\\u", "where", "clause_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "self_", "._", "process_", "(_", "update", "\\u", "stmt_", "._", "\\u", "where", "clause_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "WHE", "RE", " ", "\"_", "+_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "limit", "\\u", "clause_", "=_", "self_", "._", "update", "\\u", "limit", "\\u", "clause_", "(_", "update", "\\u", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "limit", "\\u", "clause_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "limit", "\\u", "clause_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "return", "ing_", "and_", "not_", "self_", "._", "return", "ing", "\\u", "prece", "des", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "self_", "._", "return", "ing", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "update", "\\u", "stmt_", ",_", "self_", "._", "return", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stack_", "._", "pop_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "self_", ",_", "col_", ",_", "value_", ",_", "required_", "=_", "False_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "col_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bind", "param_", "=_", "elements_", "._", "Bind", "Parameter_", "(_", "name_", ",_", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type\\u_", "=_", "col_", "._", "type_", ",_", "required_", "=_", "required_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bind", "param_", "._", "\\u", "is", "\\u", "crud", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bind", "param_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "util_", "._", "memoized", "\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "key", "\\u", "getter", "s", "\\u", "for", "\\u", "crud", "\\u", "column_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "isu", "pdate_", "and_", "self_", "._", "statement_", "._", "\\u", "extra", "\\u", "froms", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "whe", "n", " ", "extra", " ", "tables", " ", "are", " ", "presen", "t", ",", " ", "refer", " ", "to", " ", "the", " ", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "tho", "se", " ", "extra", " ", "tables", " ", "as", " ", "table", "-", "qualified", ",", " ", "inclu", "ding", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dictionar", "ies", " ", "and", " ", "whe", "n", " ", "render", "ing", " ", "bind", " ", "param", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "\"", "main", "\"", " ", "table", " ", "of", " ", "the", " ", "statem", "ent", " ", "remains", " ", "unqu", "ali", "fied", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "allow", "ing", " ", "the", " ", "most", " ", "compatibility", " ", "with", " ", "a", " ", "non", "-", "multi", "-", "table_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "statem", "ent", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "et_", "=_", "set_", "(_", "self_", "._", "statement_", "._", "\\u", "extra", "\\u", "froms", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "column", "\\u", "as", "\\u", "key_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "str", "\\u", "key_", "=_", "elements_", "._", "\\u", "column", "\\u", "as", "\\u", "key_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "key_", ",_", "'", "table", "'_", ")_", "and_", "key_", "._", "table_", "in_", "\\u", "et_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "(_", "key_", "._", "table_", "._", "name_", ",_", "str", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "str", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "getattr", "\\u", "col", "\\u", "key_", "(_", "col_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "col_", "._", "table_", "in_", "\\u", "et_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "(_", "col_", "._", "table_", "._", "name_", ",_", "col_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "col_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "col", "\\u", "bind", "\\u", "name_", "(_", "col_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "col_", "._", "table_", "in_", "\\u", "et_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "\"%", "s", "\\u", "%", "s", "\"_", "%_", "(_", "col_", "._", "table_", "._", "name_", ",_", "col_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "col_", "._", "key_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "column", "\\u", "as", "\\u", "key_", "=_", "elements_", "._", "\\u", "column", "\\u", "as", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "getattr", "\\u", "col", "\\u", "key_", "=_", "\\u", "col", "\\u", "bind", "\\u", "name_", "=_", "operator_", "._", "attrgetter_", "(_", "\"", "key", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u", "column", "\\u", "as", "\\u", "key_", ",_", "\\u", "getattr", "\\u", "col", "\\u", "key_", ",_", "\\u", "col", "\\u", "bind", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "col", "params_", "(_", "self_", ",_", "stmt_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "create", " ", "a", " ", "set", " ", "of", " ", "tuple", "s", " ", "represent", "ing", " ", "column", "/", "string", " ", "pair", "s", " ", "for", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "an", " ", "INSERT", " ", "or", " ", "UPDATE", " ", "statem", "ent", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Al", "so", " ", "generat", "es", " ", "the", " ", "Compiled", " ", "object", "'", "s", " ", "post", "fetch", ",", " ", "prefetch", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "return", "ing", " ", "column", " ", "collection", "s", ",", " ", "used", " ", "for", " ", "default", " ", "handling", " ", "and", " ", "ultima", "tel", "y", "\\", "10", ";", " ", " ", " ", " ", "popul", "ati", "ng", " ", "the", " ", "Result", "Pro", "xy", "'", "s", " ", "prefetch", "\\u", "cols", "()", " ", "and", " ", "post", "fetch", "\\u", "cols", "()", "\\", "10", ";", " ", " ", " ", " ", "collection", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "post", "fetch_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefetch", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "return", "ing_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "parameter", "s", " ", "in", " ", "the", " ", "statem", "ent", ",", " ", "no", " ", "parameter", "s", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compile", "d", " ", "params", " ", "-", " ", "return", " ", "bind", "s", " ", "for", " ", "all", " ", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "keys_", "is_", "None_", "and_", "stmt_", "._", "parameters_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "required_", "=_", "True_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "stmt_", "._", "table_", "._", "columns_", "\\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_", "stmt_", "._", "\\u", "has", "\\u", "multi", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stmt", "\\u", "parameters_", "=_", "stmt_", "._", "parameters_", "[_", "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 ", " _", "stmt", "\\u", "parameters_", "=_", "stmt_", "._", "parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "getter", "s", " ", "-", " ", "these", " ", "are", " ", "normal", "ly", " ", "just", " ", "column", ".", "key", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "in", " ", "the", " ", "case", " ", "of", " ", "mysql", " ", "multi", "-", "table", " ", "update", ",", " ", "the", " ", "rule", "s", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "key", " ", "must", " ", "conditional", "ly", " ", "take", " ", "tablename", " ", "int", "o", " ", "account_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "column", "\\u", "as", "\\u", "key_", ",_", "\\u", "getattr", "\\u", "col", "\\u", "key_", ",_", "\\u", "col", "\\u", "bind", "\\u", "name_", "=_", "self_", "._", "\\u", "key", "\\u", "getter", "s", "\\u", "for", "\\u", "crud", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "have", " ", "statem", "ent", " ", "parameter", "s", " ", "-", " ", "set", " ", "default", "s", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compile", "d", " ", "params_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "column", "\\u", "keys_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parameters_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parameters_", "=_", "dict_", "(_", "(_", "\\u", "column", "\\u", "as", "\\u", "key_", "(_", "key_", ")_", ",_", "REQUIRED_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", "in_", "self_", "._", "column", "\\u", "keys_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "stmt", "\\u", "parameters_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "not_", "in_", "stmt", "\\u", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "list", " ", "of", " ", "column", " ", "assign", "ment", " ", "clause", "s", " ", "as", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stmt", "\\u", "parameters_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", ",_", "v_", "in_", "stmt", "\\u", "parameters_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "key_", "=_", "\\u", "column", "\\u", "as", "\\u", "key_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "col", "key_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "parameters_", "._", "setdefault_", "(_", "col", "key_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "a", " ", "non", "-", "Colum", "n", " ", "express", "ion", " ", "on", " ", "the", " ", "left", " ", "side", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "it", " ", "to", " ", "values", "()", " ", "in", " ", "an", " ", "\"", "as", "-", "is", "\"", " ", "state", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coe", "rci", "ng", " ", "right", " ", "side", " ", "to", " ", "bound", " ", "param_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "elements_", "._", "\\u", "is", "\\u", "literal_", "(_", "v_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "self_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "elements_", "._", "Bind", "Parameter_", "(_", "None_", ",_", "v_", ",_", "type\\u_", "=_", "k_", "._", "type_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "=_", "self_", "._", "process_", "(_", "v_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "._", "append_", "(_", "(_", "k_", ",_", "v_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "need", "\\u", "pks", "_", "=_", "self_", "._", "isin", "ser", "t_", "and_", "not_", "self_", "._", "inline_", "and_", "not_", "stmt_", "._", "\\u", "return", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "return", "ing_", "=_", "need", "\\u", "pks", "_", "and_", "self_", "._", "dialect_", "._", "implicit", "\\u", "return", "ing_", "and_", "stmt_", "._", "table_", "._", "implicit", "\\u", "return", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "isin", "ser", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implicit", "\\u", "return", "\\u", "defaults_", "=_", "(_", "implicit", "\\u", "return", "ing_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "stmt_", "._", "\\u", "return", "\\u", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "isu", "pdate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implicit", "\\u", "return", "\\u", "defaults_", "=_", "(_", "self_", "._", "dialect_", "._", "implicit", "\\u", "return", "ing_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "stmt_", "._", "table_", "._", "implicit", "\\u", "return", "ing_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "stmt_", "._", "\\u", "return", "\\u", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implicit", "\\u", "return", "\\u", "defaults_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stmt_", "._", "\\u", "return", "\\u", "defaults_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implicit", "\\u", "return", "\\u", "defaults_", "=_", "set_", "(_", "stmt_", "._", "table_", "._", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implicit", "\\u", "return", "\\u", "defaults_", "=_", "set_", "(_", "stmt_", "._", "\\u", "return", "\\u", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "post", "fetch", "\\u", "lastr", "owi", "d_", "=_", "need", "\\u", "pks", "_", "and_", "self_", "._", "dialect_", "._", "post", "fetch", "\\u", "lastr", "owi", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "check", "\\u", "columns_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "special", " ", "logic", " ", "tha", "t", " ", "only", " ", "occur", "s", " ", "for", " ", "multi", "-", "table", " ", "UPDATE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "statements_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "isu", "pdate_", "and_", "stmt_", "._", "\\u", "extra", "\\u", "froms", "_", "and_", "stmt", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "normali", "zed", "\\u", "params_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "elements_", "._", "\\u", "clause", "\\u", "element", "\\u", "as", "\\u", "expr_", "(_", "c_", ")_", ",_", "param_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", ",_", "param_", "in_", "stmt", "\\u", "parameters_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "affect", "ed", "\\u", "tables_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "stmt_", "._", "\\u", "extra", "\\u", "froms", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c_", "in_", "t_", "._", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "c_", "in_", "normali", "zed", "\\u", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "affect", "ed", "\\u", "tables_", "._", "add_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "check", "\\u", "columns_", "[_", "\\u", "getattr", "\\u", "col", "\\u", "key_", "(_", "c_", ")_", "]_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "normali", "zed", "\\u", "params_", "[_", "c_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "elements_", "._", "\\u", "is", "\\u", "literal_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "=_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "value_", ",_", "required_", "=_", "value_", "is_", "REQUIRED_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\\u", "col", "\\u", "bind", "\\u", "name_", "(_", "c_", ")_", ")_", "\\u\\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_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "process_", "(_", "value_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "._", "append_", "(_", "(_", "c_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "tables", " ", "whi", "ch", " ", "are", " ", "actual", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "update", "d", " ", "-", " ", "process", " ", "onu", "pdat", "e", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "server", "\\u", "onu", "pdat", "e", " ", "for", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "affect", "ed", "\\u", "tables_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "c_", "in_", "t_", "._", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "c_", "in_", "normali", "zed", "\\u", "params_", ":_", "\\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_", "elif_", "(_", "c_", "._", "onu", "pdate_", "is_", "not_", "None_", "and_", "not_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "onu", "pdate_", "._", "is", "\\u", "sequence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "c_", "._", "onu", "pdate_", "._", "is", "\\u", "clause", "\\u", "element_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "onu", "pdate_", "._", "arg_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kw_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "None_", ",_", "name_", "=_", "\\u", "col", "\\u", "bind", "\\u", "name_", "(_", "c_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefetch", "_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "._", "server", "\\u", "onu", "pdate_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\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_", "._", "isin", "ser", "t_", "and_", "stmt_", "._", "select", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "an", " ", "insert", " ", "from", " ", "select", ",", " ", "we", " ", "can", " ", "only", " ", "use", " ", "names", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "give", "n", ",", " ", "so", " ", "only", " ", "select", " ", "for", " ", "tho", "se", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "(_", "stmt_", "._", "table_", "._", "c_", "[_", "\\u", "column", "\\u", "as", "\\u", "key_", "(_", "name_", ")_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", "in_", "stmt_", "._", "select", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "iterate", " ", "through", " ", "all", " ", "table", " ", "column", "s", " ", "to", " ", "maintain", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "orderi", "ng", ",", " ", "even", " ", "for", " ", "tho", "se", " ", "cols", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "included_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "stmt_", "._", "table_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "c_", "in_", "cols_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "\\u", "key_", "=_", "\\u", "getattr", "\\u", "col", "\\u", "key_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "col", "\\u", "key_", "in_", "parameters_", "and_", "col", "\\u", "key_", "not_", "in_", "check", "\\u", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "parameters_", "._", "pop_", "(_", "col", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "elements_", "._", "\\u", "is", "\\u", "literal_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "=_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "value_", ",_", "required_", "=_", "value_", "is_", "REQUIRED_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\\u", "col", "\\u", "bind", "\\u", "name_", "(_", "c_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "stmt_", "._", "\\u", "has", "\\u", "multi", "\\u", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "\"%", "s", "\\u", "0", "\"_", "%_", "\\u", "col", "\\u", "bind", "\\u", "name_", "(_", "c_", ")_", "\\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 ", " ", "_", "if_", "isinstance_", "(_", "value_", ",_", "elements_", "._", "Bind", "Parameter_", ")_", "and_", "value_", "._", "type_", "._", "\\u", "isnull_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "=_", "value_", "._", "\\u", "clone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "._", "type_", "=_", "c_", "._", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "._", "primary", "\\u", "key_", "and_", "implicit", "\\u", "return", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "process_", "(_", "value_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "process_", "(_", "value_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", "\\u\\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_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "process_", "(_", "value_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "._", "append_", "(_", "(_", "c_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "isin", "ser", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "._", "primary", "\\u", "key_", "and_", "need", "\\u", "pks", "_", "and_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "return", "ing_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "post", "fetch", "\\u", "lastr", "owi", "d_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "is_", "not_", "stmt_", "._", "table_", "._", "\\u", "autoi", "ncr", "ement", "\\u", "column_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "implicit", "\\u", "return", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "c_", "._", "default_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "c_", "._", "default_", "._", "is", "\\u", "sequence_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "sequences_", "and_", "(_", "not_", "c_", "._", "default_", "._", "optional_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "dialect_", "._", "sequence", "s", "\\u", "optional_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "proc_", "=_", "self_", "._", "process_", "(_", "c_", "._", "default_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "(_", "c_", ",_", "proc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "._", "default_", "._", "is", "\\u", "clause", "\\u", "element_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "default_", "._", "arg_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "c_", ",_", "None_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefetch", "_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\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_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", "._", "default_", "is_", "not_", "None_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "not_", "c_", "._", "default_", "._", "is", "\\u", "sequence_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "sequences_", ")_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "is_", "stmt_", "._", "table_", "._", "\\u", "autoi", "ncr", "ement", "\\u", "column_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "sequences_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "._", "\\u\\u\\uNL\\u\\u\\u_", "pree", "xec", "ute", "\\u", "autoi", "ncr", "ement", "\\u", "sequences_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "c_", ",_", "None_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prefetch", "_", "._", "append_", "(_", "c_", ")_", "\\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_", "elif_", "c_", "._", "default_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "c_", "._", "default_", "._", "is", "\\u", "sequence_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "sequences_", "and_", "(_", "not_", "c_", "._", "default_", "._", "optional_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "dialect_", "._", "sequence", "s", "\\u", "optional_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "proc_", "=_", "self_", "._", "process_", "(_", "c_", "._", "default_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "(_", "c_", ",_", "proc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "c_", "._", "primary", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "._", "default_", "._", "is", "\\u", "clause", "\\u", "element_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "default_", "._", "arg_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "c_", "._", "primary", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "add", " ", "primary", " ", "key", " ", "column", " ", "to", " ", "post", "fetch_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\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 ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "c_", ",_", "None_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefetch", "_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "._", "server", "\\u", "default_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "c_", "._", "primary", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\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_", "self_", "._", "isu", "pdate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "._", "onu", "pdate_", "is_", "not_", "None_", "and_", "not_", "c_", "._", "onu", "pdate_", "._", "is", "\\u", "sequence_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "c_", "._", "onu", "pdate_", "._", "is", "\\u", "clause", "\\u", "element_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "onu", "pdate_", "._", "arg_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\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_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\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 ", " ", " _", "values_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "c_", ",_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "c_", ",_", "None_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefetch", "_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "._", "server", "\\u", "onu", "pdate_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\u\\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_", "._", "post", "fetch_", "._", "append_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "implicit", "\\u", "return", "\\u", "defaults_", "and_", "c_", "in_", "implicit", "\\u", "return", "\\u", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "return", "ing_", "._", "append_", "(_", "c_", ")_", "\\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_", "parameters_", "and_", "stmt", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check_", "=_", "set_", "(_", "parameters_", ")_", "._", "intersection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "column", "\\u", "as", "\\u", "key_", "(_", "k_", ")_", "for_", "k_", "in_", "stmt_", "._", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "difference_", "(_", "check", "\\u", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "check_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Unco", "nsu", "med", " ", "column", " ", "names", ":", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "\"%", "s", "\"_", "%_", "c_", "for_", "c_", "in_", "check_", ")_", ")_", "\\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_", "stmt_", "._", "\\u", "has", "\\u", "multi", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values", "\\u", "0_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "[_", "values_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "values_", "._", "extend_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "\\u", "create", "\\u", "crud", "\\u", "bind", "\\u", "param_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "row_", "[_", "c_", "._", "key_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"%", "s", "\\u", "%", "d", "\"_", "%_", "(_", "c_", "._", "key_", ",_", "i_", "+_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "if_", "elements_", "._", "\\u", "is", "\\u", "literal_", "(_", "row_", "[_", "c_", "._", "key_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "self_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "[_", "c_", "._", "key_", "]_", "._", "self", "\\u", "group_", "(_", ")_", ",_", "**_", "kw_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "c_", "._", "key_", "in_", "row_", "else_", "param_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "c_", ",_", "param_", ")_", "in_", "values", "\\u", "0_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "row_", "in_", "enumerate_", "(_", "stmt_", "._", "parameters_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "delete_", "(_", "self_", ",_", "delete", "\\u", "stmt_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stack_", "._", "append_", "(_", "{_", "'", "correlate", "\\u", "froms", "'_", ":_", "set_", "(_", "[_", "delete", "\\u", "stmt_", "._", "table_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "is", "wrapp", "er", "\"_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "asf", "rom", "\\u", "froms", "\"_", ":_", "set_", "(_", "[_", "delete", "\\u", "stmt_", "._", "table_", "]_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "isd", "ele", "te_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "\"", "DELET", "E", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "delete", "\\u", "stmt_", "._", "\\u", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "self_", "._", "\\u", "generat", "e\\u", "prefixes_", "(_", "delete", "\\u", "stmt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "stmt_", "._", "\\u", "prefixes_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "FROM", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "\\u", "text_", "=_", "delete", "\\u", "stmt_", "._", "table_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "asf", "rom_", "=_", "True_", ",_", "isc", "ru", "d_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "delete", "\\u", "stmt_", "._", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dialect", "\\u", "hints_", "=_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "table_", ",_", "hin", "t", "\\u", "text_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "table_", ",_", "dialect_", ")_", ",_", "hin", "t", "\\u", "text_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "stmt_", "._", "\\u", "hints_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dialect_", "in_", "(_", "'*'_", ",_", "self_", "._", "dialect_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "delete", "\\u", "stmt_", "._", "table_", "in_", "dialect", "\\u", "hints_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table", "\\u", "text_", "=_", "self_", "._", "format\\u", "from", "\\u", "hin", "t", "\\u", "text_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "table", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "stmt_", "._", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dialect", "\\u", "hints_", "[_", "delete", "\\u", "stmt_", "._", "table_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dialect", "\\u", "hints_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "table", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "delete", "\\u", "stmt_", "._", "\\u", "return", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "return", "ing_", "=_", "delete", "\\u", "stmt_", "._", "\\u", "return", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "return", "ing", "\\u", "prece", "des", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "self_", "._", "return", "ing", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "stmt_", ",_", "delete", "\\u", "stmt_", "._", "\\u", "return", "ing_", ")_", "\\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_", "delete", "\\u", "stmt_", "._", "\\u", "where", "clause_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "delete", "\\u", "stmt_", "._", "\\u", "where", "clause_", "._", "\\u", "compiler", "\\u", "dispatch_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "WHE", "RE", " ", "\"_", "+_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "return", "ing_", "and_", "not_", "self_", "._", "return", "ing", "\\u", "prece", "des", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "self_", "._", "return", "ing", "\\u", "clause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "stmt_", ",_", "delete", "\\u", "stmt_", "._", "\\u", "return", "ing_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stack_", "._", "pop_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "savep", "oint_", "(_", "self_", ",_", "savep", "oint", "\\u", "stmt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "SAVE", "POINT", " ", "%", "s", "\"_", "%_", "self_", "._", "prepar", "er_", "._", "format\\u", "savep", "oint_", "(_", "savep", "oint", "\\u", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "rollback", "\\u", "to", "\\u", "savep", "oint_", "(_", "self_", ",_", "savep", "oint", "\\u", "stmt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "ROLL", "BACK", " ", "TO", " ", "SAVE", "POINT", " ", "%", "s", "\"_", "%_", "self_", "._", "prepar", "er_", "._", "format\\u", "savep", "oint_", "(_", "savep", "oint", "\\u", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Compiler_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "release", "\\u", "savep", "oint_", "(_", "self_", ",_", "savep", "oint", "\\u", "stmt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "RELEASE", " ", "SAVE", "POINT", " ", "%", "s", "\"_", "%_", "self_", "._", "prepar", "er_", "._", "format\\u", "savep", "oint_", "(_", "savep", "oint", "\\u", "stmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "util_", "._", "memoized", "\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sql", "\\u", "compiler_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dialect_", "._", "statem", "ent", "\\u", "compiler_", "(_", "self_", "._", "dialect_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "util_", "._", "memoized", "\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "type", "\\u", "compiler_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dialect_", "._", "type", "\\u", "compiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\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_", "prepar", "er_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dialect_", "._", "identifi", "er", "\\u", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "construct", "\\u", "params_", "(_", "self_", ",_", "params_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "ddl", "_", "(_", "self_", ",_", "ddl", "_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "table", " ", "events", " ", "can", " ", "substitute", " ", "table", " ", "and", " ", "schema", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "ddl", "_", "._", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "ddl", "_", "._", "target_", ",_", "schema_", "._", "Table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "context_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prepar", "er_", "=_", "self_", "._", "dialect_", "._", "identifi", "er", "\\u", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "prepar", "er_", "._", "format\\u", "table", "\\u", "seq_", "(_", "ddl", "_", "._", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "path_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", ",_", "sch_", "=_", "path_", "[_", "0_", "]_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", ",_", "sch_", "=_", "path_", "[_", "-_", "1_", "]_", ",_", "path_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "context_", "._", "setdefault_", "(_", "'", "table", "'_", ",_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "._", "setdefault_", "(_", "'", "schema", "'_", ",_", "sch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "._", "setdefault_", "(_", "'", "full", "name", "'_", ",_", "prepar", "er_", "._", "format\\u", "table_", "(_", "ddl", "_", "._", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "sql", "\\u", "compiler_", "._", "post", "\\u", "process", "\\u", "text_", "(_", "ddl", "_", "._", "statement_", "%_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "create", "\\u", "schema_", "(_", "self_", ",_", "create_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "schema_", "(_", "create_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", "CREATE", " ", "SCHE", "MA", " ", "\"_", "+_", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "drop", "\\u", "schema_", "(_", "self_", ",_", "drop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "schema_", "(_", "drop_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "\"", "DROP", " ", "SCHE", "MA", " ", "\"_", "+_", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "drop_", "._", "cascade_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "CAS", "CA", "DE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "create", "\\u", "table_", "(_", "self_", ",_", "create_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "create_", "._", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prepar", "er_", "=_", "self_", "._", "dialect_", "._", "identifi", "er", "\\u", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "\"\\\\", "n", "\"_", "+_", "\"", " ", "\"_", "._", "join_", "(_", "[_", "'", "CREATE", "'_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "table_", "._", "\\u", "prefixes_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "TAB", "LE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepar", "er_", "._", "format\\u", "table_", "(_", "table_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"(\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "separator_", "=_", "\"\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "only", " ", "one", " ", "primary", " ", "key", ",", " ", "speci", "fy", " ", "it", " ", "along", " ", "with", " ", "the", " ", "column_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "pk_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "create", "\\u", "column_", "in_", "create_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "column_", "=_", "create", "\\u", "column_", "._", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "processed_", "=_", "self_", "._", "process_", "(_", "create", "\\u", "column_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "pk_", "=_", "column_", "._", "primary", "\\u", "key_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "not_", "first", "\\u", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "processed_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "text_", "+=_", "separator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "separator_", "=_", "\",", " ", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "\"\\\\", "t", "\"_", "+_", "processed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "column_", "._", "primary", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "first", "\\u", "pk_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exc_", "._", "Compil", "e", "Error_", "as_", "ce_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "util_", "._", "raise", "\\u", "from", "\\u", "cause_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "exc_", "._", "Compil", "e", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "util_", "._", "u_", "(_", "\"(", "in", " ", "table", " ", "'%", "s", "',", " ", "column", " ", "'%", "s", "')", ":", " ", "%", "s", "\"_", ")_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "table_", "._", "description_", ",_", "column_", "._", "name_", ",_", "ce_", "._", "args_", "[_", "0_", "]_", ")_", "\\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_", "const_", "=_", "self_", "._", "create", "\\u", "table", "\\u", "constraints_", "(_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "const_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\",", " ", "\\\\", "n", "\\\\", "t", "\"_", "+_", "const_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"\\\\", "n", ")%", "s", "\\\\", "n", "\\\\", "n", "\"_", "%_", "self_", "._", "post", "\\u", "create", "\\u", "table_", "(_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "create", "\\u", "column_", "(_", "self_", ",_", "create_", ",_", "first", "\\u", "pk_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "column_", "=_", "create_", "._", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "column_", "._", "system_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "self_", "._", "get", "\\u", "column", "\\u", "specification_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "column_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "pk_", "=_", "first", "\\u", "pk_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "const_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "self_", "._", "process_", "(_", "constraint_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "constraint_", "in_", "column_", "._", "constraints_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "const_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "\"_", "+_", "const_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "table", "\\u", "constraints_", "(_", "self_", ",_", "table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", " ", "some", " ", "DB", " ", "order", " ", "is", " ", "significant", ":", " ", "visit", " ", "PK", " ", "first", ",", " ", "then", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", " ", "constraint", "s", " ", "(", "eng", "ine", ".", "Reflect", "ion", "Test", ".", "testb", "asi", "c", " ", "fail", "ed", " ", "on", " ", "FB", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "constraints_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "table_", "._", "primary", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "constraints_", "._", "append_", "(_", "table_", "._", "primary", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "constraints_", "._", "extend_", "(_", "[_", "c_", "for_", "c_", "in_", "table_", "._", "\\u", "sorte", "d\\u", "constraints_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "c_", "is_", "not_", "table_", "._", "primary", "\\u", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\",", " ", "\\\\", "n", "\\\\", "t", "\"_", "._", "join_", "(_", "p_", "for_", "p_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "process_", "(_", "constraint_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "constraint_", "in_", "constraints_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "constraint_", "._", "\\u", "create", "\\u", "rule_", "is_", "None_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "constraint_", "._", "\\u", "create", "\\u", "rule_", "(_", "self_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "self_", "._", "dialect_", "._", "support", "s", "\\u", "alter", "_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "getattr_", "(_", "constraint_", ",_", "'", "use", "\\u", "alter", "'_", ",_", "False_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "if_", "p_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "drop", "\\u", "table_", "(_", "self_", ",_", "drop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\\\\", "n", "DROP", " ", "TAB", "LE", " ", "\"_", "+_", "self_", "._", "prepar", "er_", "._", "format\\u", "table_", "(_", "drop_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "drop", "\\u", "view_", "(_", "self_", ",_", "drop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\\\\", "n", "DROP", " ", "VIEW", " ", "\"_", "+_", "self_", "._", "prepar", "er_", "._", "format\\u", "table_", "(_", "drop_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "verify", "\\u", "index", "\\u", "table_", "(_", "self_", ",_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "index_", "._", "table_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\"", "Index", " ", "'%", "s", "'", " ", "is", " ", "not", " ", "associate", "d", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "with", " ", "any", " ", "table", ".\"_", "%_", "index_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "create", "\\u", "index_", "(_", "self_", ",_", "create_", ",_", "include", "\\u", "schema_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "table", "\\u", "schema_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "create_", "._", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "verify", "\\u", "index", "\\u", "table_", "(_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prepar", "er_", "=_", "self_", "._", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "\"", "CREATE", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "index_", "._", "unique_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", "UNI", "QUE", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "INDE", "X", " ", "%", "s", " ", "ON", " ", "%", "s", " ", "(%", "s", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "prepared", "\\u", "index", "\\u", "name_", "(_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "schema_", "=_", "include", "\\u", "schema_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prepar", "er_", "._", "format\\u", "table_", "(_", "index_", "._", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "schema_", "=_", "include", "\\u", "table", "\\u", "schema_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sql", "\\u", "compiler_", "._", "process_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", ",_", "include", "\\u", "table_", "=_", "False_", ",_", "literal", "\\u", "binds_", "=_", "True_", ")_", "for_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "in_", "index_", "._", "expressions_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "drop", "\\u", "index_", "(_", "self_", ",_", "drop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "drop_", "._", "element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"\\\\", "n", "DROP", " ", "INDE", "X", " ", "\"_", "+_", "self_", "._", "\\u", "prepared", "\\u", "index", "\\u", "name_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "index_", ",_", "include", "\\u", "schema_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "prepared", "\\u", "index", "\\u", "name_", "(_", "self_", ",_", "index_", ",_", "include", "\\u", "schema_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "include", "\\u", "schema_", "and_", "index_", "._", "table_", "is_", "not_", "None_", "and_", "index_", "._", "table_", "._", "schema_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "index_", "._", "table_", "._", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "schema", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "quote", "\\u", "schema_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ident_", "=_", "index_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "ident_", ",_", "elements_", "._", "\\u", "truncat", "ed", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u_", "=_", "self_", "._", "dialect_", "._", "max", "\\u", "index", "\\u", "name", "\\u", "length_", "or_", "self_", "._", "dialect_", "._", "max", "\\u", "identifi", "er", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ident_", ")_", ">_", "max", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ident_", "=_", "ident_", "[_", "0_", ":_", "max", "\\u_", "-_", "8_", "]_", "+_", "\"\\u\"_", "+_", "util_", "._", "md5", "\\u", "hex_", "(_", "ident_", ")_", "[_", "-_", "4_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dialect_", "._", "validat", "e\\u", "identifier_", "(_", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "schema", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index", "\\u", "name_", "=_", "schema", "\\u", "name_", "+_", "\".\"_", "+_", "index", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "index", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "add", "\\u", "constraint_", "(_", "self_", ",_", "create_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "ALT", "ER", " ", "TAB", "LE", " ", "%", "s", " ", "ADD", " ", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prepar", "er_", "._", "format\\u", "table_", "(_", "create_", "._", "element_", "._", "table_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "process_", "(_", "create_", "._", "element_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "create", "\\u", "sequence_", "(_", "self_", ",_", "create_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"", "CREATE", " ", "SEQUENCE", " ", "%", "s", "\"_", "%_", "self_", "._", "prepar", "er_", "._", "format\\u", "sequence_", "(_", "create_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "create_", "._", "element_", "._", "increment_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "INCREMENT", " ", "BY", " ", "%", "d", "\"_", "%_", "create_", "._", "element_", "._", "increment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "create_", "._", "element_", "._", "start_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "START", " ", "WITH", " ", "%", "d", "\"_", "%_", "create_", "._", "element_", "._", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "drop", "\\u", "sequence_", "(_", "self_", ",_", "drop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "DROP", " ", "SEQUENCE", " ", "%", "s", "\"_", "%_", "self_", "._", "prepar", "er_", "._", "format\\u", "sequence_", "(_", "drop_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "drop", "\\u", "constraint_", "(_", "self_", ",_", "drop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "ALT", "ER", " ", "TAB", "LE", " ", "%", "s", " ", "DROP", " ", "CONSTR", "AIN", "T", " ", "%", "s", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prepar", "er_", "._", "format\\u", "table_", "(_", "drop_", "._", "element_", "._", "table_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prepar", "er_", "._", "format\\u", "constraint_", "(_", "drop_", "._", "element_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "drop_", "._", "cascade_", "and_", "\"", " ", "CAS", "CA", "DE", "\"_", "or_", "\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "column", "\\u", "specification_", "(_", "self_", ",_", "column_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "colsp", "ec_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "column_", "(_", "column_", ")_", "+_", "\"", " ", "\"_", "+_", "self_", "._", "dialect_", "._", "type", "\\u", "compiler_", "._", "process_", "(_", "column_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default_", "=_", "self_", "._", "get", "\\u", "column", "\\u", "default", "\\u", "string_", "(_", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "colsp", "ec_", "+=_", "\"", " ", "DEF", "AUL", "T", " ", "\"_", "+_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "column_", "._", "nullable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "colsp", "ec_", "+=_", "\"", " ", "NOT", " ", "NULL", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "colsp", "ec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post", "\\u", "create", "\\u", "table_", "(_", "self_", ",_", "table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "column", "\\u", "default", "\\u", "string_", "(_", "self_", ",_", "column_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "column_", "._", "server", "\\u", "default_", ",_", "schema_", "._", "Default", "Clause_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "column_", "._", "server", "\\u", "default_", "._", "arg_", ",_", "util_", "._", "string", "\\u", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"'", "%", "s", "'\"_", "%_", "column_", "._", "server", "\\u", "default_", "._", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "sql", "\\u", "compiler_", "._", "process_", "(_", "column_", "._", "server", "\\u", "default_", "._", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "check", "\\u", "constraint_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "constraint_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format", "ted", "\\u", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", "CONSTR", "AIN", "T", " ", "%", "s", " ", "\"_", "%_", "format", "ted", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "CHECK", " ", "(%", "s", ")\"_", "%_", "self_", "._", "sql", "\\u", "compiler_", "._", "process_", "(_", "constraint_", "._", "sql", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "include", "\\u", "table_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "literal", "\\u", "binds_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "defer", "rab", "ility_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "column", "\\u", "check", "\\u", "constraint_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "constraint_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format", "ted", "\\u", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", "CONSTR", "AIN", "T", " ", "%", "s", " ", "\"_", "%_", "format", "ted", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "CHECK", " ", "(%", "s", ")\"_", "%_", "constraint_", "._", "sql", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "defer", "rab", "ility_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "primary", "\\u", "key", "\\u", "constraint_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "constraint_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "constraint_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format", "ted", "\\u", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", "CONSTR", "AIN", "T", " ", "%", "s", " ", "\"_", "%_", "format", "ted", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "PRIMA", "RY", " ", "KEY", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "\"(", "%", "s", ")\"_", "%_", "',", " ", "'_", "._", "join_", "(_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "c_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "defer", "rab", "ility_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "foreign", "\\u", "key", "\\u", "constraint_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prepar", "er_", "=_", "self_", "._", "dialect_", "._", "identifi", "er", "\\u", "prepar", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "constraint_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "format", "ted", "\\u", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", "CONSTR", "AIN", "T", " ", "%", "s", " ", "\"_", "%_", "format", "ted", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "remote", "\\u", "table_", "=_", "list_", "(_", "constraint_", "._", "\\u", "elements_", "._", "values_", "(_", ")_", ")_", "[_", "0_", "]_", "._", "column_", "._", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "\"", "FORE", "IGN", " ", "KEY", "(%", "s", ")", " ", "REFERENCE", "S", " ", "%", "s", " ", "(%", "s", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "prepar", "er_", "._", "quote_", "(_", "f_", "._", "parent_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "f_", "in_", "constraint_", "._", "\\u", "elements_", "._", "values_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "remote", "\\u", "table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "constraint_", ",_", "remote", "\\u", "table_", ",_", "prepar", "er_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "prepar", "er_", "._", "quote_", "(_", "f_", "._", "column_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "f_", "in_", "constraint_", "._", "\\u", "elements_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "match_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "cascade", "s_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "defer", "rab", "ility_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "defin", "e\\u", "constraint", "\\u", "remote", "\\u", "table_", "(_", "self_", ",_", "constraint_", ",_", "table_", ",_", "prepar", "er_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Format", " ", "the", " ", "remote", " ", "table", " ", "clause", " ", "of", " ", "a", " ", "CREATE", " ", "CONSTR", "AIN", "T", " ", "clause", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "prepar", "er_", "._", "format\\u", "table_", "(_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "unique", "\\u", "constraint_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "constraint_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "name_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "format", "ted", "\\u", "name_", "=_", "self_", "._", "prepar", "er_", "._", "format\\u", "constraint_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "\"", "CONSTR", "AIN", "T", " ", "%", "s", " ", "\"_", "%_", "format", "ted", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "+=_", "\"", "UNI", "QUE", " ", "(%", "s", ")\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "self_", "._", "prepar", "er_", "._", "quote_", "(_", "c_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "constraint_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "+=_", "self_", "._", "defin", "e\\u", "constraint", "\\u", "defer", "rab", "ility_", "(_", "constraint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "defin", "e\\u", "constraint", "\\u", "cascade", "s_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "ondelete_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "ON", " ", "DELET", "E", " ", "%", "s", "\"_", "%_", "constraint_", "._", "ondelete_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "constraint_", "._", "onu", "pdate_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "ON", " ", "UPDATE", " ", "%", "s", "\"_", "%_", "constraint_", "._", "onu", "pdate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "defin", "e\\u", "constraint", "\\u", "defer", "rab", "ility_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "defer", "rab", "le_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "constraint_", "._", "defer", "rab", "le_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "DEF", "ERR", "AB", "LE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "NOT", " ", "DEF", "ERR", "AB", "LE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "constraint_", "._", "initially", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "INITIAL", "LY", " ", "%", "s", "\"_", "%_", "constraint_", "._", "initially", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DD", "LC", "omp", "iler", "_", "(_", "Compiled", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "defin", "e\\u", "constraint", "\\u", "match_", "(_", "self_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constraint_", "._", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"", " ", "MATCH", " ", "%", "s", "\"_", "%_", "constraint_", "._", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\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_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "visit", "\\u", "FLOAT_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "FLOAT", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "REAL", "_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "REAL", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "NUMERIC", "_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type\\u_", "._", "precision_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "NUMERIC", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type\\u_", "._", "scale_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "NUMERIC", "(%", "(", "preci", "sion", ")", "s", ")\"_", "%_", "{_", "'", "preci", "sion", "'_", ":_", "type\\u_", "._", "precision_", "}_", "\\u\\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_", "\"", "NUMERIC", "(%", "(", "preci", "sion", ")", "s", ",", " ", "%", "(", "scale", ")", "s", ")\"_", "%_", "{_", "'", "preci", "sion", "'_", ":_", "type\\u_", "._", "precision_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scale", "'_", ":_", "type\\u_", "._", "scale_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "DECIMAL", "_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type\\u_", "._", "precision_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "DECIMAL", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type\\u_", "._", "scale_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "DECIMAL", "(%", "(", "preci", "sion", ")", "s", ")\"_", "%_", "{_", "'", "preci", "sion", "'_", ":_", "type\\u_", "._", "precision_", "}_", "\\u\\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_", "\"", "DECIMAL", "(%", "(", "preci", "sion", ")", "s", ",", " ", "%", "(", "scale", ")", "s", ")\"_", "%_", "{_", "'", "preci", "sion", "'_", ":_", "type\\u_", "._", "precision_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scale", "'_", ":_", "type\\u_", "._", "scale_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "INTEGER_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "INTEG", "ER", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "SMALL", "INT_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "SMALL", "INT", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "BIG", "INT_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "BIG", "INT", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "TIMESTAMP_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "TIMES", "TAM", "P", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "DATETIME", "_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "DATETIME", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "DATE_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "DAT", "E", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "TIME_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "TIME", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "CLO", "B_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "CLO", "B", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "NC", "LO", "B_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "NC", "LO", "B", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "render", "\\u", "string", "\\u", "type_", "(_", "self_", ",_", "type\\u_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type\\u_", "._", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "\"(", "%", "d", ")\"_", "%_", "type\\u_", "._", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type\\u_", "._", "collatio", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "+=_", "'", " ", "COLL", "ATE", " ", "\"%", "s", "\"'_", "%_", "type\\u_", "._", "collatio", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "CHAR_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "string", "\\u", "type_", "(_", "type\\u_", ",_", "\"", "CHAR", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "NCH", "AR_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "string", "\\u", "type_", "(_", "type\\u_", ",_", "\"", "NCH", "AR", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "VARCHA", "R_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "string", "\\u", "type_", "(_", "type\\u_", ",_", "\"", "VARCHA", "R", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "NV", "ARCH", "AR_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "string", "\\u", "type_", "(_", "type\\u_", ",_", "\"", "NV", "ARCH", "AR", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "TEXT_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "render", "\\u", "string", "\\u", "type_", "(_", "type\\u_", ",_", "\"", "TEXT", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "BLOB", "_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "BLOB", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "BINARY_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "BIN", "ARY", "\"_", "+_", "(_", "type\\u_", "._", "length_", "and_", "\"(", "%", "d", ")\"_", "%_", "type\\u_", "._", "length_", "or_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "VAR", "BINARY_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "VAR", "BIN", "ARY", "\"_", "+_", "(_", "type\\u_", "._", "length_", "and_", "\"(", "%", "d", ")\"_", "%_", "type\\u_", "._", "length_", "or_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "BOOLEAN", "_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "BOOLEAN", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "large", "\\u", "binary_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "BLOB", "_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "boolean_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "BOOLEAN", "_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "time_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "TIME_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "datetime_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "DATETIME", "_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "date_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "DATE_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "big", "\\u", "integer_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "BIG", "INT_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "small", "\\u", "integer_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "SMALL", "INT_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "integer_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "INTEGER_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "real_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "REAL", "_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "float_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "FLOAT_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "numeric_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "NUMERIC", "_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "string_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "VARCHA", "R_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "unicode_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "VARCHA", "R_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "text_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "TEXT_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "unicode", "\\u", "text_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "TEXT_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "enum_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "visit", "\\u", "VARCHA", "R_", "(_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "null_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exc_", "._", "Compil", "e", "Error_", "(_", "\"", "Can", "'", "t", " ", "generat", "e", " ", "DD", "L", " ", "for", " ", "%", "r", ";", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "did", " ", "you", " ", "forget", " ", "to", " ", "speci", "fy", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", " ", "on", " ", "this", " ", "Colum", "n", "?\"_", "%_", "type\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "type", "\\u", "decorator_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "process_", "(_", "type\\u_", "._", "type", "\\u", "engine_", "(_", "self_", "._", "dialect_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gene", "ric", "Type", "Compiler_", "(_", "Type", "Compiler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "\\u", "user", "\\u", "defined_", "(_", "self_", ",_", "type\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "type\\u_", "._", "get", "\\u", "col", "\\u", "spec_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", " ", "quoting", " ", "and", " ", "case", "-", "fold", "ing", " ", "of", " ", "identifi", "ers", " ", "based", " ", "on", " ", "options", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reserve", "d\\u", "words_", "=_", "RESERVED", "\\u", "WORDS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lega", "l\\u", "characters_", "=_", "LEGA", "L", "\\u", "CHARACTER", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ille", "gal", "\\u", "initial", "\\u", "characters_", "=_", "ILL", "EGA", "L", "\\u", "INITIAL", "\\u", "CHARACTER", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "dialect_", ",_", "initial", "\\u", "quote_", "=_", "'\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "final", "\\u", "quote_", "=_", "None_", ",_", "escape", "\\u", "quote_", "=_", "'\"'_", ",_", "omit", "\\u", "schema_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Construct", " ", "a", " ", "new", " ", "``", "Identifie", "r", "Prepare", "r", "``", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "initial", "\\u", "quote", "\\", "10", ";", " ", " ", "Char", "acte", "r", " ", "tha", "t", " ", "begins", " ", "a", " ", "delim", "ited", " ", "identifi", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "final", "\\u", "quote", "\\", "10", ";", " ", " ", "Char", "acte", "r", " ", "tha", "t", " ", "ends", " ", "a", " ", "delim", "ited", " ", "identifi", "er", ".", " ", "Default", "s", " ", "to", "\\", "10", ";", " ", " ", "`", "initial", "\\u", "quote", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "omit", "\\u", "schema", "\\", "10", ";", " ", " ", "Prev", "ent", " ", "prepend", "ing", " ", "schema", " ", "name", ".", " ", "Us", "efu", "l", " ", "for", " ", "databa", "ses", " ", "tha", "t", " ", "do", "\\", "10", ";", " ", " ", "not", " ", "support", " ", "schema", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dialect_", "=_", "dialect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "initial", "\\u", "quote_", "=_", "initial", "\\u", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "final", "\\u", "quote_", "=_", "final", "\\u", "quote_", "or_", "self_", "._", "initial", "\\u", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "escape", "\\u", "quote_", "=_", "escape", "\\u", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "escape", "\\u", "to", "\\u", "quote_", "=_", "self_", "._", "escape", "\\u", "quote_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "omit", "\\u", "schema_", "=_", "omit", "\\u", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "strings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "escape", "\\u", "identifier_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Esc", "ape", " ", "an", " ", "identifi", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "override", " ", "this", " ", "to", " ", "provide", " ", "databa", "se", "-", "dependent", "\\", "10", ";", " ", " ", " ", " ", "esca", "ping", " ", "behavior", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "value_", "._", "replace_", "(_", "self_", "._", "escape", "\\u", "quote_", ",_", "self_", "._", "escape", "\\u", "to", "\\u", "quote_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "unescape", "\\u", "identifier_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Canonical", "ize", " ", "an", " ", "escaped", " ", "identifi", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "override", " ", "this", " ", "to", " ", "provide", " ", "databa", "se", "-", "dependent", "\\", "10", ";", " ", " ", " ", " ", "une", "scap", "ing", " ", "behavior", " ", "tha", "t", " ", "reverse", "s", " ", "\\u", "escape", "\\u", "identifi", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "value_", "._", "replace_", "(_", "self_", "._", "escape", "\\u", "to", "\\u", "quote_", ",_", "self_", "._", "escape", "\\u", "quote_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "quote", "\\u", "identifier_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Quote", " ", "an", " ", "identifi", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "override", " ", "this", " ", "to", " ", "provide", " ", "databa", "se", "-", "dependent", "\\", "10", ";", " ", " ", " ", " ", "quoting", " ", "behavior", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "initial", "\\u", "quote_", "+_", "self_", "._", "\\u", "escape", "\\u", "identifier_", "(_", "value_", ")_", "+_", "self_", "._", "final", "\\u", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "require", "s", "\\u", "quotes_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "Tru", "e", " ", "if", " ", "the", " ", "give", "n", " ", "identifi", "er", " ", "require", "s", " ", "quoting", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lc", "\\u", "value_", "=_", "value_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "lc", "\\u", "value_", "in_", "self_", "._", "reserve", "d\\u", "words_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "value_", "[_", "0_", "]_", "in_", "self_", "._", "ille", "gal", "\\u", "initial", "\\u", "characters_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "not_", "self_", "._", "lega", "l\\u", "characters_", "._", "match_", "(_", "util_", "._", "text", "\\u", "type_", "(_", "value_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "(_", "lc", "\\u", "value_", "!=_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "quote", "\\u", "schema_", "(_", "self_", ",_", "schema_", ",_", "force_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Cond", "itional", "ly", " ", "quote", " ", "a", " ", "schema", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Subc", "lasse", "s", " ", "can", " ", "override", " ", "this", " ", "to", " ", "provide", " ", "databa", "se", "-", "dependent", "\\", "10", ";", " ", " ", " ", " ", "quoting", " ", "behavior", " ", "for", " ", "schema", " ", "names", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "'", "force", "'", " ", "flag", " ", "shou", "ld", " ", "be", " ", "consider", "ed", " ", "depre", "cated", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "quote_", "(_", "schema_", ",_", "force_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "quote_", "(_", "self_", ",_", "ident_", ",_", "force_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Cond", "itional", "ly", " ", "quote", " ", "an", " ", "identifi", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "'", "force", "'", " ", "flag", " ", "shou", "ld", " ", "be", " ", "consider", "ed", " ", "depre", "cated", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "force_", "=_", "getattr_", "(_", "ident_", ",_", "\"", "quote", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "force_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ident_", "in_", "self_", "._", "\\u", "strings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "strings_", "[_", "ident_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "require", "s", "\\u", "quotes_", "(_", "ident_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "strings_", "[_", "ident_", "]_", "=_", "self_", "._", "quote", "\\u", "identifier_", "(_", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "strings_", "[_", "ident_", "]_", "=_", "ident_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "strings_", "[_", "ident_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "force_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "quote", "\\u", "identifier_", "(_", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ident_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "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_", "format\\u", "sequence_", "(_", "self_", ",_", "sequence_", ",_", "use", "\\u", "schema_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "self_", "._", "quote_", "(_", "sequence_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "self_", "._", "omit", "\\u", "schema_", "and_", "use", "\\u", "schema_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "sequence_", "._", "schema_", "is_", "not_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "self_", "._", "quote", "\\u", "schema_", "(_", "sequence_", "._", "schema_", ")_", "+_", "\".\"_", "+_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "label_", "(_", "self_", ",_", "label_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "quote_", "(_", "name_", "or_", "label_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "alias_", "(_", "self_", ",_", "alias_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "quote_", "(_", "name_", "or_", "alias_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "savep", "oint_", "(_", "self_", ",_", "savep", "oint_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "quote_", "(_", "name_", "or_", "savep", "oint_", "._", "ident_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "util_", "._", "dependencies_", "(_", "\"", "sqla", "lche", "my", ".", "sql", ".", "nami", "ng", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "format\\u", "constraint_", "(_", "self_", ",_", "naming_", ",_", "constraint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "constraint_", "._", "name_", ",_", "elements_", "._", "\\u", "defer", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "naming_", "._", "\\u", "constraint", "\\u", "name", "\\u", "for", "\\u", "table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "constraint_", ",_", "constraint_", "._", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "quote_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "constraint_", "._", "name_", ",_", "elements_", "._", "\\u", "defer", "\\u", "none", "\\u", "name_", ")_", ":_", "\\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_", "return_", "self_", "._", "quote_", "(_", "constraint_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "table_", "(_", "self_", ",_", "table_", ",_", "use", "\\u", "schema_", "=_", "True_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prepare", " ", "a", " ", "quoted", " ", "table", " ", "and", " ", "schema", " ", "name", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "table_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "self_", "._", "quote_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "omit", "\\u", "schema_", "and_", "use", "\\u", "schema_", "and_", "getattr_", "(_", "table_", ",_", "\"", "schema", "\"_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "quote", "\\u", "schema_", "(_", "table_", "._", "schema_", ")_", "+_", "\".\"_", "+_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "schema_", "(_", "self_", ",_", "name_", ",_", "quote_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prepare", " ", "a", " ", "quoted", " ", "schema", " ", "name", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "quote_", "(_", "name_", ",_", "quote_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "column_", "(_", "self_", ",_", "column_", ",_", "use", "\\u", "table_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "None_", ",_", "table", "\\u", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prepare", " ", "a", " ", "quoted", " ", "column", " ", "name", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "column_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "getattr_", "(_", "column_", ",_", "'", "is", "\\u", "literal", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "use", "\\u", "table_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "format\\u", "table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "column_", "._", "table_", ",_", "use", "\\u", "schema_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "table", "\\u", "name_", ")_", "+_", "\".\"_", "+_", "self_", "._", "quote_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "quote_", "(_", "name_", ")_", "\\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_", "#", " ", "literal", " ", "textu", "al", " ", "element", "s", " ", "get", " ", "stu", "ck", " ", "int", "o", " ", "Colum", "n", "Cla", "use", " ", "a", " ", "lot", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "shou", "ld", "n", "'", "t", " ", "get", " ", "quoted", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "use", "\\u", "table_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "format\\u", "table_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "column_", "._", "table_", ",_", "use", "\\u", "schema_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "table", "\\u", "name_", ")_", "+_", "'.'_", "+_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "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_", "format\\u", "table", "\\u", "seq_", "(_", "self_", ",_", "table_", ",_", "use", "\\u", "schema_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Format", " ", "table", " ", "name", " ", "and", " ", "schema", " ", "as", " ", "a", " ", "tuple", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dial", "ect", "s", " ", "with", " ", "more", " ", "level", "s", " ", "in", " ", "thei", "r", " ", "full", "y", " ", "qualified", " ", "references_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "('", "databa", "se", "',", " ", "'", "owner", "',", " ", "etc", ".)", " ", "coul", "d", " ", "override", " ", "this", " ", "and", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "long", "er", " ", "sequence", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "omit", "\\u", "schema_", "and_", "use", "\\u", "schema_", "and_", "getattr_", "(_", "table_", ",_", "'", "schema", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "quote", "\\u", "schema_", "(_", "table_", "._", "schema_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "format\\u", "table_", "(_", "table_", ",_", "use", "\\u", "schema_", "=_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "format\\u", "table_", "(_", "table_", ",_", "use", "\\u", "schema_", "=_", "False_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "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_", "@_", "util_", "._", "memoized", "\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "r", "\\u", "identifiers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", ",_", "final_", ",_", "escaped", "\\u", "final_", "=_", "[_", "re_", "._", "escape_", "(_", "s_", ")_", "for_", "s_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "initial", "\\u", "quote_", ",_", "self_", "._", "final", "\\u", "quote_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "escape", "\\u", "identifier_", "(_", "self_", "._", "final", "\\u", "quote_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "re_", "._", "compile_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(?:", "'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'(?:", "%", "(", "initial", ")", "s", "((", "?:", "%", "(", "escaped", ")", "s", "|[", "^", "%", "(", "final", ")", "s", "])", "+)", "%", "(", "final", ")", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'|", "([", "^", "\\\\.]", "+))", "(?=", "\\\\.", "|", "$)", ")+", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "initial", "'_", ":_", "initial_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "final", "'_", ":_", "final_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "escaped", "'_", ":_", "escaped", "\\u", "final_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Identifie", "r", "Prepare", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unfo", "rmat", "\\u", "identifiers_", "(_", "self_", ",_", "identifiers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Unpack", " ", "'", "schema", ".", "table", ".", "column", "'-", "like", " ", "string", "s", " ", "int", "o", " ", "component", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "self_", "._", "\\u", "r", "\\u", "identifiers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "self_", "._", "\\u", "unescape", "\\u", "identifier_", "(_", "i_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "[_", "a_", "or_", "b_", "for_", "a_", ",_", "b_", "in_", "r_", "._", "findall_", "(_", "identifiers_", ")_", "]_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
CGATOxford/cgat/obsolete/Cluster.py
[ { "content": "class Error(Exception):\n\n \"\"\"Base class for exceptions in this module.\"\"\"\n pass\n", "metadata": "root.Error", "header": "['module', '___EOS___']", "index": 31 } ]
[ { "span": "pass", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Error_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "exception", "s", " ", "in", " ", "this", " ", "module", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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, 0, 2, 2 ]
Unused import
eldarion/django-contacts-import/contacts_import/urls.py
[ { "content": "from django.conf.urls.defaults import patterns, include, url\n\nfrom contacts_import.views import (\n ImportBeginView, ImportServiceView\n)\n\n\nurlpatterns = patterns(\"\",\n url(r\"^$\", ImportBeginView.as_view(), name=\"contacts_import\"),\n url(r\"^(?P<service>\\w+)/$\", ImportServiceView.as_view(), name=\"contacts_import_service\"),\n)", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.conf.urls.defaults import patterns, include, url", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 60 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "conf_", "._", "urls_", "._", "defaults_", "import_", "patterns_", ",_", "include_", ",_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "contact", "s", "\\u", "import_", "._", "views_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Import", "Begin", "View_", ",_", "Import", "Service", "View_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urlpatterns_", "=_", "patterns_", "(_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "\"", "^", "$\"_", ",_", "Import", "Begin", "View_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "\"", "contact", "s", "\\u", "import", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "r", "\"", "^", "(?", "P", "<", "service", ">\\\\", "w", "+)", "/$", "\"_", ",_", "Import", "Service", "View_", "._", "as", "\\u", "view_", "(_", ")_", ",_", "name_", "=_", "\"", "contact", "s", "\\u", "import", "\\u", "service", "\"_", ")_", ",_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Use of the return value of a procedure
dronekit/dronekit-python/dronekit/__init__.py
[ { "content": "class HasObservers(object):\n\n\n\n\n\n", "metadata": "root.HasObservers", "header": "['module', '___EOS___']", "index": 521 }, { "content": " def __init__(self):\n # A mapping from attr_name to a list of observers\n self._attribute_listeners = {}\n self._attribute_cache = {}", "metadata": "root.HasObservers.__init__", "header": "['class', 'HasObservers', '(', 'object', ')', ':', '___EOS___']", "index": 522 }, { "content": " def on_attribute(self, name):\n \"\"\"\n Decorator for attribute listeners.\n\n The decorated function (``observer``) is invoked differently depending on the *type of attribute*.\n Attributes that represent sensor values or which are used to monitor connection status are updated\n whenever a message is received from the vehicle. Attributes which reflect vehicle \"state\" are\n only updated when their values change (for example :py:func:`Vehicle.system_status`,\n :py:attr:`Vehicle.armed`, and :py:attr:`Vehicle.mode`).\n\n The argument list for the callback is ``observer(object, attr_name, attribute_value)``\n\n * ``self`` - the associated :py:class:`Vehicle`. This may be compared to a global vehicle handle\n to implement vehicle-specific callback handling (if needed).\n * ``attr_name`` - the attribute name. This can be used to infer which attribute has triggered\n if the same callback is used for watching several attributes.\n * ``msg`` - the attribute value (so you don't need to re-query the vehicle object).\n\n .. note::\n\n There is no way to remove an attribute listener added with this decorator. Use\n :py:func:`add_attribute_listener` if you need to be able to remove\n the :py:func:`attribute listener <remove_attribute_listener>`.\n\n The code fragment below shows how you can create a listener for the attitude attribute.\n\n .. code:: python\n\n @vehicle.on_attribute('attitude')\n def attitude_listener(self, name, msg):\n print '%s attribute is: %s' % (name, msg)\n\n See :ref:`vehicle_state_observe_attributes` for more information.\n\n :param String attr_name: The name of the attribute to watch (or '*' to watch all attributes).\n :param observer: The callback to invoke when a change in the attribute is detected.\n \"\"\"\n\n def decorator(fn):\n if isinstance(name, list):\n for n in name:\n self.add_attribute_listener(n, fn)\n else:\n self.add_attribute_listener(name, fn)\n\n return decorator", "metadata": "root.HasObservers.on_attribute", "header": "['class', 'HasObservers', '(', 'object', ')', ':', '___EOS___']", "index": 646 }, { "content": "class Vehicle(HasObservers):\n \"\"\"\n The main vehicle API.\n\n Vehicle state is exposed through 'attributes' (e.g. :py:attr:`heading`). All attributes can be\n read, and some are also settable\n (:py:attr:`mode`, :py:attr:`armed` and :py:attr:`home_location`).\n\n Attributes can also be asynchronously monitored for changes by registering listener callback\n functions.\n\n Vehicle \"settings\" (parameters) are read/set using the :py:attr:`parameters` attribute.\n Parameters can be iterated and are also individually observable.\n\n Vehicle movement is primarily controlled using the :py:attr:`armed` attribute and\n :py:func:`simple_takeoff` and :py:func:`simple_goto` in GUIDED mode.\n\n It is also possible to work with vehicle \"missions\" using the :py:attr:`commands` attribute,\n and run them in AUTO mode.\n\n The guide contains more detailed information on the different ways you can use\n the ``Vehicle`` class:\n\n - :doc:`guide/vehicle_state_and_parameters`\n - :doc:`guide/copter/guided_mode`\n - :doc:`guide/auto_mode`\n\n\n .. note::\n\n This class currently exposes just the attributes that are most commonly used by all\n vehicle types. if you need to add additional attributes then subclass ``Vehicle``\n as demonstrated in :doc:`examples/create_attribute`.\n\n Please then :doc:`contribute <contributing/contributions_api>` your additions back\n to the project!\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n #\n # Private sugar methods\n #\n\n\n\n\n #\n # Operations to support the standard API.\n #\n\n\n\n\n\n\n\n\n\n\n\n\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.Vehicle", "header": "['module', '___EOS___']", "index": 961 }, { "content": " def __init__(self, handler):\n super(Vehicle, self).__init__()\n\n self._handler = handler\n self._master = handler.master\n\n # Cache all updated attributes for wait_ready.\n # By default, we presume all \"commands\" are loaded.\n self._ready_attrs = set(['commands'])\n\n # Default parameters when calling wait_ready() or wait_ready(True).\n self._default_ready_attrs = ['parameters', 'gps_0', 'armed', 'mode', 'attitude']\n\n @self.on_attribute('*')\n def listener(_, name, value):\n self._ready_attrs.add(name)\n\n # Attaches message listeners.\n self._message_listeners = dict()\n\n @handler.forward_message\n def listener(_, msg):\n self.notify_message_listeners(msg.get_type(), msg)\n\n self._location = Locations(self)\n self._vx = None\n self._vy = None\n self._vz = None\n\n @self.on_message('GLOBAL_POSITION_INT')\n def listener(self, name, m):\n (self._vx, self._vy, self._vz) = (m.vx / 100.0, m.vy / 100.0, m.vz / 100.0)\n self.notify_attribute_listeners('velocity', self.velocity)\n\n self._pitch = None\n self._yaw = None\n self._roll = None\n self._pitchspeed = None\n self._yawspeed = None\n self._rollspeed = None\n\n @self.on_message('ATTITUDE')\n def listener(self, name, m):\n self._pitch = m.pitch\n self._yaw = m.yaw\n self._roll = m.roll\n self._pitchspeed = m.pitchspeed\n self._yawspeed = m.yawspeed\n self._rollspeed = m.rollspeed\n self.notify_attribute_listeners('attitude', self.attitude)\n\n self._heading = None\n self._airspeed = None\n self._groundspeed = None\n\n @self.on_message('VFR_HUD')\n def listener(self, name, m):\n self._heading = m.heading\n self.notify_attribute_listeners('heading', self.heading)\n self._airspeed = m.airspeed\n self.notify_attribute_listeners('airspeed', self.airspeed)\n self._groundspeed = m.groundspeed\n self.notify_attribute_listeners('groundspeed', self.groundspeed)\n\n self._rngfnd_distance = None\n self._rngfnd_voltage = None\n\n @self.on_message('RANGEFINDER')\n def listener(self, name, m):\n self._rngfnd_distance = m.distance\n self._rngfnd_voltage = m.voltage\n self.notify_attribute_listeners('rangefinder', self.rangefinder)\n\n self._mount_pitch = None\n self._mount_yaw = None\n self._mount_roll = None\n\n @self.on_message('MOUNT_STATUS')\n def listener(self, name, m):\n self._mount_pitch = m.pointing_a / 100.0\n self._mount_roll = m.pointing_b / 100.0\n self._mount_yaw = m.pointing_c / 100.0\n self.notify_attribute_listeners('mount', self.mount_status)\n\n self._capabilities = None\n self._raw_version =None\n self._autopilot_version_msg_count = 0\n\n @self.on_message('AUTOPILOT_VERSION')\n def listener(vehicle, name, m):\n self._capabilities = m.capabilities\n self._raw_version = m.flight_sw_version\n self._autopilot_version_msg_count += 1\n if self._capabilities != 0 or self._autopilot_version_msg_count > 5:\n # ArduPilot <3.4 fails to send capabilities correctly\n # straight after boot, and even older versions send\n # this back as always-0.\n vehicle.remove_message_listener('HEARTBEAT', self.send_capabilties_request)\n self.notify_attribute_listeners('autopilot_version', self._raw_version)\n\n # gimbal\n self._gimbal = Gimbal(self)\n\n # All keys are strings.\n self._channels = Channels(self, 8)\n\n @self.on_message('RC_CHANNELS_RAW')\n def listener(self, name, m):\n def set_rc(chnum, v):\n '''Private utility for handling rc channel messages'''\n # use port to allow ch nums greater than 8\n self._channels._update_channel(str(m.port * 8 + chnum), v)\n\n set_rc(1, m.chan1_raw)\n set_rc(2, m.chan2_raw)\n set_rc(3, m.chan3_raw)\n set_rc(4, m.chan4_raw)\n set_rc(5, m.chan5_raw)\n set_rc(6, m.chan6_raw)\n set_rc(7, m.chan7_raw)\n set_rc(8, m.chan8_raw)\n self.notify_attribute_listeners('channels', self.channels)\n\n self._voltage = None\n self._current = None\n self._level = None\n\n @self.on_message('SYS_STATUS')\n def listener(self, name, m):\n self._voltage = m.voltage_battery\n self._current = m.current_battery\n self._level = m.battery_remaining\n self.notify_attribute_listeners('battery', self.battery)\n\n self._eph = None\n self._epv = None\n self._satellites_visible = None\n self._fix_type = None # FIXME support multiple GPSs per vehicle - possibly by using componentId\n\n @self.on_message('GPS_RAW_INT')\n def listener(self, name, m):\n self._eph = m.eph\n self._epv = m.epv\n self._satellites_visible = m.satellites_visible\n self._fix_type = m.fix_type\n self.notify_attribute_listeners('gps_0', self.gps_0)\n\n self._current_waypoint = 0\n\n @self.on_message(['WAYPOINT_CURRENT', 'MISSION_CURRENT'])\n def listener(self, name, m):\n self._current_waypoint = m.seq\n\n self._ekf_poshorizabs = False\n self._ekf_constposmode = False\n self._ekf_predposhorizabs = False\n\n @self.on_message('EKF_STATUS_REPORT')\n def listener(self, name, m):\n # boolean: EKF's horizontal position (absolute) estimate is good\n self._ekf_poshorizabs = (m.flags & ardupilotmega.EKF_POS_HORIZ_ABS) > 0\n # boolean: EKF is in constant position mode and does not know it's absolute or relative position\n self._ekf_constposmode = (m.flags & ardupilotmega.EKF_CONST_POS_MODE) > 0\n # boolean: EKF's predicted horizontal position (absolute) estimate is good\n self._ekf_predposhorizabs = (m.flags & ardupilotmega.EKF_PRED_POS_HORIZ_ABS) > 0\n\n self.notify_attribute_listeners('ekf_ok', self.ekf_ok, cache=True)\n\n self._flightmode = 'AUTO'\n self._armed = False\n self._system_status = None\n self._autopilot_type = None#PX4, ArduPilot, etc.\n self._vehicle_type = None#quadcopter, plane, etc.\n\n @self.on_message('HEARTBEAT')\n def listener(self, name, m):\n self._armed = (m.base_mode & mavutil.mavlink.MAV_MODE_FLAG_SAFETY_ARMED) != 0\n self.notify_attribute_listeners('armed', self.armed, cache=True)\n self._autopilot_type = m.autopilot\n self._vehicle_type = m.type\n if self._is_mode_available(m.custom_mode) == False:\n raise APIException(\"mode %s not available on mavlink definition\" % m.custom_mode)\n self._flightmode = self._mode_mapping_bynumber[m.custom_mode]\n self.notify_attribute_listeners('mode', self.mode, cache=True)\n self._system_status = m.system_status\n self.notify_attribute_listeners('system_status', self.system_status, cache=True)\n\n # Waypoints.\n\n self._home_location = None\n self._wploader = mavwp.MAVWPLoader()\n self._wp_loaded = True\n self._wp_uploaded = None\n self._wpts_dirty = False\n self._commands = CommandSequence(self)\n\n @self.on_message(['WAYPOINT_COUNT', 'MISSION_COUNT'])\n def listener(self, name, msg):\n if not self._wp_loaded:\n self._wploader.clear()\n self._wploader.expected_count = msg.count\n self._master.waypoint_request_send(0)\n\n @self.on_message(['WAYPOINT', 'MISSION_ITEM'])\n def listener(self, name, msg):\n if not self._wp_loaded:\n if msg.seq == 0:\n if not (msg.x == 0 and msg.y == 0 and msg.z == 0):\n self._home_location = LocationGlobal(msg.x, msg.y, msg.z)\n\n if msg.seq > self._wploader.count():\n # Unexpected waypoint\n pass\n elif msg.seq < self._wploader.count():\n # Waypoint duplicate\n pass\n else:\n self._wploader.add(msg)\n\n if msg.seq + 1 < self._wploader.expected_count:\n self._master.waypoint_request_send(msg.seq + 1)\n else:\n self._wp_loaded = True\n self.notify_attribute_listeners('commands', self.commands)\n\n # Waypoint send to master\n @self.on_message(['WAYPOINT_REQUEST', 'MISSION_REQUEST'])\n def listener(self, name, msg):\n if self._wp_uploaded != None:\n wp = self._wploader.wp(msg.seq)\n handler.fix_targets(wp)\n self._master.mav.send(wp)\n self._wp_uploaded[msg.seq] = True\n\n # TODO: Waypoint loop listeners\n\n # Parameters.\n\n start_duration = 0.2\n repeat_duration = 1\n\n self._params_count = -1\n self._params_set = []\n self._params_loaded = False\n self._params_start = False\n self._params_map = {}\n self._params_last = monotonic.monotonic() # Last new param.\n self._params_duration = start_duration\n self._parameters = Parameters(self)\n\n @handler.forward_loop\n def listener(_):\n # Check the time duration for last \"new\" params exceeds watchdog.\n if not self._params_start:\n return\n\n if None not in self._params_set and not self._params_loaded:\n self._params_loaded = True\n self.notify_attribute_listeners('parameters', self.parameters)\n\n if not self._params_loaded and monotonic.monotonic() - self._params_last > self._params_duration:\n c = 0\n for i, v in enumerate(self._params_set):\n if v == None:\n self._master.mav.param_request_read_send(0, 0, '', i)\n c += 1\n if c > 50:\n break\n self._params_duration = repeat_duration\n self._params_last = monotonic.monotonic()\n\n @self.on_message(['PARAM_VALUE'])\n def listener(self, name, msg):\n # If we discover a new param count, assume we\n # are receiving a new param set.\n if self._params_count != msg.param_count:\n self._params_loaded = False\n self._params_start = True\n self._params_count = msg.param_count\n self._params_set = [None] * msg.param_count\n\n # Attempt to set the params. We throw an error\n # if the index is out of range of the count or\n # we lack a param_id.\n try:\n if msg.param_index < msg.param_count and msg:\n if self._params_set[msg.param_index] == None:\n self._params_last = monotonic.monotonic()\n self._params_duration = start_duration\n self._params_set[msg.param_index] = msg\n self._params_map[msg.param_id] = msg.param_value\n self._parameters.notify_attribute_listeners(msg.param_id, msg.param_value,\n cache=True)\n except:\n import traceback\n traceback.print_exc()\n\n # Heartbeats.\n\n self._heartbeat_started = False\n self._heartbeat_lastsent = 0\n self._heartbeat_lastreceived = 0\n self._heartbeat_timeout = False\n\n self._heartbeat_warning = 5\n self._heartbeat_error = 30\n self._heartbeat_system = None\n\n @handler.forward_loop\n def listener(_):\n # Send 1 heartbeat per second\n if monotonic.monotonic() - self._heartbeat_lastsent > 1:\n self._master.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,\n mavutil.mavlink.MAV_AUTOPILOT_INVALID, 0, 0, 0)\n self._heartbeat_lastsent = monotonic.monotonic()\n\n # Timeouts.\n if self._heartbeat_started:\n if self._heartbeat_error and self._heartbeat_error > 0 and monotonic.monotonic(\n ) - self._heartbeat_lastreceived > self._heartbeat_error:\n raise APIException('No heartbeat in %s seconds, aborting.' %\n self._heartbeat_error)\n elif monotonic.monotonic() - self._heartbeat_lastreceived > self._heartbeat_warning:\n if self._heartbeat_timeout == False:\n errprinter('>>> Link timeout, no heartbeat in last %s seconds' %\n self._heartbeat_warning)\n self._heartbeat_timeout = True\n\n @self.on_message(['HEARTBEAT'])\n def listener(self, name, msg):\n self._heartbeat_system = msg.get_srcSystem()\n self._heartbeat_lastreceived = monotonic.monotonic()\n if self._heartbeat_timeout:\n errprinter('>>> ...link restored.')\n self._heartbeat_timeout = False\n\n self._last_heartbeat = None\n\n @handler.forward_loop\n def listener(_):\n if self._heartbeat_lastreceived:\n self._last_heartbeat = monotonic.monotonic() - self._heartbeat_lastreceived\n self.notify_attribute_listeners('last_heartbeat', self.last_heartbeat)", "metadata": "root.Vehicle.__init__", "header": "['class', 'Vehicle', '(', 'HasObservers', ')', ':', '___EOS___']", "index": 999 }, { "content": " def on_message(self, name):\n \"\"\"\n Decorator for message listener callback functions.\n\n .. tip::\n\n This is the most elegant way to define message listener callback functions.\n Use :py:func:`add_message_listener` only if you need to be able to\n :py:func:`remove the listener <remove_message_listener>` later.\n\n A decorated message listener function is called with three arguments every time the\n specified message is received:\n\n * ``self`` - the current vehicle.\n * ``name`` - the name of the message that was intercepted.\n * ``message`` - the actual message (a `pymavlink <http://www.qgroundcontrol.org/mavlink/pymavlink>`_\n `class <https://www.samba.org/tridge/UAV/pymavlink/apidocs/classIndex.html>`_).\n\n For example, in the fragment below ``my_method`` will be called for every heartbeat message:\n\n .. code:: python\n\n @vehicle.on_message('HEARTBEAT')\n def my_method(self, name, msg):\n pass\n\n See :ref:`mavlink_messages` for more information.\n\n :param String name: The name of the message to be intercepted by the decorated listener function (or '*' to get all messages).\n \"\"\"\n\n def decorator(fn):\n if isinstance(name, list):\n for n in name:\n self.add_message_listener(n, fn)\n else:\n self.add_message_listener(name, fn)\n\n return decorator", "metadata": "root.Vehicle.on_message", "header": "['class', 'Vehicle', '(', 'HasObservers', ')', ':', '___EOS___']", "index": 1380 } ]
[ { "span": "self.on_attribute('*')", "start_line": 1012, "start_column": 9, "end_line": 1012, "end_column": 31 }, { "span": "self.on_message('GLOBAL_POSITION_INT')", "start_line": 1028, "start_column": 9, "end_line": 1028, "end_column": 47 }, { "span": "self.on_message('ATTITUDE')", "start_line": 1040, "start_column": 9, "end_line": 1040, "end_column": 36 }, { "span": "self.on_message('VFR_HUD')", "start_line": 1054, "start_column": 9, "end_line": 1054, "end_column": 35 }, { "span": "self.on_message('RANGEFINDER')", "start_line": 1066, "start_column": 9, "end_line": 1066, "end_column": 39 }, { "span": "self.on_message('MOUNT_STATUS')", "start_line": 1076, "start_column": 9, "end_line": 1076, "end_column": 40 }, { "span": "self.on_message('AUTOPILOT_VERSION')", "start_line": 1087, "start_column": 9, "end_line": 1087, "end_column": 45 }, { "span": "self.on_message('RC_CHANNELS_RAW')", "start_line": 1105, "start_column": 9, "end_line": 1105, "end_column": 43 }, { "span": "self.on_message('SYS_STATUS')", "start_line": 1126, "start_column": 9, "end_line": 1126, "end_column": 38 }, { "span": "self.on_message('GPS_RAW_INT')", "start_line": 1138, "start_column": 9, "end_line": 1138, "end_column": 39 }, { "span": "self.on_message(['WAYPOINT_CURRENT', 'MISSION_CURRENT'])", "start_line": 1148, "start_column": 9, "end_line": 1148, "end_column": 65 }, { "span": "self.on_message('EKF_STATUS_REPORT')", "start_line": 1156, "start_column": 9, "end_line": 1156, "end_column": 45 }, { "span": "self.on_message('HEARTBEAT')", "start_line": 1173, "start_column": 9, "end_line": 1173, "end_column": 37 }, { "span": "self.on_message(['WAYPOINT_COUNT', 'MISSION_COUNT'])", "start_line": 1195, "start_column": 9, "end_line": 1195, "end_column": 61 }, { "span": "self.on_message(['WAYPOINT', 'MISSION_ITEM'])", "start_line": 1202, "start_column": 9, "end_line": 1202, "end_column": 54 }, { "span": "self.on_message(['WAYPOINT_REQUEST', 'MISSION_REQUEST'])", "start_line": 1225, "start_column": 9, "end_line": 1225, "end_column": 65 }, { "span": "self.on_message(['PARAM_VALUE'])", "start_line": 1270, "start_column": 9, "end_line": 1270, "end_column": 41 }, { "span": "self.on_message(['HEARTBEAT'])", "start_line": 1327, "start_column": 9, "end_line": 1327, "end_column": 39 } ]
[ { "span": "def decorator(fn):", "start_line": 684, "start_column": 8, "end_line": 684, "end_column": 26 }, { "span": "def decorator(fn):", "start_line": 1411, "start_column": 8, "end_line": 1411, "end_column": 26 } ]
1
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Has", "Observer", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Has", "Observer", "s_", "(_", "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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "mapping", " ", "from", " ", "attr", "\\u", "name", " ", "to", " ", "a", " ", "list", " ", "of", " ", "observers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "attribute", "\\u", "listeners_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "attribute", "\\u", "cache_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Has", "Observer", "s_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "attribute_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decorat", "or", " ", "for", " ", "attribute", " ", "listeners", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "decorated", " ", "function", " ", "(", "``", "observer", "``)", " ", "is", " ", "invoke", "d", " ", "different", "ly", " ", "depend", "ing", " ", "on", " ", "the", " ", "*", "type", " ", "of", " ", "attribute", "*.", "\\", "10", ";", " ", " ", " ", " ", "Attribute", "s", " ", "tha", "t", " ", "represent", " ", "sensor", " ", "values", " ", "or", " ", "whi", "ch", " ", "are", " ", "used", " ", "to", " ", "monit", "or", " ", "connecti", "on", " ", "status", " ", "are", " ", "update", "d", "\\", "10", ";", " ", " ", " ", " ", "whe", "neve", "r", " ", "a", " ", "message", " ", "is", " ", "receive", "d", " ", "from", " ", "the", " ", "vehic", "le", ".", " ", "Attribute", "s", " ", "whi", "ch", " ", "reflect", " ", "vehic", "le", " ", "\"", "state", "\"", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "only", " ", "update", "d", " ", "whe", "n", " ", "thei", "r", " ", "values", " ", "change", " ", "(", "for", " ", "example", " ", ":", "py", ":", "func", ":`", "Vehicle", ".", "system", "\\u", "status", "`", ",", "\\", "10", ";", " ", " ", " ", " ", ":", "py", ":", "attr", ":`", "Vehicle", ".", "arme", "d", "`", ",", " ", "and", " ", ":", "py", ":", "attr", ":`", "Vehicle", ".", "mode", "`)", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "argu", "ment", " ", "list", " ", "for", " ", "the", " ", "callback", " ", "is", " ", "``", "observer", "(", "object", ",", " ", "attr", "\\u", "name", ",", " ", "attribute", "\\u", "value", ")`", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``", "self", "``", " ", "-", " ", "the", " ", "associate", "d", " ", ":", "py", ":", "class", ":`", "Vehicle", "`.", " ", "Thi", "s", " ", "may", " ", "be", " ", "compare", "d", " ", "to", " ", "a", " ", "global", " ", "vehic", "le", " ", "handle", "\\", "10", ";", " ", " ", "to", " ", "implement", " ", "vehic", "le", "-", "specific", " ", "callback", " ", "handling", " ", "(", "if", " ", "need", "ed", ").", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``", "attr", "\\u", "name", "``", " ", "-", " ", "the", " ", "attribute", " ", "name", ".", " ", "Thi", "s", " ", "can", " ", "be", " ", "used", " ", "to", " ", "infer", " ", "whi", "ch", " ", "attribute", " ", "has", " ", "trigger", "ed", "\\", "10", ";", " ", " ", "if", " ", "the", " ", "same", " ", "callback", " ", "is", " ", "used", " ", "for", " ", "watch", "ing", " ", "sever", "al", " ", "attribute", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``", "msg", "``", " ", "-", " ", "the", " ", "attribute", " ", "value", " ", "(", "so", " ", "you", " ", "don", "'", "t", " ", "need", " ", "to", " ", "re", "-", "query", " ", "the", " ", "vehic", "le", " ", "object", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "note", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "There", " ", "is", " ", "no", " ", "way", " ", "to", " ", "remove", " ", "an", " ", "attribute", " ", "listen", "er", " ", "adde", "d", " ", "with", " ", "this", " ", "decorat", "or", ".", " ", "Us", "e", "\\", "10", ";", " ", " ", " ", " ", ":", "py", ":", "func", ":`", "add", "\\u", "attribute", "\\u", "listen", "er", "`", " ", "if", " ", "you", " ", "need", " ", "to", " ", "be", " ", "able", " ", "to", " ", "remove", "\\", "10", ";", " ", " ", " ", " ", "the", " ", ":", "py", ":", "func", ":`", "attribute", " ", "listen", "er", " ", "<", "remove", "\\u", "attribute", "\\u", "listen", "er", ">`", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "code", " ", "fragment", " ", "belo", "w", " ", "show", "s", " ", "how", " ", "you", " ", "can", " ", "create", " ", "a", " ", "listen", "er", " ", "for", " ", "the", " ", "atti", "tude", " ", "attribute", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "code", "::", " ", "python", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "vehic", "le", ".", "on", "\\u", "attribute", "('", "atti", "tude", "')", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "atti", "tude", "\\u", "listen", "er", "(", "self", ",", " ", "name", ",", " ", "msg", "):", "\\", "10", ";", " ", " ", " ", " ", "print", " ", "'%", "s", " ", "attribute", " ", "is", ":", " ", "%", "s", "'", " ", "%", " ", "(", "name", ",", " ", "msg", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", ":", "ref", ":`", "vehic", "le", "\\u", "state", "\\u", "observe", "\\u", "attribute", "s", "`", " ", "for", " ", "more", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "String", " ", "attr", "\\u", "name", ":", " ", "The", " ", "name", " ", "of", " ", "the", " ", "attribute", " ", "to", " ", "watch", " ", "(", "or", " ", "'*", "'", " ", "to", " ", "watch", " ", "all", " ", "attribute", "s", ").", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "observer", ":", " ", "The", " ", "callback", " ", "to", " ", "invoke", " ", "whe", "n", " ", "a", " ", "change", " ", "in", " ", "the", " ", "attribute", " ", "is", " ", "detect", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "decorator_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "name_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "add", "\\u", "attribute", "\\u", "listener_", "(_", "n_", ",_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "attribute", "\\u", "listener_", "(_", "name_", ",_", "fn_", ")_", "\\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_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Vehicle", "_", "(_", "Has", "Observer", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "main", " ", "vehic", "le", " ", "API", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Vehicle", " ", "state", " ", "is", " ", "exposed", " ", "through", " ", "'", "attribute", "s", "'", " ", "(", "e", ".", "g", ".", " ", ":", "py", ":", "attr", ":`", "heading", "`)", ".", " ", "All", " ", "attribute", "s", " ", "can", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "read", ",", " ", "and", " ", "some", " ", "are", " ", "als", "o", " ", "sett", "able", "\\", "10", ";", " ", " ", " ", " ", "(:", "py", ":", "attr", ":`", "mode", "`", ",", " ", ":", "py", ":", "attr", ":`", "arme", "d", "`", " ", "and", " ", ":", "py", ":", "attr", ":`", "home", "\\u", "location", "`)", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Attribute", "s", " ", "can", " ", "als", "o", " ", "be", " ", "async", "hronous", "ly", " ", "monitored", " ", "for", " ", "change", "s", " ", "by", " ", "register", "ing", " ", "listen", "er", " ", "callback", "\\", "10", ";", " ", " ", " ", " ", "function", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Vehicle", " ", "\"", "settings", "\"", " ", "(", "parameter", "s", ")", " ", "are", " ", "read", "/", "set", " ", "usi", "ng", " ", "the", " ", ":", "py", ":", "attr", ":`", "parameter", "s", "`", " ", "attribute", ".", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", " ", "can", " ", "be", " ", "iterate", "d", " ", "and", " ", "are", " ", "als", "o", " ", "individual", "ly", " ", "observable", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Vehicle", " ", "movement", " ", "is", " ", "prima", "ri", "ly", " ", "controlle", "d", " ", "usi", "ng", " ", "the", " ", ":", "py", ":", "attr", ":`", "arme", "d", "`", " ", "attribute", " ", "and", "\\", "10", ";", " ", " ", " ", " ", ":", "py", ":", "func", ":`", "simple", "\\u", "take", "off", "`", " ", "and", " ", ":", "py", ":", "func", ":`", "simple", "\\u", "got", "o", "`", " ", "in", " ", "GUID", "ED", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "is", " ", "als", "o", " ", "possib", "le", " ", "to", " ", "work", " ", "with", " ", "vehic", "le", " ", "\"", "missio", "ns", "\"", " ", "usi", "ng", " ", "the", " ", ":", "py", ":", "attr", ":`", "command", "s", "`", " ", "attribute", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "run", " ", "them", " ", "in", " ", "AUTO", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "guide", " ", "contain", "s", " ", "more", " ", "detailed", " ", "informati", "on", " ", "on", " ", "the", " ", "different", " ", "way", "s", " ", "you", " ", "can", " ", "use", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "``", "Vehicle", "``", " ", "class", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", ":", "doc", ":`", "guide", "/", "vehic", "le", "\\u", "state", "\\u", "and", "\\u", "parameter", "s", "`", "\\", "10", ";", " ", " ", " ", " ", "-", " ", ":", "doc", ":`", "guide", "/", "cop", "ter", "/", "guide", "d\\u", "mode", "`", "\\", "10", ";", " ", " ", " ", " ", "-", " ", ":", "doc", ":`", "guide", "/", "auto", "\\u", "mode", "`", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "note", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "currentl", "y", " ", "expos", "es", " ", "just", " ", "the", " ", "attribute", "s", " ", "tha", "t", " ", "are", " ", "most", " ", "common", "ly", " ", "used", " ", "by", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "vehic", "le", " ", "types", ".", " ", "if", " ", "you", " ", "need", " ", "to", " ", "add", " ", "addition", "al", " ", "attribute", "s", " ", "then", " ", "subclass", " ", "``", "Vehicle", "``", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "demonstrat", "ed", " ", "in", " ", ":", "doc", ":`", "example", "s", "/", "create", "\\u", "attribute", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ple", "ase", " ", "then", " ", ":", "doc", ":`", "contribute", " ", "<", "contrib", "uti", "ng", "/", "contributions", "\\u", "api", ">`", " ", "your", " ", "additions", " ", "back", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "project", "!", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Priva", "te", " ", "sugar", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Opera", "tion", "s", " ", "to", " ", "support", " ", "the", " ", "standard", " ", "API", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\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u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Vehicle", "_", "(_", "Has", "Observer", "s_", ")_", ":_", "\\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 ", " _", "super_", "(_", "Vehicle", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "handler_", "=_", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "master_", "=_", "handler_", "._", "master_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cache", " ", "all", " ", "update", "d", " ", "attribute", "s", " ", "for", " ", "wait", "\\u", "read", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "By", " ", "default", ",", " ", "we", " ", "presu", "me", " ", "all", " ", "\"", "command", "s", "\"", " ", "are", " ", "load", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "read", "y", "\\u", "attrs_", "=_", "set_", "(_", "[_", "'", "command", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Default", " ", "parameter", "s", " ", "whe", "n", " ", "calling", " ", "wait", "\\u", "read", "y", "()", " ", "or", " ", "wait", "\\u", "read", "y", "(", "Tru", "e", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "default", "\\u", "read", "y", "\\u", "attrs_", "=_", "[_", "'", "parameter", "s", "'_", ",_", "'", "gps", "\\u", "0", "'_", ",_", "'", "arme", "d", "'_", ",_", "'", "mode", "'_", ",_", "'", "atti", "tude", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "attribute_", "(_", "'*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "\\u_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "read", "y", "\\u", "attrs_", "._", "add_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Attache", "s", " ", "message", " ", "listeners", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "message", "\\u", "listeners_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "handler_", "._", "forward", "\\u", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "\\u_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "notif", "y", "\\u", "message", "\\u", "listeners_", "(_", "msg_", "._", "get", "\\u", "type_", "(_", ")_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "location_", "=_", "Locations_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "vx_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "vy_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "vz", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "GLOB", "AL", "\\u", "POSITION", "\\u", "INT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "self_", "._", "\\u", "vx_", ",_", "self_", "._", "\\u", "vy_", ",_", "self_", "._", "\\u", "vz", "_", ")_", "=_", "(_", "m_", "._", "vx_", "/_", "100.0_", ",_", "m_", "._", "vy_", "/_", "100.0_", ",_", "m_", "._", "vz", "_", "/_", "100.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "velo", "city", "'_", ",_", "self_", "._", "velocity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "pitch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "yaw_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "roll_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "pitch", "speed_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "yaw", "speed_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "roll", "speed_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "ATT", "ITU", "DE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "pitch_", "=_", "m_", "._", "pitch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "yaw_", "=_", "m_", "._", "yaw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "roll_", "=_", "m_", "._", "roll_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "pitch", "speed_", "=_", "m_", "._", "pitch", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "yaw", "speed_", "=_", "m_", "._", "yaw", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "roll", "speed_", "=_", "m_", "._", "roll", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "atti", "tude", "'_", ",_", "self_", "._", "atti", "tude", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "heading_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "airs", "peed", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ground", "speed_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "VF", "R", "\\u", "HU", "D", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "heading_", "=_", "m_", "._", "heading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "heading", "'_", ",_", "self_", "._", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "airs", "peed", "_", "=_", "m_", "._", "airs", "peed", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "airs", "peed", "'_", ",_", "self_", "._", "airs", "peed", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ground", "speed_", "=_", "m_", "._", "ground", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "ground", "speed", "'_", ",_", "self_", "._", "ground", "speed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "rng", "fn", "d\\u", "distance_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "rng", "fn", "d\\u", "voltage_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "RANGE", "FIND", "ER", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "rng", "fn", "d\\u", "distance_", "=_", "m_", "._", "distance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "rng", "fn", "d\\u", "voltage_", "=_", "m_", "._", "voltage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "range", "finde", "r", "'_", ",_", "self_", "._", "range", "finder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "mount", "\\u", "pitch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mount", "\\u", "yaw_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mount", "\\u", "roll_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "MOUNT", "\\u", "STATUS", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "mount", "\\u", "pitch_", "=_", "m_", "._", "pointi", "ng", "\\u", "a_", "/_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mount", "\\u", "roll_", "=_", "m_", "._", "pointi", "ng", "\\u", "b_", "/_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mount", "\\u", "yaw_", "=_", "m_", "._", "pointi", "ng", "\\u", "c_", "/_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "mount", "'_", ",_", "self_", "._", "mount", "\\u", "status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "capabilities_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "raw", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "autop", "ilo", "t", "\\u", "version", "\\u", "msg", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "AUTO", "PI", "LOT", "\\u", "VERSI", "ON", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "vehicle_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "capabilities_", "=_", "m_", "._", "capabilities_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "raw", "\\u", "version_", "=_", "m_", "._", "flight", "\\u", "sw", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "autop", "ilo", "t", "\\u", "version", "\\u", "msg", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "capabilities_", "!=_", "0_", "or_", "self_", "._", "\\u", "autop", "ilo", "t", "\\u", "version", "\\u", "msg", "\\u", "count_", ">_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ar", "du", "Pilo", "t", " ", "<", "3.4", " ", "fail", "s", " ", "to", " ", "send", " ", "capab", "ilities", " ", "correct", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "straight", " ", "after", " ", "boot", ",", " ", "and", " ", "even", " ", "older", " ", "version", "s", " ", "send_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "back", " ", "as", " ", "alw", "ay", "s", "-0", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vehicle_", "._", "remove", "\\u", "message", "\\u", "listener_", "(_", "'", "HEA", "RT", "BEA", "T", "'_", ",_", "self_", "._", "send", "\\u", "capab", "ilt", "ies", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "autop", "ilo", "t", "\\u", "version", "'_", ",_", "self_", "._", "\\u", "raw", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gi", "mba", "l_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "gi", "mba", "l_", "=_", "Gi", "mba", "l_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "keys", " ", "are", " ", "string", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "channels_", "=_", "Channels_", "(_", "self_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "RC", "\\u", "CHANNELS", "\\u", "RA", "W", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set\\u", "rc_", "(_", "chn", "um_", ",_", "v_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Priva", "te", " ", "utility", " ", "for", " ", "handling", " ", "rc", " ", "channel", " ", "message", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "use", " ", "port", " ", "to", " ", "allow", " ", "ch", " ", "nums", " ", "great", "er", " ", "than", " ", "8_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "channels_", "._", "\\u", "update", "\\u", "channel_", "(_", "str_", "(_", "m_", "._", "port_", "*_", "8_", "+_", "chn", "um_", ")_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "set\\u", "rc_", "(_", "1_", ",_", "m_", "._", "chan", "1", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "2_", ",_", "m_", "._", "chan", "2", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "3_", ",_", "m_", "._", "chan", "3", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "4_", ",_", "m_", "._", "chan", "4", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "5_", ",_", "m_", "._", "chan", "5", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "6_", ",_", "m_", "._", "chan", "6", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "7_", ",_", "m_", "._", "chan", "7", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "rc_", "(_", "8_", ",_", "m_", "._", "chan", "8", "\\u", "raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "channel", "s", "'_", ",_", "self_", "._", "channels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "voltage_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "current_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "level_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "SYS", "\\u", "STATUS", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "voltage_", "=_", "m_", "._", "voltage", "\\u", "battery", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "current_", "=_", "m_", "._", "current", "\\u", "battery", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "level_", "=_", "m_", "._", "battery", "\\u", "remaining_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "battery", "'_", ",_", "self_", "._", "battery", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "eph", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ep", "v_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "satellite", "s", "\\u", "visible_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "fix", "\\u", "type_", "=_", "None_", "#", " ", "FIX", "ME", " ", "support", " ", "multiple", " ", "GPS", "s", " ", "per", " ", "vehic", "le", " ", "-", " ", "possib", "ly", " ", "by", " ", "usi", "ng", " ", "component", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "GPS", "\\u", "RA", "W", "\\u", "INT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "eph", "_", "=_", "m_", "._", "eph", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ep", "v_", "=_", "m_", "._", "ep", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "satellite", "s", "\\u", "visible_", "=_", "m_", "._", "satellite", "s", "\\u", "visible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "fix", "\\u", "type_", "=_", "m_", "._", "fix", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "gps", "\\u", "0", "'_", ",_", "self_", "._", "gps", "\\u", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "current", "\\u", "waypoint", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "[_", "'", "WAY", "POINT", "\\u", "CURREN", "T", "'_", ",_", "'", "MISSI", "ON", "\\u", "CURREN", "T", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "current", "\\u", "waypoint", "_", "=_", "m_", "._", "seq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "ek", "f", "\\u", "pos", "horiz", "abs_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ek", "f", "\\u", "const", "pos", "mode_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ek", "f", "\\u", "pred", "pos", "horiz", "abs_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "EK", "F", "\\u", "STATUS", "\\u", "REPORT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "boolean", ":", " ", "EK", "F", "'", "s", " ", "horizon", "tal", " ", "position", " ", "(", "abs", "olute", ")", " ", "estimate", " ", "is", " ", "good_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "ek", "f", "\\u", "pos", "horiz", "abs_", "=_", "(_", "m_", "._", "flags_", "&_", "ard", "upi", "lot", "mega", "_", "._", "EK", "F", "\\u", "POS", "\\u", "HORI", "Z", "\\u", "ABS", "_", ")_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "boolean", ":", " ", "EK", "F", " ", "is", " ", "in", " ", "constant", " ", "position", " ", "mode", " ", "and", " ", "doe", "s", " ", "not", " ", "know", " ", "it", "'", "s", " ", "abs", "olute", " ", "or", " ", "relative", " ", "position_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "ek", "f", "\\u", "const", "pos", "mode_", "=_", "(_", "m_", "._", "flags_", "&_", "ard", "upi", "lot", "mega", "_", "._", "EK", "F", "\\u", "CONST", "\\u", "POS", "\\u", "MODE_", ")_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "boolean", ":", " ", "EK", "F", "'", "s", " ", "predi", "cte", "d", " ", "horizon", "tal", " ", "position", " ", "(", "abs", "olute", ")", " ", "estimate", " ", "is", " ", "good_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "ek", "f", "\\u", "pred", "pos", "horiz", "abs_", "=_", "(_", "m_", "._", "flags_", "&_", "ard", "upi", "lot", "mega", "_", "._", "EK", "F", "\\u", "PRE", "D", "\\u", "POS", "\\u", "HORI", "Z", "\\u", "ABS", "_", ")_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "ek", "f", "\\u", "ok", "'_", ",_", "self_", "._", "ek", "f", "\\u", "ok_", ",_", "cache_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "flight", "mode_", "=_", "'", "AUTO", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "arme", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "system", "\\u", "status_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "autop", "ilo", "t", "\\u", "type_", "=_", "None_", "#", "PX", "4", ",", " ", "Ar", "du", "Pilo", "t", ",", " ", "etc", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "vehic", "le", "\\u", "type_", "=_", "None_", "#", "quad", "cop", "ter", ",", " ", "plane", ",", " ", "etc", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "'", "HEA", "RT", "BEA", "T", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "m_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "arme", "d_", "=_", "(_", "m_", "._", "base", "\\u", "mode_", "&_", "mav", "util_", "._", "mavlink", "_", "._", "MAV", "\\u", "MODE", "\\u", "FLAG", "\\u", "SAFE", "TY", "\\u", "ARM", "ED_", ")_", "!=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "arme", "d", "'_", ",_", "self_", "._", "arme", "d_", ",_", "cache_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "autop", "ilo", "t", "\\u", "type_", "=_", "m_", "._", "autop", "ilo", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "vehic", "le", "\\u", "type_", "=_", "m_", "._", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "is", "\\u", "mode", "\\u", "available_", "(_", "m_", "._", "custom", "\\u", "mode_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "API", "Exception_", "(_", "\"", "mode", " ", "%", "s", " ", "not", " ", "avail", "able", " ", "on", " ", "mavlink", " ", "definit", "ion", "\"_", "%_", "m_", "._", "custom", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "flight", "mode_", "=_", "self_", "._", "\\u", "mode", "\\u", "mapping", "\\u", "by", "number_", "[_", "m_", "._", "custom", "\\u", "mode_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "mode", "'_", ",_", "self_", "._", "mode_", ",_", "cache_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "system", "\\u", "status_", "=_", "m_", "._", "system", "\\u", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "system", "\\u", "status", "'_", ",_", "self_", "._", "system", "\\u", "status_", ",_", "cache_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Way", "points", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "home", "\\u", "location_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wp", "loader_", "=_", "mav", "wp_", "._", "MAV", "WP", "Loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wp", "\\u", "loaded_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wp", "\\u", "uploade", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wpt", "s", "\\u", "dirty_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "commands_", "=_", "Command", "Sequence_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "[_", "'", "WAY", "POINT", "\\u", "COUNT", "'_", ",_", "'", "MISSI", "ON", "\\u", "COUNT", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "wp", "\\u", "loaded_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "wp", "loader_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wp", "loader_", "._", "expected", "\\u", "count_", "=_", "msg_", "._", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "master_", "._", "waypoint", "\\u", "request", "\\u", "send_", "(_", "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_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "[_", "'", "WAY", "POINT", "'_", ",_", "'", "MISSI", "ON", "\\u", "ITEM", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "wp", "\\u", "loaded_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "msg_", "._", "seq_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "(_", "msg_", "._", "x_", "==_", "0_", "and_", "msg_", "._", "y_", "==_", "0_", "and_", "msg_", "._", "z_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "home", "\\u", "location_", "=_", "Locat", "ion", "Global_", "(_", "msg_", "._", "x_", ",_", "msg_", "._", "y_", ",_", "msg_", "._", "z_", ")_", "\\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_", "msg_", "._", "seq_", ">_", "self_", "._", "\\u", "wp", "loader_", "._", "count_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Une", "xpe", "cte", "d", " ", "waypoint", "_", "\\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_", "elif_", "msg_", "._", "seq_", "<_", "self_", "._", "\\u", "wp", "loader_", "._", "count_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Way", "point", " ", "duplicate_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "wp", "loader_", "._", "add_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "msg_", "._", "seq_", "+_", "1_", "<_", "self_", "._", "\\u", "wp", "loader_", "._", "expected", "\\u", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "master_", "._", "waypoint", "\\u", "request", "\\u", "send_", "(_", "msg_", "._", "seq_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "wp", "\\u", "loaded_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "command", "s", "'_", ",_", "self_", "._", "commands_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Way", "point", " ", "send", " ", "to", " ", "master_", "\\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_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "[_", "'", "WAY", "POINT", "\\u", "REQUEST", "'_", ",_", "'", "MISSI", "ON", "\\u", "REQUEST", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "wp", "\\u", "uploade", "d_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wp_", "=_", "self_", "._", "\\u", "wp", "loader_", "._", "wp_", "(_", "msg_", "._", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "fix", "\\u", "targets_", "(_", "wp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "master_", "._", "mav_", "._", "send_", "(_", "wp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wp", "\\u", "uploade", "d_", "[_", "msg_", "._", "seq_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Way", "point", " ", "loop", " ", "listeners_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Parameter", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start", "\\u", "duration_", "=_", "0.2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repeat", "\\u", "duration_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "count_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "set_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "loaded_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "start_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "last_", "=_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "#", " ", "Las", "t", " ", "new", " ", "param", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "duration_", "=_", "start", "\\u", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "parameters_", "=_", "Parameters_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "handler_", "._", "forward", "\\u", "loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "time", " ", "duration", " ", "for", " ", "last", " ", "\"", "new", "\"", " ", "params", " ", "exceed", "s", " ", "watchdog", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "params", "\\u", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "None_", "not_", "in_", "self_", "._", "\\u", "params", "\\u", "set_", "and_", "not_", "self_", "._", "\\u", "params", "\\u", "loaded_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "params", "\\u", "loaded_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "parameter", "s", "'_", ",_", "self_", "._", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "params", "\\u", "loaded_", "and_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "-_", "self_", "._", "\\u", "params", "\\u", "last_", ">_", "self_", "._", "\\u", "params", "\\u", "duration_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "v_", "in_", "enumerate_", "(_", "self_", "._", "\\u", "params", "\\u", "set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "v_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "master_", "._", "mav_", "._", "param", "\\u", "request", "\\u", "read", "\\u", "send_", "(_", "0_", ",_", "0_", ",_", "''_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", ">_", "50_", ":_", "\\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_", "self_", "._", "\\u", "params", "\\u", "duration_", "=_", "repeat", "\\u", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "last_", "=_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "\\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_", "._", "on", "\\u", "message_", "(_", "[_", "'", "PARAM", "\\u", "VALU", "E", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "discove", "r", " ", "a", " ", "new", " ", "param", " ", "count", ",", " ", "assume", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "receiv", "ing", " ", "a", " ", "new", " ", "param", " ", "set", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "params", "\\u", "count_", "!=_", "msg_", "._", "param", "\\u", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "params", "\\u", "loaded_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "start_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "count_", "=_", "msg_", "._", "param", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "set_", "=_", "[_", "None_", "]_", "*_", "msg_", "._", "param", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "set", " ", "the", " ", "params", ".", " ", "We", " ", "throw", " ", "an", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "index", " ", "is", " ", "out", " ", "of", " ", "range", " ", "of", " ", "the", " ", "count", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "lack", " ", "a", " ", "param", "\\u", "id", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "msg_", "._", "param", "\\u", "index_", "<_", "msg_", "._", "param", "\\u", "count_", "and_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "\\u", "params", "\\u", "set_", "[_", "msg_", "._", "param", "\\u", "index_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "\\u", "params", "\\u", "last_", "=_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "duration_", "=_", "start", "\\u", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "set_", "[_", "msg_", "._", "param", "\\u", "index_", "]_", "=_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "params", "\\u", "map_", "[_", "msg_", "._", "param", "\\u", "id_", "]_", "=_", "msg_", "._", "param", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "parameters_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "msg_", "._", "param", "\\u", "id_", ",_", "msg_", "._", "param", "\\u", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cache_", "=_", "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 ", " _", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Heart", "beats", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "started_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "lasts", "ent_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "lastr", "ece", "ive", "d_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "timeout_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "warning_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "error_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "system_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "handler_", "._", "forward", "\\u", "loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sen", "d", " ", "1", " ", "heart", "beat", " ", "per", " ", "second_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "-_", "self_", "._", "\\u", "heart", "beat", "\\u", "lasts", "ent_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "master_", "._", "mav_", "._", "heart", "beat", "\\u", "send_", "(_", "mav", "util_", "._", "mavlink", "_", "._", "MAV", "\\u", "TYPE", "\\u", "GC", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mav", "util_", "._", "mavlink", "_", "._", "MAV", "\\u", "AUTO", "PI", "LOT", "\\u", "INVALID", "_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "lasts", "ent_", "=_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Time", "outs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "heart", "beat", "\\u", "started_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "heart", "beat", "\\u", "error_", "and_", "self_", "._", "\\u", "heart", "beat", "\\u", "error_", ">_", "0_", "and_", "monotonic", "_", "._", "monotonic", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "-_", "self_", "._", "\\u", "heart", "beat", "\\u", "lastr", "ece", "ive", "d_", ">_", "self_", "._", "\\u", "heart", "beat", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "API", "Exception_", "(_", "'", "No", " ", "heart", "beat", " ", "in", " ", "%", "s", " ", "second", "s", ",", " ", "abort", "ing", ".'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "-_", "self_", "._", "\\u", "heart", "beat", "\\u", "lastr", "ece", "ive", "d_", ">_", "self_", "._", "\\u", "heart", "beat", "\\u", "warning_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "\\u", "heart", "beat", "\\u", "timeout_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "err", "printer_", "(_", "'>>", ">", " ", "Link", " ", "timeo", "ut", ",", " ", "no", " ", "heart", "beat", " ", "in", " ", "last", " ", "%", "s", " ", "second", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "timeout_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "self_", "._", "on", "\\u", "message_", "(_", "[_", "'", "HEA", "RT", "BEA", "T", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "self_", ",_", "name_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "heart", "beat", "\\u", "system_", "=_", "msg_", "._", "get", "\\u", "src", "System_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "lastr", "ece", "ive", "d_", "=_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "heart", "beat", "\\u", "timeout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "printer_", "(_", "'>>", ">", " ", "...", "link", " ", "restore", "d", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "heart", "beat", "\\u", "timeout_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "last", "\\u", "heartbeat_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "handler_", "._", "forward", "\\u", "loop_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "listener_", "(_", "\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "heart", "beat", "\\u", "lastr", "ece", "ive", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "last", "\\u", "heartbeat_", "=_", "monotonic", "_", "._", "monotonic", "_", "(_", ")_", "-_", "self_", "._", "\\u", "heart", "beat", "\\u", "lastr", "ece", "ive", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "attribute", "\\u", "listeners_", "(_", "'", "last", "\\u", "heart", "beat", "'_", ",_", "self_", "._", "last", "\\u", "heartbeat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vehicle", "_", "(_", "Has", "Observer", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "message_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decorat", "or", " ", "for", " ", "message", " ", "listen", "er", " ", "callback", " ", "function", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "tip", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "most", " ", "ele", "gan", "t", " ", "way", " ", "to", " ", "defin", "e", " ", "message", " ", "listen", "er", " ", "callback", " ", "function", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", ":", "py", ":", "func", ":`", "add", "\\u", "message", "\\u", "listen", "er", "`", " ", "only", " ", "if", " ", "you", " ", "need", " ", "to", " ", "be", " ", "able", " ", "to", "\\", "10", ";", " ", " ", " ", " ", ":", "py", ":", "func", ":`", "remove", " ", "the", " ", "listen", "er", " ", "<", "remove", "\\u", "message", "\\u", "listen", "er", ">`", " ", "late", "r", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "decorated", " ", "message", " ", "listen", "er", " ", "function", " ", "is", " ", "call", "ed", " ", "with", " ", "three", " ", "argu", "ment", "s", " ", "every", " ", "time", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "specified", " ", "message", " ", "is", " ", "receive", "d", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``", "self", "``", " ", "-", " ", "the", " ", "current", " ", "vehic", "le", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``", "name", "``", " ", "-", " ", "the", " ", "name", " ", "of", " ", "the", " ", "message", " ", "tha", "t", " ", "was", " ", "intercept", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "``", "message", "``", " ", "-", " ", "the", " ", "actual", " ", "message", " ", "(", "a", " ", "`", "pyma", "vlin", "k", " ", "<", "http", "://", "www", ".", "qg", "round", "control", ".", "org", "/", "mavlink", "/", "pyma", "vlin", "k", ">`\\u", "\\", "10", ";", " ", " ", "`", "class", " ", "<", "https", "://", "www", ".", "samba", ".", "org", "/", "trid", "ge", "/", "UA", "V", "/", "pyma", "vlin", "k", "/", "apid", "ocs", "/", "class", "Index", ".", "html", ">`\\u", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "example", ",", " ", "in", " ", "the", " ", "fragment", " ", "belo", "w", " ", "``", "my", "\\u", "method", "``", " ", "will", " ", "be", " ", "call", "ed", " ", "for", " ", "every", " ", "heart", "beat", " ", "message", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "code", "::", " ", "python", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "vehic", "le", ".", "on", "\\u", "message", "('", "HEA", "RT", "BEA", "T", "')", "\\", "10", ";", " ", " ", " ", " ", "def", " ", "my", "\\u", "method", "(", "self", ",", " ", "name", ",", " ", "msg", "):", "\\", "10", ";", " ", " ", " ", " ", "pass", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", ":", "ref", ":`", "mavlink", "\\u", "message", "s", "`", " ", "for", " ", "more", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "String", " ", "name", ":", " ", "The", " ", "name", " ", "of", " ", "the", " ", "message", " ", "to", " ", "be", " ", "intercept", "ed", " ", "by", " ", "the", " ", "decorated", " ", "listen", "er", " ", "function", " ", "(", "or", " ", "'*", "'", " ", "to", " ", "get", " ", "all", " ", "message", "s", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "decorator_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "name_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "add", "\\u", "message", "\\u", "listener_", "(_", "n_", ",_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "message", "\\u", "listener_", "(_", "name_", ",_", "fn_", ")_", "\\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_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
acil-bwh/SlicerCIP/Scripted/CIP_LesionModel/FeatureExtractionLib/TextureGLRL.py
[ { "content": "from __main__ import vtk, qt, ctk, slicer\nimport string\nimport numpy\nimport math\nimport operator\nimport collections\nimport FeatureExtractionLib\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TextureGLRL:\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TextureGLRL", "header": "['module', '___EOS___']", "index": 9 }, { "content": " def __init__(self, grayLevels, numGrayLevels, parameterMatrix, parameterMatrixCoordinates, parameterValues,\n allKeys):\n self.textureFeaturesGLRL = collections.OrderedDict()\n self.textureFeaturesGLRLTiming = collections.OrderedDict()\n self.textureFeaturesGLRL[\"SRE\"] = \"self.shortRunEmphasis(self.P_glrl, self.jvector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\"LRE\"] = \"self.longRunEmphasis(self.P_glrl, self.jvector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\"GLN\"] = \"self.grayLevelNonUniformity(self.P_glrl, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\"RLN\"] = \"self.runLengthNonUniformity(self.P_glrl, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\"RP\"] = \"self.runPercentage(self.P_glrl, self.Np)\"\n self.textureFeaturesGLRL[\"LGLRE\"] = \"self.lowGrayLevelRunEmphasis(self.P_glrl, self.ivector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\"HGLRE\"] = \"self.highGrayLevelRunEmphasis(self.P_glrl, self.ivector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\n \"SRLGLE\"] = \"self.shortRunLowGrayLevelEmphasis(self.P_glrl, self.ivector, self.jvector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\n \"SRHGLE\"] = \"self.shortRunHighGrayLevelEmphasis(self.P_glrl, self.ivector, self.jvector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\n \"LRLGLE\"] = \"self.longRunLowGrayLevelEmphasis(self.P_glrl, self.ivector, self.jvector, self.sumP_glrl)\"\n self.textureFeaturesGLRL[\n \"LRHGLE\"] = \"self.longRunHighGrayLevelEmphasis(self.P_glrl, self.ivector, self.jvector, self.sumP_glrl)\"\n\n self.grayLevels = grayLevels\n self.parameterMatrix = parameterMatrix\n self.parameterMatrixCoordinates = parameterMatrixCoordinates\n self.parameterValues = parameterValues\n self.numGrayLevels = numGrayLevels\n self.keys = set(allKeys).intersection(self.textureFeaturesGLRL.keys())", "metadata": "root.TextureGLRL.__init__", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 10 }, { "content": " def CalculateCoefficients(self):\n self.angles = 13\n self.Ng = self.numGrayLevels\n self.Nr = numpy.max(self.parameterMatrix.shape)\n self.Np = self.parameterValues.size\n self.eps = numpy.spacing(1)\n\n self.P_glrl = numpy.zeros(\n (self.Ng, self.Nr, self.angles)) # maximum run length in P matrix initialized to highest gray level\n self.P_glrl = self.calculate_glrl(self.grayLevels, self.Ng, self.parameterMatrix,\n self.parameterMatrixCoordinates, self.angles, self.P_glrl)\n\n self.sumP_glrl = numpy.sum(numpy.sum(self.P_glrl, 0), 0) + self.eps\n self.ivector = numpy.arange(self.Ng) + 1\n self.jvector = numpy.arange(self.Nr) + 1", "metadata": "root.TextureGLRL.CalculateCoefficients", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 37 }, { "content": " def shortRunEmphasis(self, P_glrl, jvector, sumP_glrl, meanFlag=True):\n try:\n sre = numpy.sum(numpy.sum((P_glrl / ((jvector ** 2)[None, :, None])), 0), 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n sre = 0\n if meanFlag:\n return (sre.mean())\n else:\n return sre", "metadata": "root.TextureGLRL.shortRunEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 53 }, { "content": " def longRunEmphasis(self, P_glrl, jvector, sumP_glrl, meanFlag=True):\n try:\n lre = numpy.sum(numpy.sum((P_glrl * ((jvector ** 2)[None, :, None])), 0), 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n lre = 0\n if meanFlag:\n return (lre.mean())\n else:\n return lre", "metadata": "root.TextureGLRL.longRunEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 63 }, { "content": " def grayLevelNonUniformity(self, P_glrl, sumP_glrl, meanFlag=True):\n try:\n gln = numpy.sum((numpy.sum(P_glrl, 1) ** 2), 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n gln = 0\n if meanFlag:\n return (gln.mean())\n else:\n return gln", "metadata": "root.TextureGLRL.grayLevelNonUniformity", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 73 }, { "content": " def runLengthNonUniformity(self, P_glrl, sumP_glrl, meanFlag=True):\n try:\n rln = numpy.sum((numpy.sum(P_glrl, 0) ** 2), 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n rln = 0\n if meanFlag:\n return (rln.mean())\n else:\n return rln", "metadata": "root.TextureGLRL.runLengthNonUniformity", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 83 }, { "content": " def runPercentage(self, P_glrl, Np, meanFlag=True):\n try:\n rp = numpy.sum(numpy.sum((P_glrl / (Np)), 0), 0)\n except ZeroDivisionError:\n rp = 0\n if meanFlag:\n return (rp.mean())\n else:\n return rp", "metadata": "root.TextureGLRL.runPercentage", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 93 }, { "content": " def lowGrayLevelRunEmphasis(self, P_glrl, ivector, sumP_glrl, meanFlag=True):\n try:\n lglre = numpy.sum(numpy.sum((P_glrl / ((ivector ** 2)[:, None, None])), 0), 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n lglre = 0\n if meanFlag:\n return (lglre.mean())\n else:\n return lglre", "metadata": "root.TextureGLRL.lowGrayLevelRunEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 103 }, { "content": " def highGrayLevelRunEmphasis(self, P_glrl, ivector, sumP_glrl, meanFlag=True):\n try:\n hglre = numpy.sum(numpy.sum((P_glrl * ((ivector ** 2)[:, None, None])), 0), 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n hglre = 0\n if meanFlag:\n return (hglre.mean())\n else:\n return hglre", "metadata": "root.TextureGLRL.highGrayLevelRunEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 113 }, { "content": " def shortRunLowGrayLevelEmphasis(self, P_glrl, ivector, jvector, sumP_glrl, meanFlag=True):\n try:\n srlgle = numpy.sum(numpy.sum((P_glrl / ((jvector ** 2)[None, :, None] * (ivector ** 2)[:, None, None])), 0),\n 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n srlgle = 0\n if meanFlag:\n return (srlgle.mean())\n else:\n return srlgle", "metadata": "root.TextureGLRL.shortRunLowGrayLevelEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 123 }, { "content": " def shortRunHighGrayLevelEmphasis(self, P_glrl, ivector, jvector, sumP_glrl, meanFlag=True):\n try:\n srhgle = numpy.sum(\n numpy.sum(((P_glrl * (ivector ** 2)[:, None, None]) / ((jvector ** 2)[None, :, None])), 0), 0) / (\n sumP_glrl[None, None, :])\n except ZeroDivisionError:\n srhgle = 0\n if meanFlag:\n return (srhgle.mean())\n else:\n return srhgle", "metadata": "root.TextureGLRL.shortRunHighGrayLevelEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 134 }, { "content": " def longRunLowGrayLevelEmphasis(self, P_glrl, ivector, jvector, sumP_glrl, meanFlag=True):\n try:\n lrlgle = numpy.sum(\n numpy.sum(((P_glrl * (jvector ** 2)[None, :, None]) / ((ivector ** 2)[:, None, None])), 0), 0) / (\n sumP_glrl[None, None, :])\n except ZeroDivisionError:\n lrlgle = 0\n if meanFlag:\n return (lrlgle.mean())\n else:\n return lrlgle", "metadata": "root.TextureGLRL.longRunLowGrayLevelEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 146 }, { "content": " def longRunHighGrayLevelEmphasis(self, P_glrl, ivector, jvector, sumP_glrl, meanFlag=True):\n try:\n lrhgle = numpy.sum(numpy.sum((P_glrl * (ivector ** 2)[:, None, None] * (jvector ** 2)[None, :, None]), 0),\n 0) / (sumP_glrl[None, None, :])\n except ZeroDivisionError:\n lrhgle = 0\n if meanFlag:\n return (lrhgle.mean())\n else:\n return lrhgle", "metadata": "root.TextureGLRL.longRunHighGrayLevelEmphasis", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 158 }, { "content": " def calculate_glrl(self, grayLevels, numGrayLevels, matrix, matrixCoordinates, angles, P_out):\n padVal = 0 # use eps or NaN to pad matrix\n matrixDiagonals = list()\n\n # TODO: try using itertools list merging with lists of GLRL diagonal \n # i.e.: self.heterogeneityFeatureWidgets = list(itertools.chain.from_iterable(self.featureWidgets.values()))\n\n # For a single direction or diagonal (aDiags, bDiags...lDiags, mDiags): \n # Generate a 1D array for each valid offset of the diagonal, a, in the range specified by lowBound and highBound \n # Convert each 1D array to a python list ( matrix.diagonal(a,,).tolist() ) \n # Join lists using reduce(lamda x,y: x+y, ...) to represent all 1D arrays for the direction/diagonal \n # Use filter(lambda x: numpy.nonzero(x)[0].size>1, ....) to filter 1D arrays of size < 2 or value == 0 or padValue\n\n # Should change from nonzero() to filter for the padValue specifically (NaN, eps, etc)\n\n # (1,0,0), #(-1,0,0),\n aDiags = reduce(lambda x, y: x + y, [a.tolist() for a in numpy.transpose(matrix, (1, 2, 0))])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, aDiags))\n\n # (0,1,0), #(0,-1,0),\n bDiags = reduce(lambda x, y: x + y, [a.tolist() for a in numpy.transpose(matrix, (0, 2, 1))])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, bDiags))\n\n # (0,0,1), #(0,0,-1), \n cDiags = reduce(lambda x, y: x + y, [a.tolist() for a in numpy.transpose(matrix, (0, 1, 2))])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, cDiags))\n\n # (1,1,0),#(-1,-1,0),\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[1]\n\n dDiags = reduce(lambda x, y: x + y, [matrix.diagonal(a, 0, 1).tolist() for a in xrange(lowBound, highBound)])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, dDiags))\n\n # (1,0,1), #(-1,0-1),\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[2]\n\n eDiags = reduce(lambda x, y: x + y, [matrix.diagonal(a, 0, 2).tolist() for a in xrange(lowBound, highBound)])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, eDiags))\n\n # (0,1,1), #(0,-1,-1),\n lowBound = -matrix.shape[1] + 1\n highBound = matrix.shape[2]\n\n fDiags = reduce(lambda x, y: x + y, [matrix.diagonal(a, 1, 2).tolist() for a in xrange(lowBound, highBound)])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, fDiags))\n\n # (1,-1,0), #(-1,1,0), \n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[1]\n\n gDiags = reduce(lambda x, y: x + y,\n [matrix[:, ::-1, :].diagonal(a, 0, 1).tolist() for a in xrange(lowBound, highBound)])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, gDiags))\n\n # (-1,0,1), #(1,0,-1),\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[2]\n\n hDiags = reduce(lambda x, y: x + y,\n [matrix[:, :, ::-1].diagonal(a, 0, 2).tolist() for a in xrange(lowBound, highBound)])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, hDiags))\n\n # (0,1,-1), #(0,-1,1),\n lowBound = -matrix.shape[1] + 1\n highBound = matrix.shape[2]\n\n iDiags = reduce(lambda x, y: x + y,\n [matrix[:, :, ::-1].diagonal(a, 1, 2).tolist() for a in xrange(lowBound, highBound)])\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, iDiags))\n\n # (1,1,1), #(-1,-1,-1)\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[1]\n\n jDiags = [numpy.diagonal(h, x, 0, 1).tolist() for h in\n [matrix.diagonal(a, 0, 1) for a in xrange(lowBound, highBound)] for x in\n xrange(-h.shape[0] + 1, h.shape[1])]\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, jDiags))\n\n # (-1,1,-1), #(1,-1,1),\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[1]\n\n kDiags = [numpy.diagonal(h, x, 0, 1).tolist() for h in\n [matrix[:, ::-1, :].diagonal(a, 0, 1) for a in xrange(lowBound, highBound)] for x in\n xrange(-h.shape[0] + 1, h.shape[1])]\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, kDiags))\n\n # (1,1,-1), #(-1,-1,1),\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[1]\n\n lDiags = [numpy.diagonal(h, x, 0, 1).tolist() for h in\n [matrix[:, :, ::-1].diagonal(a, 0, 1) for a in xrange(lowBound, highBound)] for x in\n xrange(-h.shape[0] + 1, h.shape[1])]\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, lDiags))\n\n # (-1,1,1), #(1,-1,-1),\n lowBound = -matrix.shape[0] + 1\n highBound = matrix.shape[1]\n \n mDiags = [numpy.diagonal(h, x, 0, 1).tolist() for h in\n [matrix[:, ::-1, ::-1].diagonal(a, 0, 1) for a in xrange(lowBound, highBound)] for x in\n xrange(-h.shape[0] + 1, h.shape[1])]\n matrixDiagonals.append(filter(lambda x: numpy.nonzero(x)[0].size > 1, mDiags))\n\n # [n for n in mDiags if numpy.nonzero(n)[0].size>1] instead of filter(lambda x: numpy.nonzero(x)[0].size>1, mDiags)?\n\n # Run-Length Encoding (rle) for the 13 list of diagonals (1 list per 3D direction/angle)\n for angle in xrange(0, len(matrixDiagonals)):\n P = P_out[:, :, angle]\n for diagonal in matrixDiagonals[angle]:\n diagonal = numpy.array(diagonal, dtype='int')\n pos, = numpy.where(\n numpy.diff(diagonal) != 0) # can use instead of using map operator._ on np.where tuples\n pos = numpy.concatenate(([0], pos + 1, [len(diagonal)]))\n\n # a or pos[:-1] = run start #b or pos[1:] = run stop #diagonal[a] is matrix value \n # adjust condition for pos[:-1] != padVal = 0 to != padVal = eps or NaN or whatever pad value\n rle = zip([n for n in diagonal[pos[:-1]] if n != padVal], pos[1:] - pos[:-1])\n rle = [[numpy.where(grayLevels == x)[0][0], y - 1] for x, y in\n rle] # rle = map(lambda (x,y): [voxelToIndexDict[x],y-1], rle)\n\n # Increment GLRL matrix counter at coordinates defined by the run-length encoding \n P[zip(*rle)] += 1\n\n return (P_out)", "metadata": "root.TextureGLRL.calculate_glrl", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 169 }, { "content": " def EvaluateFeatures(self, printTiming=False, checkStopProcessFunction=None):\n if not self.keys:\n if not printTiming:\n return self.textureFeaturesGLRL\n else:\n return self.textureFeaturesGLRL, self.textureFeaturesGLRLTiming\n \n if not printTiming:\n self.CalculateCoefficients()\n else:\n import time\n t1 = time.time()\n self.CalculateCoefficients()\n print(\"- Time to calculate coefficients in GLRL: {0} seconds\".format(time.time() - t1))\n\n if not printTiming:\n # Evaluate dictionary elements corresponding to user selected keys\n for key in self.keys:\n self.textureFeaturesGLRL[key] = eval(self.textureFeaturesGLRL[key])\n if checkStopProcessFunction is not None:\n checkStopProcessFunction()\n return self.textureFeaturesGLRL\n else:\n # Evaluate dictionary elements corresponding to user selected keys\n for key in self.keys:\n t1 = time.time()\n self.textureFeaturesGLRL[key] = eval(self.textureFeaturesGLRL[key])\n self.textureFeaturesGLRLTiming[key] = time.time() - t1\n if checkStopProcessFunction is not None:\n checkStopProcessFunction()\n return self.textureFeaturesGLRL, self.textureFeaturesGLRLTiming", "metadata": "root.TextureGLRL.EvaluateFeatures", "header": "['class', 'TextureGLRL', ':', '___EOS___']", "index": 299 } ]
[ { "span": "from __main__ import vtk, qt, ctk, slicer", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 41 }, { "span": "import string", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 13 }, { "span": "import math", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 11 }, { "span": "import operator", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 15 }, { "span": "import FeatureExtractionLib", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 27 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "main\\u\\u_", "import_", "vtk_", ",_", "qt_", ",_", "ct", "k_", ",_", "slicer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Feature", "Extraction", "Lib_", "\\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_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\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_", ",_", "gray", "Levels_", ",_", "num", "Gra", "y", "Levels_", ",_", "parameter", "Matrix_", ",_", "parameter", "Matrix", "Coordinates_", ",_", "parameter", "Values_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "all", "Keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "=_", "collections_", "._", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "Tim", "ing_", "=_", "collections_", "._", "Order", "ed", "Dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "SRE", "\"_", "]_", "=_", "\"", "self", ".", "short", "Run", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "jv", "ector", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "LR", "E", "\"_", "]_", "=_", "\"", "self", ".", "long", "Run", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "jv", "ector", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "GL", "N", "\"_", "]_", "=_", "\"", "self", ".", "gray", "Leve", "l", "Non", "Uniform", "it", "y", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "RL", "N", "\"_", "]_", "=_", "\"", "self", ".", "run", "Length", "Non", "Uniform", "it", "y", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "RP", "\"_", "]_", "=_", "\"", "self", ".", "run", "Perce", "nta", "ge", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "Np", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "LG", "LR", "E", "\"_", "]_", "=_", "\"", "self", ".", "low", "Gra", "y", "Leve", "l", "Run", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "ive", "ctor", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\"", "HG", "LR", "E", "\"_", "]_", "=_", "\"", "self", ".", "high", "Gra", "y", "Leve", "l", "Run", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "ive", "ctor", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SR", "LG", "LE", "\"_", "]_", "=_", "\"", "self", ".", "short", "Run", "Lo", "w", "Gra", "y", "Leve", "l", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "ive", "ctor", ",", " ", "self", ".", "jv", "ector", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SR", "HG", "LE", "\"_", "]_", "=_", "\"", "self", ".", "short", "Run", "Hig", "h", "Gra", "y", "Leve", "l", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "ive", "ctor", ",", " ", "self", ".", "jv", "ector", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LR", "LG", "LE", "\"_", "]_", "=_", "\"", "self", ".", "long", "Run", "Lo", "w", "Gra", "y", "Leve", "l", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "ive", "ctor", ",", " ", "self", ".", "jv", "ector", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LR", "HG", "LE", "\"_", "]_", "=_", "\"", "self", ".", "long", "Run", "Hig", "h", "Gra", "y", "Leve", "l", "Emp", "has", "is", "(", "self", ".", "P", "\\u", "gl", "rl", ",", " ", "self", ".", "ive", "ctor", ",", " ", "self", ".", "jv", "ector", ",", " ", "self", ".", "sum", "P", "\\u", "gl", "rl", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gray", "Levels_", "=_", "gray", "Levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parameter", "Matrix_", "=_", "parameter", "Matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parameter", "Matrix", "Coordinates_", "=_", "parameter", "Matrix", "Coordinates_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parameter", "Values_", "=_", "parameter", "Values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "Gra", "y", "Levels_", "=_", "num", "Gra", "y", "Levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keys_", "=_", "set_", "(_", "all", "Keys_", ")_", "._", "intersection_", "(_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Coeff", "icient", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "angles_", "=_", "13_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Ng", "_", "=_", "self_", "._", "num", "Gra", "y", "Levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Nr_", "=_", "numpy_", "._", "max_", "(_", "self_", "._", "parameter", "Matrix_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Np", "_", "=_", "self_", "._", "parameter", "Values_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "eps_", "=_", "numpy_", "._", "spacing_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "P", "\\u", "gl", "rl_", "=_", "numpy_", "._", "zeros_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "Ng", "_", ",_", "self_", "._", "Nr_", ",_", "self_", "._", "angles_", ")_", ")_", "#", " ", "maxim", "um", " ", "run", " ", "length", " ", "in", " ", "P", " ", "matrix", " ", "initialize", "d", " ", "to", " ", "high", "est", " ", "gray", " ", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "P", "\\u", "gl", "rl_", "=_", "self_", "._", "calcul", "ate", "\\u", "gl", "rl_", "(_", "self_", "._", "gray", "Levels_", ",_", "self_", "._", "Ng", "_", ",_", "self_", "._", "parameter", "Matrix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "parameter", "Matrix", "Coordinates_", ",_", "self_", "._", "angles_", ",_", "self_", "._", "P", "\\u", "gl", "rl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sum", "P", "\\u", "gl", "rl_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "self_", "._", "P", "\\u", "gl", "rl_", ",_", "0_", ")_", ",_", "0_", ")_", "+_", "self_", "._", "eps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ive", "ctor_", "=_", "numpy_", "._", "arange_", "(_", "self_", "._", "Ng", "_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "jv", "ector_", "=_", "numpy_", "._", "arange_", "(_", "self_", "._", "Nr_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "short", "Run", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "jv", "ector_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "sre", "_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "/_", "(_", "(_", "jv", "ector_", "**_", "2_", ")_", "[_", "None_", ",_", ":_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sre", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "sre", "_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "sre", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "long", "Run", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "jv", "ector_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "lre", "_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "*_", "(_", "(_", "jv", "ector_", "**_", "2_", ")_", "[_", "None_", ",_", ":_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lre", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "lre", "_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "lre", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gray", "Leve", "l", "Non", "Uniform", "ity_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "gl", "n_", "=_", "numpy_", "._", "sum_", "(_", "(_", "numpy_", "._", "sum_", "(_", "P", "\\u", "gl", "rl_", ",_", "1_", ")_", "**_", "2_", ")_", ",_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gl", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "gl", "n_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "gl", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "Length", "Non", "Uniform", "ity_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "rl", "n_", "=_", "numpy_", "._", "sum_", "(_", "(_", "numpy_", "._", "sum_", "(_", "P", "\\u", "gl", "rl_", ",_", "0_", ")_", "**_", "2_", ")_", ",_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rl", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "rl", "n_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "rl", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "Percentage_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "Np", "_", ",_", "mean", "Flag_", "=_", "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 ", " _", "rp_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "/_", "(_", "Np", "_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rp_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "rp_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "rp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "low", "Gra", "y", "Leve", "l", "Run", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "ive", "ctor_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "lg", "lre", "_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "/_", "(_", "(_", "ive", "ctor_", "**_", "2_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lg", "lre", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "lg", "lre", "_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "lg", "lre", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "high", "Gra", "y", "Leve", "l", "Run", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "ive", "ctor_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "hg", "lre", "_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "*_", "(_", "(_", "ive", "ctor_", "**_", "2_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hg", "lre", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "hg", "lre", "_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "hg", "lre", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "short", "Run", "Lo", "w", "Gra", "y", "Leve", "l", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "ive", "ctor_", ",_", "jv", "ector_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "sr", "lg", "le_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "/_", "(_", "(_", "jv", "ector_", "**_", "2_", ")_", "[_", "None_", ",_", ":_", ",_", "None_", "]_", "*_", "(_", "ive", "ctor_", "**_", "2_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sr", "lg", "le_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "sr", "lg", "le_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "sr", "lg", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "short", "Run", "Hig", "h", "Gra", "y", "Leve", "l", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "ive", "ctor_", ",_", "jv", "ector_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "sr", "hg", "le_", "=_", "numpy_", "._", "sum_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "numpy_", "._", "sum_", "(_", "(_", "(_", "P", "\\u", "gl", "rl_", "*_", "(_", "ive", "ctor_", "**_", "2_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", ")_", "/_", "(_", "(_", "jv", "ector_", "**_", "2_", ")_", "[_", "None_", ",_", ":_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "/_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sr", "hg", "le_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "sr", "hg", "le_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "sr", "hg", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "long", "Run", "Lo", "w", "Gra", "y", "Leve", "l", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "ive", "ctor_", ",_", "jv", "ector_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "lr", "lg", "le_", "=_", "numpy_", "._", "sum_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "numpy_", "._", "sum_", "(_", "(_", "(_", "P", "\\u", "gl", "rl_", "*_", "(_", "jv", "ector_", "**_", "2_", ")_", "[_", "None_", ",_", ":_", ",_", "None_", "]_", ")_", "/_", "(_", "(_", "ive", "ctor_", "**_", "2_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", ")_", ")_", ",_", "0_", ")_", ",_", "0_", ")_", "/_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lr", "lg", "le_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "lr", "lg", "le_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "lr", "lg", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "long", "Run", "Hig", "h", "Gra", "y", "Leve", "l", "Emp", "has", "is_", "(_", "self_", ",_", "P", "\\u", "gl", "rl_", ",_", "ive", "ctor_", ",_", "jv", "ector_", ",_", "sum", "P", "\\u", "gl", "rl_", ",_", "mean", "Flag_", "=_", "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 ", " _", "lr", "hg", "le_", "=_", "numpy_", "._", "sum_", "(_", "numpy_", "._", "sum_", "(_", "(_", "P", "\\u", "gl", "rl_", "*_", "(_", "ive", "ctor_", "**_", "2_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", "*_", "(_", "jv", "ector_", "**_", "2_", ")_", "[_", "None_", ",_", ":_", ",_", "None_", "]_", ")_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ")_", "/_", "(_", "sum", "P", "\\u", "gl", "rl_", "[_", "None_", ",_", "None_", ",_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lr", "hg", "le_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mean", "Flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "lr", "hg", "le_", "._", "mean_", "(_", ")_", ")_", "\\u\\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_", "lr", "hg", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "calcul", "ate", "\\u", "gl", "rl_", "(_", "self_", ",_", "gray", "Levels_", ",_", "num", "Gra", "y", "Levels_", ",_", "matrix_", ",_", "matrix", "Coordinates_", ",_", "angles_", ",_", "P", "\\u", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pad", "Val_", "=_", "0_", "#", " ", "use", " ", "eps", " ", "or", " ", "Na", "N", " ", "to", " ", "pad", " ", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "try", " ", "usi", "ng", " ", "iter", "tool", "s", " ", "list", " ", "mer", "ging", " ", "with", " ", "lists", " ", "of", " ", "GL", "RL", " ", "diagonal", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "i", ".", "e", ".:", " ", "self", ".", "hetero", "gene", "it", "y", "Feature", "Wid", "gets", " ", "=", " ", "list", "(", "iter", "tool", "s", ".", "chain", ".", "from", "\\u", "iterable", "(", "self", ".", "feature", "Wid", "gets", ".", "values", "())", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "a", " ", "single", " ", "direction", " ", "or", " ", "diagonal", " ", "(", "a", "Diag", "s", ",", " ", "b", "Diag", "s", "...", "l", "Diag", "s", ",", " ", "m", "Diag", "s", "):", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "a", " ", "1", "D", " ", "array", " ", "for", " ", "each", " ", "valid", " ", "offset", " ", "of", " ", "the", " ", "diagonal", ",", " ", "a", ",", " ", "in", " ", "the", " ", "range", " ", "specified", " ", "by", " ", "low", "Bound", " ", "and", " ", "high", "Bound", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "each", " ", "1", "D", " ", "array", " ", "to", " ", "a", " ", "python", " ", "list", " ", "(", " ", "matrix", ".", "diagonal", "(", "a", ",", ",)", ".", "tol", "ist", "()", " ", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Join", " ", "lists", " ", "usi", "ng", " ", "reduce", "(", "lam", "da", " ", "x", ",", "y", ":", " ", "x", "+", "y", ",", " ", "...)", " ", "to", " ", "represent", " ", "all", " ", "1", "D", " ", "arrays", " ", "for", " ", "the", " ", "direction", "/", "diagonal", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "filter", "(", "lambda", " ", "x", ":", " ", "nump", "y", ".", "nonzero", "(", "x", ")[", "0", "].", "size", ">", "1", ",", " ", "....", ")", " ", "to", " ", "filter", " ", "1", "D", " ", "arrays", " ", "of", " ", "size", " ", "<", " ", "2", " ", "or", " ", "value", " ", "==", " ", "0", " ", "or", " ", "pad", "Value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "change", " ", "from", " ", "nonzero", "()", " ", "to", " ", "filter", " ", "for", " ", "the", " ", "pad", "Value", " ", "specifica", "ll", "y", " ", "(", "Na", "N", ",", " ", "eps", ",", " ", "etc", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",", "0", ",", "0", "),", " ", "#(", "-1", ",", "0", ",", "0", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "a", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "[_", "a_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "numpy_", "._", "transpose_", "(_", "matrix_", ",_", "(_", "1_", ",_", "2_", ",_", "0_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "a", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "0", ",", "1", ",", "0", "),", " ", "#(", "0", ",-", "1", ",", "0", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "b", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "[_", "a_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "numpy_", "._", "transpose_", "(_", "matrix_", ",_", "(_", "0_", ",_", "2_", ",_", "1_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "b", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "0", ",", "0", ",", "1", "),", " ", "#(", "0", ",", "0", ",-", "1", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "c", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "[_", "a_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "numpy_", "._", "transpose_", "(_", "matrix_", ",_", "(_", "0_", ",_", "1_", ",_", "2_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "c", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",", "1", ",", "0", "),", "#(", "-1", ",-", "1", ",", "0", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "[_", "matrix_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "1_", ")_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "d", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",", "0", ",", "1", "),", " ", "#(", "-1", ",", "0", "-1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "[_", "matrix_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "2_", ")_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "e", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "0", ",", "1", ",", "1", "),", " ", "#(", "0", ",-", "1", ",-", "1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "1_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "[_", "matrix_", "._", "diagonal_", "(_", "a_", ",_", "1_", ",_", "2_", ")_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "f", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",-", "1", ",", "0", "),", " ", "#(", "-1", ",", "1", ",", "0", "),", " _", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "[_", ":_", ",_", ":_", ":_", "-_", "1_", ",_", ":_", "]_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "1_", ")_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "g", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(-", "1", ",", "0", ",", "1", "),", " ", "#(", "1", ",", "0", ",-", "1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "[_", ":_", ",_", ":_", ",_", ":_", ":_", "-_", "1_", "]_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "2_", ")_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "h", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "0", ",", "1", ",-", "1", "),", " ", "#(", "0", ",-", "1", ",", "1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "1_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "i", "Diag", "s_", "=_", "reduce_", "(_", "lambda_", "x_", ",_", "y_", ":_", "x_", "+_", "y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "[_", ":_", ",_", ":_", ",_", ":_", ":_", "-_", "1_", "]_", "._", "diagonal_", "(_", "a_", ",_", "1_", ",_", "2_", ")_", "._", "tolist_", "(_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "i", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",", "1", ",", "1", "),", " ", "#(", "-1", ",-", "1", ",-", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "j", "Diag", "s_", "=_", "[_", "numpy_", "._", "diagonal_", "(_", "h_", ",_", "x_", ",_", "0_", ",_", "1_", ")_", "._", "tolist_", "(_", ")_", "for_", "h_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "1_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "(_", "-_", "h_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", ",_", "h_", "._", "shape_", "[_", "1_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "j", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(-", "1", ",", "1", ",-", "1", "),", " ", "#(", "1", ",-", "1", ",", "1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "k", "Diag", "s_", "=_", "[_", "numpy_", "._", "diagonal_", "(_", "h_", ",_", "x_", ",_", "0_", ",_", "1_", ")_", "._", "tolist_", "(_", ")_", "for_", "h_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "[_", ":_", ",_", ":_", ":_", "-_", "1_", ",_", ":_", "]_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "1_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "(_", "-_", "h_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", ",_", "h_", "._", "shape_", "[_", "1_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "k", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",", "1", ",-", "1", "),", " ", "#(", "-1", ",-", "1", ",", "1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l", "Diag", "s_", "=_", "[_", "numpy_", "._", "diagonal_", "(_", "h_", ",_", "x_", ",_", "0_", ",_", "1_", ")_", "._", "tolist_", "(_", ")_", "for_", "h_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "[_", ":_", ",_", ":_", ",_", ":_", ":_", "-_", "1_", "]_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "1_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "(_", "-_", "h_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", ",_", "h_", "._", "shape_", "[_", "1_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "l", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(-", "1", ",", "1", ",", "1", "),", " ", "#(", "1", ",-", "1", ",-", "1", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "low", "Bound_", "=_", "-_", "matrix_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Bound_", "=_", "matrix_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m", "Diag", "s_", "=_", "[_", "numpy_", "._", "diagonal_", "(_", "h_", ",_", "x_", ",_", "0_", ",_", "1_", ")_", "._", "tolist_", "(_", ")_", "for_", "h_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "matrix_", "[_", ":_", ",_", ":_", ":_", "-_", "1_", ",_", ":_", ":_", "-_", "1_", "]_", "._", "diagonal_", "(_", "a_", ",_", "0_", ",_", "1_", ")_", "for_", "a_", "in_", "xrange_", "(_", "low", "Bound_", ",_", "high", "Bound_", ")_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "(_", "-_", "h_", "._", "shape_", "[_", "0_", "]_", "+_", "1_", ",_", "h_", "._", "shape_", "[_", "1_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix", "Diag", "onal", "s_", "._", "append_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "numpy_", "._", "nonzero_", "(_", "x_", ")_", "[_", "0_", "]_", "._", "size_", ">_", "1_", ",_", "m", "Diag", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[", "n", " ", "for", " ", "n", " ", "in", " ", "m", "Diag", "s", " ", "if", " ", "nump", "y", ".", "nonzero", "(", "n", ")[", "0", "].", "size", ">", "1", "]", " ", "inst", "ead", " ", "of", " ", "filter", "(", "lambda", " ", "x", ":", " ", "nump", "y", ".", "nonzero", "(", "x", ")[", "0", "].", "size", ">", "1", ",", " ", "m", "Diag", "s", ")?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", "-", "Length", " ", "Enco", "ding", " ", "(", "rle", ")", " ", "for", " ", "the", " ", "13", " ", "list", " ", "of", " ", "diagonal", "s", " ", "(", "1", " ", "list", " ", "per", " ", "3", "D", " ", "direction", "/", "angle", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "angle_", "in_", "xrange_", "(_", "0_", ",_", "len_", "(_", "matrix", "Diag", "onal", "s_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "P_", "=_", "P", "\\u", "out_", "[_", ":_", ",_", ":_", ",_", "angle_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "diagonal_", "in_", "matrix", "Diag", "onal", "s_", "[_", "angle_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diagonal_", "=_", "numpy_", "._", "array_", "(_", "diagonal_", ",_", "dtype_", "=_", "'", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", ",_", "=_", "numpy_", "._", "where_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "numpy_", "._", "diff_", "(_", "diagonal_", ")_", "!=_", "0_", ")_", "#", " ", "can", " ", "use", " ", "inst", "ead", " ", "of", " ", "usi", "ng", " ", "map", " ", "opera", "tor", ".\\u", " ", "on", " ", "np", ".", "where", " ", "tuples_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "numpy_", "._", "concatenate_", "(_", "(_", "[_", "0_", "]_", ",_", "pos_", "+_", "1_", ",_", "[_", "len_", "(_", "diagonal_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "or", " ", "pos", "[:", "-1", "]", " ", "=", " ", "run", " ", "start", " ", "#", "b", " ", "or", " ", "pos", "[", "1", ":]", " ", "=", " ", "run", " ", "stop", " ", "#", "diagonal", "[", "a", "]", " ", "is", " ", "matrix", " ", "value", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adjust", " ", "condition", " ", "for", " ", "pos", "[:", "-1", "]", " ", "!=", " ", "pad", "Val", " ", "=", " ", "0", " ", "to", " ", "!=", " ", "pad", "Val", " ", "=", " ", "eps", " ", "or", " ", "Na", "N", " ", "or", " ", "what", "ever", " ", "pad", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "rle", "_", "=_", "zip_", "(_", "[_", "n_", "for_", "n_", "in_", "diagonal_", "[_", "pos_", "[_", ":_", "-_", "1_", "]_", "]_", "if_", "n_", "!=_", "pad", "Val_", "]_", ",_", "pos_", "[_", "1_", ":_", "]_", "-_", "pos_", "[_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rle", "_", "=_", "[_", "[_", "numpy_", "._", "where_", "(_", "gray", "Levels_", "==_", "x_", ")_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "y_", "-_", "1_", "]_", "for_", "x_", ",_", "y_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "rle", "_", "]_", "#", " ", "rle", " ", "=", " ", "map", "(", "lambda", " ", "(", "x", ",", "y", "):", " ", "[", "voxel", "To", "Index", "Dict", "[", "x", "],", "y", "-1", "],", " ", "rle", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Increment", " ", "GL", "RL", " ", "matrix", " ", "counter", " ", "at", " ", "coordinate", "s", " ", "defin", "ed", " ", "by", " ", "the", " ", "run", "-", "length", " ", "encoding", " _", "\\u\\u\\uNL\\u\\u\\u_", "P_", "[_", "zip_", "(_", "*_", "rle", "_", ")_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "P", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Text", "ure", "GL", "RL", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Evaluate", "Features_", "(_", "self_", ",_", "print", "Tim", "ing_", "=_", "False_", ",_", "check", "Sto", "p", "Process", "Function_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "print", "Tim", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "\\u\\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_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", ",_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "Tim", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "print", "Tim", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Calculat", "e", "Coeff", "icient", "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 ", " _", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Calculat", "e", "Coeff", "icient", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"-", " ", "Time", " ", "to", " ", "calcul", "ate", " ", "coefficient", "s", " ", "in", " ", "GL", "RL", ":", " ", "{", "0", "}", " ", "second", "s", "\"_", "._", "format_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "t1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "print", "Tim", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Evaluate", " ", "dictionar", "y", " ", "element", "s", " ", "correspond", "ing", " ", "to", " ", "user", " ", "selecte", "d", " ", "keys_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "self_", "._", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "key_", "]_", "=_", "eval_", "(_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "check", "Sto", "p", "Process", "Function_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "check", "Sto", "p", "Process", "Function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Evaluate", " ", "dictionar", "y", " ", "element", "s", " ", "correspond", "ing", " ", "to", " ", "user", " ", "selecte", "d", " ", "keys_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "self_", "._", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "key_", "]_", "=_", "eval_", "(_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "textu", "re", "Feature", "s", "GL", "RL", "Tim", "ing_", "[_", "key_", "]_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "t1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "check", "Sto", "p", "Process", "Function_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "check", "Sto", "p", "Process", "Function_", "(_", ")_", "\\u\\u\\uNEWLINE\\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otlib.pyplot as plt\nplt.ion()\n\n\nif __name__ == \"__main__\":\n # set up board\n m,n = 100,100\n A = np.zeros((m,n))\n A = 0.6*np.random.random(m*n).reshape((m, n))\n A = A.round()\n\n # plot each frame\n plt.figure()\n img_plot = plt.imshow(A, interpolation=\"nearest\", cmap = plt.cm.gray)\n plt.show(block=False)\n while True:\n A = two_by_two(A)\n img_plot.set_data(A)\n plt.draw()\n time.sleep(0.01)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "A ", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 5 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lib_", "import_", "fft", "\\u", "convolve", "2d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ion_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "board_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", ",_", "n_", "=_", "100_", ",_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "np_", "._", "zeros_", "(_", "(_", "m_", ",_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "0.6_", "*_", "np_", "._", "random_", "._", "random_", "(_", "m_", "*_", "n_", ")_", "._", "reshape_", "(_", "(_", "m_", ",_", "n_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "A_", "._", "round_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plot", " ", "each", " ", "frame_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "plot_", "=_", "plt_", "._", "imshow_", "(_", "A_", ",_", "interpolation_", "=_", "\"", "near", "est", "\"_", ",_", "cmap_", "=_", "plt_", "._", "cm_", "._", "gray_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", "block_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "A_", "=_", "two", "\\u", "by", "\\u", "two_", "(_", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "plot_", "._", "set\\u", "data_", "(_", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "draw_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.01_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Suspicious unused loop iteration variable
zzzeek/sqlalchemy/test/engine/test_pool.py
[ { "content": " @testing.uses_deprecated(r\".*Use event.listen\")\n def test_listeners_callables(self):\n def connect(dbapi_con, con_record):\n counts[0] += 1\n\n def checkout(dbapi_con, con_record, con_proxy):\n counts[1] += 1\n\n def checkin(dbapi_con, con_record):\n counts[2] += 1\n\n i_all = dict(connect=connect, checkout=checkout, checkin=checkin)\n i_connect = dict(connect=connect)\n i_checkout = dict(checkout=checkout)\n i_checkin = dict(checkin=checkin)\n\n for cls in (pool.QueuePool, pool.StaticPool):\n counts = [0, 0, 0]\n\n def assert_listeners(p, total, conn, cout, cin):\n for instance in (p, p.recreate()):\n eq_(len(instance.dispatch.connect), conn)\n eq_(len(instance.dispatch.checkout), cout)\n eq_(len(instance.dispatch.checkin), cin)\n\n p = self._queuepool_fixture()\n assert_listeners(p, 0, 0, 0, 0)\n\n p.add_listener(i_all)\n assert_listeners(p, 1, 1, 1, 1)\n\n p.add_listener(i_connect)\n assert_listeners(p, 2, 1, 1, 1)\n\n p.add_listener(i_checkout)\n assert_listeners(p, 3, 1, 1, 1)\n\n p.add_listener(i_checkin)\n assert_listeners(p, 4, 1, 1, 1)\n del p\n\n p = self._queuepool_fixture(listeners=[i_all])\n assert_listeners(p, 1, 1, 1, 1)\n\n c = p.connect()\n assert counts == [1, 1, 0]\n c.close()\n assert counts == [1, 1, 1]\n\n c = p.connect()\n assert counts == [1, 2, 1]\n p.add_listener(i_checkin)\n c.close()\n assert counts == [1, 2, 2]", "metadata": "root.DeprecatedPoolListenerTest.test_listeners_callables", "header": "['class', 'DeprecatedPoolListenerTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 881 } ]
[ { "span": "for cls in (pool.QueuePool, pool.StaticPool):", "start_line": 897, "start_column": 8, "end_line": 897, "end_column": 53 } ]
[]
1
true
[ "[CLS]_", "Sus", "picio", "us_", "unused_", "loop_", "iteration_", "variable_", "[SEP]_", "class_", "Dep", "reca", "ted", "Poo", "l", "Listen", "er", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "use", "s", "\\u", "deprecated_", "(_", "r", "\".*", "Us", "e", " ", "event", ".", "listen", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "listeners", "\\u", "calla", "bles_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "connect_", "(_", "dbapi", "\\u", "con_", ",_", "con", "\\u", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "checkout_", "(_", "dbapi", "\\u", "con_", ",_", "con", "\\u", "record_", ",_", "con", "\\u", "proxy_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "[_", "1_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "checkin", "_", "(_", "dbapi", "\\u", "con_", ",_", "con", "\\u", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "[_", "2_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i", "\\u", "all_", "=_", "dict_", "(_", "connect_", "=_", "connect_", ",_", "checkout_", "=_", "checkout_", ",_", "checkin", "_", "=_", "checkin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "\\u", "connect_", "=_", "dict_", "(_", "connect_", "=_", "connect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "\\u", "checkout_", "=_", "dict_", "(_", "checkout_", "=_", "checkout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i", "\\u", "checkin", "_", "=_", "dict_", "(_", "checkin", "_", "=_", "checkin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cls_", "in_", "(_", "pool_", "._", "Queue", "Pool_", ",_", "pool_", "._", "Static", "Pool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "=_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "total_", ",_", "conn_", ",_", "cout", "_", ",_", "cin", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "instance_", "in_", "(_", "p_", ",_", "p_", "._", "recreate", "_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "eq\\u_", "(_", "len_", "(_", "instance_", "._", "dispatch_", "._", "connect_", ")_", ",_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "len_", "(_", "instance_", "._", "dispatch_", "._", "checkout_", ")_", ",_", "cout", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "len_", "(_", "instance_", "._", "dispatch_", "._", "checkin", "_", ")_", ",_", "cin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "self_", "._", "\\u", "queue", "pool", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "add", "\\u", "listener_", "(_", "i", "\\u", "all_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "1_", ",_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "add", "\\u", "listener_", "(_", "i", "\\u", "connect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "2_", ",_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "add", "\\u", "listener_", "(_", "i", "\\u", "checkout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "3_", ",_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "add", "\\u", "listener_", "(_", "i", "\\u", "checkin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "4_", ",_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "self_", "._", "\\u", "queue", "pool", "\\u", "fixture_", "(_", "listeners_", "=_", "[_", "i", "\\u", "all_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "listeners_", "(_", "p_", ",_", "1_", ",_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "counts_", "==_", "[_", "1_", ",_", "1_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "counts_", "==_", "[_", "1_", ",_", "1_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "counts_", "==_", "[_", "1_", ",_", "2_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "add", "\\u", "listener_", "(_", "i", "\\u", "checkin", "_", ")_", "\\u\\u\\uNEW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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 ]
Imprecise assert
AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/fixtures_regress/tests.py
[ { "content": " def test_dumpdata_uses_default_manager(self):\n \"\"\"\n Regression for #11286\n Ensure that dumpdata honors the default manager\n Dump the current contents of the database as a JSON fixture\n \"\"\"\n management.call_command(\n 'loaddata',\n 'animal.xml',\n verbosity=0,\n commit=False,\n )\n management.call_command(\n 'loaddata',\n 'sequence.json',\n verbosity=0,\n commit=False,\n )\n animal = Animal(\n name='Platypus',\n latin_name='Ornithorhynchus anatinus',\n count=2,\n weight=2.2\n )\n animal.save()\n\n stdout = StringIO()\n management.call_command(\n 'dumpdata',\n 'fixtures_regress.animal',\n format='json',\n stdout=stdout\n )\n\n # Output order isn't guaranteed, so check for parts\n data = stdout.getvalue()\n\n # Get rid of artifacts like '000000002' to eliminate the differences\n # between different Python versions.\n data = re.sub('0{6,}\\d', '', data)\n\n lion_json = '{\"pk\": 1, \"model\": \"fixtures_regress.animal\", \"fields\": {\"count\": 3, \"weight\": 1.2, \"name\": \"Lion\", \"latin_name\": \"Panthera leo\"}}'\n emu_json = '{\"pk\": 10, \"model\": \"fixtures_regress.animal\", \"fields\": {\"count\": 42, \"weight\": 1.2, \"name\": \"Emu\", \"latin_name\": \"Dromaius novaehollandiae\"}}'\n platypus_json = '{\"pk\": %d, \"model\": \"fixtures_regress.animal\", \"fields\": {\"count\": 2, \"weight\": 2.2, \"name\": \"Platypus\", \"latin_name\": \"Ornithorhynchus anatinus\"}}'\n platypus_json = platypus_json % animal.pk\n\n self.assertEqual(len(data), len('[%s]' % ', '.join([lion_json, emu_json, platypus_json])))\n self.assertTrue(lion_json in data)\n self.assertTrue(emu_json in data)\n self.assertTrue(platypus_json in data)", "metadata": "root.TestFixtures.test_dumpdata_uses_default_manager", "header": "['class', 'TestFixtures', '(', 'TestCase', ')', ':', '___EOS___']", "index": 293 }, { "content": " def test_loaddata_not_existant_fixture_file(self):\n stdout_output = StringIO()\n management.call_command(\n 'loaddata',\n 'this_fixture_doesnt_exist',\n verbosity=2,\n commit=False,\n stdout=stdout_output,\n )\n self.assertTrue(\"No xml fixture 'this_fixture_doesnt_exist' in\" in\n stdout_output.getvalue())", "metadata": "root.TestFixtures.test_loaddata_not_existant_fixture_file", "header": "['class', 'TestFixtures', '(', 'TestCase', ')', ':', '___EOS___']", "index": 427 } ]
[ { "span": "self.assertTrue(lion_json in data)", "start_line": 340, "start_column": 8, "end_line": 340, "end_column": 42 }, { "span": "self.assertTrue(emu_json in data)", "start_line": 341, "start_column": 8, "end_line": 341, "end_column": 41 }, { "span": "self.assertTrue(platypus_json in data)", "start_line": 342, "start_column": 8, "end_line": 342, "end_column": 46 }, { "span": "self.assertTrue(\"No xml fixture 'this_fixture_doesnt_exist' in\" in\n stdout_output.getvalue())", "start_line": 436, "start_column": 8, "end_line": 437, "end_column": 37 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Fix", "tures", "_", "(_", "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", "dump", "data\\u", "use", "s", "\\u", "default", "\\u", "manager_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Regr", "ession", " ", "for", " ", "#", "112", "86", "\\", "10", ";", " ", " ", " ", " ", "Ensur", "e", " ", "tha", "t", " ", "dump", "data", " ", "honor", "s", " ", "the", " ", "default", " ", "manage", "r", "\\", "10", ";", " ", " ", " ", " ", "Dump", " ", "the", " ", "current", " ", "content", "s", " ", "of", " ", "the", " ", "databa", "se", " ", "as", " ", "a", " ", "JSO", "N", " ", "fixture", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "load", "data", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "animal", ".", "xml", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbosity_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "commit_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "load", "data", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sequence", ".", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbosity_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "commit_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "animal", "_", "=_", "Anima", "l_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "Plat", "yp", "us", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "latin", "\\u", "name_", "=_", "'", "Or", "nit", "hor", "hy", "nch", "us", " ", "anat", "inu", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "count_", "=_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "weight_", "=_", "2.2_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "animal", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dump", "data", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fixture", "s", "\\u", "regress", ".", "animal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format_", "=_", "'", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "stdout_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "order", " ", "isn", "'", "t", " ", "guaran", "tee", "d", ",", " ", "so", " ", "check", " ", "for", " ", "parts_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "stdout_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "rid", " ", "of", " ", "artifact", "s", " ", "like", " ", "'", "00000000", "2", "'", " ", "to", " ", "eliminat", "e", " ", "the", " ", "difference", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bet", "ween", " ", "different", " ", "Pyth", "on", " ", "version", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "re_", "._", "sub_", "(_", "'", "0", "{", "6", ",}", "\\\\", "d", "'_", ",_", "''_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lio", "n", "\\u", "json_", "=_", "'{", "\"", "pk", "\":", " ", "1", ",", " ", "\"", "model", "\":", " ", "\"", "fixture", "s", "\\u", "regress", ".", "animal", "\",", " ", "\"", "fields", "\":", " ", "{", "\"", "count", "\":", " ", "3", ",", " ", "\"", "weight", "\":", " ", "1.2", ",", " ", "\"", "name", "\":", " ", "\"", "Li", "on", "\",", " ", "\"", "latin", "\\u", "name", "\":", " ", "\"", "Pant", "her", "a", " ", "leo", "\"}}", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "emu", "\\u", "json_", "=_", "'{", "\"", "pk", "\":", " ", "10", ",", " ", "\"", "model", "\":", " ", "\"", "fixture", "s", "\\u", "regress", ".", "animal", "\",", " ", "\"", "fields", "\":", " ", "{", "\"", "count", "\":", " ", "4", "2", ",", " ", "\"", "weight", "\":", " ", "1.2", ",", " ", "\"", "name", "\":", " ", "\"", "Em", "u", "\",", " ", "\"", "latin", "\\u", "name", "\":", " ", "\"", "Dro", "mai", "us", " ", "nova", "eh", "oll", "and", "ia", "e", "\"}}", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plat", "yp", "us", "\\u", "json_", "=_", "'{", "\"", "pk", "\":", " ", "%", "d", ",", " ", "\"", "model", "\":", " ", "\"", "fixture", "s", "\\u", "regress", ".", "animal", "\",", " ", "\"", "fields", "\":", " ", "{", "\"", "count", "\":", " ", "2", ",", " ", "\"", "weight", "\":", " ", "2.2", ",", " ", "\"", "name", "\":", " ", "\"", "Plat", "yp", "us", "\",", " ", "\"", "latin", "\\u", "name", "\":", " ", "\"", "Or", "nit", "hor", "hy", "nch", "us", " ", "anat", "inu", "s", "\"}}", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plat", "yp", "us", "\\u", "json_", "=_", "plat", "yp", "us", "\\u", "json_", "%_", "animal", "_", "._", "pk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "data_", ")_", ",_", "len_", "(_", "'[", "%", "s", "]'_", "%_", "',", " ", "'_", "._", "join_", "(_", "[_", "lio", "n", "\\u", "json_", ",_", "emu", "\\u", "json_", ",_", "plat", "yp", "us", "\\u", "json_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "lio", "n", "\\u", "json_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "emu", "\\u", "json_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "plat", "yp", "us", "\\u", "json_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Fix", "tures", "_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "data\\u", "not", "\\u", "exist", "ant", "\\u", "fixture", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout", "\\u", "output_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "load", "data", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "\\u", "fixture", "\\u", "doesnt", "\\u", "exist", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verbosity_", "=_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "commit_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "stdout", "\\u", "output_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "No", " ", "xml", " ", "fixture", " ", "'", "this", "\\u", "fixture", "\\u", "doesnt", "\\u", "exist", "'", " ", "in", "\"_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "stdout", "\\u", "output_", "._", "getvalue_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 1, 1, 2 ]
Except block handles 'BaseException'
spacetelescope/PyFITS/pyfits/util.py
[ { "content": "def _words_group(input, strlen):\n \"\"\"\n Split a long string into parts where each part is no longer\n than `strlen` and no word is cut into two pieces. But if\n there is one single word which is longer than `strlen`, then\n it will be split in the middle of the word.\n \"\"\"\n\n words = []\n nblanks = input.count(' ')\n nmax = max(nblanks, len(input) // strlen + 1)\n arr = np.fromstring((input + ' '), dtype=(binary_type, 1))\n\n # locations of the blanks\n blank_loc = np.nonzero(arr == ' '.encode('latin1'))[0]\n offset = 0\n xoffset = 0\n for idx in range(nmax):\n try:\n loc = np.nonzero(blank_loc >= strlen + offset)[0][0]\n offset = blank_loc[loc - 1] + 1\n if loc == 0:\n offset = -1\n except:\n offset = len(input)\n\n # check for one word longer than strlen, break in the middle\n if offset <= xoffset:\n offset = xoffset + strlen\n\n # collect the pieces in a list\n words.append(input[xoffset:offset])\n if len(input) == offset:\n break\n xoffset = offset\n\n return words", "metadata": "root._words_group", "header": "['module', '___EOS___']", "index": 1234 } ]
[ { "span": "except:", "start_line": 1257, "start_column": 8, "end_line": 1257, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "words", "\\u", "group_", "(_", "input_", ",_", "strl", "en_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Split", " ", "a", " ", "long", " ", "string", " ", "int", "o", " ", "part", "s", " ", "where", " ", "each", " ", "part", " ", "is", " ", "no", " ", "long", "er", "\\", "10", ";", " ", " ", " ", " ", "than", " ", "`", "strl", "en", "`", " ", "and", " ", "no", " ", "word", " ", "is", " ", "cut", " ", "int", "o", " ", "two", " ", "piece", "s", ".", " ", " ", "Bu", "t", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "there", " ", "is", " ", "one", " ", "single", " ", "word", " ", "whi", "ch", " ", "is", " ", "long", "er", " ", "than", " ", "`", "strl", "en", "`", ",", " ", "then", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "will", " ", "be", " ", "split", " ", "in", " ", "the", " ", "middle", " ", "of", " ", "the", " ", "word", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "words_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nbl", "ank", "s_", "=_", "input_", "._", "count_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nma", "x_", "=_", "max_", "(_", "nbl", "ank", "s_", ",_", "len_", "(_", "input_", ")_", "//_", "strl", "en_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr_", "=_", "np_", "._", "fromstring_", "(_", "(_", "input_", "+_", "'", " ", "'_", ")_", ",_", "dtype_", "=_", "(_", "binar", "y", "\\u", "type_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "location", "s", " ", "of", " ", "the", " ", "blanks_", "\\u\\u\\uNL\\u\\u\\u_", "blank", "\\u", "loc_", "=_", "np_", "._", "nonzero_", "(_", "arr_", "==_", "'", " ", "'_", "._", "encode_", "(_", "'", "latin", "1", "'_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xoff", "set_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", "in_", "range_", "(_", "nma", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loc_", "=_", "np_", "._", "nonzero_", "(_", "blank", "\\u", "loc_", ">=_", "strl", "en_", "+_", "offset_", ")_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "=_", "blank", "\\u", "loc_", "[_", "loc_", "-_", "1_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "loc_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "-_", "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 ", " _", "offset_", "=_", "len_", "(_", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "one", " ", "word", " ", "long", "er", " ", "than", " ", "strl", "en", ",", " ", "break", " ", "in", " ", "the", " ", "middle_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "offset_", "<=_", "xoff", "set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "xoff", "set_", "+_", "strl", "en_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "collect", " ", "the", " ", "piece", "s", " ", "in", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "words_", "._", "append_", "(_", "input_", "[_", "xoff", "set_", ":_", "offset_", "]_", ")_", "\\u\\u\\uNEW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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, 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 ]
Unused import
karesansui/karesansui/karesansui/lib/parser/eml.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This file is part of Karesansui Core.\n#\n# Copyright (C) 2009-2012 HDE, Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\nimport os\nimport re\nimport sys\nimport time\nimport email.Parser\n\nfrom karesansui.lib.dict_op import DictOp\nfrom karesansui.lib.parser.base.null_parser import nullParser as Parser\nfrom karesansui.lib.utils import array_replace\nfrom karesansui.lib.utils import preprint_r\n\n\n\"\"\"\nDefine Variables for This Parser\n\"\"\"\n\n\n\"\"\"\n\"\"\"\nif __name__ == '__main__':\n \"\"\"Testing\n \"\"\"\n\n message = \"\"\"Message-ID: <[email protected]>\nSubject: Hello, World!!\nMIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"----=_Part_0_22060966.1231404007271\"\n\n------=_Part_0_22060966.1231404007271\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\nE-Mail created by Application\n------=_Part_0_22060966.1231404007271\nContent-Type: application/pdf; name=HelloWorld_007.pdf\nContent-Transfer-Encoding: base64\nContent-Disposition: attachment; filename=HelloWorld_007.pdf\nContent-ID: Attachment\n\nJVBERi0xLjMgCiXi48/TIAo3IDAgb2JqCjw8Ci9Db250ZW50cyBbIDggMCBSIF0gCi9QYXJlbnQg\n\n------=_Part_0_22060966.1231404007271--\n \"\"\"\n\n parser = emlParser()\n dop = DictOp()\n eml = \"/tmp/test2.eml\"\n extra_args = {\"message\":message}\n extra_args = {\"file\":eml}\n extra_args = {\"message\":open(eml).read()}\n dop.addconf(\"dum\",parser.read_conf(extra_args=extra_args))\n conf = dop.getconf(\"dum\")\n preprint_r(conf)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class emlParser(Parser):\n\n _module = \"eml\"\n\n\n\n\n\n", "metadata": "root.emlParser", "header": "['module', '___EOS___']", "index": 42 }, { "content": " def __init__(self):\n self.dop = DictOp()\n self.dop.addconf(self._module,{})\n\n self.base_parser_name = Parser.__name__\n\n self.encoding = \"UTF-8\"\n pass", "metadata": "root.emlParser.__init__", "header": "['class', 'emlParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 46 }, { "content": " def source_file(self):\n try:\n retval = self.get_source_file()\n except:\n retval = []\n\n return retval", "metadata": "root.emlParser.source_file", "header": "['class', 'emlParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 55 }, { "content": " def _parse_mail(self,mail):\n retval = {}\n try:\n body = mail.get_payload()\n boundary = mail.get_boundary()\n charsets = mail.get_charsets() # ['iso-8859-1']\n content_charset = mail.get_content_charset() # 'iso-8859-1'\n content_maintype = mail.get_content_maintype() # 'text'\n content_subtype = mail.get_content_subtype() # 'plain'\n content_type = mail.get_content_type() # 'text/plain'\n default_type = mail.get_default_type() # 'text/plain'\n filename = mail.get_filename() # ??\n params = mail.get_params() # [('text/plain', ''), ('charset', 'iso-8859-1')]\n is_multipart = mail.is_multipart() # False\n if type(body) is list:\n new_body = []\n for _mail in body:\n new_body.append(self._parse_mail(_mail))\n body = new_body\n retval = {}\n retval['body'] = body\n retval['boundary'] = boundary\n retval['charsets'] = charsets\n retval['content_charset'] = content_charset\n retval['content_maintype'] = content_maintype\n retval['content_subtype'] = content_subtype\n retval['content_type'] = content_type\n retval['default_type'] = default_type\n retval['filename'] = filename\n retval['params'] = params\n retval['is_multipart'] = is_multipart\n except:\n pass\n\n #preprint_r(retval)\n return retval", "metadata": "root.emlParser._parse_mail", "header": "['class', 'emlParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 63 }, { "content": " def parse(self,file=None,message=None):\n retval = {}\n try:\n if file is not None and os.path.exists(file):\n message = open(file).read()\n\n mail = email.Parser.Parser().parsestr(message)\n\n headers = mail._headers\n msgs = self._parse_mail(mail)\n\n if type(msgs['body']) is list:\n rawbody = \"\"\n\n if file is not None and os.path.exists(file):\n f = open(file)\n line = f.readline()\n while line:\n line = f.readline()\n if line.rstrip() == \"\":\n rawbody += line\n rawbody += ''.join(f.readlines())\n break\n f.close\n else:\n in_body = False\n for line in message.split(\"\\n\"):\n if line.rstrip() == \"\":\n in_body = True\n if in_body is True:\n rawbody += line + \"\\n\"\n\n elif type(msgs['body']) is str:\n rawbody = msgs['body']\n\n retval[\"headers\"] = headers\n retval[\"msgs\"] = msgs\n retval[\"rawbody\"] = rawbody\n\n except:\n pass\n\n #preprint_r(retval)\n return retval", "metadata": "root.emlParser.parse", "header": "['class', 'emlParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 100 }, { "content": " def read_conf(self,extra_args=None):\n retval = {}\n\n self.dop.addconf(self._module,{})\n\n try:\n self.set_source_file(extra_args[\"file\"])\n\n for _file in self.source_file():\n if os.path.exists(_file):\n mail = self.parse(file=_file)\n\n headers = mail['headers']\n msgs = mail['msgs']\n rawbody = mail['rawbody']\n\n self.dop.add(self._module,[_file,'@msgs'] ,msgs)\n self.dop.add(self._module,[_file,'@headers'],headers)\n for _header in headers:\n self.dop.add(self._module,[_file,'header',_header[0]],_header[1])\n self.dop.add(self._module,[_file,'rawbody'] ,rawbody)\n\n except:\n pass\n\n try:\n message = extra_args[\"message\"]\n\n try:\n message = message.encode(self.encoding)\n except:\n pass\n\n if message != \"\" and message is not None:\n mail = self.parse(message=message)\n\n headers = mail['headers']\n msgs = mail['msgs']\n rawbody = mail['rawbody']\n\n self.dop.add(self._module,[\"@message\",'@msgs'] ,msgs)\n self.dop.add(self._module,[\"@message\",'@headers'],headers)\n for _header in headers:\n self.dop.add(self._module,[\"@message\",'header',_header[0]],_header[1])\n self.dop.add(self._module,[\"@message\",'rawbody'] ,rawbody)\n except:\n pass\n\n\n return self.dop.getconf(self._module)", "metadata": "root.emlParser.read_conf", "header": "['class', 'emlParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 145 }, { "content": " def write_conf(self,conf_arr={},extra_args=None,dryrun=False):\n retval = True\n\n return retval", "metadata": "root.emlParser.write_conf", "header": "['class', 'emlParser', '(', 'Parser', ')', ':', '___EOS___']", "index": 196 } ]
[ { "span": "import re", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 9 }, { "span": "import sys", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 10 }, { "span": "import time", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 11 }, { "span": "from karesansui.lib.utils import array_replace", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "Kar", "esa", "nsu", "i", " ", "Core", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "200", "9", "-", "2012", " ", "HD", "E", ",", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\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_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "email_", "._", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "._", "lib_", "._", "dict", "\\u", "op_", "import_", "Dict", "Op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "._", "lib_", "._", "parser_", "._", "base_", "._", "null", "\\u", "parser_", "import_", "null", "Parser_", "as_", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "._", "lib_", "._", "utils_", "import_", "array", "\\u", "replace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kar", "esa", "nsu", "i_", "._", "lib_", "._", "utils_", "import_", "prep", "rint", "\\u", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Define", " ", "Varia", "bles", " ", "for", " ", "Thi", "s", " ", "Parser", "\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "ing", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "=_", "\"\"\"", "Messag", "e-", "ID", ":", " ", "<", "671", "472", "91.", "1.1", "231", "874", "007", "256", ".", "Ja", "va", "Mail", ".", "tai", "zo", "@", "kar", "esa", "nsu", "i", "-", "project", ".", "info", ">", "\\", "10", ";", "Sub", "ject", ":", " ", "Hell", "o", ",", " ", "Wor", "ld", "!!", "\\", "10", ";", "MIME", "-", "Version", ":", " ", "1.0", "\\", "10", ";", "Conten", "t", "-", "Type", ":", " ", "multip", "art", "/", "mixed", ";", " ", "bound", "ary", "=\"", "----", "=", "\\u", "Part", "\\u", "0", "\\u", "220", "609", "66.", "1231", "404", "007", "271", "\"", "\\", "10", ";", "\\", "10", ";", "------", "=", "\\u", "Part", "\\u", "0", "\\u", "220", "609", "66.", "1231", "404", "007", "271", "\\", "10", ";", "Conten", "t", "-", "Type", ":", " ", "text", "/", "plain", ";", " ", "charset", "=", "us", "-", "ascii", "\\", "10", ";", "Conten", "t", "-", "Transfer", "-", "Enco", "ding", ":", " ", "7b", "it", "\\", "10", ";", "\\", "10", ";", "E-", "Mail", " ", "created", " ", "by", " ", "Applica", "tion", "\\", "10", ";", "------", "=", "\\u", "Part", "\\u", "0", "\\u", "220", "609", "66.", "1231", "404", "007", "271", "\\", "10", ";", "Conten", "t", "-", "Type", ":", " ", "applica", "tion", "/", "pdf", ";", " ", "name", "=", "Hell", "o", "Wor", "ld", "\\u", "007", ".", "pdf", "\\", "10", ";", "Conten", "t", "-", "Transfer", "-", "Enco", "ding", ":", " ", "base64", "\\", "10", ";", "Conten", "t", "-", "Dispo", "sition", ":", " ", "attach", "ment", ";", " ", "filename", "=", "Hell", "o", "Wor", "ld", "\\u", "007", ".", "pdf", "\\", "10", ";", "Conten", "t", "-", "ID", ":", " ", "Attach", "ment", "\\", "10", ";", "\\", "10", ";", "JV", "BER", "i", "0", "x", "Lj", "Mg", "Ci", "Xi", "4", "8", "/", "TI", "Ao", "3", "IDA", "gb", "2", "Jq", "C", "jw", "8", "Ci", "9", "Db", "250", "ZW", "50", "cy", "Bb", "ID", "gg", "MC", "BS", "IF", "0", "g", "Ci", "9", "QY", "XJ", "lb", "n", "Qg", "\\", "10", ";", "\\", "10", ";", "------", "=", "\\u", "Part", "\\u", "0", "\\u", "220", "609", "66.", "1231", "404", "007", "271", "--", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "em", "l", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dop", "_", "=_", "Dict", "Op_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "em", "l_", "=_", "\"/", "tmp", "/", "test", "2", ".", "em", "l", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "args_", "=_", "{_", "\"", "message", "\"_", ":_", "message_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "args_", "=_", "{_", "\"", "file", "\"_", ":_", "em", "l_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "args_", "=_", "{_", "\"", "message", "\"_", ":_", "open_", "(_", "em", "l_", ")_", "._", "read_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dop", "_", "._", "addc", "onf_", "(_", "\"", "dum", "\"_", ",_", "parser_", "._", "read", "\\u", "conf_", "(_", "extra", "\\u", "args_", "=_", "extra", "\\u", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "=_", "dop", "_", "._", "getcon", "f_", "(_", "\"", "dum", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prep", "rint", "\\u", "r_", "(_", "conf_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "module_", "=_", "\"", "em", "l", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\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_", "._", "dop", "_", "=_", "Dict", "Op_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dop", "_", "._", "addc", "onf_", "(_", "self_", "._", "\\u", "module_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "base", "\\u", "parser", "\\u", "name_", "=_", "Parser_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "encoding_", "=_", "\"", "UT", "F", "-", "8", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "source", "\\u", "file_", "(_", "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 ", " _", "retval_", "=_", "self_", "._", "get", "\\u", "source", "\\u", "file_", "(_", ")_", "\\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 ", " _", "retval_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "mail_", "(_", "self_", ",_", "mail_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "mail_", "._", "get", "\\u", "payload_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "boundary_", "=_", "mail_", "._", "get", "\\u", "boundary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "charset", "s_", "=_", "mail_", "._", "get", "\\u", "charset", "s_", "(_", ")_", "#", " ", "['", "iso", "-", "8859", "-1", "']", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "charset_", "=_", "mail_", "._", "get", "\\u", "content", "\\u", "charset_", "(_", ")_", "#", " ", "'", "iso", "-", "8859", "-1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "maint", "ype_", "=_", "mail_", "._", "get", "\\u", "content", "\\u", "maint", "ype_", "(_", ")_", "#", " ", "'", "text", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "subtype_", "=_", "mail_", "._", "get", "\\u", "content", "\\u", "subtype_", "(_", ")_", "#", " ", "'", "plain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content", "\\u", "type_", "=_", "mail_", "._", "get", "\\u", "content", "\\u", "type_", "(_", ")_", "#", " ", "'", "text", "/", "plain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "type_", "=_", "mail_", "._", "get", "\\u", "default", "\\u", "type_", "(_", ")_", "#", " ", "'", "text", "/", "plain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "mail_", "._", "get", "\\u", "filename_", "(_", ")_", "#", " ", "??", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "mail_", "._", "get", "\\u", "params_", "(_", ")_", "#", " ", "[(", "'", "text", "/", "plain", "',", " ", "''", "),", " ", "('", "charset", "',", " ", "'", "iso", "-", "8859", "-1", "')]", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "multipart_", "=_", "mail_", "._", "is", "\\u", "multipart_", "(_", ")_", "#", " ", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "body_", ")_", "is_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "body_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "mail_", "in_", "body_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "new", "\\u", "body_", "._", "append_", "(_", "self_", "._", "\\u", "parse", "\\u", "mail_", "(_", "\\u", "mail_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "=_", "new", "\\u", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "retval_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "body", "'_", "]_", "=_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "bound", "ary", "'_", "]_", "=_", "boundary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "charset", "s", "'_", "]_", "=_", "charset", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "content", "\\u", "charset", "'_", "]_", "=_", "content", "\\u", "charset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "content", "\\u", "maint", "ype", "'_", "]_", "=_", "content", "\\u", "maint", "ype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "content", "\\u", "subt", "ype", "'_", "]_", "=_", "content", "\\u", "subtype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "content", "\\u", "type", "'_", "]_", "=_", "content", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "default", "\\u", "type", "'_", "]_", "=_", "default", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "filename", "'_", "]_", "=_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "params", "'_", "]_", "=_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "'", "is", "\\u", "multip", "art", "'_", "]_", "=_", "is", "\\u", "multipart_", "\\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_", "#", "prep", "rint", "\\u", "r", "(", "ret", "val", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "file_", "=_", "None_", ",_", "message_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "file_", "is_", "not_", "None_", "and_", "os_", "._", "path_", "._", "exists_", "(_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "open_", "(_", "file_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mail_", "=_", "email_", "._", "Parser_", "._", "Parser_", "(_", ")_", "._", "parse", "str_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "mail_", "._", "\\u", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgs_", "=_", "self_", "._", "\\u", "parse", "\\u", "mail_", "(_", "mail_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type_", "(_", "msgs_", "[_", "'", "body", "'_", "]_", ")_", "is_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "body_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "file_", "is_", "not_", "None_", "and_", "os_", "._", "path_", "._", "exists_", "(_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f_", "=_", "open_", "(_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "f_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "line_", "=_", "f_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "._", "rstrip_", "(_", ")_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raw", "body_", "+=_", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "body_", "+=_", "''_", "._", "join_", "(_", "f_", "._", "readlines_", "(_", ")_", ")_", "\\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_", "f_", "._", "close_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "in", "\\u", "body_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "message_", "._", "split_", "(_", "\"\\\\", "n", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "line_", "._", "rstrip_", "(_", ")_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "in", "\\u", "body_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "in", "\\u", "body_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raw", "body_", "+=_", "line_", "+_", "\"\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "msgs_", "[_", "'", "body", "'_", "]_", ")_", "is_", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "body_", "=_", "msgs_", "[_", "'", "body", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "retval_", "[_", "\"", "header", "s", "\"_", "]_", "=_", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "\"", "msgs", "\"_", "]_", "=_", "msgs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "[_", "\"", "raw", "body", "\"_", "]_", "=_", "raw", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "prep", "rint", "\\u", "r", "(", "ret", "val", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "\\u", "conf_", "(_", "self_", ",_", "extra", "\\u", "args_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dop", "_", "._", "addc", "onf_", "(_", "self_", "._", "\\u", "module_", ",_", "{_", "}_", ")_", "\\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", "source", "\\u", "file_", "(_", "extra", "\\u", "args_", "[_", "\"", "file", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "\\u", "file_", "in_", "self_", "._", "source", "\\u", "file_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "exists_", "(_", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mail_", "=_", "self_", "._", "parse_", "(_", "file_", "=_", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "mail_", "[_", "'", "header", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgs_", "=_", "mail_", "[_", "'", "msgs", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "body_", "=_", "mail_", "[_", "'", "raw", "body", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\\u", "file_", ",_", "'@", "msgs", "'_", "]_", ",_", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\\u", "file_", ",_", "'@", "header", "s", "'_", "]_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "header_", "in_", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\\u", "file_", ",_", "'", "header", "'_", ",_", "\\u", "header_", "[_", "0_", "]_", "]_", ",_", "\\u", "header_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\\u", "file_", ",_", "'", "raw", "body", "'_", "]_", ",_", "raw", "body_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "extra", "\\u", "args_", "[_", "\"", "message", "\"_", "]_", "\\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 ", " _", "message_", "=_", "message_", "._", "encode_", "(_", "self_", "._", "encoding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "message_", "!=_", "\"\"_", "and_", "message_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mail_", "=_", "self_", "._", "parse_", "(_", "message_", "=_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "mail_", "[_", "'", "header", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgs_", "=_", "mail_", "[_", "'", "msgs", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "body_", "=_", "mail_", "[_", "'", "raw", "body", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\"@", "message", "\"_", ",_", "'@", "msgs", "'_", "]_", ",_", "msgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\"@", "message", "\"_", ",_", "'@", "header", "s", "'_", "]_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "header_", "in_", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\"@", "message", "\"_", ",_", "'", "header", "'_", ",_", "\\u", "header_", "[_", "0_", "]_", "]_", ",_", "\\u", "header_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dop", "_", "._", "add_", "(_", "self_", "._", "\\u", "module_", ",_", "[_", "\"@", "message", "\"_", ",_", "'", "raw", "body", "'_", "]_", ",_", "raw", "body_", ")_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "dop", "_", "._", "getcon", "f_", "(_", "self_", "._", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "em", "l", "Parser_", "(_", "Parser_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "conf_", "(_", "self_", ",_", "conf", "\\u", "arr_", "=_", "{_", "}_", ",_", "extra", "\\u", "args_", "=_", "None_", ",_", "dryrun_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "retval_", "\\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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
ctuning/ck/ck/repo/module/web/module.py
[ { "content": "#\n# Collective Knowledge (CK web service)\n#\n# See CK LICENSE.txt for licensing details\n# See CK COPYRIGHT.txt for copyright details\n#\n# Developer: Grigori Fursin\n#\n\ncfg={} # Will be updated by CK (meta description of this module)\nwork={} # Will be updated by CK (temporal data)\nck=None # Will be updated by CK (initialized CK kernel) \n\ns_host=''\ns_port=''\n\n# Local settings\nimport os\nimport sys\nimport cgi\nimport urllib\nimport base64\nimport tempfile\n\n# Import various modules while supporting both Python 2.x and 3.x\ntry:\n from http.server import BaseHTTPRequestHandler, HTTPServer\nexcept:\n from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer\n\ntry:\n import urllib.parse as urlparse\nexcept:\n import urlparse\n\ntry:\n from urllib.parse import quote as urlquote\nexcept:\n from urllib import quote as urlquote\n\ntry:\n from urllib.parse import unquote as urlunquote\nexcept:\n from urllib import unquote as urlunquote\n\n#try:\n# import http.cookies as Cookie\n#except:\n# import Cookie\n\ntry:\n from socketserver import ThreadingMixIn\nexcept:\n from SocketServer import ThreadingMixIn\n\n##############################################################################\n# Initialize module\n\n\n##############################################################################\n# Access CK through CMD (can detach console)\n\n\n##############################################################################\n# Send error to HTTP stream\n\n\n##############################################################################\n# Send error to HTTP stream\n\n\n##############################################################################\n# Process CK web service request (both GET and POST)\n\n\n##############################################################################\n# Class to handle requests in separate threads\n\n\n##############################################################################\n# Class to handle CK web service requests\n\n\n##############################################################################\n# start web service\n\n\n##############################################################################\n# test web\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import urllib", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 13 }, { "span": "import urllib.parse as urlparse", "start_line": 31, "start_column": 3, "end_line": 31, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Collecti", "ve", " ", "Knowledge", " ", "(", "CK", " ", "web", " ", "service", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "CK", " ", "LICENSE", ".", "txt", " ", "for", " ", "lice", "nsi", "ng", " ", "details_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "CK", " ", "COPY", "RIG", "HT", ".", "txt", " ", "for", " ", "copyr", "ight", " ", "details_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dev", "elope", "r", ":", " ", "Gri", "gori", " ", "Fur", "sin_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cfg_", "=_", "{_", "}_", "#", " ", "Wil", "l", " ", "be", " ", "update", "d", " ", "by", " ", "CK", " ", "(", "meta", " ", "description", " ", "of", " ", "this", " ", "module", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work_", "=_", "{_", "}_", "#", " ", "Wil", "l", " ", "be", " ", "update", "d", " ", "by", " ", "CK", " ", "(", "tempora", "l", " ", "data", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ck_", "=_", "None_", "#", " ", "Wil", "l", " ", "be", " ", "update", "d", " ", "by", " ", "CK", " ", "(", "initialize", "d", " ", "CK", " ", "kernel", ")", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s", "\\u", "host_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s", "\\u", "port_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Local", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cgi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Import", " ", "vari", "ous", " ", "module", "s", " ", "whi", "le", " ", "support", "ing", " ", "bot", "h", " ", "Pyth", "on", " ", "2", ".", "x", " ", "and", " ", "3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "http_", "._", "server_", "import_", "Base", "HTTP", "Request", "Handler_", ",_", "HTTP", "Server_", "\\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_", "Base", "HTTP", "Server_", "import_", "Base", "HTTP", "Request", "Handler_", ",_", "HTTP", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "urllib_", "._", "parse_", "as_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "urlparse_", "\\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_", "urllib_", "._", "parse_", "import_", "quote_", "as_", "url", "quote_", "\\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_", "urllib_", "import_", "quote_", "as_", "url", "quote_", "\\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_", "urllib_", "._", "parse_", "import_", "unquote_", "as_", "urlu", "nq", "uot", "e_", "\\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_", "urllib_", "import_", "unquote_", "as_", "urlu", "nq", "uot", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "import", " ", "http", ".", "cookie", "s", " ", "as", " ", "Cookie_", "\\u\\u\\uNL\\u\\u\\u_", "#", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "import", " ", "Cookie_", "\\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 ", " _", "from_", "socket", "server_", "import_", "Thread", "ing", "Mix", "In_", "\\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_", "Sock", "et", "Server_", "import_", "Thread", "ing", "Mix", "In_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Access", " ", "CK", " ", "through", " ", "CMD", " ", "(", "can", " ", "deta", "ch", " ", "console", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sen", "d", " ", "error", " ", "to", " ", "HTTP", " ", "stream_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sen", "d", " ", "error", " ", "to", " ", "HTTP", " ", "stream_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Process", " ", "CK", " ", "web", " ", "service", " ", "request", " ", "(", "bot", "h", " ", "GET", " ", "and", " ", "POST", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Class", " ", "to", " ", "handle", " ", "request", "s", " ", "in", " ", "separate", " ", "threads_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Class", " ", "to", " ", "handle", " ", "CK", " ", "web", " ", "service", " ", "requests_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "web", " ", "service_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "web_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Unused local variable
fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/sfa/openflow_utils/expiration_manager.py
[ { "content": " @staticmethod\n def extend_expiration(slice_name,authority,time_extension):\n time_extended = time_extension #FIXME: See how is processed the new expiration time\n try:\n exp_sl = ExpiringComponents.objects.get(slice=slice,authority=authority)\n except:\n raise Exception(\"Slice %s has already expired\" %slice_name)\n exp_sl.extend_expiration(time_extension)", "metadata": "root.ExpirationManager.extend_expiration", "header": "['class', 'ExpirationManager', ':', '___EOS___']", "index": 8 }, { "content": " @staticmethod\n def find_expired_slices():\n try:\n from openflow.optin_manager.sfa.drivers.OFSfaDriver import OFSfaDriver #Avoiding circular Deps\n except:\n pass\n slices = ExpiringComponets.objects.all()\n expired_components = list()\n for slice in slices:\n expiration_date = int(datetime_to_epoch(utcparse(slice.expires)))\n if expiration_date <= int(datetime_to_epoch(utcparse(datetime.utcnow()))):\n try:\n OFSfaDriver().crud_slice(slice.slice,slice.authority, 'delete_slice')\n except:\n pass", "metadata": "root.ExpirationManager.find_expired_slices", "header": "['class', 'ExpirationManager', ':', '___EOS___']", "index": 18 } ]
[ { "span": "time_extended ", "start_line": 10, "start_column": 8, "end_line": 10, "end_column": 21 }, { "span": "expired_components ", "start_line": 25, "start_column": 8, "end_line": 25, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Expir", "ation", "Manager_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "extend", "\\u", "expiration_", "(_", "slice", "\\u", "name_", ",_", "authority_", ",_", "time", "\\u", "extension_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time", "\\u", "extended_", "=_", "time", "\\u", "extension_", "#", "FIX", "ME", ":", " ", "See", " ", "how", " ", "is", " ", "process", "ed", " ", "the", " ", "new", " ", "expir", "ation", " ", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exp", "\\u", "sl_", "=_", "Expir", "ing", "Components_", "._", "objects_", "._", "get_", "(_", "slice_", "=_", "slice_", ",_", "authority_", "=_", "authority_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Slice", " ", "%", "s", " ", "has", " ", "alr", "ead", "y", " ", "expir", "ed", "\"_", "%_", "slice", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exp", "\\u", "sl_", "._", "extend", "\\u", "expiration_", "(_", "time", "\\u", "extension_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Expir", "ation", "Manager_", ":_", "\\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_", "find", "\\u", "expir", "ed", "\\u", "slices_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "drivers_", "._", "OF", "Sf", "a", "Driver_", "import_", "OF", "Sf", "a", "Driver_", "#", "Av", "oid", "ing", " ", "circular", " ", "Deps", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "slices_", "=_", "Expir", "ing", "Compo", "nets_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expir", "ed", "\\u", "components_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "slice_", "in_", "slices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expir", "ation", "\\u", "date_", "=_", "int_", "(_", "datetime", "\\u", "to", "\\u", "epoch_", "(_", "utc", "parse_", "(_", "slice_", "._", "expires_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "expir", "ation", "\\u", "date_", "<=_", "int_", "(_", "datetime", "\\u", "to", "\\u", "epoch_", "(_", "utc", "parse_", "(_", "datetime_", "._", "utcnow_", "(_", ")_", ")_", ")_", ")_", ":_", "\\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 ", " ", "_", "OF", "Sf", "a", "Driver_", "(_", ")_", "._", "crud", "\\u", "slice_", "(_", "slice_", "._", "slice_", ",_", "slice_", "._", "authority_", ",_", "'", "delete", "\\u", "slice", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
HewlettPackard/python-hpOneView/examples/scripts/add-volume-template.py
[ { "content": "def login(con, credential):\n # Login with givin credentials\n try:\n con.login(credential)\n except:\n print('Login failed')", "metadata": "root.login", "header": "['module', '___EOS___']", "index": 55 } ]
[ { "span": "except:", "start_line": 59, "start_column": 4, "end_line": 59, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "login_", "(_", "con_", ",_", "credential_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Logi", "n", " ", "with", " ", "gi", "vin", " ", "credentials_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "con_", "._", "login_", "(_", "credential_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Logi", "n", " ", "fail", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
benadida/helios-server/helios/management/commands/helios_trustee_decrypt.py
[ { "content": "\"\"\"\ndecrypt elections where Helios is trustee\n\nDEPRECATED\n\nBen Adida\[email protected]\n2010-05-22\n\"\"\"\n\nfrom django.core.management.base import BaseCommand, CommandError\nimport csv, datetime\n\nfrom helios import utils as helios_utils\n\nfrom helios.models import *\n\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Command(BaseCommand):\n args = ''\n help = 'decrypt elections where helios is the trustee'\n ", "metadata": "root.Command", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def handle(self, *args, **options):\n # query for elections where decryption is ready to go and Helios is the trustee\n active_helios_trustees = Trustee.objects.exclude(secret_key = None).exclude(election__encrypted_tally = None).filter(decryption_factors = None)\n\n # for each one, do the decryption\n for t in active_helios_trustees:\n tally = t.election.encrypted_tally\n\n # FIXME: this should probably be in the encrypted_tally getter\n tally.init_election(t.election)\n\n factors, proof = tally.decryption_factors_and_proofs(t.secret_key)\n t.decryption_factors = factors\n t.decryption_proofs = proof\n t.save()", "metadata": "root.Command.handle", "header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']", "index": 21 } ]
[ { "span": "from django.core.management.base import BaseCommand, CommandError", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 65 }, { "span": "import csv, datetime", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 20 }, { "span": "from helios import utils as helios_utils", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "decrypt", " ", "election", "s", " ", "where", " ", "Heli", "os", " ", "is", " ", "trust", "ee", "\\", "10", ";", "\\", "10", ";", "DEP", "RECA", "TED", "\\", "10", ";", "\\", "10", ";", "Ben", " ", "Adi", "da", "\\", "10", ";", "ben", "@", "adi", "da", ".", "net", "\\", "10", ";", "2010", "-0", "5", "-", "2", "2", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "management_", "._", "base_", "import_", "Base", "Command_", ",_", "Command", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", ",_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "heli", "os_", "import_", "utils_", "as_", "heli", "os", "\\u", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "heli", "os_", "._", "models_", "import_", "*_", "\\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_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "help_", "=_", "'", "decrypt", " ", "election", "s", " ", "where", " ", "heli", "os", " ", "is", " ", "the", " ", "trust", "ee", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "query", " ", "for", " ", "election", "s", " ", "where", " ", "decrypt", "ion", " ", "is", " ", "read", "y", " ", "to", " ", "go", " ", "and", " ", "Heli", "os", " ", "is", " ", "the", " ", "trust", "ee_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "active", "\\u", "heli", "os", "\\u", "trust", "ees", "_", "=_", "Trust", "ee_", "._", "objects_", "._", "exclude_", "(_", "secret", "\\u", "key_", "=_", "None_", ")_", "._", "exclude_", "(_", "election", "\\u\\u", "encrypt", "ed", "\\u", "tally", "_", "=_", "None_", ")_", "._", "filter_", "(_", "decrypt", "ion", "\\u", "factors_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "each", " ", "one", ",", " ", "do", " ", "the", " ", "decrypt", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "active", "\\u", "heli", "os", "\\u", "trust", "ees", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tally", "_", "=_", "t_", "._", "election_", "._", "encrypt", "ed", "\\u", "tally", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "this", " ", "shou", "ld", " ", "probab", "ly", " ", "be", " ", "in", " ", "the", " ", "encrypt", "ed", "\\u", "tally", " ", "getter_", "\\u\\u\\uNL\\u\\u\\u_", "tally", "_", "._", "init", "\\u", "election_", "(_", "t_", "._", "election_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factors_", ",_", "proof", "_", "=_", "tally", "_", "._", "decrypt", "ion", "\\u", "factor", "s", "\\u", "and", "\\u", "proof", "s_", "(_", "t_", "._", "secret", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "decrypt", "ion", "\\u", "factors_", "=_", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "decrypt", "ion", "\\u", "proof", "s_", "=_", "pro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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 ]
`__init__` method calls overridden method
lisa-lab/pylearn2/pylearn2/devtools/tests/docscrape.py
[ { "content": "class NumpyDocString(object):\n\n\n\n\n\n\n\n\n\n\n\n\n # string conversion routines\n\n\n\n\n\n\n\n\n\n\n\n # --\n", "metadata": "root.NumpyDocString", "header": "['module', '___EOS___']", "index": 91 }, { "content": " def __init__(self, docstring, name=None):\n if name:\n self.name = name\n docstring = docstring.split('\\n')\n\n # De-indent paragraph\n try:\n indent = min(len(s) - len(s.lstrip()) for s in docstring\n if s.strip())\n except ValueError:\n indent = 0\n\n for n,line in enumerate(docstring):\n docstring[n] = docstring[n][indent:]\n\n self._doc = Reader(docstring)\n self._parsed_data = {\n 'Signature': '',\n 'Summary': '',\n 'Extended Summary': [],\n 'Parameters': [],\n 'Other Parameters': [],\n 'Returns': [],\n 'Raises': [],\n 'Warns': [],\n 'See Also': [],\n 'Notes': [],\n 'References': '',\n 'Examples': '',\n 'index': {},\n 'Attributes': [],\n 'Methods': [],\n }\n self.section_order = []\n\n self._parse()", "metadata": "root.NumpyDocString.__init__", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 92 }, { "content": " def __getitem__(self,key):\n return self._parsed_data[key]", "metadata": "root.NumpyDocString.__getitem__", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 129 }, { "content": " def __setitem__(self,key,val):\n if key not in self._parsed_data:\n raise ValueError(\"Unknown section %s\" % key)\n else:\n self._parsed_data[key] = val", "metadata": "root.NumpyDocString.__setitem__", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 132 }, { "content": " def _is_at_section(self):\n self._doc.seek_next_non_empty_line()\n\n if self._doc.eof():\n return False\n\n l1 = self._doc.peek().strip() # e.g. Parameters\n\n if l1.startswith('.. index::'):\n return True\n\n l2 = self._doc.peek(1).strip() # ----------\n return (len(l1) == len(l2) and l2 == '-'*len(l1))", "metadata": "root.NumpyDocString._is_at_section", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 138 }, { "content": " def _strip(self,doc):\n i = 0\n j = 0\n for i,line in enumerate(doc):\n if line.strip(): break\n\n for j,line in enumerate(doc[::-1]):\n if line.strip(): break\n\n return doc[i:len(doc)-j]", "metadata": "root.NumpyDocString._strip", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 152 }, { "content": " def _read_to_next_section(self):\n section = self._doc.read_to_next_empty_line()\n\n while not self._is_at_section() and not self._doc.eof():\n if not self._doc.peek(-1).strip(): # previous line was empty\n section += ['']\n\n section += self._doc.read_to_next_empty_line()\n\n return section", "metadata": "root.NumpyDocString._read_to_next_section", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 163 }, { "content": " def _read_sections(self):\n while not self._doc.eof():\n data = self._read_to_next_section()\n name = data[0].strip()\n\n if name.startswith('..'): # index section\n yield name, data[1:]\n elif len(data) < 2:\n yield StopIteration\n else:\n yield name, self._strip(data[2:])", "metadata": "root.NumpyDocString._read_sections", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 174 }, { "content": " def _parse_param_list(self,content):\n r = Reader(content)\n params = []\n while not r.eof():\n header = r.read().strip()\n if ' : ' in header:\n arg_name, arg_type = header.split(' : ')[:2]\n else:\n arg_name, arg_type = header, ''\n\n desc = r.read_to_next_unindented_line()\n for n,line in enumerate(desc):\n desc[n] = line.strip()\n desc = desc #'\\n'.join(desc)\n\n params.append((arg_name,arg_type,desc))\n\n return params", "metadata": "root.NumpyDocString._parse_param_list", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 186 }, { "content": " def _parse_see_also(self, content):\n \"\"\"\n func_name : Descriptive text\n continued text\n another_func_name : Descriptive text\n func_name1, func_name2, func_name3\n\n \"\"\"\n functions = []\n current_func = None\n rest = []\n for line in content:\n if not line.strip(): continue\n if ':' in line:\n if current_func:\n functions.append((current_func, rest))\n r = line.split(':', 1)\n current_func = r[0].strip()\n r[1] = r[1].strip()\n if r[1]:\n rest = [r[1]]\n else:\n rest = []\n elif not line.startswith(' '):\n if current_func:\n functions.append((current_func, rest))\n current_func = None\n rest = []\n if ',' in line:\n for func in line.split(','):\n func = func.strip()\n if func:\n functions.append((func, []))\n elif line.strip():\n current_func = line.strip()\n elif current_func is not None:\n rest.append(line.strip())\n if current_func:\n functions.append((current_func, rest))\n return functions", "metadata": "root.NumpyDocString._parse_see_also", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 205 }, { "content": " def _parse_index(self, section, content):\n \"\"\"\n .. index: default\n :refguide: something, else, and more\n\n \"\"\"\n def strip_each_in(lst):\n return [s.strip() for s in lst]\n\n out = {}\n section = section.split('::')\n if len(section) > 1:\n out['default'] = strip_each_in(section[1].split(','))[0]\n for line in content:\n line = line.split(':')\n if len(line) > 2:\n out[line[1]] = strip_each_in(line[2].split(','))\n return out", "metadata": "root.NumpyDocString._parse_index", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 246 }, { "content": " def _parse_summary(self):\n \"\"\"Grab signature (if given) and summary\"\"\"\n summary = self._doc.read_to_next_empty_line()\n summary_str = \"\\n\".join([s.strip() for s in summary])\n if re.compile('^([\\w. ]+=)?[\\w\\.]+\\(.*\\)$').match(summary_str):\n self['Signature'] = summary_str\n if not self._is_at_section():\n self['Summary'] = self._doc.read_to_next_empty_line()\n elif re.compile('^[\\w]+\\n[-]+').match(summary_str):\n self['Summary'] = ''\n self._doc.reset()\n else:\n self['Summary'] = summary\n\n if not self._is_at_section():\n self['Extended Summary'] = self._read_to_next_section()", "metadata": "root.NumpyDocString._parse_summary", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 265 }, { "content": " def _parse(self):\n self._doc.reset()\n self._parse_summary()\n for (section, content) in self._read_sections():\n if not section.startswith('..'):\n section = ' '.join([s.capitalize()\n for s in section.split(' ')])\n if section in ('Parameters', 'Other Parameters', 'Returns',\n 'Raises', 'Warns', 'Attributes', 'Methods'):\n self[section] = self._parse_param_list(content)\n self.section_order.append(section)\n elif section.startswith('.. index::'):\n self['index'] = self._parse_index(section, content)\n self.section_order.append('index')\n elif section.lower() == 'see also':\n self['See Also'] = self._parse_see_also(content)\n self.section_order.append('See Also')\n else:\n self[section] = content\n self.section_order.append(section)", "metadata": "root.NumpyDocString._parse", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 282 }, { "content": " def _str_header(self, name, symbol='-'):\n return [name, len(name)*symbol]", "metadata": "root.NumpyDocString._str_header", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 305 }, { "content": " def _str_indent(self, doc, indent=4):\n out = []\n for line in doc:\n out += [' '*indent + line]\n return out", "metadata": "root.NumpyDocString._str_indent", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 308 }, { "content": " def _str_signature(self):\n if not self['Signature']:\n return []\n return [\"*%s*\" % self['Signature'].replace('*','\\*')] + ['']", "metadata": "root.NumpyDocString._str_signature", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 314 }, { "content": " def _str_summary(self):\n return self['Summary'] + ['']", "metadata": "root.NumpyDocString._str_summary", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 319 }, { "content": " def _str_extended_summary(self):\n return self['Extended Summary'] + ['']", "metadata": "root.NumpyDocString._str_extended_summary", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 322 }, { "content": " def _str_param_list(self, name):\n out = []\n if self[name]:\n out += self._str_header(name)\n for param,param_type,desc in self[name]:\n out += ['%s : %s' % (param, param_type)]\n out += self._str_indent(desc)\n out += ['']\n return out", "metadata": "root.NumpyDocString._str_param_list", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 325 }, { "content": " def _str_section(self, name):\n out = []\n if self[name]:\n out += self._str_header(name)\n out += self[name]\n out += ['']\n return out", "metadata": "root.NumpyDocString._str_section", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 335 }, { "content": " def _str_see_also(self):\n if not self['See Also']: return []\n out = []\n out += self._str_header(\"See Also\")\n last_had_desc = True\n for func, desc in self['See Also']:\n if desc or last_had_desc:\n out += ['']\n out += [\"`%s`_\" % func]\n else:\n out[-1] += \", `%s`_\" % func\n if desc:\n out += self._str_indent(desc)\n last_had_desc = True\n else:\n last_had_desc = False\n out += ['']\n return out", "metadata": "root.NumpyDocString._str_see_also", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 343 }, { "content": " def _str_index(self):\n idx = self['index']\n out = []\n out += ['.. index:: %s' % idx.get('default','')]\n for section, references in six.iteritems(idx):\n if section == 'default':\n continue\n out += [' :%s: %s' % (section, ', '.join(references))]\n return out", "metadata": "root.NumpyDocString._str_index", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 362 }, { "content": " def __str__(self):\n out = []\n out += self._str_signature()\n out += self._str_summary()\n out += self._str_extended_summary()\n for param_list in ('Parameters', 'Other Parameters',\n 'Returns', 'Raises', 'Warns'):\n out += self._str_param_list(param_list)\n out += self._str_see_also()\n for s in ('Notes','References','Examples'):\n out += self._str_section(s)\n out += self._str_index()\n return '\\n'.join(out)", "metadata": "root.NumpyDocString.__str__", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 372 }, { "content": " def get_errors(self, check_order=True):\n errors = []\n self._doc.reset()\n for j, line in enumerate(self._doc):\n if len(line) > 75:\n if hasattr(self, 'name'):\n errors.append(\"%s: Line %d exceeds 75 chars\"\n \": \\\"%s\\\"...\" % (self.name, j+1, line[:30]))\n else:\n errors.append(\"Line %d exceeds 75 chars\"\n \": \\\"%s\\\"...\" % (j+1, line[:30]))\n\n if check_order:\n canonical_order = ['Signature', 'Summary', 'Extended Summary',\n 'Attributes', 'Methods', 'Parameters',\n 'Other Parameters','Returns', 'Raises', 'Warns',\n 'See Also', 'Notes', 'References', 'Examples',\n 'index']\n\n canonical_order_copy = list(canonical_order)\n\n for s in self.section_order:\n while canonical_order_copy and s != canonical_order_copy[0]:\n canonical_order_copy.pop(0)\n if not canonical_order_copy:\n errors.append(\n \"Sections in wrong order (starting at %s). The\"\n \" right order is %s\" % (s, canonical_order))\n\n return errors", "metadata": "root.NumpyDocString.get_errors", "header": "['class', 'NumpyDocString', '(', 'object', ')', ':', '___EOS___']", "index": 388 }, { "content": "class NumpyFunctionDocString(NumpyDocString):\n\n", "metadata": "root.NumpyFunctionDocString", "header": "['module', '___EOS___']", "index": 426 }, { "content": " def __init__(self, docstring, function):\n super(NumpyFunctionDocString, self).__init__(docstring)\n args, varargs, keywords, defaults = inspect.getargspec(function)\n if (args and args != ['self']) or varargs or keywords or defaults:\n self.has_parameters = True\n else:\n self.has_parameters = False", "metadata": "root.NumpyFunctionDocString.__init__", "header": "['class', 'NumpyFunctionDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 427 }, { "content": " def _parse(self):\n self._parsed_data = {\n 'Signature': '',\n 'Summary': '',\n 'Extended Summary': [],\n 'Parameters': [],\n 'Other Parameters': [],\n 'Returns': [],\n 'Raises': [],\n 'Warns': [],\n 'See Also': [],\n 'Notes': [],\n 'References': '',\n 'Examples': '',\n 'index': {},\n }\n return NumpyDocString._parse(self)", "metadata": "root.NumpyFunctionDocString._parse", "header": "['class', 'NumpyFunctionDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 435 }, { "content": " def get_errors(self):\n errors = NumpyDocString.get_errors(self)\n\n if not self['Signature']:\n #errors.append(\"No function signature\") #this check is currently\n #too restrictive. Disabling\n #it for now\n pass\n\n if not self['Summary']:\n errors.append(\"No function summary line\")\n\n if len(\" \".join(self['Summary'])) > 3*80:\n errors.append(\"Brief function summary is longer than 3 lines\")\n\n if not self['Parameters'] and self.has_parameters:\n errors.append(\"No Parameters section\")\n\n return errors", "metadata": "root.NumpyFunctionDocString.get_errors", "header": "['class', 'NumpyFunctionDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 453 }, { "content": "class NumpyClassDocString(NumpyDocString):\n\n\n", "metadata": "root.NumpyClassDocString", "header": "['module', '___EOS___']", "index": 473 }, { "content": " def __init__(self, docstring, class_name, class_object):\n super(NumpyClassDocString, self).__init__(docstring)\n self.class_name = class_name\n methods = dict((name, func) for name, func\n in inspect.getmembers(class_object))\n\n self.has_parameters = False\n if '__init__' in methods:\n # verify if __init__ is a Python function. If it isn't\n # (e.g. the function is implemented in C), getargspec will fail\n if not inspect.ismethod(methods['__init__']):\n return\n args, varargs, keywords, defaults = inspect.getargspec(\n methods['__init__'])\n if (args and args != ['self']) or varargs or keywords or defaults:\n self.has_parameters = True", "metadata": "root.NumpyClassDocString.__init__", "header": "['class', 'NumpyClassDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 474 }, { "content": " def _parse(self):\n self._parsed_data = {\n 'Signature': '',\n 'Summary': '',\n 'Extended Summary': [],\n 'Parameters': [],\n 'Other Parameters': [],\n 'Raises': [],\n 'Warns': [],\n 'See Also': [],\n 'Notes': [],\n 'References': '',\n 'Examples': '',\n 'index': {},\n 'Attributes': [],\n 'Methods': [],\n }\n return NumpyDocString._parse(self)", "metadata": "root.NumpyClassDocString._parse", "header": "['class', 'NumpyClassDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 491 }, { "content": " def __str__(self):\n out = []\n out += self._str_signature()\n out += self._str_summary()\n out += self._str_extended_summary()\n for param_list in ('Attributes', 'Methods', 'Parameters', 'Raises',\n 'Warns'):\n out += self._str_param_list(param_list)\n out += self._str_see_also()\n for s in ('Notes','References','Examples'):\n out += self._str_section(s)\n out += self._str_index()\n return '\\n'.join(out)", "metadata": "root.NumpyClassDocString.__str__", "header": "['class', 'NumpyClassDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 510 }, { "content": " def get_errors(self):\n errors = NumpyDocString.get_errors(self)\n if not self['Parameters'] and self.has_parameters:\n errors.append(\"%s class has no Parameters section\"\n % self.class_name)\n return errors", "metadata": "root.NumpyClassDocString.get_errors", "header": "['class', 'NumpyClassDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 524 }, { "content": "class NumpyModuleDocString(NumpyDocString):\n \"\"\"\n Module doc strings: no parsing is done.\n\n \"\"\"\n\n\n", "metadata": "root.NumpyModuleDocString", "header": "['module', '___EOS___']", "index": 531 }, { "content": " def _parse(self):\n self.out = []", "metadata": "root.NumpyModuleDocString._parse", "header": "['class', 'NumpyModuleDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 537 }, { "content": " def __str__(self):\n return \"\\n\".join(self._doc._str)", "metadata": "root.NumpyModuleDocString.__str__", "header": "['class', 'NumpyModuleDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 540 }, { "content": " def get_errors(self):\n errors = NumpyDocString.get_errors(self, check_order=False)\n return errors", "metadata": "root.NumpyModuleDocString.get_errors", "header": "['class', 'NumpyModuleDocString', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 543 }, { "content": "class SphinxDocString(NumpyDocString):\n # string conversion routines\n\n\n\n\n\n\n\n", "metadata": "root.SphinxDocString", "header": "['module', '___EOS___']", "index": 551 }, { "content": " def _str_header(self, name, symbol='`'):\n return ['**' + name + '**'] + [symbol*(len(name)+4)]", "metadata": "root.SphinxDocString._str_header", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 553 }, { "content": " def _str_indent(self, doc, indent=4):\n out = []\n for line in doc:\n out += [' '*indent + line]\n return out", "metadata": "root.SphinxDocString._str_indent", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 556 }, { "content": " def _str_signature(self):\n return ['``%s``' % self['Signature'].replace('*','\\*')] + ['']", "metadata": "root.SphinxDocString._str_signature", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 562 }, { "content": " def _str_summary(self):\n return self['Summary'] + ['']", "metadata": "root.SphinxDocString._str_summary", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 565 }, { "content": " def _str_extended_summary(self):\n return self['Extended Summary'] + ['']", "metadata": "root.SphinxDocString._str_extended_summary", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 568 }, { "content": " def _str_param_list(self, name):\n out = []\n if self[name]:\n out += self._str_header(name)\n out += ['']\n for param,param_type,desc in self[name]:\n out += self._str_indent(['**%s** : %s' % (param, param_type)])\n out += ['']\n out += self._str_indent(desc,8)\n out += ['']\n return out", "metadata": "root.SphinxDocString._str_param_list", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 571 }, { "content": " def _str_section(self, name):\n out = []\n if self[name]:\n out += self._str_header(name)\n out += ['']\n content = self._str_indent(self[name])\n out += content\n out += ['']\n return out", "metadata": "root.SphinxDocString._str_section", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 583 }, { "content": " def _str_index(self):\n idx = self['index']\n out = []\n out += ['.. index:: %s' % idx.get('default','')]\n for section, references in six.iteritems(idx):\n if section == 'default':\n continue\n out += [' :%s: %s' % (section, ', '.join(references))]\n return out", "metadata": "root.SphinxDocString._str_index", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 593 }, { "content": " def __str__(self, indent=0):\n out = []\n out += self._str_summary()\n out += self._str_extended_summary()\n for param_list in ('Parameters','Returns','Raises','Warns'):\n out += self._str_param_list(param_list)\n for s in ('Notes','References','Examples'):\n out += self._str_section(s)\n # out += self._str_index()\n out = self._str_indent(out,indent)\n return '\\n'.join(out)", "metadata": "root.SphinxDocString.__str__", "header": "['class', 'SphinxDocString', '(', 'NumpyDocString', ')', ':', '___NEWLINE___', '# string conversion routines', '___NL___', '___EOS___']", "index": 603 } ]
[ { "span": "self._parse()", "start_line": 127, "start_column": 8, "end_line": 127, "end_column": 21 } ]
[ { "span": "def _parse(self):", "start_line": 282, "start_column": 4, "end_line": 282, "end_column": 21 }, { "span": "def _parse(self):", "start_line": 435, "start_column": 4, "end_line": 435, "end_column": 21 }, { "span": "def _parse(self):", "start_line": 491, "start_column": 4, "end_line": 491, "end_column": 21 }, { "span": "def _parse(self):", "start_line": 537, "start_column": 4, "end_line": 537, "end_column": 21 } ]
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_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "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_", ",_", "docstring_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "docstring_", "=_", "docstring_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "De", "-", "indent", " ", "paragraph_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indent_", "=_", "min_", "(_", "len_", "(_", "s_", ")_", "-_", "len_", "(_", "s_", "._", "lstrip_", "(_", ")_", ")_", "for_", "s_", "in_", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "s_", "._", "strip_", "(_", ")_", ")_", "\\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 ", " _", "indent_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", ",_", "line_", "in_", "enumerate_", "(_", "docstring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docstring_", "[_", "n_", "]_", "=_", "docstring_", "[_", "n_", "]_", "[_", "indent_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "doc_", "=_", "Reader_", "(_", "docstring_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "parsed", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sign", "ature", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Summ", "ary", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Parameter", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ot", "her", " ", "Parameter", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Return", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rai", "ses", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Warn", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "See", " ", "Al", "so", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Not", "es", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Reference", "s", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Exam", "ples", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "index", "'_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Attribute", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meth", "ods", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "section", "\\u", "order_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "parse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "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 ", " _", "return_", "self_", "._", "\\u", "parsed", "\\u", "data_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "not_", "in_", "self_", "._", "\\u", "parsed", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "section", " ", "%", "s", "\"_", "%_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "parsed", "\\u", "data_", "[_", "key_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "is", "\\u", "at", "\\u", "section_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "doc_", "._", "seek", "\\u", "next", "\\u", "non", "\\u", "empty", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "doc_", "._", "eof_", "(_", ")_", ":_", "\\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_", "l1_", "=_", "self_", "._", "\\u", "doc_", "._", "peek_", "(_", ")_", "._", "strip_", "(_", ")_", "#", " ", "e", ".", "g", ".", " ", "Parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "l1_", "._", "startswith_", "(_", "'..", " ", "index", "::'", "_", ")_", ":_", "\\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_", "l2_", "=_", "self_", "._", "\\u", "doc_", "._", "peek_", "(_", "1_", ")_", "._", "strip_", "(_", ")_", "#", " ", " ", " ", " ", "----------", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "len_", "(_", "l1_", ")_", "==_", "len_", "(_", "l2_", ")_", "and_", "l2_", "==_", "'-'_", "*_", "len_", "(_", "l1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "strip_", "(_", "self_", ",_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "line_", "in_", "enumerate_", "(_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "strip_", "(_", ")_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "j_", ",_", "line_", "in_", "enumerate_", "(_", "doc_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "strip_", "(_", ")_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "doc_", "[_", "i_", ":_", "len_", "(_", "doc_", ")_", "-_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read", "\\u", "to", "\\u", "next", "\\u", "section_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "section_", "=_", "self_", "._", "\\u", "doc_", "._", "read", "\\u", "to", "\\u", "next", "\\u", "empty", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "not_", "self_", "._", "\\u", "is", "\\u", "at", "\\u", "section_", "(_", ")_", "and_", "not_", "self_", "._", "\\u", "doc_", "._", "eof_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "doc_", "._", "peek_", "(_", "-_", "1_", ")_", "._", "strip_", "(_", ")_", ":_", "#", " ", "previ", "ous", " ", "line", " ", "was", " ", "empty_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "section_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "section_", "+=_", "self_", "._", "\\u", "doc_", "._", "read", "\\u", "to", "\\u", "next", "\\u", "empty", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "read", "\\u", "sections_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "not_", "self_", "._", "\\u", "doc_", "._", "eof_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "self_", "._", "\\u", "read", "\\u", "to", "\\u", "next", "\\u", "section_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "data_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "._", "startswith_", "(_", "'..'_", ")_", ":_", "#", " ", "index", " ", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "name_", ",_", "data_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "data_", ")_", "<_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "Sto", "p", "Iteration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "name_", ",_", "self_", "._", "\\u", "strip_", "(_", "data_", "[_", "2_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "param", "\\u", "list_", "(_", "self_", ",_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "Reader_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "r_", "._", "eof_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "r_", "._", "read_", "(_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", " ", ":", " ", "'_", "in_", "header_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg", "\\u", "name_", ",_", "arg", "\\u", "type_", "=_", "header_", "._", "split_", "(_", "'", " ", ":", " ", "'_", ")_", "[_", ":_", "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 ", " _", "arg", "\\u", "name_", ",_", "arg", "\\u", "type_", "=_", "header_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "desc_", "=_", "r_", "._", "read", "\\u", "to", "\\u", "next", "\\u", "unin", "dent", "ed", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", ",_", "line_", "in_", "enumerate_", "(_", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "[_", "n_", "]_", "=_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "desc_", "=_", "desc_", "#'", "\\\\", "n", "'.", "join", "(", "desc", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "._", "append_", "(_", "(_", "arg", "\\u", "name_", ",_", "arg", "\\u", "type_", ",_", "desc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "see", "\\u", "als", "o_", "(_", "self_", ",_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "func", "\\u", "name", " ", ":", " ", "Descripti", "ve", " ", "text", "\\", "10", ";", " ", " ", " ", " ", "continue", "d", " ", "text", "\\", "10", ";", " ", " ", " ", " ", "anot", "her", "\\u", "func", "\\u", "name", " ", ":", " ", "Descripti", "ve", " ", "text", "\\", "10", ";", " ", " ", " ", " ", "func", "\\u", "name", "1", ",", " ", "func", "\\u", "name2", ",", " ", "func", "\\u", "name", "3", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "functions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "func_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rest_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "line_", "._", "strip_", "(_", ")_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "':'_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "current", "\\u", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "functions_", "._", "append_", "(_", "(_", "current", "\\u", "func_", ",_", "rest_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "line_", "._", "split_", "(_", "':'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "func_", "=_", "r_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "[_", "1_", "]_", "=_", "r_", "[_", "1_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "rest_", "=_", "[_", "r_", "[_", "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 ", " ", "_", "rest_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "line_", "._", "startswith_", "(_", "'", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "current", "\\u", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "functions_", "._", "append_", "(_", "(_", "current", "\\u", "func_", ",_", "rest_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "func_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rest_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "','_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "func_", "in_", "line_", "._", "split_", "(_", "','_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "func_", "=_", "func_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "functions_", "._", "append_", "(_", "(_", "func_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "func_", "=_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "current", "\\u", "func_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rest_", "._", "append_", "(_", "line_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "functions_", "._", "append_", "(_", "(_", "current", "\\u", "func_", ",_", "rest_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "functions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "index_", "(_", "self_", ",_", "section_", ",_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "index", ":", " ", "default", "\\", "10", ";", " ", " ", " ", ":", "ref", "guide", ":", " ", "somet", "hing", ",", " ", "else", ",", " ", "and", " ", "more", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "strip", "\\u", "each", "\\u", "in_", "(_", "lst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "s_", "._", "strip_", "(_", ")_", "for_", "s_", "in_", "lst_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section_", "=_", "section_", "._", "split_", "(_", "'::'", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "section_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "[_", "'", "default", "'_", "]_", "=_", "strip", "\\u", "each", "\\u", "in_", "(_", "section_", "[_", "1_", "]_", "._", "split_", "(_", "','_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "line_", "in_", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "line_", "._", "split_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "line_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "[_", "line_", "[_", "1_", "]_", "]_", "=_", "strip", "\\u", "each", "\\u", "in_", "(_", "line_", "[_", "2_", "]_", "._", "split_", "(_", "','_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Grab", " ", "signa", "ture", " ", "(", "if", " ", "give", "n", ")", " ", "and", " ", "summar", "y", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "=_", "self_", "._", "\\u", "doc_", "._", "read", "\\u", "to", "\\u", "next", "\\u", "empty", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summar", "y", "\\u", "str_", "=_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "[_", "s_", "._", "strip_", "(_", ")_", "for_", "s_", "in_", "summary_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "compile_", "(_", "'", "^", "([\\\\", "w", ".", " ", "]+", "=", ")?", "[\\\\", "w", "\\\\.]", "+\\\\", "(.", "*\\\\", ")$'_", ")_", "._", "match_", "(_", "summar", "y", "\\u", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "Sign", "ature", "'_", "]_", "=_", "summar", "y", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "is", "\\u", "at", "\\u", "section_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "Summ", "ary", "'_", "]_", "=_", "self_", "._", "\\u", "doc_", "._", "read", "\\u", "to", "\\u", "next", "\\u", "empty", "\\u", "line_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "re_", "._", "compile_", "(_", "'", "^", "[\\\\", "w", "]+\\\\", "n", "[-]", "+'_", ")_", "._", "match_", "(_", "summar", "y", "\\u", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "Summ", "ary", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "doc_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "Summ", "ary", "'_", "]_", "=_", "summary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "is", "\\u", "at", "\\u", "section_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", "]_", "=_", "self_", "._", "\\u", "read", "\\u", "to", "\\u", "next", "\\u", "section_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "doc_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "parse", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "section_", ",_", "content_", ")_", "in_", "self_", "._", "\\u", "read", "\\u", "sections_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "section_", "._", "startswith_", "(_", "'..'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "section_", "=_", "'", " ", "'_", "._", "join_", "(_", "[_", "s_", "._", "capitalize_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "s_", "in_", "section_", "._", "split_", "(_", "'", " ", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "section_", "in_", "(_", "'", "Parameter", "s", "'_", ",_", "'", "Ot", "her", " ", "Parameter", "s", "'_", ",_", "'", "Return", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rai", "ses", "'_", ",_", "'", "Warn", "s", "'_", ",_", "'", "Attribute", "s", "'_", ",_", "'", "Meth", "ods", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "section_", "]_", "=_", "self_", "._", "\\u", "parse", "\\u", "param", "\\u", "list_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "section", "\\u", "order_", "._", "append_", "(_", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "section_", "._", "startswith_", "(_", "'..", " ", "index", "::'", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "index", "'_", "]_", "=_", "self_", "._", "\\u", "parse", "\\u", "index_", "(_", "section_", ",_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "section", "\\u", "order_", "._", "append_", "(_", "'", "index", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "section_", "._", "lower_", "(_", ")_", "==_", "'", "see", " ", "als", "o", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "[_", "'", "See", " ", "Al", "so", "'_", "]_", "=_", "self_", "._", "\\u", "parse", "\\u", "see", "\\u", "als", "o_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "section", "\\u", "order_", "._", "append_", "(_", "'", "See", " ", "Al", "so", "'_", ")_", "\\u\\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_", "[_", "section_", "]_", "=_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "section", "\\u", "order_", "._", "append_", "(_", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "header_", "(_", "self_", ",_", "name_", ",_", "symbol_", "=_", "'-'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "name_", ",_", "len_", "(_", "name_", ")_", "*_", "symbol_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "indent_", "(_", "self_", ",_", "doc_", ",_", "indent_", "=_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "[_", "'", " ", "'_", "*_", "indent_", "+_", "line_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "signature_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "[_", "'", "Sign", "ature", "'_", "]_", ":_", "\\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_", "[_", "\"*", "%", "s", "*\"_", "%_", "self_", "[_", "'", "Sign", "ature", "'_", "]_", "._", "replace_", "(_", "'*'_", ",_", "'\\\\", "*'_", ")_", "]_", "+_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "'", "Summ", "ary", "'_", "]_", "+_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "extend", "ed", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", "]_", "+_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "param", "\\u", "list_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "header_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param_", ",_", "param", "\\u", "type_", ",_", "desc_", "in_", "self_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "[_", "'%", "s", " ", ":", " ", "%", "s", "'_", "%_", "(_", "param_", ",_", "param", "\\u", "type_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "indent_", "(_", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "section_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "header_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "see", "\\u", "als", "o_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "[_", "'", "See", " ", "Al", "so", "'_", "]_", ":_", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "header_", "(_", "\"", "See", " ", "Al", "so", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "had", "\\u", "desc_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "func_", ",_", "desc_", "in_", "self_", "[_", "'", "See", " ", "Al", "so", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "desc_", "or_", "last", "\\u", "had", "\\u", "desc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "\"`", "%", "s", "`\\u", "\"_", "%_", "func_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "[_", "-_", "1_", "]_", "+=_", "\",", " ", "`", "%", "s", "`\\u", "\"_", "%_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "desc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "indent_", "(_", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "had", "\\u", "desc_", "=_", "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 ", " _", "last", "\\u", "had", "\\u", "desc_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "str", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "idx_", "=_", "self_", "[_", "'", "index", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "'..", " ", "index", "::", " ", "%", "s", "'_", "%_", "idx_", "._", "get_", "(_", "'", "default", "'_", ",_", "''_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "section_", ",_", "references_", "in_", "six_", "._", "iteritems_", "(_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "section_", "==_", "'", "default", "'_", ":_", "\\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_", "out_", "+=_", "[_", "'", " ", " ", " ", ":", "%", "s", ":", " ", "%", "s", "'_", "%_", "(_", "section_", ",_", "',", " ", "'_", "._", "join_", "(_", "references_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "signature_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "extend", "ed", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param", "\\u", "list_", "in_", "(_", "'", "Parameter", "s", "'_", ",_", "'", "Ot", "her", " ", "Parameter", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Return", "s", "'_", ",_", "'", "Rai", "ses", "'_", ",_", "'", "Warn", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "param", "\\u", "list_", "(_", "param", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "see", "\\u", "als", "o_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "(_", "'", "Not", "es", "'_", ",_", "'", "Reference", "s", "'_", ",_", "'", "Exam", "ples", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "section_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "index_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Doc", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "errors_", "(_", "self_", ",_", "check", "\\u", "order_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "doc_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", ",_", "line_", "in_", "enumerate_", "(_", "self_", "._", "\\u", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "line_", ")_", ">_", "75_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "'", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "errors_", "._", "append_", "(_", "\"%", "s", ":", " ", "Line", " ", "%", "d", " ", "exceed", "s", " ", "7", "5", " ", "char", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\":", " ", "\\\\\"", "%", "s", "\\\\\".", "..\"_", "%_", "(_", "self_", "._", "name_", ",_", "j_", "+_", "1_", ",_", "line_", "[_", ":_", "30_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "errors_", "._", "append_", "(_", "\"", "Line", " ", "%", "d", " ", "exceed", "s", " ", "7", "5", " ", "char", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\":", " ", "\\\\\"", "%", "s", "\\\\\".", "..\"_", "%_", "(_", "j_", "+_", "1_", ",_", "line_", "[_", ":_", "30_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "check", "\\u", "order_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "canonical", "\\u", "order_", "=_", "[_", "'", "Sign", "ature", "'_", ",_", "'", "Summ", "ary", "'_", ",_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Attribute", "s", "'_", ",_", "'", "Meth", "ods", "'_", ",_", "'", "Parameter", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ot", "her", " ", "Parameter", "s", "'_", ",_", "'", "Return", "s", "'_", ",_", "'", "Rai", "ses", "'_", ",_", "'", "Warn", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "See", " ", "Al", "so", "'_", ",_", "'", "Not", "es", "'_", ",_", "'", "Reference", "s", "'_", ",_", "'", "Exam", "ples", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "index", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "canonical", "\\u", "order", "\\u", "copy_", "=_", "list_", "(_", "canonical", "\\u", "order_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "s_", "in_", "self_", "._", "section", "\\u", "order_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "canonical", "\\u", "order", "\\u", "copy_", "and_", "s_", "!=_", "canonical", "\\u", "order", "\\u", "copy_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "canonical", "\\u", "order", "\\u", "copy_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "canonical", "\\u", "order", "\\u", "copy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "errors_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Sections", " ", "in", " ", "wrong", " ", "order", " ", "(", "startin", "g", " ", "at", " ", "%", "s", ").", " ", "The", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "right", " ", "order", " ", "is", " ", "%", "s", "\"_", "%_", "(_", "s_", ",_", "canonical", "\\u", "order_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "errors_", "\\u\\u\\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_", "Num", "py", "Function", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\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_", "Num", "py", "Function", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\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_", ",_", "docstring_", ",_", "function_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Num", "py", "Function", "Doc", "String_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "docstring_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", ",_", "varargs", "_", ",_", "keywords_", ",_", "defaults_", "=_", "inspect_", "._", "getargs", "pec_", "(_", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "args_", "and_", "args_", "!=_", "[_", "'", "self", "'_", "]_", ")_", "or_", "varargs", "_", "or_", "keywords_", "or_", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "parameters_", "=_", "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 ", " _", "self_", "._", "has", "\\u", "parameters_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Function", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "parsed", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sign", "ature", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Summ", "ary", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Parameter", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ot", "her", " ", "Parameter", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Return", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rai", "ses", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Warn", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "See", " ", "Al", "so", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Not", "es", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Reference", "s", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Exam", "ples", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "index", "'_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Num", "py", "Doc", "String_", "._", "\\u", "parse_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Function", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "errors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "=_", "Num", "py", "Doc", "String_", "._", "get", "\\u", "errors_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "[_", "'", "Sign", "ature", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "error", "s", ".", "append", "(\"", "No", " ", "function", " ", "signa", "ture", "\")", " ", "#", "this", " ", "check", " ", "is", " ", "currentl", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", "too", " ", "restrict", "ive", ".", " ", "Disa", "blin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "#", "it", " ", "for", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "[_", "'", "Summ", "ary", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "append_", "(_", "\"", "No", " ", "function", " ", "summar", "y", " ", "line", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "\"", " ", "\"_", "._", "join_", "(_", "self_", "[_", "'", "Summ", "ary", "'_", "]_", ")_", ")_", ">_", "3_", "*_", "80_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "append_", "(_", "\"", "Brie", "f", " ", "function", " ", "summar", "y", " ", "is", " ", "long", "er", " ", "than", " ", "3", " ", "lines", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "[_", "'", "Parameter", "s", "'_", "]_", "and_", "self_", "._", "has", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "append_", "(_", "\"", "No", " ", "Parameter", "s", " ", "section", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Num", "py", "Class", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\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_", "Num", "py", "Class", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\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_", ",_", "docstring_", ",_", "class", "\\u", "name_", ",_", "class", "\\u", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Num", "py", "Class", "Doc", "String_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "docstring_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "class", "\\u", "name_", "=_", "class", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "methods_", "=_", "dict_", "(_", "(_", "name_", ",_", "func_", ")_", "for_", "name_", ",_", "func_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "inspect_", "._", "getmember", "s_", "(_", "class", "\\u", "object_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "has", "\\u", "parameters_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'\\u", "\\u", "init", "\\u\\u'_", "in_", "methods_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "verify", " ", "if", " ", "\\u\\u", "init", "\\u\\u", " ", "is", " ", "a", " ", "Pyth", "on", " ", "function", ".", " ", "If", " ", "it", " ", "isn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "e", ".", "g", ".", " ", "the", " ", "function", " ", "is", " ", "implemented", " ", "in", " ", "C", "),", " ", "getargs", "pec", " ", "will", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "inspect_", "._", "isme", "thod", "_", "(_", "methods_", "[_", "'\\u", "\\u", "init", "\\u\\u'_", "]_", ")_", ":_", "\\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_", "args_", ",_", "varargs", "_", ",_", "keywords_", ",_", "defaults_", "=_", "inspect_", "._", "getargs", "pec_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "methods_", "[_", "'\\u", "\\u", "init", "\\u\\u'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "args_", "and_", "args_", "!=_", "[_", "'", "self", "'_", "]_", ")_", "or_", "varargs", "_", "or_", "keywords_", "or_", "defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "has", "\\u", "parameters_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Class", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\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", "parse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "parsed", "\\u", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sign", "ature", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Summ", "ary", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Parameter", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ot", "her", " ", "Parameter", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Rai", "ses", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Warn", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "See", " ", "Al", "so", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Not", "es", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Reference", "s", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Exam", "ples", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "index", "'_", ":_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Attribute", "s", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meth", "ods", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Num", "py", "Doc", "String_", "._", "\\u", "parse_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Class", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "signature_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "extend", "ed", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param", "\\u", "list_", "in_", "(_", "'", "Attribute", "s", "'_", ",_", "'", "Meth", "ods", "'_", ",_", "'", "Parameter", "s", "'_", ",_", "'", "Rai", "ses", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Warn", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "param", "\\u", "list_", "(_", "param", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "see", "\\u", "als", "o_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "(_", "'", "Not", "es", "'_", ",_", "'", "Reference", "s", "'_", ",_", "'", "Exam", "ples", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "section_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "index_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Class", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "errors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "=_", "Num", "py", "Doc", "String_", "._", "get", "\\u", "errors_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "[_", "'", "Parameter", "s", "'_", "]_", "and_", "self_", "._", "has", "\\u", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "append_", "(_", "\"%", "s", " ", "class", " ", "has", " ", "no", " ", "Parameter", "s", " ", "section", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "self_", "._", "class", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Num", "py", "Modul", "e", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Modul", "e", " ", "doc", " ", "string", "s", ":", " ", "no", " ", "pars", "ing", " ", "is", " ", "don", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Modul", "e", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "parse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Modul", "e", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "self_", "._", "\\u", "doc_", "._", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Num", "py", "Modul", "e", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "errors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "=_", "Num", "py", "Doc", "String_", "._", "get", "\\u", "errors_", "(_", "self_", ",_", "check", "\\u", "order_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "errors_", "\\u\\u\\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_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "str", "\\u", "header_", "(_", "self_", ",_", "name_", ",_", "symbol_", "=_", "'`", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "'**", "'_", "+_", "name_", "+_", "'**", "'_", "]_", "+_", "[_", "symbol_", "*_", "(_", "len_", "(_", "name_", ")_", "+_", "4_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "indent_", "(_", "self_", ",_", "doc_", ",_", "indent_", "=_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "[_", "'", " ", "'_", "*_", "indent_", "+_", "line_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "signature_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "'``", "%", "s", "``", "'_", "%_", "self_", "[_", "'", "Sign", "ature", "'_", "]_", "._", "replace_", "(_", "'*'_", ",_", "'\\\\", "*'_", ")_", "]_", "+_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "'", "Summ", "ary", "'_", "]_", "+_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "extend", "ed", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "'", "Extend", "ed", " ", "Summ", "ary", "'_", "]_", "+_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "param", "\\u", "list_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "header_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param_", ",_", "param", "\\u", "type_", ",_", "desc_", "in_", "self_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "indent_", "(_", "[_", "'**", "%", "s", "**", " ", ":", " ", "%", "s", "'_", "%_", "(_", "param_", ",_", "param", "\\u", "type_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "indent_", "(_", "desc_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "section_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "[_", "name_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "header_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "self_", "._", "\\u", "str", "\\u", "indent_", "(_", "self_", "[_", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "idx_", "=_", "self_", "[_", "'", "index", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "[_", "'..", " ", "index", "::", " ", "%", "s", "'_", "%_", "idx_", "._", "get_", "(_", "'", "default", "'_", ",_", "''_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "section_", ",_", "references_", "in_", "six_", "._", "iteritems_", "(_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "section_", "==_", "'", "default", "'_", ":_", "\\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_", "out_", "+=_", "[_", "'", " ", " ", " ", ":", "%", "s", ":", " ", "%", "s", "'_", "%_", "(_", "section_", ",_", "',", " ", "'_", "._", "join_", "(_", "references_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sph", "inx", "Doc", "String_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "string", " ", "conve", "rsi", "on", " ", "routin", "es_", "\\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", "str\\u\\u_", "(_", "self_", ",_", "indent_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "extend", "ed", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param", "\\u", "list_", "in_", "(_", "'", "Parameter", "s", "'_", ",_", "'", "Return", "s", "'_", ",_", "'", "Rai", "ses", "'_", ",_", "'", "Warn", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "param", "\\u", "list_", "(_", "param", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "s_", "in_", "(_", "'", "Not", "es", "'_", ",_", "'", "Reference", "s", "'_", ",_", "'", "Exam", "ples", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "+=_", "self_", "._", "\\u", "str", "\\u", "section_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "out", " ", "+=", " ", "self", ".\\u", "str", "\\u", "index", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "=_", "self_", "._", "\\u", "str", "\\u", "indent_", "(_", "out_", ",_", "indent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "out_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Missing call to `__init__` during object initialization
Alephbet/gimel/vendor/redis/client.py
[ { "content": " def __init__(self, host='localhost', port=6379,\n db=0, password=None, socket_timeout=None,\n socket_connect_timeout=None,\n socket_keepalive=None, socket_keepalive_options=None,\n connection_pool=None, unix_socket_path=None,\n encoding='utf-8', encoding_errors='strict',\n charset=None, errors=None,\n decode_responses=False, retry_on_timeout=False,\n ssl=False, ssl_keyfile=None, ssl_certfile=None,\n ssl_cert_reqs=None, ssl_ca_certs=None,\n max_connections=None):\n if not connection_pool:\n if charset is not None:\n warnings.warn(DeprecationWarning(\n '\"charset\" is deprecated. Use \"encoding\" instead'))\n encoding = charset\n if errors is not None:\n warnings.warn(DeprecationWarning(\n '\"errors\" is deprecated. Use \"encoding_errors\" instead'))\n encoding_errors = errors\n\n kwargs = {\n 'db': db,\n 'password': password,\n 'socket_timeout': socket_timeout,\n 'encoding': encoding,\n 'encoding_errors': encoding_errors,\n 'decode_responses': decode_responses,\n 'retry_on_timeout': retry_on_timeout,\n 'max_connections': max_connections\n }\n # based on input, setup appropriate connection args\n if unix_socket_path is not None:\n kwargs.update({\n 'path': unix_socket_path,\n 'connection_class': UnixDomainSocketConnection\n })\n else:\n # TCP specific options\n kwargs.update({\n 'host': host,\n 'port': port,\n 'socket_connect_timeout': socket_connect_timeout,\n 'socket_keepalive': socket_keepalive,\n 'socket_keepalive_options': socket_keepalive_options,\n })\n\n if ssl:\n kwargs.update({\n 'connection_class': SSLConnection,\n 'ssl_keyfile': ssl_keyfile,\n 'ssl_certfile': ssl_certfile,\n 'ssl_cert_reqs': ssl_cert_reqs,\n 'ssl_ca_certs': ssl_ca_certs,\n })\n connection_pool = ConnectionPool(**kwargs)\n self.connection_pool = connection_pool\n self._use_lua_lock = None\n\n self.response_callbacks = self.__class__.RESPONSE_CALLBACKS.copy()", "metadata": "root.StrictRedis.__init__", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 393 }, { "content": " def __init__(self, connection_pool, response_callbacks, transaction,\n shard_hint):\n self.connection_pool = connection_pool\n self.connection = None\n self.response_callbacks = response_callbacks\n self.transaction = transaction\n self.shard_hint = shard_hint\n\n self.watching = False\n self.reset()", "metadata": "root.BasePipeline.__init__", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2377 }, { "content": "class StrictPipeline(BasePipeline, StrictRedis):\n \"Pipeline for the StrictRedis class\"\n pass", "metadata": "root.StrictPipeline", "header": "['module', '___EOS___']", "index": 2665 }, { "content": "class Pipeline(BasePipeline, Redis):\n \"Pipeline for the Redis class\"\n pass", "metadata": "root.Pipeline", "header": "['module', '___EOS___']", "index": 2670 } ]
[ { "span": "class StrictPipeline(BasePipeline, StrictRedis):", "start_line": 2665, "start_column": 0, "end_line": 2665, "end_column": 48 }, { "span": "class Pipeline(BasePipeline, Redis):", "start_line": 2670, "start_column": 0, "end_line": 2670, "end_column": 36 } ]
[ { "span": "def __init__(self, host='localhost', port=6379,\n db=0, password=None, socket_timeout=None,\n socket_connect_timeout=None,\n socket_keepalive=None, socket_keepalive_options=None,\n connection_pool=None, unix_socket_path=None,\n encoding='utf-8', encoding_errors='strict',\n charset=None, errors=None,\n decode_responses=False, retry_on_timeout=False,\n ssl=False, ssl_keyfile=None, ssl_certfile=None,\n ssl_cert_reqs=None, ssl_ca_certs=None,\n max_connections=None):", "start_line": 393, "start_column": 4, "end_line": 403, "end_column": 39 }, { "span": "def __init__(self, connection_pool, response_callbacks, transaction,\n shard_hint):", "start_line": 2377, "start_column": 4, "end_line": 2378, "end_column": 29 } ]
1
false
[ "[CLS]_", "Missing", "_", "call_", "to_", " _", "`_", "\\u\\u", "init\\u\\u_", "`_", "dur", "ing_", "object_", "initialization", "_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", "=_", "'", "local", "host", "'_", ",_", "port_", "=_", "6379", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "0_", ",_", "password_", "=_", "None_", ",_", "socket", "\\u", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "socket", "\\u", "connect", "\\u", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "socket", "\\u", "keepalive", "_", "=_", "None_", ",_", "socket", "\\u", "keepalive", "\\u", "options_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "connecti", "on", "\\u", "pool_", "=_", "None_", ",_", "unix", "\\u", "socket", "\\u", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ",_", "encoding", "\\u", "errors_", "=_", "'", "strict", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "charset_", "=_", "None_", ",_", "errors_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decode", "\\u", "responses_", "=_", "False_", ",_", "retr", "y", "\\u", "on", "\\u", "timeout_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ssl_", "=_", "False_", ",_", "ssl", "\\u", "keyfile_", "=_", "None_", ",_", "ssl", "\\u", "certfile", "_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ssl", "\\u", "cert", "\\u", "reqs_", "=_", "None_", ",_", "ssl", "\\u", "ca", "\\u", "certs_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "connections_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "connecti", "on", "\\u", "pool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "charset_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "Dep", "reca", "tion", "Warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "charset", "\"", " ", "is", " ", "depre", "cated", ".", " ", "Us", "e", " ", "\"", "encoding", "\"", " ", "inst", "ead", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoding_", "=_", "charset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errors_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "Dep", "reca", "tion", "Warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "error", "s", "\"", " ", "is", " ", "depre", "cated", ".", " ", "Us", "e", " ", "\"", "encoding", "\\u", "error", "s", "\"", " ", "inst", "ead", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoding", "\\u", "errors_", "=_", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "db", "'_", ":_", "db_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "timeo", "ut", "'_", ":_", "socket", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "encoding", "'_", ":_", "encoding_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "encoding", "\\u", "error", "s", "'_", ":_", "encoding", "\\u", "errors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "decode", "\\u", "response", "s", "'_", ":_", "decode", "\\u", "responses_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "retr", "y", "\\u", "on", "\\u", "timeo", "ut", "'_", ":_", "retr", "y", "\\u", "on", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "connections", "'_", ":_", "max", "\\u", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "based", " ", "on", " ", "input", ",", " ", "setup", " ", "appropr", "iate", " ", "connecti", "on", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "unix", "\\u", "socket", "\\u", "path_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "unix", "\\u", "socket", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "connecti", "on", "\\u", "class", "'_", ":_", "Uni", "x", "Doma", "in", "Sock", "et", "Connection_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TC", "P", " ", "specific", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "host", "'_", ":_", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "connect", "\\u", "timeo", "ut", "'_", ":_", "socket", "\\u", "connect", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "keepalive", "'_", ":_", "socket", "\\u", "keepalive", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "keepalive", "\\u", "options", "'_", ":_", "socket", "\\u", "keepalive", "\\u", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ssl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "kwargs_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "connecti", "on", "\\u", "class", "'_", ":_", "SS", "LC", "onnect", "ion_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "keyfile", "'_", ":_", "ssl", "\\u", "keyfile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "certfile", "'_", ":_", "ssl", "\\u", "certfile", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "cert", "\\u", "reqs", "'_", ":_", "ssl", "\\u", "cert", "\\u", "reqs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "ca", "\\u", "cert", "s", "'_", ":_", "ssl", "\\u", "ca", "\\u", "certs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connecti", "on", "\\u", "pool_", "=_", "Connect", "ion", "Pool_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connecti", "on", "\\u", "pool_", "=_", "connecti", "on", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "use", "\\u", "lua", "\\u", "lock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "RESPONSE", "\\u", "CALL", "BACK", "S_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "connecti", "on", "\\u", "pool_", ",_", "response", "\\u", "callbacks_", ",_", "transaction_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shard", "\\u", "hint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connecti", "on", "\\u", "pool_", "=_", "connecti", "on", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", "=_", "response", "\\u", "callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transaction_", "=_", "transaction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shard", "\\u", "hint_", "=_", "shard", "\\u", "hint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "watch", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Stri", "ct", "Pipeline_", "(_", "Base", "Pipeline_", ",_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Pipe", "line", " ", "for", " ", "the", " ", "Stri", "ct", "Red", "is", " ", "class", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pipeline_", "(_", "Base", "Pipeline_", ",_", "Redis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Pipe", "line", " ", "for", " ", "the", " ", "Red", "is", " ", "class", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
openstack/python-rackclient/rackclient/tests/test_client.py
[ { "content": " def test_request(self):\n cs = client.HTTPClient('http://www.foo.com', False)\n data = (\n '{\"group\": { \"gid\": \"11111111\",'\n '\"user_id\": \"4ffc664c198e435e9853f253lkbcd7a7\",'\n '\"project_id\": \"9sac664c198e435e9853f253lkbcd7a7\",'\n '\"name\": \"group1\",'\n '\"description\": \"This is group1\",'\n '\"status\": \"ACTIVE\"}}'\n )\n\n mock_request = mock.Mock()\n mock_request.return_value = requests.Response()\n mock_request.return_value.status_code = 201\n mock_request.return_value._content = data\n\n with mock.patch('requests.request', mock_request):\n resp, body = cs.post('/groups', body=data)\n kwargs = {\n 'headers': {\n 'User-Agent': 'python-rackclient',\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n 'data': json.dumps(data)\n }\n mock_request.assert_called_with('POST',\n 'http://www.foo.com/groups',\n **kwargs)", "metadata": "root.ClientTest.test_request", "header": "['class', 'ClientTest', '(', 'utils', '.', 'TestCase', ')', ':', '___EOS___']", "index": 85 } ]
[ { "span": "resp,", "start_line": 102, "start_column": 12, "end_line": 102, "end_column": 16 }, { "span": "body ", "start_line": 102, "start_column": 18, "end_line": 102, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Client", "Test_", "(_", "utils_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cs_", "=_", "client_", "._", "HTTP", "Client_", "(_", "'", "http", "://", "www", ".", "foo", ".", "com", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'{", "\"", "group", "\":", " ", "{", " ", "\"", "gid", "\":", " ", "\"", "11111111", "\",'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "user", "\\u", "id", "\":", " ", "\"", "4f", "fc", "664", "c1", "98", "e4", "3", "5e", "985", "3f", "253", "lk", "bcd", "7a", "7", "\",'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "project", "\\u", "id", "\":", " ", "\"", "9", "sac", "664", "c1", "98", "e4", "3", "5e", "985", "3f", "253", "lk", "bcd", "7a", "7", "\",'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "name", "\":", " ", "\"", "group", "1", "\",'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "description", "\":", " ", "\"", "Thi", "s", " ", "is", " ", "group", "1", "\",'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "status", "\":", " ", "\"", "ACTI", "VE", "\"}}", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "request_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "request_", "._", "return", "\\u", "value_", "=_", "requests_", "._", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "request_", "._", "return", "\\u", "value_", "._", "status", "\\u", "code_", "=_", "201_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "request_", "._", "return", "\\u", "value_", "._", "\\u", "content_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "mock_", "._", "patch_", "(_", "'", "request", "s", ".", "request", "'_", ",_", "mock", "\\u", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", ",_", "body_", "=_", "cs_", "._", "post_", "(_", "'/", "group", "s", "'_", ",_", "body_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "header", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "User", "-", "Agent", "'_", ":_", "'", "python", "-", "rack", "client", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Accept", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Conten", "t", "-", "Type", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data", "'_", ":_", "json_", "._", "dumps_", "(_", "data_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "request_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "'", "POST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "://", "www", ".", "foo", ".", "com", "/", "group", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\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, 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 ]
`__eq__` not overridden when adding attributes
HIPS/autograd/autograd/core.py
[ { "content": "class CalculationTape(list):\n", "metadata": "root.CalculationTape", "header": "['module', '___EOS___']", "index": 247 }, { "content": " def __init__(self):\n self.complete = False", "metadata": "root.CalculationTape.__init__", "header": "['class', 'CalculationTape', '(', 'list', ')', ':', '___EOS___']", "index": 248 }, { "content": " def __hash__(self):\n return id(self)", "metadata": "root.CalculationTape.__hash__", "header": "['class', 'CalculationTape', '(', 'list', ')', ':', '___EOS___']", "index": 251 } ]
[ { "span": "class CalculationTape(list):", "start_line": 247, "start_column": 0, "end_line": 247, "end_column": 28 } ]
[ { "span": "self.complete ", "start_line": 249, "start_column": 8, "end_line": 249, "end_column": 21 } ]
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_", "Calculat", "ion", "Tap", "e_", "(_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Calculat", "ion", "Tap", "e_", "(_", "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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "complete_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Calculat", "ion", "Tap", "e_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "id_", "(_", "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, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
TurboGears/gearbox/gearbox/commands/scaffold.py
[ { "content": " def _find_toplevel_packages(self):\n egg_info_dir = find_egg_info_dir(os.getcwd())\n if egg_info_dir is None:\n print('Unable to find distribution egg-info, did you run setup.py egg_info or develop?')\n return []\n\n modules = os.path.join(egg_info_dir, 'top_level.txt')\n try:\n modules = open(modules).readlines()\n except:\n print('Unable to detect distribution top level packages.')\n return []\n\n modules = map(lambda x: x.strip().replace(os.sep, '.'), modules)\n modules = filter(lambda x: not x.startswith('test'), modules) # Remove test suite modules\n return list(modules)", "metadata": "root.ScaffoldCommand._find_toplevel_packages", "header": "['class', 'ScaffoldCommand', '(', 'Command', ')', ':', '___EOS___']", "index": 67 } ]
[ { "span": "except:", "start_line": 76, "start_column": 8, "end_line": 76, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Sca", "ffo", "ld", "Command_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "find", "\\u", "toplevel", "\\u", "packages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "egg", "\\u", "info", "\\u", "dir_", "=_", "find", "\\u", "egg", "\\u", "info", "\\u", "dir_", "(_", "os_", "._", "getcwd_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "egg", "\\u", "info", "\\u", "dir_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Una", "ble", " ", "to", " ", "find", " ", "distribu", "tion", " ", "egg", "-", "info", ",", " ", "did", " ", "you", " ", "run", " ", "setup", ".", "py", " ", "egg", "\\u", "info", " ", "or", " ", "develop", "?'_", ")_", "\\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_", "modules_", "=_", "os_", "._", "path_", "._", "join_", "(_", "egg", "\\u", "info", "\\u", "dir_", ",_", "'", "top", "\\u", "level", ".", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "modules_", "=_", "open_", "(_", "modules_", ")_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Una", "ble", " ", "to", " ", "detect", " ", "distribu", "tion", " ", "top", " ", "level", " ", "package", "s", ".'_", ")_", "\\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_", "modules_", "=_", "map_", "(_", "lambda_", "x_", ":_", "x_", "._", "strip_", "(_", ")_", "._", "replace_", "(_", "os_", "._", "sep_", ",_", "'.'_", ")_", ",_", "modules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modules_", "=_", "filter_", "(_", "lambda_", "x_", ":_", "not_", "x_", "._", "startswith_", "(_", "'", "test", "'_", ")_", ",_", "modules_", ")_", "#", " ", "Remove", " ", "test", " ", "suit", "e", " ", "modules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "list_", "(_", "modules_", ")_", "\\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, 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 ]
Unused import
sunlightlabs/read_FEC/fecreader/legislators/management/commands/load_committee_membership.py
[ { "content": "import yaml\nimport os\n\nfrom dateutil.parser import parse as dateparse\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand, CommandError\n\nfrom legislators.models import *\n\nPROJECT_ROOT = getattr(settings, 'PROJECT_ROOT')\ncurrent_membership = os.path.join(PROJECT_ROOT, '..', 'legislators', 'data', 'committee-membership-current.yaml')\n\n\n ", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def process_file(filename):\n print \"Processing file %s\" % (filename)\n # read the whole file -- slow, but...\n membership_records = yaml.load(open(filename, 'r'))\n #print membership_records\n for membership in membership_records:\n # We only care about committees, not subcomittees. These have 4-letter thomas_ids. The subcommittees are \\w{4}\\d{2}\n if len(membership)==4:\n print membership\n committee = Committee.objects.get(thomas_id=membership)\n print \"Processing committee %s\" % (committee)\n for member in membership_records[membership]:\n bioguide = member['bioguide']\n \n legislator = Legislator.objects.get(bioguide=bioguide)\n print \"Adding %s\" % (legislator.last_name)\n try:\n CurrentCommitteeMembership.objects.get(committee=committee, member=legislator)\n except CurrentCommitteeMembership.DoesNotExist:\n CurrentCommitteeMembership.objects.create(\n committee=committee,\n member=legislator,\n rank = member['rank'],\n party = member['party'],\n title = member.get('title'),\n )", "metadata": "root.process_file", "header": "['module', '___EOS___']", "index": 14 }, { "content": "class Command(BaseCommand):\n help = \"Load current committees from yaml files. This is not efficient, because it checks for the existence of each separate piece of data before loading.\"\n requires_model_validation = False\n ", "metadata": "root.Command", "header": "['module', '___EOS___']", "index": 41 }, { "content": " def handle(self, *args, **options):\n \n process_file(current_membership)", "metadata": "root.Command.handle", "header": "['class', 'Command', '(', 'BaseCommand', ')', ':', '___EOS___']", "index": 45 } ]
[ { "span": "from dateutil.parser import parse as dateparse", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 46 }, { "span": "from django.core.management.base import BaseCommand, CommandError", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 65 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "yaml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "dateutil_", "._", "parser_", "import_", "parse_", "as_", "date", "parse_", "\\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_", "._", "management_", "._", "base_", "import_", "Base", "Command_", ",_", "Command", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "legislat", "ors_", "._", "models_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PROJECT", "\\u", "ROOT_", "=_", "getattr_", "(_", "settings_", ",_", "'", "PROJECT", "\\u", "ROO", "T", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "membership_", "=_", "os_", "._", "path_", "._", "join_", "(_", "PROJECT", "\\u", "ROOT_", ",_", "'..'_", ",_", "'", "legislat", "ors", "'_", ",_", "'", "data", "'_", ",_", "'", "committee", "-", "member", "ship", "-", "current", ".", "yaml", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "process", "\\u", "file_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Process", "ing", " ", "file", " ", "%", "s", "\"_", "%_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "read", " ", "the", " ", "whole", " ", "file", " ", "--", " ", "slow", ",", " ", "but", "..._", "\\u\\u\\uNL\\u\\u\\u_", "member", "ship", "\\u", "records_", "=_", "yaml_", "._", "load_", "(_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "member", "ship", "\\u", "records_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "membership_", "in_", "member", "ship", "\\u", "records_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "only", " ", "care", " ", "abo", "ut", " ", "committee", "s", ",", " ", "not", " ", "subco", "mit", "tee", "s", ".", " ", "The", "se", " ", "have", " ", "4", "-", "letter", " ", "tho", "mas", "\\u", "ids", ".", " ", "The", " ", "subco", "mmi", "tte", "es", " ", "are", " ", "\\\\", "w", "{", "4", "}\\\\", "d", "{", "2", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "membership_", ")_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "membership_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "committee", "_", "=_", "Committe", "e_", "._", "objects_", "._", "get_", "(_", "tho", "mas", "\\u", "id_", "=_", "membership_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Process", "ing", " ", "committee", " ", "%", "s", "\"_", "%_", "(_", "committee", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "member_", "in_", "member", "ship", "\\u", "records_", "[_", "membership_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bio", "guide_", "=_", "member_", "[_", "'", "bio", "guide", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "legislat", "or_", "=_", "Legi", "slat", "or_", "._", "objects_", "._", "get_", "(_", "bio", "guide_", "=_", "bio", "guide_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Add", "ing", " ", "%", "s", "\"_", "%_", "(_", "legislat", "or_", "._", "last", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "Curr", "ent", "Committe", "e", "Membership", "_", "._", "objects_", "._", "get_", "(_", "committee", "_", "=_", "committee", "_", ",_", "member_", "=_", "legislat", "or_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Curr", "ent", "Committe", "e", "Membership", "_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "Curr", "ent", "Committe", "e", "Membership", "_", "._", "objects_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "committee", "_", "=_", "committee", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "member_", "=_", "legislat", "or_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rank_", "=_", "member_", "[_", "'", "rank", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "party_", "=_", "member_", "[_", "'", "part", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "member_", "._", "get_", "(_", "'", "title", "'_", ")_", ",_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help_", "=_", "\"", "Load", " ", "current", " ", "committee", "s", " ", "from", " ", "yaml", " ", "files", ".", " ", "Thi", "s", " ", "is", " ", "not", " ", "efficien", "t", ",", " ", "bec", "aus", "e", " ", "it", " ", "checks", " ", "for", " ", "the", " ", "existence", " ", "of", " ", "each", " ", "separate", " ", "piece", " ", "of", " ", "data", " ", "bef", "ore", " ", "load", "ing", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "require", "s", "\\u", "model", "\\u", "validation_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Base", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u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----------------\n\n# basics:\n\na = ['' for a in [1]]\n#? str()\na[0]\n#? ['insert']\na.insert\n\na = [a for a in [1]]\n#? int()\na[0]\n\ny = 1.0\n# Should not leak.\n[y for y in [3]]\n#? float()\ny\n\na = [a for a in (1, 2)]\n#? int()\na[0]\n\na = [a for a,b in [(1,'')]]\n#? int()\na[0]\n\narr = [1,'']\na = [a for a in arr]\n#? int() str()\na[0]\n\na = [a if 1.0 else '' for a in [1] if [1.0]]\n#? int() str()\na[0]\n\n# name resolve should be correct\nleft, right = 'a', 'b'\nleft, right = [x for x in (left, right)]\n#? str()\nleft\n\n# with a dict literal\n#? str()\n[a for a in {1:'x'}][0]\n\n##? str()\n{a-1:b for a,b in {1:'a', 3:1.0}.items()}[0]\n\n# with a set literal\n#? int()\n[a for a in {1, 2, 3}][0]\n\n#? set()\n{a for a in range(10)}\n\n##? int()\n[x for x in {a for a in range(10)}][0]\n\n##? int()\n{a for a in range(10)}.pop()\n\n##? int()\niter({a for a in range(10)}).next()\n\n\n# list comprehensions should also work in combination with functions\n\nlisten(['' for x in [1]])\n#? str\n([str for x in []])[0]\n\n\n# -----------------\n# nested list comprehensions\n# -----------------\n\nb = [a for arr in [[1]] for a in arr]\n#? int()\nb[0]\n\nb = [a for arr in [[1]] if '' for a in arr if '']\n#? int()\nb[0]\n\nb = [b for arr in [[[1.0]]] for a in arr for b in a]\n#? float()\nb[0]\n\n# jedi issue #26\n#? list()\na = [[int(v) for v in line.strip().split() if v] for line in [\"123\", \"123\", \"123\"] if line]\n#? list()\na[0]\n#? int()\na[0][0]\n\n# -----------------\n# generator comprehensions\n# -----------------\n\nleft, right = (i for i in (1, ''))\n\n#? int()\nleft\n\ngen = (i for i in (1,))\n\n#? int()\nnext(gen)\n#?\ngen[0]\n\ngen = (a for arr in [[1.0]] for a in arr)\n#? float()\nnext(gen)\n\n#? int()\n(i for i in (1,)).send()\n\n# issues with different formats\nleft, right = (i for i in\n ('1', '2'))\n#? str()\nleft\n\n# -----------------\n# name resolution in comprehensions.\n# -----------------\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "1.0 ", "start_line": 35, "start_column": 10, "end_line": 35, "end_column": 13 }, { "span": "[1.0]]", "start_line": 35, "start_column": 38, "end_line": 35, "end_column": 43 } ]
[]
1
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", " ", "compre", "hens", "ions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "basics", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "''_", "for_", "a_", "in_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "['", "insert", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "._", "insert_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "a_", "for_", "a_", "in_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "y_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sho", "ul", "d", " ", "not", " ", "leak", "._", "\\u\\u\\uNL\\u\\u\\u_", "[_", "y_", "for_", "y_", "in_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "float", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "a_", "for_", "a_", "in_", "(_", "1_", ",_", "2_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "a_", "for_", "a_", ",_", "b_", "in_", "[_", "(_", "1_", ",_", "''_", ")_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arr_", "=_", "[_", "1_", ",_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "[_", "a_", "for_", "a_", "in_", "arr_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "a_", "if_", "1.0_", "else_", "''_", "for_", "a_", "in_", "[_", "1_", "]_", "if_", "[_", "1.0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "resolve", " ", "shou", "ld", " ", "be", " ", "correct_", "\\u\\u\\uNL\\u\\u\\u_", "left_", ",_", "right_", "=_", "'", "a", "'_", ",_", "'", "b", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", ",_", "right_", "=_", "[_", "x_", "for_", "x_", "in_", "(_", "left_", ",_", "right_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "a", " ", "dict", " ", "literal_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "a_", "for_", "a_", "in_", "{_", "1_", ":_", "'", "x", "'_", "}_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "?", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "a_", "-_", "1_", ":_", "b_", "for_", "a_", ",_", "b_", "in_", "{_", "1_", ":_", "'", "a", "'_", ",_", "3_", ":_", "1.0_", "}_", "._", "items_", "(_", ")_", "}_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "a", " ", "set", " ", "literal_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "a_", "for_", "a_", "in_", "{_", "1_", ",_", "2_", ",_", "3_", "}_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "set", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "a_", "for_", "a_", "in_", "range_", "(_", "10_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "for_", "x_", "in_", "{_", "a_", "for_", "a_", "in_", "range_", "(_", "10_", ")_", "}_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "a_", "for_", "a_", "in_", "range_", "(_", "10_", ")_", "}_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "iter_", "(_", "{_", "a_", "for_", "a_", "in_", "range_", "(_", "10_", ")_", "}_", ")_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", " ", "compre", "hens", "ion", "s", " ", "shou", "ld", " ", "als", "o", " ", "work", " ", "in", " ", "combinat", "ion", " ", "with", " ", "functions_", "\\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_", "listen_", "(_", "[_", "''_", "for_", "x_", "in_", "[_", "1_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "str_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "[_", "str_", "for_", "x_", "in_", "[_", "]_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nest", "ed", " ", "list", " ", "compre", "hens", "ions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "=_", "[_", "a_", "for_", "arr_", "in_", "[_", "[_", "1_", "]_", "]_", "for_", "a_", "in_", "arr_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "=_", "[_", "a_", "for_", "arr_", "in_", "[_", "[_", "1_", "]_", "]_", "if_", "''_", "for_", "a_", "in_", "arr_", "if_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "=_", "[_", "b_", "for_", "arr_", "in_", "[_", "[_", "[_", "1.0_", "]_", "]_", "]_", "for_", "a_", "in_", "arr_", "for_", "b_", "in_", "a_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "float", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "b_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "jedi", " ", "issue", " ", "#", "26_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "list", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "[_", "[_", "int_", "(_", "v_", ")_", "for_", "v_", "in_", "line_", "._", "strip_", "(_", ")_", "._", "split_", "(_", ")_", "if_", "v_", "]_", "for_", "line_", "in_", "[_", "\"", "123", "\"_", ",_", "\"", "123", "\"_", ",_", "\"", "123", "\"_", "]_", "if_", "line_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "list", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "or", " ", "compre", "hens", "ions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "left_", ",_", "right_", "=_", "(_", "i_", "for_", "i_", "in_", "(_", "1_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gen_", "=_", "(_", "i_", "for_", "i_", "in_", "(_", "1_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "next_", "(_", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "gen_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gen_", "=_", "(_", "a_", "for_", "arr_", "in_", "[_", "[_", "1.0_", "]_", "]_", "for_", "a_", "in_", "arr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "float", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "next_", "(_", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "?", " ", "int", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "i_", "for_", "i_", "in_", "(_", "1_", ",_", ")_", ")_", "._", "send_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "issue", "s", " ", "with", " ", "different", " ", "formats_", "\\u\\u\\uNL\\u\\u\\u_", "left_", ",_", "right_", "=_", "(_", "i_", "for_", "i_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "1", "'_", ",_", "'", "2", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "?", " ", "str", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "resolu", "tion", " ", "in", " ", "compre", "hens", "ion", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
mirumee/saleor/saleor/product/migrations/0005_auto_20150825_1433.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import models, migrations\nimport django_prices.models\nimport saleor.product.models.fields\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(migrations.Migration):\n\n dependencies = [\n ('product', '0004_merge'),\n ]\n\n operations = [\n migrations.AlterField(\n model_name='fixedproductdiscount',\n name='discount',\n field=django_prices.models.PriceField(verbose_name='discount value', max_digits=12, decimal_places=2, currency='USD'),\n ),\n migrations.AlterField(\n model_name='product',\n name='price',\n field=django_prices.models.PriceField(verbose_name='price', max_digits=12, decimal_places=2, currency='USD'),\n ),\n migrations.AlterField(\n model_name='product',\n name='weight',\n field=saleor.product.models.fields.WeightField(verbose_name='weight', max_digits=6, decimal_places=2, unit='lb'),\n ),\n migrations.AlterField(\n model_name='productvariant',\n name='price_override',\n field=django_prices.models.PriceField(verbose_name='price override', decimal_places=2, blank=True, currency='USD', max_digits=12, null=True),\n ),\n migrations.AlterField(\n model_name='productvariant',\n name='weight_override',\n field=saleor.product.models.fields.WeightField(verbose_name='weight override', decimal_places=2, blank=True, max_digits=6, unit='lb', null=True),\n ),\n migrations.AlterField(\n model_name='stock',\n name='cost_price',\n field=django_prices.models.PriceField(verbose_name='cost price', decimal_places=2, blank=True, currency='USD', max_digits=12, null=True),\n ),\n ]", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 8 } ]
[ { "span": "from django.db import models, migrations", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", ",_", "migrations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "django", "\\u", "prices_", "._", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sal", "eo", "r_", "._", "product_", "._", "models_", "._", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "migrations_", "._", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dependencies_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "product", "'_", ",_", "'", "0004", "\\u", "merge", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "operations_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "fixed", "product", "discou", "nt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "discou", "nt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "django", "\\u", "prices_", "._", "models_", "._", "Price", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "discou", "nt", " ", "value", "'_", ",_", "max", "\\u", "digits_", "=_", "12_", ",_", "decima", "l\\u", "places_", "=_", "2_", ",_", "currency_", "=_", "'", "US", "D", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "product", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "price", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "django", "\\u", "prices_", "._", "models_", "._", "Price", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "price", "'_", ",_", "max", "\\u", "digits_", "=_", "12_", ",_", "decima", "l\\u", "places_", "=_", "2_", ",_", "currency_", "=_", "'", "US", "D", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "product", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "weight", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "sal", "eo", "r_", "._", "product_", "._", "models_", "._", "fields_", "._", "Weig", "ht", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "weight", "'_", ",_", "max", "\\u", "digits_", "=_", "6_", ",_", "decima", "l\\u", "places_", "=_", "2_", ",_", "unit_", "=_", "'", "lb", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "product", "variant", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "price", "\\u", "override", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "django", "\\u", "prices_", "._", "models_", "._", "Price", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "price", " ", "override", "'_", ",_", "decima", "l\\u", "places_", "=_", "2_", ",_", "blank_", "=_", "True_", ",_", "currency_", "=_", "'", "US", "D", "'_", ",_", "max", "\\u", "digits_", "=_", "12_", ",_", "null_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "product", "variant", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "weight", "\\u", "override", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "sal", "eo", "r_", "._", "product_", "._", "models_", "._", "fields_", "._", "Weig", "ht", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "weight", " ", "override", "'_", ",_", "decima", "l\\u", "places_", "=_", "2_", ",_", "blank_", "=_", "True_", ",_", "max", "\\u", "digits_", "=_", "6_", ",_", "unit_", "=_", "'", "lb", "'_", ",_", "null_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "name_", "=_", "'", "stock", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "cost", "\\u", "price", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "field_", "=_", "django", "\\u", "prices_", "._", "models_", "._", "Price", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "cost", " ", "price", "'_", ",_", "decima", "l\\u", "places_", "=_", "2_", ",_", "blank_", "=_", "True_", ",_", "currency_", "=_", "'", "US", "D", "'_", ",_", "max", "\\u", "digits_", "=_", "12_", ",_", "null_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 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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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 ]
Except block handles 'BaseException'
benoitc/couchdbkit/couchdbkit/consumer/ceventlet.py
[ { "content": " def _run(self):\n while True:\n try:\n resp = self.db.res.get(\"_changes\", **self.params)\n return self.consume(resp)\n except (SystemExit, KeyboardInterrupt):\n eventlet.sleep(5)\n break\n except:\n traceback.print_exc()\n eventlet.sleep(5)\n break\n self.stop_event.send(True)", "metadata": "root.ChangeConsumer._run", "header": "['class', 'ChangeConsumer', '(', 'object', ')', ':', '___EOS___']", "index": 29 } ]
[ { "span": "except:", "start_line": 37, "start_column": 12, "end_line": 37, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Change", "Consumer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "run_", "(_", "self_", ")_", ":_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "db_", "._", "res_", "._", "get_", "(_", "\"\\u", "change", "s", "\"_", ",_", "**_", "self_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "consume_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "System", "Exit_", ",_", "Key", "board", "Interrupt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eventlet_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\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 ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eventlet_", "._", "sleep_", "(_", "5_", ")_", "\\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_", "self_", "._", "stop", "\\u", "event_", "._", "send_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
elistevens/solari/ajax/solariajax/__init__.py
[ { "content": "# Copyright (c) 2010 Eli Stevens\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n\nfrom core import ajaxify, append, content, jseval, replace\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from core import ajaxify, append, content, jseval, replace", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2010", " ", "Eli", " ", "Ste", "ven", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", " ", "include", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "EXPR", "ESS", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "core_", "import_", "aja", "xi", "fy_", ",_", "append_", ",_", "content_", ",_", "js", "eval_", ",_", "replace_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Illegal raise
pydanny/django-admin2/djadmin2/types.py
[ { "content": " def get_urls(self):\n pattern_list = []\n for admin_view in self.views:\n admin_view.model_admin = self\n get_kwargs = getattr(self, \"get_%s_kwargs\" % admin_view.name, None)\n if not get_kwargs:\n get_kwargs = admin_view.get_view_kwargs\n try:\n view_instance = admin_view.view.as_view(**get_kwargs())\n except Exception as e:\n trace = sys.exc_info()[2]\n new_exception = TypeError(\n 'Cannot instantiate admin view \"{}.{}\". '\n 'The error that got raised was: {}'.format(\n self.__class__.__name__, admin_view.name, e))\n try:\n raise new_exception.with_traceback(trace)\n except AttributeError:\n raise (new_exception, None, trace)\n\n pattern_list.append(\n url(\n regex=admin_view.url,\n view=view_instance,\n name=self.get_prefixed_view_name(admin_view.name)\n )\n )\n return patterns('', *pattern_list)", "metadata": "root.ModelAdmin2.get_urls", "header": "['class', 'ModelAdmin2', '(', 'with_metaclass', '(', 'ModelAdminBase2', ')', ')', ':', '___EOS___']", "index": 211 } ]
[ { "span": "raise (new_exception, None, trace)", "start_line": 229, "start_column": 20, "end_line": 229, "end_column": 54 } ]
[]
1
true
[ "[CLS]_", "Il", "lega", "l_", "raise_", "[SEP]_", "class_", "Model", "Admi", "n2_", "(_", "with", "\\u", "metaclass_", "(_", "Model", "Admi", "n", "Base", "2_", ")_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pattern", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "admin", "\\u", "view_", "in_", "self_", "._", "views_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "admin", "\\u", "view_", "._", "model", "\\u", "admin_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "kwargs_", "=_", "getattr_", "(_", "self_", ",_", "\"", "get", "\\u", "%", "s", "\\u", "kwarg", "s", "\"_", "%_", "admin", "\\u", "view_", "._", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "get", "\\u", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "kwargs_", "=_", "admin", "\\u", "view_", "._", "get", "\\u", "view", "\\u", "kwargs_", "\\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 ", " _", "view", "\\u", "instance_", "=_", "admin", "\\u", "view_", "._", "view_", "._", "as", "\\u", "view_", "(_", "**_", "get", "\\u", "kwargs_", "(_", ")_", ")_", "\\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 ", " _", "trace_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "exception_", "=_", "Type", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cann", "ot", " ", "instantiate", " ", "admin", " ", "view", " ", "\"{}", ".{}", "\".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "The", " ", "error", " ", "tha", "t", " ", "got", " ", "raise", "d", " ", "was", ":", " ", "{}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "admin", "\\u", "view_", "._", "name_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "new", "\\u", "exception_", "._", "with", "\\u", "traceback_", "(_", "trace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "(_", "new", "\\u", "exception_", ",_", "None_", ",_", "trace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pattern", "\\u", "list_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "regex_", "=_", "admin", "\\u", "view_", "._", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "view_", "=_", "view", "\\u", "instance_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "get", "\\u", "prefixed", "\\u", "view", "\\u", "name_", "(_", "admin", "\\u", "view_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "patterns_", "(_", "''_", ",_", "*_", "pattern", "\\u", "list_", ")_", "\\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, 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 ]
Unused import
byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/tests/ntacls.py
[ { "content": "# Unix SMB/CIFS implementation. Tests for ntacls manipulation\n# Copyright (C) Matthieu Patou <[email protected]> 2009-2010\n# Copyright (C) Andrew Bartlett 2012\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (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, see <http://www.gnu.org/licenses/>.\n#\n\n\"\"\"Tests for samba.ntacls.\"\"\"\n\nfrom samba.ntacls import setntacl, getntacl, XattrBackendError\nfrom samba.dcerpc import xattr, security\nfrom samba.param import LoadParm\nfrom samba.tests import TestCaseInTempDir, TestSkipped\nimport random\nimport os\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NtaclsTests(TestCaseInTempDir):\n\n\n\n\n\n\n\n", "metadata": "root.NtaclsTests", "header": "['module', '___EOS___']", "index": 27 }, { "content": " def test_setntacl(self):\n lp = LoadParm()\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n open(self.tempf, 'w').write(\"empty\")\n lp.set(\"posix:eadb\",os.path.join(self.tempdir,\"eadbtest.tdb\"))\n setntacl(lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\")\n os.unlink(os.path.join(self.tempdir,\"eadbtest.tdb\"))", "metadata": "root.NtaclsTests.test_setntacl", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_setntacl_getntacl(self):\n lp = LoadParm()\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n open(self.tempf, 'w').write(\"empty\")\n lp.set(\"posix:eadb\",os.path.join(self.tempdir,\"eadbtest.tdb\"))\n setntacl(lp,self.tempf,acl,\"S-1-5-21-2212615479-2695158682-2101375467\")\n facl = getntacl(lp,self.tempf)\n anysid = security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(facl.as_sddl(anysid),acl)\n os.unlink(os.path.join(self.tempdir,\"eadbtest.tdb\"))", "metadata": "root.NtaclsTests.test_setntacl_getntacl", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 37 }, { "content": " def test_setntacl_getntacl_param(self):\n lp = LoadParm()\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n open(self.tempf, 'w').write(\"empty\")\n setntacl(lp,self.tempf,acl,\"S-1-5-21-2212615479-2695158682-2101375467\",\"tdb\",os.path.join(self.tempdir,\"eadbtest.tdb\"))\n facl=getntacl(lp,self.tempf,\"tdb\",os.path.join(self.tempdir,\"eadbtest.tdb\"))\n domsid=security.dom_sid(security.SID_NT_SELF)\n self.assertEquals(facl.as_sddl(domsid),acl)\n os.unlink(os.path.join(self.tempdir,\"eadbtest.tdb\"))", "metadata": "root.NtaclsTests.test_setntacl_getntacl_param", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 48 }, { "content": " def test_setntacl_invalidbackend(self):\n lp = LoadParm()\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n open(self.tempf, 'w').write(\"empty\")\n self.assertRaises(XattrBackendError, setntacl, lp, self.tempf, acl, \"S-1-5-21-2212615479-2695158682-2101375467\",\"ttdb\", os.path.join(self.tempdir,\"eadbtest.tdb\"))", "metadata": "root.NtaclsTests.test_setntacl_invalidbackend", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 58 }, { "content": " def test_setntacl_forcenative(self):\n if os.getuid() == 0:\n raise TestSkipped(\"Running test as root, test skipped\")\n lp = LoadParm()\n acl = \"O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)\"\n open(self.tempf, 'w').write(\"empty\")\n lp.set(\"posix:eadb\", os.path.join(self.tempdir,\"eadbtest.tdb\"))\n self.assertRaises(Exception, setntacl, lp, self.tempf ,acl,\n \"S-1-5-21-2212615479-2695158682-2101375467\",\"native\")", "metadata": "root.NtaclsTests.test_setntacl_forcenative", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 64 }, { "content": " def setUp(self):\n super(NtaclsTests, self).setUp()\n self.tempf = os.path.join(self.tempdir, \"test\")\n open(self.tempf, 'w').write(\"empty\")", "metadata": "root.NtaclsTests.setUp", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 75 }, { "content": " def tearDown(self):\n os.unlink(self.tempf)\n super(NtaclsTests, self).tearDown()", "metadata": "root.NtaclsTests.tearDown", "header": "['class', 'NtaclsTests', '(', 'TestCaseInTempDir', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "from samba.dcerpc import xattr, security", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 40 }, { "span": "import random", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Uni", "x", " ", "SMB", "/", "CIF", "S", " ", "implementation", ".", " ", "Test", "s", " ", "for", " ", "nta", "cls", " ", "manipulati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "Matt", "hi", "eu", " ", "Pat", "ou", " ", "<", "mat", "@", "mat", "ws", ".", "net", ">", " ", "200", "9", "-", "2010_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "Andre", "w", " ", "Bar", "tle", "tt", " ", "2012_", "\\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", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "as", " ", "publi", "shed", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "3", " ", "of", " ", "the", " ", "License", ",", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "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", ",", " ", "see", " ", "<", "http", "://", "www", ".", "gnu", ".", "org", "/", "license", "s", "/>", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Test", "s", " ", "for", " ", "samba", ".", "nta", "cls", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "samba", "_", "._", "nta", "cls_", "import_", "setn", "tac", "l_", ",_", "getn", "tac", "l_", ",_", "Xa", "ttr", "Back", "end", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "samba", "_", "._", "dce", "rpc_", "import_", "xattr", "_", ",_", "security_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "samba", "_", "._", "param_", "import_", "Load", "Parm", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "samba", "_", "._", "tests_", "import_", "Test", "Case", "In", "Temp", "Dir_", ",_", "Test", "Skipped", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\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_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "setn", "tac", "l_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lp_", "=_", "Load", "Parm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "=_", "\"", "O", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", "G", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "513", "D", ":(", "A", ";", "OI", "CI", ";", "0x001", "f0", "1f", "f", ";;;", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "self_", "._", "temp", "f_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "\"", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "._", "set_", "(_", "\"", "posix", ":", "ead", "b", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setn", "tac", "l_", "(_", "lp_", ",_", "self_", "._", "temp", "f_", ",_", "acl_", ",_", "\"", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "unlink_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "setn", "tac", "l\\u", "getn", "tac", "l_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lp_", "=_", "Load", "Parm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "=_", "\"", "O", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", "G", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "513", "D", ":(", "A", ";", "OI", "CI", ";", "0x001", "f0", "1f", "f", ";;;", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "self_", "._", "temp", "f_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "\"", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "._", "set_", "(_", "\"", "posix", ":", "ead", "b", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setn", "tac", "l_", "(_", "lp_", ",_", "self_", "._", "temp", "f_", ",_", "acl_", ",_", "\"", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fac", "l_", "=_", "getn", "tac", "l_", "(_", "lp_", ",_", "self_", "._", "temp", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "any", "sid_", "=_", "security_", "._", "dom", "\\u", "sid_", "(_", "security_", "._", "SID", "\\u", "NT", "\\u", "SELF", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fac", "l_", "._", "as", "\\u", "sdd", "l_", "(_", "any", "sid_", ")_", ",_", "acl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "unlink_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "setn", "tac", "l\\u", "getn", "tac", "l\\u", "param_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lp_", "=_", "Load", "Parm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "=_", "\"", "O", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", "G", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "513", "D", ":(", "A", ";", "OI", "CI", ";", "0x001", "f0", "1f", "f", ";;;", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "self_", "._", "temp", "f_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "\"", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setn", "tac", "l_", "(_", "lp_", ",_", "self_", "._", "temp", "f_", ",_", "acl_", ",_", "\"", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "\"_", ",_", "\"", "tdb", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fac", "l_", "=_", "getn", "tac", "l_", "(_", "lp_", ",_", "self_", "._", "temp", "f_", ",_", "\"", "tdb", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dom", "sid_", "=_", "security_", "._", "dom", "\\u", "sid_", "(_", "security_", "._", "SID", "\\u", "NT", "\\u", "SELF", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "fac", "l_", "._", "as", "\\u", "sdd", "l_", "(_", "dom", "sid_", ")_", ",_", "acl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "unlink_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "setn", "tac", "l\\u", "invalid", "backend_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lp_", "=_", "Load", "Parm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "=_", "\"", "O", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", "G", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "513", "D", ":(", "A", ";", "OI", "CI", ";", "0x001", "f0", "1f", "f", ";;;", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "self_", "._", "temp", "f_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "\"", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Xa", "ttr", "Back", "end", "Error_", ",_", "setn", "tac", "l_", ",_", "lp_", ",_", "self_", "._", "temp", "f_", ",_", "acl_", ",_", "\"", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "\"_", ",_", "\"", "tt", "db", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "setn", "tac", "l\\u", "force", "native_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "getu", "id_", "(_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Skipped", "_", "(_", "\"", "Run", "ning", " ", "test", " ", "as", " ", "root", ",", " ", "test", " ", "skip", "ped", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lp_", "=_", "Load", "Parm", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "acl_", "=_", "\"", "O", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", "G", ":", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "513", "D", ":(", "A", ";", "OI", "CI", ";", "0x001", "f0", "1f", "f", ";;;", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "-", "512", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "self_", "._", "temp", "f_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "\"", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "._", "set_", "(_", "\"", "posix", ":", "ead", "b", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "ead", "bt", "est", ".", "tdb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ",_", "setn", "tac", "l_", ",_", "lp_", ",_", "self_", "._", "temp", "f_", ",_", "acl_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "S", "-1", "-", "5", "-", "21", "-", "221", "261", "547", "9", "-", "269", "515", "868", "2", "-", "210", "137", "546", "7", "\"_", ",_", "\"", "nativ", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\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 ", " _", "super_", "(_", "Nt", "acl", "s", "Tests_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "temp", "f_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tempdir_", ",_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "open_", "(_", "self_", "._", "temp", "f_", ",_", "'", "w", "'_", ")_", "._", "write_", "(_", "\"", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Nt", "acl", "s", "Tests_", "(_", "Test", "Case", "In", "Temp", "Dir_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "self_", "._", "temp", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Nt", "acl", "s", "Tests_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
FishPi/FishPi-POCV---Command---Control/fishpi/perception/world.py
[ { "content": "\n#\n# FishPi - An autonomous drop in the ocean\n#\n# Perception Unit\n# - responsible for mapping sensor to internal model\n#\n\n# temporarily put gpx loading code here\n# using https://github.com/tkrajina/gpxpy\n\nimport logging\n\nimport gpxpy\nimport gpxpy.gpx\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PerceptionUnit:\n\n \n \n \n\n", "metadata": "root.PerceptionUnit", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def __init__(self, vehicle_constants, data):\n self._vehicle_constants = vehicle_constants\n self._observed_speed = 0.0\n self._observed_heading = 0.0\n self.update(data)", "metadata": "root.PerceptionUnit.__init__", "header": "['class', 'PerceptionUnit', ':', '___EOS___']", "index": 18 }, { "content": " @property\n def observed_speed(self):\n return self._observed_speed", "metadata": "root.PerceptionUnit.observed_speed", "header": "['class', 'PerceptionUnit', ':', '___EOS___']", "index": 24 }, { "content": " @property\n def observed_heading(self):\n return self._observed_heading", "metadata": "root.PerceptionUnit.observed_heading", "header": "['class', 'PerceptionUnit', ':', '___EOS___']", "index": 28 }, { "content": " def update(self, data):\n \"\"\" Update observed speed, heading, location from model and sensor data. \"\"\"\n if data.has_time:\n #data.timestamp\n #data.datestamp\n pass\n\n if data.has_compass:\n compass_heading = data.compass_heading\n compass_pitch = data.compass_pitch\n compass_roll = data.compass_roll\n \n if data.has_GPS and data.fix:\n lat = data.lat\n lon = data.lon\n # heading only vaild above speed x\n gps_heading = data.gps_heading\n gps_speed = data.speed\n altitude = data.altitude\n num_sat = data.num_sat\n \n # temp - use GPS speed\n if data.has_GPS and data.fix:\n self._observed_speed = 0.0 #gps_speed\n\n # temp - average compass and GPS headings\n if data.has_compass and data.has_GPS and data.fix:\n self._observed_heading = (compass_heading + gps_heading) / 2.0\n elif data.has_compass:\n self._observed_heading = compass_heading\n elif data.has_GPS and data.fix:\n self._observed_heading = gps_heading", "metadata": "root.PerceptionUnit.update", "header": "['class', 'PerceptionUnit', ':', '___EOS___']", "index": 32 }, { "content": " def load_gpx(self, filename):\n gpx_file = open(filename)\n gpx = gpxpy.parse(gpx_file)\n return gpx", "metadata": "root.PerceptionUnit.load_gpx", "header": "['class', 'PerceptionUnit', ':', '___EOS___']", "index": 66 } ]
[ { "span": "import logging", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 14 } ]
[]
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_", "#", " ", "Fish", "Pi", " ", "-", " ", "An", " ", "autono", "mou", "s", " ", "drop", " ", "in", " ", "the", " ", "oce", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Perce", "ption", " ", "Unit_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "-", " ", "responsib", "le", " ", "for", " ", "mapping", " ", "sensor", " ", "to", " ", "internal", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "temporar", "il", "y", " ", "put", " ", "gpx", " ", "load", "ing", " ", "code", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "https", "://", "git", "hub", ".", "com", "/", "tk", "raj", "ina", "/", "gpx", "py_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "gpx", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gpx", "py_", "._", "gpx", "_", "\\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_", "Perce", "ption", "Unit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Perce", "ption", "Unit_", ":_", "\\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_", ",_", "vehic", "le", "\\u", "constants_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "vehic", "le", "\\u", "constants_", "=_", "vehic", "le", "\\u", "constants_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "observe", "d\\u", "speed_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "observe", "d\\u", "heading_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Perce", "ption", "Unit_", ":_", "\\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_", "observe", "d\\u", "speed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "observe", "d\\u", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Perce", "ption", "Unit_", ":_", "\\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_", "observe", "d\\u", "heading_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "observe", "d\\u", "heading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Perce", "ption", "Unit_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Update", " ", "observe", "d", " ", "speed", ",", " ", "heading", ",", " ", "location", " ", "from", " ", "model", " ", "and", " ", "sensor", " ", "data", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "._", "has", "\\u", "time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "data", ".", "timestamp_", "\\u\\u\\uNL\\u\\u\\u_", "#", "data", ".", "dates", "tamp", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "._", "has", "\\u", "compass", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compass", "\\u", "heading_", "=_", "data_", "._", "compass", "\\u", "heading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compass", "\\u", "pitch_", "=_", "data_", "._", "compass", "\\u", "pitch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compass", "\\u", "roll_", "=_", "data_", "._", "compass", "\\u", "roll_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "._", "has", "\\u", "GPS", "_", "and_", "data_", "._", "fix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lat_", "=_", "data_", "._", "lat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lon_", "=_", "data_", "._", "lon_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "heading", " ", "only", " ", "vail", "d", " ", "above", " ", "speed", " ", "x_", "\\u\\u\\uNL\\u\\u\\u_", "gps", "\\u", "heading_", "=_", "data_", "._", "gps", "\\u", "heading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gps", "\\u", "speed_", "=_", "data_", "._", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "altitude_", "=_", "data_", "._", "altitude_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "sat_", "=_", "data_", "._", "num", "\\u", "sat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "temp", " ", "-", " ", "use", " ", "GPS", " ", "speed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "._", "has", "\\u", "GPS", "_", "and_", "data_", "._", "fix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "observe", "d\\u", "speed_", "=_", "0.0_", "#", "gps", "\\u", "speed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "temp", " ", "-", " ", "averag", "e", " ", "compass", " ", "and", " ", "GPS", " ", "headings_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "._", "has", "\\u", "compass", "_", "and_", "data_", "._", "has", "\\u", "GPS", "_", "and_", "data_", "._", "fix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "observe", "d\\u", "heading_", "=_", "(_", "compass", "\\u", "heading_", "+_", "gps", "\\u", "heading_", ")_", "/_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "data_", "._", "has", "\\u", "compass", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "observe", "d\\u", "heading_", "=_", "compass", "\\u", "heading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "data_", "._", "has", "\\u", "GPS", "_", "and_", "data_", "._", "fix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "observe", "d\\u", "heading_", "=_", "gps", "\\u", "heading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Perce", "ption", "Unit_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "gpx", "_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gpx", "\\u", "file_", "=_", "open_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gpx", "_", "=_", "gpx", "py_", "._", "parse_", "(_", "gpx", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "gpx", "_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
scikit-learn/scikit-learn/sklearn/utils/arpack.py
[ { "content": " def extract(self, return_eigenvectors):\n k, n = self.k, self.n\n\n ierr = 0\n howmny = 'A' # return all eigenvectors\n sselect = np.zeros(self.ncv, 'int') # unused\n sigmar = np.real(self.sigma)\n sigmai = np.imag(self.sigma)\n workev = np.zeros(3 * self.ncv, self.tp)\n\n if self.tp in 'fd':\n dr = np.zeros(k + 1, self.tp)\n di = np.zeros(k + 1, self.tp)\n zr = np.zeros((n, k + 1), self.tp)\n dr, di, zr, ierr = \\\n self._arpack_extract(return_eigenvectors,\n howmny, sselect, sigmar, sigmai, workev,\n self.bmat, self.which, k, self.tol, self.resid,\n self.v, self.iparam, self.ipntr,\n self.workd, self.workl, self.info)\n if ierr != 0:\n raise ArpackError(ierr, infodict=self.extract_infodict)\n nreturned = self.iparam[4] # number of good eigenvalues returned\n\n # Build complex eigenvalues from real and imaginary parts\n d = dr + 1.0j * di\n\n # Arrange the eigenvectors: complex eigenvectors are stored as\n # real,imaginary in consecutive columns\n z = zr.astype(self.tp.upper())\n\n # The ARPACK nonsymmetric real and double interface (s,d)naupd\n # return eigenvalues and eigenvectors in real (float,double)\n # arrays.\n\n # Efficiency: this should check that return_eigenvectors == True\n # before going through this construction.\n if sigmai == 0:\n i = 0\n while i <= k:\n # check if complex\n if abs(d[i].imag) != 0:\n # this is a complex conjugate pair with eigenvalues\n # in consecutive columns\n if i < k:\n z[:, i] = zr[:, i] + 1.0j * zr[:, i + 1]\n z[:, i + 1] = z[:, i].conjugate()\n i += 1\n else:\n # last eigenvalue is complex: the imaginary part of\n # the eigenvector has not been returned\n # this can only happen if nreturned > k, so we'll\n # throw out this case.\n nreturned -= 1\n i += 1\n\n else:\n # real matrix, mode 3 or 4, imag(sigma) is nonzero:\n # see remark 3 in <s,d>neupd.f\n # Build complex eigenvalues from real and imaginary parts\n i = 0\n while i <= k:\n if abs(d[i].imag) == 0:\n d[i] = np.dot(zr[:, i], self.matvec(zr[:, i]))\n else:\n if i < k:\n z[:, i] = zr[:, i] + 1.0j * zr[:, i + 1]\n z[:, i + 1] = z[:, i].conjugate()\n d[i] = ((np.dot(zr[:, i],\n self.matvec(zr[:, i])) +\n np.dot(zr[:, i + 1],\n self.matvec(zr[:, i + 1]))) +\n 1j * (np.dot(zr[:, i],\n self.matvec(zr[:, i + 1])) -\n np.dot(zr[:, i + 1],\n self.matvec(zr[:, i]))))\n d[i + 1] = d[i].conj()\n i += 1\n else:\n # last eigenvalue is complex: the imaginary part of\n # the eigenvector has not been returned\n # this can only happen if nreturned > k, so we'll\n # throw out this case.\n nreturned -= 1\n i += 1\n\n # Now we have k+1 possible eigenvalues and eigenvectors\n # Return the ones specified by the keyword \"which\"\n\n if nreturned <= k:\n # we got less or equal as many eigenvalues we wanted\n d = d[:nreturned]\n z = z[:, :nreturned]\n else:\n # we got one extra eigenvalue (likely a cc pair, but which?)\n # cut at approx precision for sorting\n rd = np.round(d, decimals=_ndigits[self.tp])\n if self.which in ['LR', 'SR']:\n ind = np.argsort(rd.real)\n elif self.which in ['LI', 'SI']:\n # for LI,SI ARPACK returns largest,smallest\n # abs(imaginary) why?\n ind = np.argsort(abs(rd.imag))\n else:\n ind = np.argsort(abs(rd))\n if self.which in ['LR', 'LM', 'LI']:\n d = d[ind[-k:]]\n z = z[:, ind[-k:]]\n if self.which in ['SR', 'SM', 'SI']:\n d = d[ind[:k]]\n z = z[:, ind[:k]]\n else:\n # complex is so much simpler...\n d, z, ierr =\\\n self._arpack_extract(return_eigenvectors,\n howmny, sselect, self.sigma, workev,\n self.bmat, self.which, k, self.tol, self.resid,\n self.v, self.iparam, self.ipntr,\n self.workd, self.workl, self.rwork, ierr)\n\n if ierr != 0:\n raise ArpackError(ierr, infodict=self.extract_infodict)\n\n k_ok = self.iparam[4]\n d = d[:k_ok]\n z = z[:, :k_ok]\n\n if return_eigenvectors:\n return d, z\n else:\n return d", "metadata": "root._UnsymmetricArpackParams.extract", "header": "['class', '_UnsymmetricArpackParams', '(', '_ArpackParams', ')', ':', '___EOS___']", "index": 813 } ]
[ { "span": "dr ", "start_line": 824, "start_column": 12, "end_line": 824, "end_column": 14 }, { "span": "di ", "start_line": 825, "start_column": 12, "end_line": 825, "end_column": 14 }, { "span": "zr ", "start_line": 826, "start_column": 12, "end_line": 826, "end_column": 14 } ]
[ { "span": "dr,", "start_line": 827, "start_column": 12, "end_line": 827, "end_column": 14 }, { "span": "di,", "start_line": 827, "start_column": 16, "end_line": 827, "end_column": 18 }, { "span": "zr,", "start_line": 827, "start_column": 20, "end_line": 827, "end_column": 22 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "\\u", "Uns", "ymm", "etric", "Arp", "ack", "Params_", "(_", "\\u", "Arp", "ack", "Params_", ")_", ":_", "\\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_", "extract_", "(_", "self_", ",_", "return", "\\u", "eigenvector", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", ",_", "n_", "=_", "self_", "._", "k_", ",_", "self_", "._", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ier", "r_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "how", "mn", "y_", "=_", "'", "A", "'_", "#", " ", "return", " ", "all", " ", "eigenvector", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sse", "lect", "_", "=_", "np_", "._", "zeros_", "(_", "self_", "._", "nc", "v_", ",_", "'", "int", "'_", ")_", "#", " ", "unused_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "r_", "=_", "np_", "._", "real_", "(_", "self_", "._", "sigma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "i_", "=_", "np_", "._", "imag_", "(_", "self_", "._", "sigma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "work", "ev_", "=_", "np_", "._", "zeros_", "(_", "3_", "*_", "self_", "._", "nc", "v_", ",_", "self_", "._", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "tp_", "in_", "'", "fd", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dr_", "=_", "np_", "._", "zeros_", "(_", "k_", "+_", "1_", ",_", "self_", "._", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "di_", "=_", "np_", "._", "zeros_", "(_", "k_", "+_", "1_", ",_", "self_", "._", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zr", "_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "k_", "+_", "1_", ")_", ",_", "self_", "._", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dr_", ",_", "di_", ",_", "zr", "_", ",_", "ier", "r_", "=_", "self_", "._", "\\u", "arp", "ack", "\\u", "extract_", "(_", "return", "\\u", "eigenvector", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "how", "mn", "y_", ",_", "sse", "lect", "_", ",_", "sigma", "r_", ",_", "sigma", "i_", ",_", "work", "ev_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "bma", "t_", ",_", "self_", "._", "which_", ",_", "k_", ",_", "self_", "._", "tol_", ",_", "self_", "._", "resid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "v_", ",_", "self_", "._", "ipa", "ram_", ",_", "self_", "._", "ip", "ntr", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "work", "d_", ",_", "self_", "._", "work", "l_", ",_", "self_", "._", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ier", "r_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Arp", "ack", "Error_", "(_", "ier", "r_", ",_", "info", "dict_", "=_", "self_", "._", "extract", "\\u", "info", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nre", "turn", "ed_", "=_", "self_", "._", "ipa", "ram_", "[_", "4_", "]_", "#", " ", "number", " ", "of", " ", "good", " ", "eigenvalues", " ", "returned_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "complex", " ", "eigenvalues", " ", "from", " ", "real", " ", "and", " ", "imagin", "ary", " ", "parts_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "dr_", "+_", "1.0", "j_", "*_", "di_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Arr", "ange", " ", "the", " ", "eigenvector", "s", ":", " ", "complex", " ", "eigenvector", "s", " ", "are", " ", "store", "d", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "real", ",", "imagin", "ary", " ", "in", " ", "consec", "uti", "ve", " ", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "z_", "=_", "zr", "_", "._", "astype_", "(_", "self_", "._", "tp_", "._", "upper_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "ARP", "AC", "K", " ", "nons", "ymm", "etric", " ", "real", " ", "and", " ", "double", " ", "interface", " ", "(", "s", ",", "d", ")", "na", "upd", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "eigenvalues", " ", "and", " ", "eigenvector", "s", " ", "in", " ", "real", " ", "(", "float", ",", "double", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "arrays", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Efficien", "cy", ":", " ", "this", " ", "shou", "ld", " ", "check", " ", "tha", "t", " ", "return", "\\u", "eigenvector", "s", " ", "==", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "bef", "ore", " ", "goi", "ng", " ", "through", " ", "this", " ", "constructi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sigma", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<=_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "complex_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "abs_", "(_", "d_", "[_", "i_", "]_", "._", "imag_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "a", " ", "complex", " ", "conjugate", " ", "pair", " ", "with", " ", "eigenvalues", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "consec", "uti", "ve", " ", "columns_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "i_", "<_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "z_", "[_", ":_", ",_", "i_", "]_", "=_", "zr", "_", "[_", ":_", ",_", "i_", "]_", "+_", "1.0", "j_", "*_", "zr", "_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", "=_", "z_", "[_", ":_", ",_", "i_", "]_", "._", "conjugate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "last", " ", "eigen", "value", " ", "is", " ", "complex", ":", " ", "the", " ", "imagin", "ary", " ", "part", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "eigenvector", " ", "has", " ", "not", " ", "bee", "n", " ", "returned_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "can", " ", "only", " ", "happ", "en", " ", "if", " ", "nre", "turn", "ed", " ", ">", " ", "k", ",", " ", "so", " ", "we", "'", "ll_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "throw", " ", "out", " ", "this", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "nre", "turn", "ed_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "real", " ", "matrix", ",", " ", "mode", " ", "3", " ", "or", " ", "4", ",", " ", "imag", "(", "sigma", ")", " ", "is", " ", "nonzero", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "see", " ", "remark", " ", "3", " ", "in", " ", "<", "s", ",", "d", ">", "neu", "pd", ".", "f_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "complex", " ", "eigenvalues", " ", "from", " ", "real", " ", "and", " ", "imagin", "ary", " ", "parts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "i_", "<=_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "abs_", "(_", "d_", "[_", "i_", "]_", "._", "imag_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "[_", "i_", "]_", "=_", "np_", "._", "dot_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "]_", ",_", "self_", "._", "mat", "vec_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "]_", ")_", ")_", "\\u\\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_", "i_", "<_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "z_", "[_", ":_", ",_", "i_", "]_", "=_", "zr", "_", "[_", ":_", ",_", "i_", "]_", "+_", "1.0", "j_", "*_", "zr", "_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", "=_", "z_", "[_", ":_", ",_", "i_", "]_", "._", "conjugate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "i_", "]_", "=_", "(_", "(_", "np_", "._", "dot_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mat", "vec_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "]_", ")_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "dot_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mat", "vec_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", ")_", ")_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "1j_", "*_", "(_", "np_", "._", "dot_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mat", "vec_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", ")_", ")_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "dot_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "+_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "mat", "vec_", "(_", "zr", "_", "[_", ":_", ",_", "i_", "]_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "[_", "i_", "+_", "1_", "]_", "=_", "d_", "[_", "i_", "]_", "._", "conj_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "last", " ", "eigen", "value", " ", "is", " ", "complex", ":", " ", "the", " ", "imagin", "ary", " ", "part", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "eigenvector", " ", "has", " ", "not", " ", "bee", "n", " ", "returned_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "can", " ", "only", " ", "happ", "en", " ", "if", " ", "nre", "turn", "ed", " ", ">", " ", "k", ",", " ", "so", " ", "we", "'", "ll_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "throw", " ", "out", " ", "this", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "nre", "turn", "ed_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "have", " ", "k", "+", "1", " ", "possib", "le", " ", "eigenvalues", " ", "and", " ", "eigenvector", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", " ", "the", " ", "ones", " ", "specified", " ", "by", " ", "the", " ", "keyw", "ord", " ", "\"", "whi", "ch", "\"_", "\\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_", "nre", "turn", "ed_", "<=_", "k_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "got", " ", "less", " ", "or", " ", "equal", " ", "as", " ", "many", " ", "eigenvalues", " ", "we", " ", "wanted_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "d_", "[_", ":_", "nre", "turn", "ed_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "z_", "[_", ":_", ",_", ":_", "nre", "turn", "ed_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "got", " ", "one", " ", "extra", " ", "eigen", "value", " ", "(", "like", "ly", " ", "a", " ", "cc", " ", "pair", ",", " ", "but", " ", "whi", "ch", "?)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cut", " ", "at", " ", "approx", " ", "preci", "sion", " ", "for", " ", "sorting", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rd_", "=_", "np_", "._", "round_", "(_", "d_", ",_", "decimals_", "=_", "\\u", "ndi", "git", "s_", "[_", "self_", "._", "tp_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "which_", "in_", "[_", "'", "LR", "'_", ",_", "'", "SR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ind_", "=_", "np_", "._", "argsort_", "(_", "rd_", "._", "real_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "which_", "in_", "[_", "'", "LI", "'_", ",_", "'", "SI", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "LI", ",", "SI", " ", "ARP", "AC", "K", " ", "return", "s", " ", "large", "st", ",", "smallest", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abs", "(", "imagin", "ary", ")", " ", "wh", "y", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ind_", "=_", "np_", "._", "argsort_", "(_", "abs_", "(_", "rd_", "._", "imag_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ind_", "=_", "np_", "._", "argsort_", "(_", "abs_", "(_", "rd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "which_", "in_", "[_", "'", "LR", "'_", ",_", "'", "LM", "'_", ",_", "'", "LI", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d_", "=_", "d_", "[_", "ind_", "[_", "-_", "k_", ":_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "z_", "[_", ":_", ",_", "ind_", "[_", "-_", "k_", ":_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "which_", "in_", "[_", "'", "SR", "'_", ",_", "'", "SM", "'_", ",_", "'", "SI", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d_", "=_", "d_", "[_", "ind_", "[_", ":_", "k_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "z_", "[_", ":_", ",_", "ind_", "[_", ":_", "k_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "complex", " ", "is", " ", "so", " ", "muc", "h", " ", "simple", "r", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", ",_", "z_", ",_", "ier", "r_", "=_", "self_", "._", "\\u", "arp", "ack", "\\u", "extract_", "(_", "return", "\\u", "eigenvector", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "how", "mn", "y_", ",_", "sse", "lect", "_", ",_", "self_", "._", "sigma_", ",_", "work", "ev_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "bma", "t_", ",_", "self_", "._", "which_", ",_", "k_", ",_", "self_", "._", "tol_", ",_", "self_", "._", "resid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "v_", ",_", "self_", "._", "ipa", "ram_", ",_", "self_", "._", "ip", "ntr", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "work", "d_", ",_", "self_", "._", "work", "l_", ",_", "self_", "._", "rw", "ork", "_", ",_", "ier", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ier", "r_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Arp", "ack", "Error_", "(_", "ier", "r_", ",_", "info", "dict_", "=_", "self_", "._", "extract", "\\u", "info", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "k", "\\u", "ok_", "=_", "self_", "._", "ipa", "ram_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "d_", "[_", ":_", "k", "\\u", "ok_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "z_", "[_", ":_", ",_", ":_", "k", "\\u", "ok_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "return", "\\u", "eigenvector", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", ",_", "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 ", " _", "return_", "d_", "\\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, 0, 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 ]
Unused import
rvanlaar/easy-transifex/src/transifex/transifex/storage/widgets.py
[ { "content": "from django import forms\nfrom django.forms.util import flatatt\nfrom django.template.loader import render_to_string\nfrom django.utils.safestring import mark_safe\nfrom django.utils.translation import ugettext as _\n\nfrom transifex.languages.models import Language\nfrom transifex.storage.models import StorageFile\nfrom transifex.txcommon.log import logger\nfrom transifex.txcommon.utils import get_url_pattern\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class StorageFileWidget(forms.MultiWidget):\n \"\"\"\n Widgets for handling StorageFile objects creation/deletion. It can be\n used with normal Django forms. Everything happens through AJAX using the\n storage app API.\n \"\"\"\n\n", "metadata": "root.StorageFileWidget", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def __init__(self, *args, **kwargs):\n attrs = kwargs.pop('attrs', {})\n language = kwargs.pop('language', {})\n display_language = kwargs.pop('display_language', False)\n \n if not display_language:\n language_field=forms.HiddenInput(attrs=attrs)\n else:\n self.language_choices = kwargs.pop('language_choices', [])\n if not self.language_choices:\n queryset = Language.objects.all()\n self.language_choices = [(l.code, l) for l in queryset]\n self.language_choices.insert(0, (\"\", \"---------\"))\n\n language_field = forms.Select(attrs=attrs,\n choices=self.language_choices)\n\n widgets=(\n language_field,\n forms.HiddenInput(attrs=attrs)\n )\n super(StorageFileWidget, self).__init__(widgets, attrs)", "metadata": "root.StorageFileWidget.__init__", "header": "['class', 'StorageFileWidget', '(', 'forms', '.', 'MultiWidget', ')', ':', '___EOS___']", "index": 17 }, { "content": " def render(self, name, value, attrs):\n if hasattr(self, 'initial'):\n value = self.initial\n\n final_attrs = self.build_attrs(attrs)\n self.html_id = final_attrs.pop('id', name)\n\n if not isinstance(value, list):\n value = self.decompress(value)\n\n # Querying objects\n language, storagefile = None, None\n if value:\n try:\n language = Language.objects.by_code_or_alias(value[0])\n except Exception, e:\n pass\n try:\n storagefile = StorageFile.objects.get(id=int(value[1]))\n except Exception, e:\n pass\n\n # Fields in HTML\n rendered_fields = []\n rendered_fields.append(self.widgets[0].render(name + '_0',\n getattr(language, 'code', None), final_attrs))\n rendered_fields.append(self.widgets[1].render(name + '_1',\n getattr(storagefile, 'id', None), final_attrs))\n\n context = {\n 'name': name,\n 'names': [name + '_%s' %n for n, w in enumerate(self.widgets)],\n 'storagefile': storagefile,\n 'rendered_fields': rendered_fields,\n 'api_storagefile_url': get_url_pattern('api.storage.file'),\n }\n\n return mark_safe(\n render_to_string('storage/storagefilewidget.html', context)\n )", "metadata": "root.StorageFileWidget.render", "header": "['class', 'StorageFileWidget', '(', 'forms', '.', 'MultiWidget', ')', ':', '___EOS___']", "index": 40 }, { "content": " def decompress(self, value):\n if value:\n return value\n return ['','']", "metadata": "root.StorageFileWidget.decompress", "header": "['class', 'StorageFileWidget', '(', 'forms', '.', 'MultiWidget', ')', ':', '___EOS___']", "index": 81 } ]
[ { "span": "from django.forms.util import flatatt", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 37 }, { "span": "from transifex.txcommon.log import logger", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "import_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "forms_", "._", "util_", "import_", "flat", "att_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "loader_", "import_", "render", "\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "safe", "string_", "import_", "mark", "\\u", "safe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "ugettext_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "trans", "ife", "x_", "._", "languages_", "._", "models_", "import_", "Language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "trans", "ife", "x_", "._", "storage_", "._", "models_", "import_", "Stor", "age", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "trans", "ife", "x_", "._", "tx", "common_", "._", "log_", "import_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "trans", "ife", "x_", "._", "tx", "common_", "._", "utils_", "import_", "get", "\\u", "url", "\\u", "pattern_", "\\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_", "Stor", "age", "File", "Widget_", "(_", "forms_", "._", "Multi", "Widget_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wid", "gets", " ", "for", " ", "handling", " ", "Stor", "age", "File", " ", "object", "s", " ", "creati", "on", "/", "deletion", ".", " ", "It", " ", "can", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "used", " ", "with", " ", "normal", " ", "Dj", "ang", "o", " ", "forms", ".", " ", "Every", "thing", " ", "happ", "ens", " ", "through", " ", "AJ", "AX", " ", "usi", "ng", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "storage", " ", "app", " ", "API", ".", "\\", "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_", "Stor", "age", "File", "Widget_", "(_", "forms_", "._", "Multi", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attrs_", "=_", "kwargs_", "._", "pop_", "(_", "'", "attr", "s", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "language_", "=_", "kwargs_", "._", "pop_", "(_", "'", "language", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "display", "\\u", "language_", "=_", "kwargs_", "._", "pop_", "(_", "'", "display", "\\u", "language", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "display", "\\u", "language_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "language", "\\u", "field_", "=_", "forms_", "._", "Hi", "dde", "n", "Input_", "(_", "attrs_", "=_", "attrs_", ")_", "\\u\\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_", "._", "language", "\\u", "choices_", "=_", "kwargs_", "._", "pop_", "(_", "'", "language", "\\u", "choice", "s", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "language", "\\u", "choices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "Language_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "language", "\\u", "choices_", "=_", "[_", "(_", "l_", "._", "code_", ",_", "l_", ")_", "for_", "l_", "in_", "queryset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "language", "\\u", "choices_", "._", "insert_", "(_", "0_", ",_", "(_", "\"\"_", ",_", "\"-------", "--\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "language", "\\u", "field_", "=_", "forms_", "._", "Select_", "(_", "attrs_", "=_", "attrs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "self_", "._", "language", "\\u", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "widgets_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "language", "\\u", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "forms_", "._", "Hi", "dde", "n", "Input_", "(_", "attrs_", "=_", "attrs_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Stor", "age", "File", "Widget_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "widgets_", ",_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stor", "age", "File", "Widget_", "(_", "forms_", "._", "Multi", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "'", "initial", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "initial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "attrs_", "=_", "self_", "._", "build", "\\u", "attrs_", "(_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "html", "\\u", "id_", "=_", "final", "\\u", "attrs_", "._", "pop_", "(_", "'", "id", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "value_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "decompress_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Query", "ing", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "language_", ",_", "storage", "file_", "=_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "language_", "=_", "Language_", "._", "objects_", "._", "by", "\\u", "code", "\\u", "or", "\\u", "alias_", "(_", "value_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "storage", "file_", "=_", "Stor", "age", "File_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "int_", "(_", "value_", "[_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Field", "s", " ", "in", " ", "HTML_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "render", "ed", "\\u", "fields_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render", "ed", "\\u", "fields_", "._", "append_", "(_", "self_", "._", "widgets_", "[_", "0_", "]_", "._", "render_", "(_", "name_", "+_", "'\\u", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "getattr_", "(_", "language_", ",_", "'", "code", "'_", ",_", "None_", ")_", ",_", "final", "\\u", "attrs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render", "ed", "\\u", "fields_", "._", "append_", "(_", "self_", "._", "widgets_", "[_", "1_", "]_", "._", "render_", "(_", "name_", "+_", "'\\u", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "getattr_", "(_", "storage", "file_", ",_", "'", "id", "'_", ",_", "None_", ")_", ",_", "final", "\\u", "attrs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "context_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "names", "'_", ":_", "[_", "name_", "+_", "'\\u", "%", "s", "'_", "%_", "n_", "for_", "n_", ",_", "w_", "in_", "enumerate_", "(_", "self_", "._", "widgets_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "storage", "file", "'_", ":_", "storage", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "render", "ed", "\\u", "fields", "'_", ":_", "render", "ed", "\\u", "fields_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "api", "\\u", "storage", "file", "\\u", "url", "'_", ":_", "get", "\\u", "url", "\\u", "pattern_", "(_", "'", "api", ".", "storage", ".", "file", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "mark", "\\u", "safe_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "render", "\\u", "to", "\\u", "string_", "(_", "'", "storage", "/", "storage", "file", "widget", ".", "html", "'_", ",_", "context_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stor", "age", "File", "Widget_", "(_", "forms_", "._", "Multi", "Widget_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decompress_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "''_", ",_", "''_", "]_" ]
[ 4, 4, 4, 4, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
datastax/cstar_perf/frontend/cstar_perf/frontend/server/controllers.py
[ { "content": "@app.route('/api/tests')\ndef get_tests():\n \"\"\"Retreive all completed tests\"\"\"\n\n completed_tests = db.get_completed_tests()\n\n # Apply filters\n try:\n param_from = request.args.get('date_from', None)\n param_to = request.args.get('date_to', None)\n date_from = datetime.fromtimestamp(float(param_from)) if param_from else None\n date_to = datetime.fromtimestamp(float(param_to)) if param_to else None\n except:\n return make_response(jsonify({'error':'Invalid date parameters.'}), 400)\n\n if date_from:\n completed_tests = [t for t in completed_tests if t['scheduled_date'] >= date_from]\n if date_to:\n completed_tests = [t for t in completed_tests if t['scheduled_date'] <= date_to]\n\n tests = map(lambda t: {\n 'test_id': t['test_id'],\n 'href': url_for('get_test', test_id=t['test_id'])\n }, completed_tests)\n\n response = json.dumps(obj=tests)\n return Response(response=response,\n status=200,\n mimetype= 'application/json')", "metadata": "root.get_tests", "header": "['module', '___EOS___']", "index": 380 } ]
[ { "span": "except:", "start_line": 392, "start_column": 4, "end_line": 392, "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_", "@_", "app_", "._", "route_", "(_", "'/", "api", "/", "tests", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Retr", "eive", " ", "all", " ", "complete", "d", " ", "tests", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "d\\u", "tests_", "=_", "db_", "._", "get", "\\u", "complete", "d\\u", "tests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "filters_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param", "\\u", "from_", "=_", "request_", "._", "args_", "._", "get_", "(_", "'", "date", "\\u", "from", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "\\u", "to_", "=_", "request_", "._", "args_", "._", "get_", "(_", "'", "date", "\\u", "to", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "from_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "float_", "(_", "param", "\\u", "from_", ")_", ")_", "if_", "param", "\\u", "from_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "to_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "float_", "(_", "param", "\\u", "to_", ")_", ")_", "if_", "param", "\\u", "to_", "else_", "None_", "\\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_", "make", "\\u", "response_", "(_", "jsonify_", "(_", "{_", "'", "error", "'_", ":_", "'", "Inva", "lid", " ", "date", " ", "parameter", "s", ".'_", "}_", ")_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "date", "\\u", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "complete", "d\\u", "tests_", "=_", "[_", "t_", "for_", "t_", "in_", "complete", "d\\u", "tests_", "if_", "t_", "[_", "'", "schedule", "d\\u", "date", "'_", "]_", ">=_", "date", "\\u", "from_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "date", "\\u", "to_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "complete", "d\\u", "tests_", "=_", "[_", "t_", "for_", "t_", "in_", "complete", "d\\u", "tests_", "if_", "t_", "[_", "'", "schedule", "d\\u", "date", "'_", "]_", "<=_", "date", "\\u", "to_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tests_", "=_", "map_", "(_", "lambda_", "t_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "test\\u", "id", "'_", ":_", "t_", "[_", "'", "test\\u", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "url", "\\u", "for_", "(_", "'", "get", "\\u", "test", "'_", ",_", "test\\u", "id_", "=_", "t_", "[_", "'", "test\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "complete", "d\\u", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "json_", "._", "dumps_", "(_", "obj_", "=_", "tests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Response_", "(_", "response_", "=_", "response_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "=_", "200_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mimetype_", "=_", "'", "applica", "tion", "/", "json", "'_", ")_", "\\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, 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 ]
Except block handles 'BaseException'
azoft-dev-team/imagrium/env/Demo/applet/deprecated/Converter.py
[ { "content": " def getValue(self):\n\ttry:\n\t return float(self.text.getText())\n\texcept:\n\t return 0.0", "metadata": "root.ConversionPanel.getValue", "header": "['class', 'ConversionPanel', '(', 'awt', '.', 'Panel', ',', 'SimpleBorder', ',', '___NL___', 'ActionListener', ',', 'AdjustmentListener', ',', 'ItemListener', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "except:", "start_line": 83, "start_column": 1, "end_line": 83, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Conversion", "Panel_", "(_", "aw", "t_", "._", "Panel_", ",_", "Simple", "Border", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Action", "Listener_", ",_", "Adjustment", "Listener_", ",_", "Item", "Listener_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Value_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", " _", "return_", "float_", "(_", "self_", "._", "text_", "._", "get", "Text_", "(_", ")_", ")_", "\\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\t", " _", "return_", "0.0_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Implicit string concatenation in a list
kuri65536/python-for-android/python-modules/twisted/twisted/application/app.py
[ { "content": "class ServerOptions(usage.Options, ReactorSelectionMixin):\n\n longdesc = (\"twistd reads a twisted.application.service.Application out \"\n \"of a file and runs it.\")\n\n optFlags = [['savestats', None,\n \"save the Stats object rather than the text output of \"\n \"the profiler.\"],\n ['no_save','o', \"do not save state on shutdown\"],\n ['encrypted', 'e',\n \"The specified tap/aos file is encrypted.\"]]\n\n optParameters = [['logfile','l', None,\n \"log to a specified file, - for stdout\"],\n ['profile', 'p', None,\n \"Run in profile mode, dumping results to specified file\"],\n ['profiler', None, \"hotshot\",\n \"Name of the profiler to use (%s).\" %\n \", \".join(AppProfiler.profilers)],\n ['file','f','twistd.tap',\n \"read the given .tap file\"],\n ['python','y', None,\n \"read an application from within a Python file \"\n \"(implies -o)\"],\n ['source', 's', None,\n \"Read an application from a .tas file (AOT format).\"],\n ['rundir','d','.',\n 'Change to a supplied directory before running'],\n ['report-profile', None, None,\n 'E-mail address to use when reporting dynamic execution '\n 'profiler stats. This should not be combined with '\n 'other profiling options. This will only take effect '\n 'if the application to be run has an application '\n 'name.']]\n\n #zsh_altArgDescr = {\"foo\":\"use this description for foo instead\"}\n #zsh_multiUse = [\"foo\", \"bar\"]\n zsh_mutuallyExclusive = [(\"file\", \"python\", \"source\")]\n zsh_actions = {\"file\":'_files -g \"*.tap\"',\n \"python\":'_files -g \"*.(tac|py)\"',\n \"source\":'_files -g \"*.tas\"',\n \"rundir\":\"_dirs\"}\n #zsh_actionDescr = {\"logfile\":\"log file name\", \"random\":\"random seed\"}\n\n\n opt_b = opt_debug\n\n\n\n\n\n\n\n\n subCommands = property(subCommands)", "metadata": "root.ServerOptions", "header": "['module', '___EOS___']", "index": 522 } ]
[ { "span": "\"save the Stats object rather than the text output of \"\n \"the profiler.\"]", "start_line": 528, "start_column": 17, "end_line": 529, "end_column": 32 }, { "span": "\"read an application from within a Python file \"\n \"(implies -o)\"]", "start_line": 544, "start_column": 22, "end_line": 545, "end_column": 36 }, { "span": "'E-mail address to use when reporting dynamic execution '\n 'profiler stats. This should not be combined with '\n 'other profiling options. This will only take effect '\n 'if the application to be run has an application '\n 'name.']", "start_line": 551, "start_column": 22, "end_line": 555, "end_column": 29 } ]
[]
1
true
[ "[CLS]_", "Implicit", "_", "string_", "concate", "nation_", "in_", "a_", "list_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Server", "Options_", "(_", "usage_", "._", "Options_", ",_", "Reactor", "Selecti", "on", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "long", "desc_", "=_", "(_", "\"", "twist", "d", " ", "reads", " ", "a", " ", "twist", "ed", ".", "applica", "tion", ".", "service", ".", "Applica", "tion", " ", "out", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "of", " ", "a", " ", "file", " ", "and", " ", "runs", " ", "it", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opt", "Flags_", "=_", "[_", "[_", "'", "save", "stats", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "save", " ", "the", " ", "Stat", "s", " ", "object", " ", "rat", "her", " ", "than", " ", "the", " ", "text", " ", "output", " ", "of", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", " ", "profiler", ".\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "no", "\\u", "save", "'_", ",_", "'", "o", "'_", ",_", "\"", "do", " ", "not", " ", "save", " ", "state", " ", "on", " ", "shut", "down", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "encrypt", "ed", "'_", ",_", "'", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "The", " ", "specified", " ", "tap", "/", "ao", "s", " ", "file", " ", "is", " ", "encrypt", "ed", ".\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opt", "Parameters_", "=_", "[_", "[_", "'", "logfile", "'_", ",_", "'", "l", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "log", " ", "to", " ", "a", " ", "specified", " ", "file", ",", " ", "-", " ", "for", " ", "stdout", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "profile", "'_", ",_", "'", "p", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Run", " ", "in", " ", "profile", " ", "mode", ",", " ", "dump", "ing", " ", "results", " ", "to", " ", "specified", " ", "file", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "profiler", "'_", ",_", "None_", ",_", "\"", "hots", "hot", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", " ", "of", " ", "the", " ", "profiler", " ", "to", " ", "use", " ", "(%", "s", ").\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "\",", " ", "\"_", "._", "join_", "(_", "App", "Profiler", "_", "._", "profiler", "s_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "file", "'_", ",_", "'", "f", "'_", ",_", "'", "twist", "d", ".", "tap", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "read", " ", "the", " ", "give", "n", " ", ".", "tap", " ", "file", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "python", "'_", ",_", "'", "y", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "read", " ", "an", " ", "applica", "tion", " ", "from", " ", "within", " ", "a", " ", "Pyth", "on", " ", "file", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "implies", " ", "-", "o", ")\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "source", "'_", ",_", "'", "s", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Read", " ", "an", " ", "applica", "tion", " ", "from", " ", "a", " ", ".", "tas", " ", "file", " ", "(", "AO", "T", " ", "format", ").\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "rund", "ir", "'_", ",_", "'", "d", "'_", ",_", "'.'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Change", " ", "to", " ", "a", " ", "supplie", "d", " ", "director", "y", " ", "bef", "ore", " ", "runn", "ing", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "report", "-", "profile", "'_", ",_", "None_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "E-", "mail", " ", "address", " ", "to", " ", "use", " ", "whe", "n", " ", "reporting", " ", "dynami", "c", " ", "executi", "on", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "profiler", " ", "stats", ".", " ", " ", "Thi", "s", " ", "shou", "ld", " ", "not", " ", "be", " ", "combin", "ed", " ", "with", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", " ", "profiling", " ", "options", ".", " ", " ", "Thi", "s", " ", "will", " ", "only", " ", "take", " ", "effect", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "if", " ", "the", " ", "applica", "tion", " ", "to", " ", "be", " ", "run", " ", "has", " ", "an", " ", "applica", "tion", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", ".'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "zs", "h", "\\u", "alt", "Arg", "Descr", " ", "=", " ", "{", "\"", "foo", "\":\"", "use", " ", "this", " ", "description", " ", "for", " ", "foo", " ", "inst", "ead", "\"}", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "zs", "h", "\\u", "multi", "Us", "e", " ", "=", " ", "[\"", "foo", "\",", " ", "\"", "bar", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "zs", "h", "\\u", "mutual", "ly", "Exclu", "sive", "_", "=_", "[_", "(_", "\"", "file", "\"_", ",_", "\"", "python", "\"_", ",_", "\"", "source", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zs", "h", "\\u", "actions_", "=_", "{_", "\"", "file", "\"_", ":_", "'\\u", "files", " ", "-", "g", " ", "\"*", ".", "tap", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "python", "\"_", ":_", "'\\u", "files", " ", "-", "g", " ", "\"*", ".(", "tac", "|", "py", ")\"", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "source", "\"_", ":_", "'\\u", "files", " ", "-", "g", " ", "\"*", ".", "tas", "\"'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "rund", "ir", "\"_", ":_", "\"\\u", "dirs", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "zs", "h", "\\u", "action", "Descr", " ", "=", " ", "{", "\"", "logfile", "\":\"", "log", " ", "file", " ", "name", "\",", " ", "\"", "random", "\":\"", "random", " ", "seed", "\"}", "_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "opt", "\\u", "b_", "=_", "opt", "\\u", "debug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sub", "Commands_", "=_", "property_", "(_", "sub", "Commands_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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\nimport shutil\nimport os\n\nfrom flask import Flask\nfrom flask.ext.testing import LiveServerTestCase\n\nfrom lwp.app import app\nfrom lwp.utils import connect_db\n\n\n#class TestWebBrowser(unittest.TestCase):\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestWebBrowser(LiveServerTestCase):\n \"\"\"\n These tests are made using a stateful programmatic web browsing\n and use the cookie and standard login form to operate on the lwp.\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestWebBrowser", "header": "['module', '___EOS___']", "index": 15 }, { "content": " @classmethod\n def setUpClass(cls):\n # cleanup\n shutil.copyfile('lwp.db.base', '/tmp/db.sql')\n shutil.rmtree('/tmp/lxc', ignore_errors=True)\n cj = cookielib.LWPCookieJar()\n cls.br = mechanize.Browser()\n cls.br.set_cookiejar(cj)", "metadata": "root.TestWebBrowser.setUpClass", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 21 }, { "content": " def create_app(self):\n app.config['DATABASE'] = '/tmp/db.sql'\n return app", "metadata": "root.TestWebBrowser.create_app", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 30 }, { "content": " def test_00_login(self):\n \"\"\"\n login with the standard admin/admin\n \"\"\"\n self.client = app.test_client()\n self.client.post('/login', data={'username': 'admin', 'password': 'admin'}, follow_redirects=True)\n\n self.br.open(self.get_server_url() + \"/login\")\n resp = self.br.response()\n assert self.br.viewing_html()\n\n # select login form and fill it\n self.br.select_form(name=\"form-signin\")\n self.br['username'] = \"admin\"\n self.br['password'] = \"admin\"\n resp = self.br.submit()\n\n assert '/home' in resp.geturl()", "metadata": "root.TestWebBrowser.test_00_login", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 34 }, { "content": " def test_01_home_render(self):\n \"\"\"\n we are now logged in, create a container and check that\n it is displayed in home page, the stopped badge is displayed\n \"\"\"\n subprocess.check_output('lxc-create -n mocktest_00_lxc', shell=True)\n\n self.br.open(self.get_server_url() + \"/home\")\n resp = self.br.response().read()\n assert self.br.viewing_html()\n\n assert 'mocktest_00_lxc' in resp\n assert 'Stopped' in resp", "metadata": "root.TestWebBrowser.test_01_home_render", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 53 }, { "content": " def test_02_start_container(self):\n \"\"\"\n the container exists, start it using /action and check badge on home\n \"\"\"\n self.br.open(self.get_server_url() + \"/action?action=start&name=mocktest_00_lxc\")\n\n self.br.open(self.get_server_url() + \"/home\")\n resp = self.br.response().read()\n assert self.br.viewing_html()\n\n assert 'mocktest_00_lxc' in resp\n assert 'Running' in resp", "metadata": "root.TestWebBrowser.test_02_start_container", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 67 }, { "content": " def test_03_freeze_container(self):\n \"\"\"\n freeze the container using /action and check badge on home\n \"\"\"\n self.br.open(self.get_server_url() + \"/action?action=freeze&name=mocktest_00_lxc\")\n\n self.br.open(self.get_server_url() + \"/home\")\n resp = self.br.response().read()\n assert self.br.viewing_html()\n\n assert 'mocktest_00_lxc' in resp\n assert 'Frozen' in resp", "metadata": "root.TestWebBrowser.test_03_freeze_container", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 80 }, { "content": " def test_04_unfreeze_container(self):\n \"\"\"\n unfreeze container using /action and check badge on home\n \"\"\"\n self.br.open(self.get_server_url() + \"/action?action=unfreeze&name=mocktest_00_lxc\")\n\n self.br.open(self.get_server_url() + \"/home\")\n resp = self.br.response().read()\n assert self.br.viewing_html()\n\n assert 'mocktest_00_lxc' in resp\n assert 'Running' in resp", "metadata": "root.TestWebBrowser.test_04_unfreeze_container", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 93 }, { "content": " def test_05_stop_container(self):\n \"\"\"\n try to stop it\n \"\"\"\n self.br.open(self.get_server_url() + \"/action?action=stop&name=mocktest_00_lxc\")\n\n self.br.open(self.get_server_url() + \"/home\")\n resp = self.br.response().read()\n assert self.br.viewing_html()\n\n assert 'mocktest_00_lxc' in resp\n assert 'Stopped' in resp", "metadata": "root.TestWebBrowser.test_05_stop_container", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 106 }, { "content": " def test_06_refresh_info(self):\n \"\"\"\n the _refresh_info should return json object with host info\n \"\"\"\n self.br.open(self.get_server_url() + '/_refresh_info')\n\n j_data = self.br.response().read()\n assert 'cpu' in j_data\n assert 'disk' in j_data\n assert 'uptime' in j_data", "metadata": "root.TestWebBrowser.test_06_refresh_info", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 119 }, { "content": " def test_07_create_container(self):\n \"\"\"\n try to create \"test_created_container\"\n \"\"\"\n self.br.open(self.get_server_url() + \"/home\")\n\n # select create-container form and fill it\n self.br.select_form(name=\"create_container\")\n self.br['name'] = \"test_created_container\"\n resp = self.br.submit()\n\n assert '/home' in resp.geturl()\n assert 'mocktest_00_lxc' in resp.read()", "metadata": "root.TestWebBrowser.test_07_create_container", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 130 }, { "content": " def test_08_create_token(self):\n \"\"\"\n try to create \"test_created_container\"\n \"\"\"\n self.br.open(self.get_server_url() + \"/lwp/tokens\")\n\n # select create-container form and fill it\n self.br.select_form(name=\"lwp_token\")\n self.br['token'] = \"mechanize_token\"\n self.br['description'] = \"my_token_desc\"\n resp = self.br.submit()\n body = resp.read()\n\n assert '/lwp/tokens' in resp.geturl()\n assert 'mechanize_token' in body\n assert 'my_token_desc' in body", "metadata": "root.TestWebBrowser.test_08_create_token", "header": "['class', 'TestWebBrowser', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 144 } ]
[ { "span": "import os", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 9 }, { "span": "from flask import Flask", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 23 }, { "span": "from lwp.utils import connect_db", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mechani", "ze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cookie", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flask_", "import_", "Flask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "._", "ext_", "._", "testing_", "import_", "Live", "Server", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lw", "p_", "._", "app_", "import_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lw", "p_", "._", "utils_", "import_", "connect", "\\u", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "class", " ", "Test", "Web", "Brows", "er", "(", "unittest", ".", "Test", "Case", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", "se", " ", "tests", " ", "are", " ", "made", " ", "usi", "ng", " ", "a", " ", "stateful", " ", "program", "mati", "c", " ", "web", " ", "brow", "sing", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "use", " ", "the", " ", "cookie", " ", "and", " ", "standard", " ", "login", " ", "form", " ", "to", " ", "operate", " ", "on", " ", "the", " ", "lw", "p", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set", "Up", "Class_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "cleanup_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shutil_", "._", "copyfile_", "(_", "'", "lw", "p", ".", "db", ".", "base", "'_", ",_", "'/", "tmp", "/", "db", ".", "sql", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "'/", "tmp", "/", "lxc", "'_", ",_", "ignore", "\\u", "errors_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cj_", "=_", "cookie", "lib_", "._", "LW", "PC", "ook", "ie", "Jar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "br_", "=_", "mechani", "ze_", "._", "Browser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "br_", "._", "set\\u", "cookie", "jar_", "(_", "cj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "app_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "._", "config_", "[_", "'", "DATA", "BASE", "'_", "]_", "=_", "'/", "tmp", "/", "db", ".", "sql", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "00", "\\u", "login_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "login", " ", "with", " ", "the", " ", "standard", " ", "admin", "/", "admin", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "app_", "._", "test\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "'/", "login", "'_", ",_", "data_", "=_", "{_", "'", "user", "name", "'_", ":_", "'", "admin", "'_", ",_", "'", "password", "'_", ":_", "'", "admin", "'_", "}_", ",_", "follow", "\\u", "redirects_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "login", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "br_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", " ", "login", " ", "form", " ", "and", " ", "fill", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "select", "\\u", "form_", "(_", "name_", "=_", "\"", "form", "-", "signin", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "[_", "'", "user", "name", "'_", "]_", "=_", "\"", "admin", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "[_", "'", "password", "'_", "]_", "=_", "\"", "admin", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "submit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'/", "home", "'_", "in_", "resp_", "._", "geturl", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "01", "\\u", "home", "\\u", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "we", " ", "are", " ", "now", " ", "logged", " ", "in", ",", " ", "create", " ", "a", " ", "container", " ", "and", " ", "check", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "is", " ", "displaye", "d", " ", "in", " ", "home", " ", "page", ",", " ", "the", " ", "stopp", "ed", " ", "badge", " ", "is", " ", "displaye", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "output_", "(_", "'", "lxc", "-", "create", " ", "-", "n", " ", "mock", "test\\u", "00", "\\u", "lxc", "'_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "home", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "br_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "mock", "test\\u", "00", "\\u", "lxc", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Stopp", "ed", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "02", "\\u", "start", "\\u", "container_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "container", " ", "exist", "s", ",", " ", "start", " ", "it", " ", "usi", "ng", " ", "/", "action", " ", "and", " ", "check", " ", "badge", " ", "on", " ", "home", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "action", "?", "action", "=", "start", "&", "name", "=", "mock", "test\\u", "00", "\\u", "lxc", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "home", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "br_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "mock", "test\\u", "00", "\\u", "lxc", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Run", "ning", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "03", "\\u", "freez", "e\\u", "container_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "freez", "e", " ", "the", " ", "container", " ", "usi", "ng", " ", "/", "action", " ", "and", " ", "check", " ", "badge", " ", "on", " ", "home", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "action", "?", "action", "=", "freez", "e", "&", "name", "=", "mock", "test\\u", "00", "\\u", "lxc", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "home", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "br_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "mock", "test\\u", "00", "\\u", "lxc", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Fro", "zen", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "04", "\\u", "unf", "ree", "ze", "\\u", "container_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "unf", "ree", "ze", " ", "container", " ", "usi", "ng", " ", "/", "action", " ", "and", " ", "check", " ", "badge", " ", "on", " ", "home", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "action", "?", "action", "=", "unf", "ree", "ze", "&", "name", "=", "mock", "test\\u", "00", "\\u", "lxc", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "home", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "br_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "mock", "test\\u", "00", "\\u", "lxc", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Run", "ning", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "05", "\\u", "stop", "\\u", "container_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "try", " ", "to", " ", "stop", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "action", "?", "action", "=", "stop", "&", "name", "=", "mock", "test\\u", "00", "\\u", "lxc", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "home", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "br_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'", "mock", "test\\u", "00", "\\u", "lxc", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "Stopp", "ed", "'_", "in_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "0", "6", "\\u", "refre", "sh", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "\\u", "refre", "sh", "\\u", "info", " ", "shou", "ld", " ", "return", " ", "json", " ", "object", " ", "with", " ", "host", " ", "info", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "'/\\", "ure", "fresh", "\\u", "info", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "j", "\\u", "data_", "=_", "self_", "._", "br_", "._", "response_", "(_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "cpu", "'_", "in_", "j", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "disk", "'_", "in_", "j", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "upti", "me", "'_", "in_", "j", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "0", "7", "\\u", "create", "\\u", "container_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "try", " ", "to", " ", "create", " ", "\"", "test\\u", "created", "\\u", "container", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "home", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", " ", "create", "-", "container", " ", "form", " ", "and", " ", "fill", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "select", "\\u", "form_", "(_", "name_", "=_", "\"", "create", "\\u", "container", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "[_", "'", "name", "'_", "]_", "=_", "\"", "test\\u", "created", "\\u", "container", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "submit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'/", "home", "'_", "in_", "resp_", "._", "geturl", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "mock", "test\\u", "00", "\\u", "lxc", "'_", "in_", "resp_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Web", "Browser_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "0", "8", "\\u", "create", "\\u", "token_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "try", " ", "to", " ", "create", " ", "\"", "test\\u", "created", "\\u", "container", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "._", "open_", "(_", "self_", "._", "get", "\\u", "server", "\\u", "url_", "(_", ")_", "+_", "\"/", "lw", "p", "/", "token", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", " ", "create", "-", "container", " ", "form", " ", "and", " ", "fill", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "br_", "._", "select", "\\u", "form_", "(_", "name_", "=_", "\"", "lw", "p", "\\u", "token", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "[_", "'", "token", "'_", "]_", "=_", "\"", "mechani", "ze", "\\u", "token", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "br_", "[_", "'", "description", "'_", "]_", "=_", "\"", "my", "\\u", "token", "\\u", "desc", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "br_", "._", "submit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "resp_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "'/", "lw", "p", "/", "token", "s", "'_", "in_", "resp_", "._", "geturl", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "mechani", "ze", "\\u", "token", "'_", "in_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "'", "my", "\\u", "token", "\\u", "desc", "'_", "in_", "body_", "\\u\\u\\uNEWLINE\\u\\u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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Comparison of constants
flags/Reactor-3/numbers.py
[ { "content": "def calculate_dijkstra_map(dijkstra):\n\t_map = dijkstra['map']\n\t_min_x = dijkstra['x_range'][0]\n\t_max_x = dijkstra['x_range'][1]\n\t_min_y = dijkstra['y_range'][0]\n\t_max_y = dijkstra['y_range'][1]\n\t_target_positions = [tuple(target['position']) for target in dijkstra['targets']]\n\t\n\t_i = 0\n\twhile 1==1:\n\t\t_i += 1\n\t\t_orig_map = _map.copy()\n\t\t\n\t\tfor _x in range(_min_x,_max_x):\n\t\t\tfor _y in range(_min_y,_max_y):\n\t\t\t\tif (_x,_y) in _target_positions or _orig_map[_y-_min_y,_x-_min_x] == -1:\n\t\t\t\t\t\n\t\t\t\t\tcontinue\n\t\t\t\t\n\t\t\t\t_lowest_score = 9000\n\t\t\t\t\n\t\t\t\tfor x1 in range(-1,2):\n\t\t\t\t\tx = _x+x1\n\t\t\t\t\t\n\t\t\t\t\tif 0>x or x>=_max_x:\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t\n\t\t\t\t\tfor y1 in range(-1,2):\n\t\t\t\t\t\t#if (x1,y1) in [(-1,-1),(1,-1),(-1,1),(1,1)]:\n\t\t\t\t\t\t#\tcontinue\n\t\t\t\t\t\t\n\t\t\t\t\t\ty = _y+y1\n\t\t\t\t\t\t\n\t\t\t\t\t\tif 0>y or y>=_max_y or (x1,y1) == (0,0) or _orig_map[y-_min_y,x-_min_x] == -1:\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\n\t\t\t\t\t\tif _orig_map[y-_min_y,x-_min_x] < _lowest_score:\n\t\t\t\t\t\t\t_lowest_score = _orig_map[y-_min_y,x-_min_x]\n\t\t\t\t\n\t\t\t\tif _lowest_score>=0:\n\t\t\t\t\tif _orig_map[_y-_min_y,_x-_min_x]-_lowest_score>=2:\n\t\t\t\t\t\t_map[_y-_min_y,_x-_min_x] = _lowest_score+1\n\t\t\n\t\tif numpy.array_equal(_map,_orig_map):\n\t\t\tbreak", "metadata": "root.calculate_dijkstra_map", "header": "['module', '___EOS___']", "index": 66 } ]
[ { "span": "1==1:", "start_line": 75, "start_column": 7, "end_line": 75, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "constants_", "[SEP]_", "module_", "\\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_", "calcul", "ate", "\\u", "dij", "kst", "ra", "\\u", "map_", "(_", "dij", "kst", "ra_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "map_", "=_", "dij", "kst", "ra_", "[_", "'", "map", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "min", "\\u", "x_", "=_", "dij", "kst", "ra_", "[_", "'", "x", "\\u", "range", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "max", "\\u", "x_", "=_", "dij", "kst", "ra_", "[_", "'", "x", "\\u", "range", "'_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "min", "\\u", "y_", "=_", "dij", "kst", "ra_", "[_", "'", "y", "\\u", "range", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "max", "\\u", "y_", "=_", "dij", "kst", "ra_", "[_", "'", "y", "\\u", "range", "'_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "target", "\\u", "positions_", "=_", "[_", "tuple_", "(_", "target_", "[_", "'", "position", "'_", "]_", ")_", "for_", "target_", "in_", "dij", "kst", "ra_", "[_", "'", "target", "s", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "orig", "\\u", "map_", "=_", "\\u", "map_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "\\u", "x_", "in_", "range_", "(_", "\\u", "min", "\\u", "x_", ",_", "\\u", "max", "\\u", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "\\u", "y_", "in_", "range_", "(_", "\\u", "min", "\\u", "y_", ",_", "\\u", "max", "\\u", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "(_", "\\u", "x_", ",_", "\\u", "y_", ")_", "in_", "\\u", "target", "\\u", "positions_", "or_", "\\u", "orig", "\\u", "map_", "[_", "\\u", "y_", "-_", "\\u", "min", "\\u", "y_", ",_", "\\u", "x_", "-_", "\\u", "min", "\\u", "x_", "]_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "lowe", "st", "\\u", "score_", "=_", "9000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "x1_", "in_", "range_", "(_", "-_", "1_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "x_", "=_", "\\u", "x_", "+_", "x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "0_", ">_", "x_", "or_", "x_", ">=_", "\\u", "max", "\\u", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y1_", "in_", "range_", "(_", "-_", "1_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "(", "x1", ",", "y1", ")", " ", "in", " ", "[(", "-1", ",-", "1", "),", "(", "1", ",-", "1", "),", "(-", "1", ",", "1", "),", "(", "1", ",", "1", ")]", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "y_", "=_", "\\u", "y_", "+_", "y1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "0_", ">_", "y_", "or_", "y_", ">=_", "\\u", "max", "\\u", "y_", "or_", "(_", "x1_", ",_", "y1_", ")_", "==_", "(_", "0_", ",_", "0_", ")_", "or_", "\\u", "orig", "\\u", "map_", "[_", "y_", "-_", "\\u", "min", "\\u", "y_", ",_", "x_", "-_", "\\u", "min", "\\u", "x_", "]_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "orig", "\\u", "map_", "[_", "y_", "-_", "\\u", "min", "\\u", "y_", ",_", "x_", "-_", "\\u", "min", "\\u", "x_", "]_", "<_", "\\u", "lowe", "st", "\\u", "score_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t\t_", "\\u", "lowe", "st", "\\u", "score_", "=_", "\\u", "orig", "\\u", "map_", "[_", "y_", "-_", "\\u", "min", "\\u", "y_", ",_", "x_", "-_", "\\u", "min", "\\u", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "lowe", "st", "\\u", "score_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "if_", "\\u", "orig", "\\u", "map_", "[_", "\\u", "y_", "-_", "\\u", "min", "\\u", "y_", ",_", "\\u", "x_", "-_", "\\u", "min", "\\u", "x_", "]_", "-_", "\\u", "lowe", "st", "\\u", "score_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "\\u", "map_", "[_", "\\u", "y_", "-_", "\\u", "min", "\\u", "y_", ",_", "\\u", "x_", "-_", "\\u", "min", "\\u", "x_", "]_", "=_", "\\u", "lowe", "st", "\\u", "score_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "numpy_", "._", "array", "\\u", "equal_", "(_", "\\u", "map_", ",_", "\\u", "orig", "\\u", "map_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "break_", "\\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,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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 ]
Unused local variable
OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/drivers/test/test_opt_golinski.py
[ { "content": " def test_opt1(self):\n # Golinski optimization using CONMIN\n\n self.top.driver.add_objective('comp.result')\n #\n # maximize x[0] value\n iter = 1\n self.top.driver.add_parameter('comp.x[1]',.7,.8)\n self.top.driver.add_parameter('comp.x[2]',17.,28.)\n self.top.driver.add_parameter('comp.x[3]',7.3,8.3)\n self.top.driver.add_parameter('comp.x[4]',7.3,8.3)\n # 25 CONSTRAINTS defined in the problem\n # reduced to 1 constraint\n self.top.driver.add_constraint('40.0/(comp.x[2] * comp.x[3]) > 1.0')\n while iter < 4:\n # print 'iter ',iter\n g00 = self.top.comp.x[0]\n g11 = self.top.comp.x[1]\n g12 = self.top.comp.x[2]\n g13 = self.top.comp.x[3]\n g14 = self.top.comp.x[4]\n g15 = self.top.comp.x[5]\n g16 = self.top.comp.x[6]\n # print 'starting initial design variables ****** x0 to x6'\n # print g00, g11, g12, g13, g14, g15, g16\n self.top.comp.set('x[0]', self.getx0(g11, g12))\n self.top.comp.set('x[5]', self.getx5(g11, g12, g13))\n self.top.comp.set('x[6]', self.getx6(g11, g12, g14))\n # print ' *********************************'\n # print ' *********************************'\n # pylint: disable-msg=C0301\n\n # print ' before run values ..x0 - x6...'\n # print 'x0 = ', self.top.comp.x[0]\n # print 'x1 = ', self.top.comp.x[1]\n # print 'x2 = ', self.top.comp.x[2]\n # print 'x3 = ', self.top.comp.x[3]\n # print 'x4 = ', self.top.comp.x[4]\n # print 'x5 = ', self.top.comp.x[5]\n # print 'x6 = ', self.top.comp.x[6]\n self.top.run()\n # print 'New values after CONMIN optimization **********'\n # print 'x0 = ', self.top.comp.x[0]\n # print 'x1 = ', self.top.comp.x[1]\n # print 'x2 = ', self.top.comp.x[2]\n # print 'x3 = ', self.top.comp.x[3]\n # print 'x4 = ', self.top.comp.x[4]\n # print 'x5 = ', self.top.comp.x[5]\n # print 'x6 = ', self.top.comp.x[6]\n\n # print ' *********************************'\n # print ' *********************************'\n # print 'Obj FUNCTION Val = ', self.top.comp.result\n iter = iter +1\n\n #print 'Obj FUNCTION Val = ', self.top.comp.result\n # pylint: disable-msg=E1101\n assert_rel_error(self, self.top.comp.opt_objective, \\\n self.top.driver.eval_objective(), 0.01)\n assert_rel_error(self, self.top.comp.opt_design_vars[1], \\\n self.top.comp.x[1], 0.1)\n assert_rel_error(self, self.top.comp.opt_design_vars[2], \\\n self.top.comp.x[2], 0.01)\n assert_rel_error(self, self.top.comp.opt_design_vars[3], \\\n self.top.comp.x[3], 0.01)\n assert_rel_error(self, self.top.comp.opt_design_vars[4], \\\n self.top.comp.x[4], 0.05)", "metadata": "root.GolinskiTestCase.test_opt1", "header": "['class', 'GolinskiTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 194 } ]
[ { "span": "g00 ", "start_line": 210, "start_column": 12, "end_line": 210, "end_column": 15 }, { "span": "g15 ", "start_line": 215, "start_column": 12, "end_line": 215, "end_column": 15 }, { "span": "g16 ", "start_line": 216, "start_column": 12, "end_line": 216, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Gol", "ins", "ki", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "opt", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Gol", "ins", "ki", " ", "optimization", " ", "usi", "ng", " ", "CON", "MIN_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "comp", ".", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "maximize", " ", "x", "[", "0", "]", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "iter_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "1", "]'_", ",_", ".7_", ",_", ".8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "2", "]'_", ",_", "17.", "_", ",_", "28.", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "3", "]'_", ",_", "7.3", "_", ",_", "8.3", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "[", "4", "]'_", ",_", "7.3", "_", ",_", "8.3", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "25", " ", "CONSTR", "AIN", "TS", " ", " ", "defin", "ed", " ", "in", " ", "the", " ", "problem_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "reduce", "d", " ", "to", " ", "1", " ", "constraint_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "40.0", "/(", "comp", ".", "x", "[", "2", "]", " ", "*", " ", "comp", ".", "x", "[", "3", "])", " ", ">", " ", "1.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "iter_", "<_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", " ", "'", "iter", " ", "',", "iter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g0", "0_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "1_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "2_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "3_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "4_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "5_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1", "6_", "=_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", "startin", "g", " ", "initial", " ", "design", " ", "variab", "les", " ", "*****", "*", " ", "x0", " ", "to", " ", "x6", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", " ", "g0", "0", ",", " ", "g1", "1", ",", " ", "g1", "2", ",", " ", "g1", "3", ",", " ", "g1", "4", ",", " ", "g1", "5", ",", " ", "g1", "6_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "comp_", "._", "set_", "(_", "'", "x", "[", "0", "]'_", ",_", "self_", "._", "get", "x0_", "(_", "g1", "1_", ",_", "g1", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "comp_", "._", "set_", "(_", "'", "x", "[", "5", "]'_", ",_", "self_", "._", "get", "x5", "_", "(_", "g1", "1_", ",_", "g1", "2_", ",_", "g1", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "comp_", "._", "set_", "(_", "'", "x", "[", "6", "]'_", ",_", "self_", "._", "get", "x6", "_", "(_", "g1", "1_", ",_", "g1", "2_", ",_", "g1", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "C0", "301_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", " ", "'", " ", " ", "bef", "ore", " ", "run", " ", "values", " ", "..", "x0", " ", "-", " ", "x6", "...'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x0", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x1", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x2", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x3", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x4", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x5", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x6", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "6", "]_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", " ", "'", "New", " ", "values", " ", "after", " ", "CON", "MIN", " ", "optimization", " ", "********", "**'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x0", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x1", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x2", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x3", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x4", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x5", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "x6", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "x", "[", "6", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", "***********", "***********", "***********", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "Obj", " ", "FUNC", "TIO", "N", " ", "Val", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "result_", "\\u\\u\\uNL\\u\\u\\u_", "iter_", "=_", "iter_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "Obj", " ", "FUNC", "TIO", "N", " ", "Val", " ", "=", " ", "',", " ", "self", ".", "top", ".", "comp", ".", "result_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "-", "msg", "=", "E1", "101_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "objective_", ",_", "self_", "._", "top_", "._", "driver_", "._", "eval", "\\u", "objective_", "(_", ")_", ",_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "1_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "1_", "]_", ",_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "2_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "2_", "]_", ",_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "3_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "3_", "]_", ",_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "self_", "._", "top_", "._", "comp_", "._", "opt", "\\u", "design", "\\u", "vars_", "[_", "4_", "]_", ",_", "self_", "._", "top_", "._", "comp_", "._", "x_", "[_", "4_", "]_", ",_", "0.05_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Import of deprecated module
jdf/processing.py/testing/resources/test_md5.py
[ { "content": "import md5\n\nhex = md5.new(\"Nobody inspects the spammish repetition\").hexdigest()\nassert hex == 'bb649c83dd1ea5c9d9dec9a18df0ffe9'\nprint 'OK'\nexit()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "md5", "start_line": 0, "start_column": 7, "end_line": 0, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Import_", "of_", "deprecated_", "module_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "md5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hex_", "=_", "md5_", "._", "new_", "(_", "\"", "No", "body", " ", "inspect", "s", " ", "the", " ", "spam", "mis", "h", " ", "repetition", "\"_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "hex_", "==_", "'", "bb", "649", "c8", "3d", "d1", "ea", "5c", "9", "d", "9", "dec", "9", "a1", "8d", "f0", "ffe", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "OK", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 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 ]
Unreachable code
cloudera/hue/desktop/core/ext-py/python-ldap-2.3.13/Tests/slapd.py
[ { "content": " def start(self):\n \"\"\"\n Starts the slapd server process running, and waits for it to come up. \n \"\"\"\n if self._proc is None:\n ok = False\n config_path = None\n try:\n self.configure(self._config)\n self._test_configuration()\n self._start_slapd()\n self._wait_for_slapd()\n ok = True\n self._log.debug(\"slapd ready at %s\", self.get_url())\n self.started()\n finally:\n if not ok:\n if config_path:\n try: os.remove(config_path)\n except os.error: pass\n if self._proc:\n self.stop()", "metadata": "root.Slapd.start", "header": "['class', 'Slapd', ':', '___EOS___']", "index": 159 } ]
[ { "span": "try: ", "start_line": 177, "start_column": 24, "end_line": 177, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Sla", "pd_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Start", "s", " ", "the", " ", "sla", "pd", " ", "server", " ", "process", " ", "runn", "ing", ",", " ", "and", " ", "waits", " ", "for", " ", "it", " ", "to", " ", "come", " ", "up", ".", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "proc_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ok_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config", "\\u", "path_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "configure_", "(_", "self_", "._", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test\\u", "configuration_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "start", "\\u", "sla", "pd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "wait", "\\u", "for", "\\u", "sla", "pd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "log_", "._", "debug_", "(_", "\"", "sla", "pd", " ", "read", "y", " ", "at", " ", "%", "s", "\"_", ",_", "self_", "._", "get", "\\u", "url_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "started_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "ok_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "config", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "try_", ":_", "os_", "._", "remove_", "(_", "config", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "os_", "._", "error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "proc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "stop_", "(_", ")_", "\\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, 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 ]
Imprecise assert
mjhea0/flask-basic-registration/tests/test_config.py
[ { "content": " def test_app_is_testing(self):\n self.assertTrue(current_app.config['TESTING'])\n self.assertTrue(app.config['DEBUG'] is True)\n self.assertTrue(app.config['BCRYPT_LOG_ROUNDS'] == 1)\n self.assertTrue(app.config['WTF_CSRF_ENABLED'] is False)", "metadata": "root.TestTestingConfig.test_app_is_testing", "header": "['class', 'TestTestingConfig', '(', 'TestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_app_exists(self):\n self.assertFalse(current_app is None)", "metadata": "root.TestTestingConfig.test_app_exists", "header": "['class', 'TestTestingConfig', '(', 'TestCase', ')', ':', '___EOS___']", "index": 23 } ]
[ { "span": "self.assertTrue(app.config['DEBUG'] is True)", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 52 }, { "span": "self.assertTrue(app.config['BCRYPT_LOG_ROUNDS'] == 1)", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 61 }, { "span": "self.assertTrue(app.config['WTF_CSRF_ENABLED'] is False)", "start_line": 21, "start_column": 8, "end_line": 21, "end_column": 64 }, { "span": "self.assertFalse(current_app is None)", "start_line": 24, "start_column": 8, "end_line": 24, "end_column": 45 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Test", "ing", "Config_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "app", "\\u", "is", "\\u", "testing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "current", "\\u", "app_", "._", "config_", "[_", "'", "TESTING", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "DEBU", "G", "'_", "]_", "is_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "BC", "RY", "PT", "\\u", "LOG", "\\u", "ROUND", "S", "'_", "]_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "app_", "._", "config_", "[_", "'", "WT", "F", "\\u", "CSRF", "\\u", "ENABLE", "D", "'_", "]_", "is_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Test", "ing", "Config_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "app", "\\u", "exists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "current", "\\u", "app_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
neurodata/ndstore/examples/annodel.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 urllib2\nimport argparse\nimport numpy as np\nimport urllib2\nimport cStringIO\nimport sys\nimport tempfile\nimport h5py\n\n\nif __name__ == \"__main__\":\n main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main():\n\n parser = argparse.ArgumentParser(description='Fetch an annotation as an HDF5 file')\n parser.add_argument('baseurl', action=\"store\")\n parser.add_argument('token', action=\"store\")\n parser.add_argument('annids', action=\"store\", help='Comma separated list of annotation IDs to delete')\n\n result = parser.parse_args()\n\n # Get annotation in question\n try:\n import httplib\n conn = httplib.HTTPConnection ( \"%s\" % ( result.baseurl ))\n conn.request ( 'DELETE', '/ocpca/%s/%s/' % ( result.token, result.annids ))\n resp = conn.getresponse()\n content=resp.read()\n except httplib.HTTPException, e:\n print \"Error %s\" % (e) \n sys.exit(0)\n\n print \"Delete returns %s\" % content", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 23 } ]
[ { "span": "import urllib2", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 14 }, { "span": "import numpy as np", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 18 }, { "span": "import urllib2", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 14 }, { "span": "import cStringIO", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 16 }, { "span": "import tempfile", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 15 }, { "span": "import h5py", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "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_", "urllib2_", "\\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_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "h5py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "'", "Fe", "tch", " ", "an", " ", "annot", "ation", " ", "as", " ", "an", " ", "HDF", "5", " ", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "baseu", "rl", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "token", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "ann", "ids", "'_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "help_", "=_", "'", "Comm", "a", " ", "separate", "d", " ", "list", " ", "of", " ", "annot", "ation", " ", "ID", "s", " ", "to", " ", "delete", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "annot", "ation", " ", "in", " ", "question_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "httplib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "httplib_", "._", "HTTP", "Connection_", "(_", "\"%", "s", "\"_", "%_", "(_", "result_", "._", "baseurl_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "request_", "(_", "'", "DELET", "E", "'_", ",_", "'/", "oc", "pca", "/", "%", "s", "/", "%", "s", "/'_", "%_", "(_", "result_", "._", "token_", ",_", "result_", "._", "ann", "ids_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "conn_", "._", "getresponse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "resp_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "httplib_", "._", "HTTP", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Error", " ", "%", "s", "\"_", "%_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Delete", " ", "return", "s", " ", "%", "s", "\"_", "%_", "content_", "\\u\\u\\uNEWLINE\\u\\u\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
CountZer0/PipelineConstructionSet/python/moBu/site-packages/PyMoBu-0.2/pymobu/components/constraints.py
[ { "content": " def ImportMapping(self, filePath, addPrefix=None, haltOnError=True):\n '''\n Applies a character template to the character\n @param filePath: mapping file to import\n @param addPrefix: append a prefix onto the model names\n @param haltOnError: True/False if to raise an exception if a slot or model is not found, otherwise continue\n '''\n import cPickle as pickle\n \n with file(filePath) as pickleFile:\n dumpData = pickle.load(pickleFile)\n \n for slot, model in dumpData.iteritems():\n if model and addPrefix:\n model = addPrefix + model\n try:\n self.SetSlotModel(slot, model)\n except:\n if haltOnError:\n raise", "metadata": "root.PMBCharacter.ImportMapping", "header": "['class', 'PMBCharacter', '(', 'PMBConstraint', ')', ':', '___EOS___']", "index": 236 } ]
[ { "span": "except:", "start_line": 253, "start_column": 12, "end_line": 253, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "PM", "BC", "hara", "cte", "r_", "(_", "PM", "BC", "ons", "train", "t_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Import", "Mapping_", "(_", "self_", ",_", "file", "Path_", ",_", "add", "Prefix_", "=_", "None_", ",_", "halt", "On", "Error_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Appl", "ies", " ", "a", " ", "character", " ", "template", " ", "to", " ", "the", " ", "character", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "file", "Path", ":", " ", "mapping", " ", "file", " ", "to", " ", "import", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "add", "Pref", "ix", ":", " ", "append", " ", "a", " ", "prefix", " ", "onto", " ", "the", " ", "model", " ", "names", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "halt", "On", "Error", ":", " ", "Tru", "e", "/", "Fal", "se", " ", "if", " ", "to", " ", "raise", " ", "an", " ", "exception", " ", "if", " ", "a", " ", "slot", " ", "or", " ", "model", " ", "is", " ", "not", " ", "found", ",", " ", "other", "wis", "e", " ", "continue", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "as_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "file_", "(_", "file", "Path_", ")_", "as_", "pickle", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dump", "Data_", "=_", "pickle_", "._", "load_", "(_", "pickle", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "slot_", ",_", "model_", "in_", "dump", "Data_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model_", "and_", "add", "Prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "add", "Prefix_", "+_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Set", "Slot", "Model_", "(_", "slot_", ",_", "model_", ")_", "\\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 ", " _", "if_", "halt", "On", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
dgraziotin/dycapo/piston/utils.py
[ { "content": "def translate_mime(request):\n request = Mimer(request).translate()", "metadata": "root.translate_mime", "header": "['module', '___EOS___']", "index": 276 } ]
[ { "span": "request ", "start_line": 277, "start_column": 4, "end_line": 277, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "translat", "e\\u", "mime_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "Mim", "er_", "(_", "request_", ")_", "._", "translate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
sassoftware/conary/conary_test/localcstest.py
[ { "content": " def testIncomplete(self):\n raise testhelp.SkipTestException('Broken in hg rev 0efa49c1bcab')\n built, info = self.setup()\n OLD_TROVE_VERSION = trove.TROVE_VERSION\n OLD_TROVE_VERSION_1_1 = trove.TROVE_VERSION_1_1\n d = {}\n if use.Arch.x86:\n d = { 'flavor': 'is: x86' }\n elif use.Arch.x86_64:\n d = { 'flavor': 'is: x86_64' }\n else:\n raise NotImplementedError, 'edit test for this arch'\n try:\n trove.TROVE_VERSION = 1\n trove.TROVE_VERSION_1_1 = 2\n self.logFilter.add()\n try:\n path = self._testBasic1(built, info)\n except errors.ConaryError, err:\n assert(str(err) == '''\\\nCannot create a local changeset using an incomplete troves: Please ensure \nyou have the latest conary and then reinstall these troves:\n testcase=/localhost@rpl:linux/1.0-1-1[%(flavor)s]\n testcase:runtime=/localhost@rpl:linux/1.0-1-1[%(flavor)s]\n''' %d)\n else:\n assert(0)\n finally:\n trove.TROVE_VERSION = OLD_TROVE_VERSION\n trove.TROVE_VERSION_1_1 = OLD_TROVE_VERSION_1_1\n\n self.resetRoot()\n path = self._testBasic1(built, info)\n try:\n trove.TROVE_VERSION = 1\n trove.TROVE_VERSION_1_1 = 2\n self.resetRoot()\n self.updatePkg(self.rootDir, 'info-%(user)s' % info)\n self.updatePkg(self.rootDir, 'testcase')\n db = self.openDatabase()\n tups = db.findTroves(None, [('info-%(user)s' % info, None, None),\n ('testcase', None, None)])\n tups = list(itertools.chain(*tups.itervalues()))\n assert([ x for x in db.getTroves(tups) if not x.troveInfo.incomplete()] == [])\n try:\n self._testBasic2(path, info)\n except errors.ConaryError, err:\n assert(re.match(r'Cannot apply a relative changeset to an incomplete trove. Please upgrade conary and/or reinstall testcase:?.*=/localhost@rpl:linux/1.0-1-1\\[%(flavor)s\\].' %d, str(err)))\n else:\n assert(0)\n finally:\n trove.TROVE_VERSION = OLD_TROVE_VERSION\n trove.TROVE_VERSION_1_1 = OLD_TROVE_VERSION_1_1\n\n os.remove(path)", "metadata": "root.LocalCsTest.testIncomplete", "header": "['class', 'LocalCsTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 62 } ]
[ { "span": "built, info = self.setup()", "start_line": 64, "start_column": 8, "end_line": 64, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Local", "Cs", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Incomp", "lete", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "testh", "elp", "_", "._", "Ski", "p", "Test", "Exception_", "(_", "'", "Bro", "ken", " ", "in", " ", "hg", " ", "rev", " ", "0e", "fa", "4", "9c", "1b", "cab", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "built_", ",_", "info_", "=_", "self_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OLD", "\\u", "TRO", "VE", "\\u", "VERSION_", "=_", "trove_", "._", "TRO", "VE", "\\u", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OLD", "\\u", "TRO", "VE", "\\u", "VERSI", "ON", "\\u", "1", "\\u", "1_", "=_", "trove_", "._", "TRO", "VE", "\\u", "VERSI", "ON", "\\u", "1", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "use_", "._", "Arch", "_", "._", "x8", "6_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "{_", "'", "flavor", "'_", ":_", "'", "is", ":", " ", "x8", "6", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "use_", "._", "Arch", "_", "._", "x8", "6", "\\u", "64_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "{_", "'", "flavor", "'_", ":_", "'", "is", ":", " ", "x8", "6", "\\u", "64", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", ",_", "'", "edit", " ", "test", " ", "for", " ", "this", " ", "arch", "'_", "\\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 ", " _", "trove_", "._", "TRO", "VE", "\\u", "VERSION_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "._", "TRO", "VE", "\\u", "VERSI", "ON", "\\u", "1", "\\u", "1_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "Filter_", "._", "add_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "self_", "._", "\\u", "test", "Basic", "1_", "(_", "built_", ",_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "Con", "ary", "Error_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "str_", "(_", "err_", ")_", "==_", "'''", "\\\\", "\\", "10", ";", "Cann", "ot", " ", "create", " ", "a", " ", "local", " ", "changeset", " ", "usi", "ng", " ", "an", " ", "incomplete", " ", "trove", "s", ":", " ", " ", "Ple", "ase", " ", "ensure", " ", "\\", "10", ";", "you", " ", "have", " ", "the", " ", "late", "st", " ", "cona", "ry", " ", "and", " ", "then", " ", "rein", "stall", " ", "these", " ", "trove", "s", ":", "\\", "10", ";", " ", "testc", "ase", "=", "/", "local", "host", "@", "rpl", ":", "linux", "/", "1.0", "-1", "-1", "[", "%", "(", "flavor", ")", "s", "]", "\\", "10", ";", " ", " ", " ", " ", "testc", "ase", ":", "runt", "ime", "=", "/", "local", "host", "@", "rpl", ":", "linux", "/", "1.0", "-1", "-1", "[", "%", "(", "flavor", ")", "s", "]", "\\", "10", ";'", "''_", "%_", "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 ", " _", "assert_", "(_", "0_", ")_", "\\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 ", " _", "trove_", "._", "TRO", "VE", "\\u", "VERSION_", "=_", "OLD", "\\u", "TRO", "VE", "\\u", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "._", "TRO", "VE", "\\u", "VERSI", "ON", "\\u", "1", "\\u", "1_", "=_", "OLD", "\\u", "TRO", "VE", "\\u", "VERSI", "ON", "\\u", "1", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "self_", "._", "\\u", "test", "Basic", "1_", "(_", "built_", ",_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trove_", "._", "TRO", "VE", "\\u", "VERSION_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "._", "TRO", "VE", "\\u", "VERSI", "ON", "\\u", "1", "\\u", "1_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "info", "-%", "(", "user", ")", "s", "'_", "%_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "testc", "ase", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "self_", "._", "open", "Database_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tup", "s_", "=_", "db_", "._", "find", "Trove", "s_", "(_", "None_", ",_", "[_", "(_", "'", "info", "-%", "(", "user", ")", "s", "'_", "%_", "info_", ",_", "None_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "testc", "ase", "'_", ",_", "None_", ",_", "None_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tup", "s_", "=_", "list_", "(_", "itertools_", "._", "chain_", "(_", "*_", "tup", "s_", "._", "itervalues_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "[_", "x_", "for_", "x_", "in_", "db_", "._", "get", "Trove", "s_", "(_", "tup", "s_", ")_", "if_", "not_", "x_", "._", "trove", "Info_", "._", "incomplete", "_", "(_", ")_", "]_", "==_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test", "Basic", "2_", "(_", "path_", ",_", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "errors_", "._", "Con", "ary", "Error_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "re_", "._", "match_", "(_", "r", "'", "Cann", "ot", " ", "appl", "y", " ", "a", " ", "relative", " ", "changeset", " ", "to", " ", "an", " ", "incomplete", " ", "trove", ".", " ", " ", "Ple", "ase", " ", "upgrade", " ", "cona", "ry", " ", "and", "/", "or", " ", "rein", "stall", " ", "testc", "ase", ":", "?", ".*", "=", "/", "local", "host", "@", "rpl", ":", "linux", "/", "1.0", "-1", "-1", "\\\\[", "%", "(", "flavor", ")", "s", "\\\\]", ".'_", "%_", "d_", ",_", "str_", "(_", "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 ", " _", "assert_", "(_", "0_", ")_", "\\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 ", " _", "trove_", "._", "TRO", "VE", "\\u", "VERSION_", "=_", "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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 ]
Unused import
Masood-M/yalih/jsbeautifier/build/lib.linux-i686-2.7/jsbeautifier/__init__.py
[ { "content": "from __future__ import print_function\nimport sys\nimport os\nimport getopt\nimport re\nimport string\nimport errno\nfrom jsbeautifier.__version__ import __version__\n\n#\n# The MIT License (MIT)\n\n# Copyright (c) 2007-2013 Einar Lielmanis and contributors.\n\n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated documentation files\n# (the \"Software\"), to deal in the Software without restriction,\n# including without limitation the rights to use, copy, modify, merge,\n# publish, distribute, sublicense, and/or sell copies of the Software,\n# and to permit persons to whom the Software is furnished to do so,\n# subject to the following conditions:\n\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n# SOFTWARE.\n#\n# Originally written by Einar Lielmanis et al.,\n# Conversion to python by Einar Lielmanis, [email protected],\n# Parsing improvement for brace-less and semicolon-less statements\n# by Liam Newman <[email protected]>\n# Python is not my native language, feel free to push things around.\n#\n# Use either from command line (script displays its usage when run\n# without any parameters),\n#\n#\n# or, alternatively, use it as a module:\n#\n# import jsbeautifier\n# res = jsbeautifier.beautify('your javascript string')\n# res = jsbeautifier.beautify_file('some_file.js')\n#\n# you may specify some options:\n#\n# opts = jsbeautifier.default_options()\n# opts.indent_size = 2\n# res = jsbeautifier.beautify('some javascript', opts)\n#\n#\n# Here are the available options: (read source)\n\n\n\n\n\n# Using object instead of string to allow for later expansion of info about each line\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 BeautifierOptions:\n\n\n", "metadata": "root.BeautifierOptions", "header": "['module', '___EOS___']", "index": 60 }, { "content": " def __init__(self):\n self.indent_size = 4\n self.indent_char = ' '\n self.indent_with_tabs = False\n self.preserve_newlines = True\n self.max_preserve_newlines = 10\n self.space_in_paren = False\n self.e4x = False\n self.jslint_happy = False\n self.brace_style = 'collapse'\n self.keep_array_indentation = False\n self.keep_function_indentation = False\n self.eval_code = True\n self.unescape_strings = True\n self.wrap_line_length = 0\n self.break_chained_methods = False", "metadata": "root.BeautifierOptions.__init__", "header": "['class', 'BeautifierOptions', ':', '___EOS___']", "index": 61 }, { "content": " def __repr__(self):\n return \\\n\"\"\"indent_size = %d\nindent_char = [%s]\npreserve_newlines = %s\nmax_preserve_newlines = %d\nspace_in_paren = %s\njslint_happy = %s\nindent_with_tabs = %s\nbrace_style = %s\nkeep_array_indentation = %s\neval_code = %s\nwrap_line_length = %s\nunescape_strings = %s\n\"\"\" % ( self.indent_size,\n self.indent_char,\n self.preserve_newlines,\n self.max_preserve_newlines,\n self.space_in_paren,\n self.jslint_happy,\n self.indent_with_tabs,\n self.brace_style,\n self.keep_array_indentation,\n self.eval_code,\n self.wrap_line_length,\n self.unescape_strings,\n )", "metadata": "root.BeautifierOptions.__repr__", "header": "['class', 'BeautifierOptions', ':', '___EOS___']", "index": 80 }, { "content": "class BeautifierFlags:\n", "metadata": "root.BeautifierFlags", "header": "['module', '___EOS___']", "index": 109 }, { "content": " def __init__(self, mode):\n self.mode = mode\n self.parent = None\n self.last_text = ''\n self.last_word = ''\n self.var_line = False\n self.var_line_tainted = False\n self.var_line_reindented = False\n self.in_html_comment = False\n self.multiline_frame = False\n self.if_block = False\n self.do_block = False\n self.do_while = False\n self.in_case = False\n self.in_case_statement = False\n self.case_body = False\n self.indentation_level = 0\n self.line_indent_level = 0\n self.start_line_index = 0\n self.ternary_depth = 0\n self.had_comment = False", "metadata": "root.BeautifierFlags.__init__", "header": "['class', 'BeautifierFlags', ':', '___EOS___']", "index": 110 }, { "content": " def apply_base(self, flags_base, added_newline):\n next_indent_level = flags_base.indentation_level;\n if flags_base.var_line and flags_base.var_line_reindented:\n next_indent_level += 1\n if not added_newline and \\\n flags_base.line_indent_level > next_indent_level:\n next_indent_level = flags_base.line_indent_level;\n\n self.parent = flags_base;\n self.last_text = flags_base.last_text\n self.last_word = flags_base.last_word\n self.indentation_level = next_indent_level", "metadata": "root.BeautifierFlags.apply_base", "header": "['class', 'BeautifierFlags', ':', '___EOS___']", "index": 132 }, { "content": "class OutputLine:", "metadata": "root.OutputLine", "header": "['module', '___EOS___']", "index": 146 }, { "content": " def __init__(self):\n self.text = []", "metadata": "root.OutputLine.__init__", "header": "['class', 'OutputLine', ':', '___EOS___']", "index": 147 }, { "content": "def default_options():\n return BeautifierOptions()", "metadata": "root.default_options", "header": "['module', '___EOS___']", "index": 153 }, { "content": "def beautify(string, opts = default_options() ):\n b = Beautifier()\n return b.beautify(string, opts)", "metadata": "root.beautify", "header": "['module', '___EOS___']", "index": 157 }, { "content": "def beautify_file(file_name, opts = default_options() ):\n if file_name == '-': # stdin\n stream = sys.stdin\n else:\n stream = open(file_name)\n\n return beautify(''.join(stream.readlines()), opts);", "metadata": "root.beautify_file", "header": "['module', '___EOS___']", "index": 161 }, { "content": "def usage(stream=sys.stdout):\n\n print(\"jsbeautifier.py@\" + __version__ + \"\"\"\n\nJavascript beautifier (http://jsbeautifier.org/)\n\nUsage: jsbeautifier.py [options] <infile>\n\n <infile> can be \"-\", which means stdin.\n <outfile> defaults to stdout\n\nInput options:\n\n -i, --stdin read input from stdin\n\nOutput options:\n\n -s, --indent-size=NUMBER indentation size. (default 4).\n -c, --indent-char=CHAR character to indent with. (default space).\n -t, --indent-with-tabs Indent with tabs, overrides -s and -c\n -d, --disable-preserve-newlines do not preserve existing line breaks.\n -P, --space-in-paren add padding spaces within paren, ie. f( a, b )\n -j, --jslint-happy more jslint-compatible output\n -b, --brace-style=collapse brace style (collapse, expand, end-expand)\n -k, --keep-array-indentation keep array indentation.\n -o, --outfile=FILE specify a file to output to (default stdout)\n -f, --keep-function-indentation Do not re-indent function bodies defined in var lines.\n -x, --unescape-strings Decode printable chars encoded in \\\\xNN notation.\n -X, --e4x Pass E4X xml literals through untouched\n -w, --wrap-line-length Attempt to wrap line when it exceeds this length.\n NOTE: Line continues until next wrap point is found.\n\nRarely needed options:\n\n --eval-code evaluate code if a JS interpreter is\n installed. May be useful with some obfuscated\n script but poses a potential security issue.\n\n -l, --indent-level=NUMBER initial indentation level. (default 0).\n\n -h, --help, --usage prints this help statement.\n -v, --version Show the version\n\n\"\"\", file=stream)\n if stream == sys.stderr:\n return 1\n else:\n return 0", "metadata": "root.usage", "header": "['module', '___EOS___']", "index": 170 }, { "content": "class MODE:\n BlockStatement, Statement, ObjectLiteral, ArrayLiteral, \\\n ForInitializer, Conditional, Expression = range(7)", "metadata": "root.MODE", "header": "['module', '___EOS___']", "index": 221 }, { "content": "class Beautifier:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.Beautifier", "header": "['module', '___EOS___']", "index": 225 }, { "content": " def __init__(self, opts = default_options() ):\n\n self.opts = opts\n self.blank_state()", "metadata": "root.Beautifier.__init__", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 227 }, { "content": " def blank_state(self):\n\n # internal flags\n self.flags = None\n self.previous_flags = None\n self.flag_store = []\n self.input_wanted_newline = False\n if self.opts.indent_with_tabs:\n self.opts.indent_char = \"\\t\"\n self.opts.indent_size = 1\n\n self.indent_string = self.opts.indent_char * self.opts.indent_size\n\n self.preindent_string = ''\n self.last_type = 'TK_START_BLOCK' # last token type\n self.last_last_text = '' # pre-last token text\n\n self.input = None\n self.output_lines = [ OutputLine() ]\n self.output_wrapped = False\n self.output_space_before_token = False\n self.whitespace_before_token = []\n\n self.whitespace = [\"\\n\", \"\\r\", \"\\t\", \" \"]\n self.wordchar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'\n self.digits = '0123456789'\n self.punct = '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |= ::'\n self.punct += ' <?= <? ?> <%= <% %>'\n self.punct = self.punct.split(' ')\n\n\n # Words which always should start on a new line\n self.line_starters = 'continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(',')\n\n self.set_mode(MODE.BlockStatement)\n\n self.parser_pos = 0", "metadata": "root.Beautifier.blank_state", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 232 }, { "content": " def beautify(self, s, opts = None ):\n\n if opts != None:\n self.opts = opts\n\n if self.opts.brace_style not in ['expand', 'collapse', 'end-expand']:\n raise(Exception('opts.brace_style must be \"expand\", \"collapse\" or \"end-expand\".'))\n\n self.blank_state()\n\n while s and s[0] in [' ', '\\t']:\n self.preindent_string += s[0]\n s = s[1:]\n\n self.input = self.unpack(s, self.opts.eval_code)\n\n self.parser_pos = 0\n handlers = {\n 'TK_START_EXPR': self.handle_start_expr,\n 'TK_END_EXPR': self.handle_end_expr,\n 'TK_START_BLOCK': self.handle_start_block,\n 'TK_END_BLOCK': self.handle_end_block,\n 'TK_WORD': self.handle_word,\n 'TK_SEMICOLON': self.handle_semicolon,\n 'TK_STRING': self.handle_string,\n 'TK_EQUALS': self.handle_equals,\n 'TK_OPERATOR': self.handle_operator,\n 'TK_COMMA': self.handle_comma,\n 'TK_BLOCK_COMMENT': self.handle_block_comment,\n 'TK_INLINE_COMMENT': self.handle_inline_comment,\n 'TK_COMMENT': self.handle_comment,\n 'TK_DOT': self.handle_dot,\n 'TK_UNKNOWN': self.handle_unknown,\n }\n\n while True:\n self.token_text, token_type = self.get_next_token()\n\n #print (token_text, token_type, self.flags.mode)\n if token_type == 'TK_EOF':\n break\n\n keep_whitespace = self.opts.keep_array_indentation and self.is_array(self.flags.mode)\n self.input_wanted_newline = self.n_newlines > 0\n\n if keep_whitespace:\n for i in range(self.n_newlines):\n self.append_newline(i > 0)\n else: # not keep_whitespace\n if self.opts.max_preserve_newlines != 0 and self.n_newlines > self.opts.max_preserve_newlines:\n self.n_newlines = self.opts.max_preserve_newlines\n\n if self.opts.preserve_newlines and self.n_newlines > 1:\n\n for i in range(self.n_newlines):\n self.append_newline(i != 0)\n\n handlers[token_type](self.token_text)\n\n # The cleanest handling of inline comments is to treat them as though they aren't there.\n # Just continue formatting and the behavior should be logical.\n if token_type != 'TK_INLINE_COMMENT' and token_type != 'TK_COMMENT' and token_type != 'TK_BLOCK_COMMENT' and token_type != 'TK_UNKNOWN':\n self.last_last_text = self.flags.last_text\n self.last_type = token_type\n self.flags.last_text = self.token_text\n self.flags.had_comment = token_type in ['TK_COMMENT', 'TK_INLINE_COMMENT', 'TK_BLOCK_COMMENT']\n\n sweet_code = ''.join(self.output_lines[0].text)\n if len(self.output_lines) > 1:\n for line_index in range(1, len(self.output_lines)):\n sweet_code += '\\n' + ''.join(self.output_lines[line_index].text);\n\n sweet_code = re.sub('[\\n ]+$', '', sweet_code)\n return sweet_code", "metadata": "root.Beautifier.beautify", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 271 }, { "content": " def unpack(self, source, evalcode=False):\n import jsbeautifier.unpackers as unpackers\n try:\n return unpackers.run(source, evalcode)\n except unpackers.UnpackingError as error:\n print('error:', error)\n return ''", "metadata": "root.Beautifier.unpack", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 346 }, { "content": " def trim_output(self, eat_newlines = False):\n self.trim_output_line(self.output_lines[-1])\n\n while eat_newlines and len(self.output_lines) > 1 and \\\n len(self.output_lines[-1].text) == 0:\n self.output_lines.pop()\n self.trim_output_line(self.output_lines[-1])", "metadata": "root.Beautifier.trim_output", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 354 }, { "content": " def trim_output_line(self, line):\n while len(line.text) \\\n and (\n line.text[-1] == ' '\\\n or line.text[-1] == self.indent_string \\\n or line.text[-1] == self.preindent_string):\n line.text.pop()", "metadata": "root.Beautifier.trim_output_line", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 362 }, { "content": " def is_special_word(self, s):\n return s in ['case', 'return', 'do', 'if', 'throw', 'else']", "metadata": "root.Beautifier.is_special_word", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 370 }, { "content": " def is_array(self, mode):\n return mode == MODE.ArrayLiteral", "metadata": "root.Beautifier.is_array", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 373 }, { "content": " def is_expression(self, mode):\n return mode in [MODE.Expression, MODE.ForInitializer, MODE.Conditional]", "metadata": "root.Beautifier.is_expression", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 377 }, { "content": " def just_added_newline(self):\n line = self.output_lines[-1]\n return len(line.text) == 0", "metadata": "root.Beautifier.just_added_newline", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 380 }, { "content": " def just_added_blankline(self):\n if self.just_added_newline():\n if len(self.output_lines) == 1:\n return True\n\n line = self.output_lines[-2]\n return len(line.text) == 0\n\n return False", "metadata": "root.Beautifier.just_added_blankline", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 385 }, { "content": " def allow_wrap_or_preserved_newline(self, token_text, force_linewrap = False):\n if self.opts.wrap_line_length > 0 and not force_linewrap:\n line = self.output_lines[-1]\n\n # never wrap the first token of a line.\n if len(line.text) > 0:\n proposed_line_length = len(''.join(line.text)) + len(token_text)\n if self.output_space_before_token:\n proposed_line_length += 1\n\n if proposed_line_length >= self.opts.wrap_line_length:\n force_linewrap = True\n\n if ((self.opts.preserve_newlines and self.input_wanted_newline) or force_linewrap) and not self.just_added_newline():\n self.append_newline(preserve_statement_flags = True)\n\n # Expressions and array literals already indent their contents.\n if not (self.is_array(self.flags.mode) or self.is_expression(self.flags.mode)):\n self.output_wrapped = True", "metadata": "root.Beautifier.allow_wrap_or_preserved_newline", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 395 }, { "content": " def append_newline(self, force_newline = False, preserve_statement_flags = False):\n self.output_wrapped = False\n self.output_space_before_token = False\n\n if not preserve_statement_flags:\n if self.flags.last_text != ';':\n while self.flags.mode == MODE.Statement and not self.flags.if_block and not self.flags.do_block:\n self.restore_mode();\n\n if len(self.output_lines) == 1 and self.just_added_newline():\n # no newline on start of file\n return\n\n if force_newline or not self.just_added_newline():\n self.flags.multiline_frame = True\n self.output_lines.append(OutputLine())", "metadata": "root.Beautifier.append_newline", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 416 }, { "content": " def append_token_line_indentation(self):\n if self.just_added_newline():\n line = self.output_lines[-1]\n if self.opts.keep_array_indentation and self.is_array(self.flags.mode) and self.input_wanted_newline:\n # prevent removing of this whitespace as redundant\n line.text.append('');\n for item in self.whitespace_before_token:\n line.text.append(item)\n\n else:\n if self.preindent_string != '':\n line.text.append(self.preindent_string)\n\n level = self.flags.indentation_level;\n if self.flags.var_line and self.flags.var_line_reindented:\n level += 1\n if self.output_wrapped:\n level += 1\n\n self.append_indent_string(level)", "metadata": "root.Beautifier.append_token_line_indentation", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 434 }, { "content": " def append_indent_string(self, level):\n # Never indent your first output indent at the start of the file\n if len(self.output_lines) > 1:\n line = self.output_lines[-1]\n self.flags.line_indent_level = level\n for i in range(level):\n line.text.append(self.indent_string)", "metadata": "root.Beautifier.append_indent_string", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 456 }, { "content": " def append_token_space_before(self):\n # make sure only single space gets drawn\n line = self.output_lines[-1]\n if self.output_space_before_token and len(line.text) and line.text[-1] not in [' ', self.indent_string]:\n line.text.append(' ')", "metadata": "root.Beautifier.append_token_space_before", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 465 }, { "content": " def append_token(self, s):\n self.append_token_line_indentation()\n self.output_wrapped = False\n self.append_token_space_before()\n self.output_space_before_token = False\n self.output_lines[-1].text.append(s)", "metadata": "root.Beautifier.append_token", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 472 }, { "content": " def indent(self):\n self.flags.indentation_level += 1", "metadata": "root.Beautifier.indent", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 480 }, { "content": " def deindent(self):\n allow_deindent = self.flags.indentation_level > 0 and ((self.flags.parent == None) or self.flags.indentation_level > self.flags.parent.indentation_level)\n\n if allow_deindent:\n self.flags.indentation_level -= 1", "metadata": "root.Beautifier.deindent", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 483 }, { "content": " def remove_redundant_indentation(self, frame):\n # This implementation is effective but has some issues:\n # - less than great performance due to array splicing\n # - can cause line wrap to happen too soon due to indent removal\n # after wrap points are calculated\n # These issues are minor compared to ugly indentation.\n\n if frame.multiline_frame:\n return\n\n # remove one indent from each line inside this section\n index = frame.start_line_index\n splice_index = 0\n while index < len(self.output_lines):\n line = self.output_lines[index]\n index += 1\n\n # skip empty lines\n if len(line.text) == 0:\n continue\n\n # skip the preindent string if present\n if self.preindent_string != '' and \\\n line.text[0] == self.preindent_string:\n splice_index = 1\n else:\n splice_index = 0\n\n # remove one indent, if present\n if line.text[splice_index] == self.indent_string:\n del line.text[splice_index]", "metadata": "root.Beautifier.remove_redundant_indentation", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 489 }, { "content": " def set_mode(self, mode):\n if self.flags:\n self.flag_store.append(self.flags)\n self.previous_flags = self.flags\n else:\n self.previous_flags = BeautifierFlags(mode)\n\n self.flags = BeautifierFlags(mode)\n self.flags.apply_base(self.previous_flags, self.just_added_newline());\n self.flags.start_line_index = len(self.output_lines)", "metadata": "root.Beautifier.set_mode", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 521 }, { "content": " def restore_mode(self):\n if len(self.flag_store) > 0:\n self.previous_flags = self.flags\n self.flags = self.flag_store.pop()", "metadata": "root.Beautifier.restore_mode", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 532 }, { "content": " def start_of_object_property(self):\n return self.flags.mode == MODE.ObjectLiteral and self.flags.last_text == ':' and \\\n self.flags.ternary_depth == 0", "metadata": "root.Beautifier.start_of_object_property", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 537 }, { "content": " def start_of_statement(self):\n if (self.flags.last_text == 'do' \\\n or (self.flags.last_text == 'else' and self.token_text != 'if' ) \\\n or (self.last_type == 'TK_END_EXPR' and (self.previous_flags.mode == MODE.ForInitializer or self.previous_flags.mode == MODE.Conditional))):\n # Issue #276:\n # If starting a new statement with [if, for, while, do], push to a new line.\n # if (a) if (b) if(c) d(); else e(); else f();\n self.allow_wrap_or_preserved_newline(self.token_text, self.token_text in ['do', 'for', 'if', 'while']);\n\n self.set_mode(MODE.Statement);\n # Issue #275:\n # If starting on a newline, all of a statement should be indented.\n # if not, use line wrapping logic for indent.\n if self.just_added_newline():\n self.indent()\n self.output_wrapped = False\n\n return True\n else:\n return False", "metadata": "root.Beautifier.start_of_statement", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 541 }, { "content": " def is_next(self, find):\n local_pos = self.parser_pos\n if local_pos >= len(self.input):\n return False\n c = self.input[local_pos]\n\n while (c in self.whitespace) and c != find:\n local_pos+= 1\n if local_pos >= len(self.input):\n return False\n c = self.input[local_pos]\n\n return c == find", "metadata": "root.Beautifier.is_next", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 562 }, { "content": " def get_next_token(self):\n\n self.n_newlines = 0\n\n if self.parser_pos >= len(self.input):\n return '', 'TK_EOF'\n\n self.input_wanted_newline = False\n self.whitespace_before_token = []\n\n c = self.input[self.parser_pos]\n self.parser_pos += 1\n\n while c in self.whitespace:\n if c == '\\n':\n self.n_newlines += 1\n self.whitespace_before_token = []\n elif c == self.indent_string:\n self.whitespace_before_token.append(self.indent_string)\n elif c != '\\r':\n self.whitespace_before_token.append(' ')\n\n if self.parser_pos >= len(self.input):\n return '', 'TK_EOF'\n\n c = self.input[self.parser_pos]\n self.parser_pos += 1\n\n\n if c in self.wordchar:\n if self.parser_pos < len(self.input):\n while self.input[self.parser_pos] in self.wordchar:\n c = c + self.input[self.parser_pos]\n self.parser_pos += 1\n if self.parser_pos == len(self.input):\n break\n\n # small and surprisingly unugly hack for IE-10 representation\n if self.parser_pos != len(self.input) and self.input[self.parser_pos] in '+-' \\\n and re.match('^[0-9]+[Ee]$', c):\n\n sign = self.input[self.parser_pos]\n self.parser_pos += 1\n t = self.get_next_token()\n c += sign + t[0]\n return c, 'TK_WORD'\n\n if c == 'in': # in is an operator, need to hack\n return c, 'TK_OPERATOR'\n\n return c, 'TK_WORD'\n\n if c in '([':\n return c, 'TK_START_EXPR'\n\n if c in ')]':\n return c, 'TK_END_EXPR'\n\n if c == '{':\n return c, 'TK_START_BLOCK'\n\n if c == '}':\n return c, 'TK_END_BLOCK'\n\n if c == ';':\n return c, 'TK_SEMICOLON'\n\n if c == '/':\n comment = ''\n inline_comment = True\n if self.input[self.parser_pos] == '*': # peek /* .. */ comment\n self.parser_pos += 1\n if self.parser_pos < len(self.input):\n while not (self.input[self.parser_pos] == '*' and \\\n self.parser_pos + 1 < len(self.input) and \\\n self.input[self.parser_pos + 1] == '/')\\\n and self.parser_pos < len(self.input):\n c = self.input[self.parser_pos]\n comment += c\n if c in '\\r\\n':\n inline_comment = False\n self.parser_pos += 1\n if self.parser_pos >= len(self.input):\n break\n self.parser_pos += 2\n if inline_comment and self.n_newlines == 0:\n return '/*' + comment + '*/', 'TK_INLINE_COMMENT'\n else:\n return '/*' + comment + '*/', 'TK_BLOCK_COMMENT'\n\n if self.input[self.parser_pos] == '/': # peek // comment\n comment = c\n while self.input[self.parser_pos] not in '\\r\\n':\n comment += self.input[self.parser_pos]\n self.parser_pos += 1\n if self.parser_pos >= len(self.input):\n break\n\n return comment, 'TK_COMMENT'\n\n if c == \"'\" or c == '\"' or \\\n ( \\\n (c == '/') or \\\n (self.opts.e4x and c == \"<\" and re.match('^<(!\\[CDATA\\[[\\s\\S]*?\\]\\]|[-a-zA-Z:0-9_.]+|\\{[^{}]*\\})\\s*([-a-zA-Z:0-9_.]+=(\\{[^{}]*\\}|\"[^\"]*\"|\\'[^\\']*\\')\\s*)*\\/?\\s*>', self.input[self.parser_pos - 1:])) \\\n ) and ( \\\n (self.last_type == 'TK_WORD' and self.is_special_word(self.flags.last_text)) or \\\n (self.last_type == 'TK_END_EXPR' and self.previous_flags.mode in [MODE.Conditional, MODE.ForInitializer]) or \\\n (self.last_type in ['TK_COMMENT', 'TK_START_EXPR', 'TK_START_BLOCK', 'TK_END_BLOCK', 'TK_OPERATOR', \\\n 'TK_EQUALS', 'TK_EOF', 'TK_SEMICOLON', 'TK_COMMA'])):\n sep = c\n esc = False\n esc1 = 0\n esc2 = 0\n resulting_string = c\n in_char_class = False\n\n if self.parser_pos < len(self.input):\n if sep == '/':\n # handle regexp\n in_char_class = False\n while esc or in_char_class or self.input[self.parser_pos] != sep:\n resulting_string += self.input[self.parser_pos]\n if not esc:\n esc = self.input[self.parser_pos] == '\\\\'\n if self.input[self.parser_pos] == '[':\n in_char_class = True\n elif self.input[self.parser_pos] == ']':\n in_char_class = False\n else:\n esc = False\n self.parser_pos += 1\n if self.parser_pos >= len(self.input):\n # incomplete regex when end-of-file reached\n # bail out with what has received so far\n return resulting_string, 'TK_STRING'\n\n elif self.opts.e4x and sep == '<':\n # handle e4x xml literals\n xmlRegExp = re.compile('<(\\/?)(!\\[CDATA\\[[\\s\\S]*?\\]\\]|[-a-zA-Z:0-9_.]+|\\{[^{}]*\\})\\s*([-a-zA-Z:0-9_.]+=(\\{[^{}]*\\}|\"[^\"]*\"|\\'[^\\']*\\')\\s*)*(\\/?)\\s*>')\n xmlStr = self.input[self.parser_pos - 1:]\n match = xmlRegExp.match(xmlStr)\n if match:\n rootTag = match.group(2)\n depth = 0\n while (match):\n isEndTag = match.group(1)\n tagName = match.group(2)\n isSingletonTag = (match.groups()[-1] != \"\") or (match.group(2)[0:8] == \"![CDATA[\")\n if tagName == rootTag and not isSingletonTag:\n if isEndTag:\n depth -= 1\n else:\n depth += 1\n\n if depth <= 0:\n break\n\n match = xmlRegExp.search(xmlStr, match.end())\n\n if match:\n xmlLength = match.end() # + len(match.group())\n else:\n xmlLength = len(xmlStr)\n\n self.parser_pos += xmlLength - 1\n return xmlStr[:xmlLength], 'TK_STRING'\n\n else:\n # handle string\n while esc or self.input[self.parser_pos] != sep:\n resulting_string += self.input[self.parser_pos]\n if esc1 and esc1 >= esc2:\n try:\n esc1 = int(resulting_string[-esc2:], 16)\n except Exception:\n esc1 = False\n if esc1 and esc1 >= 0x20 and esc1 <= 0x7e:\n esc1 = chr(esc1)\n resulting_string = resulting_string[:-2 - esc2]\n if esc1 == sep or esc1 == '\\\\':\n resulting_string += '\\\\'\n resulting_string += esc1\n esc1 = 0\n if esc1:\n esc1 += 1\n elif not esc:\n esc = self.input[self.parser_pos] == '\\\\'\n else:\n esc = False\n if self.opts.unescape_strings:\n if self.input[self.parser_pos] == 'x':\n esc1 += 1\n esc2 = 2\n elif self.input[self.parser_pos] == 'u':\n esc1 += 1\n esc2 = 4\n self.parser_pos += 1\n if self.parser_pos >= len(self.input):\n # incomplete string when end-of-file reached\n # bail out with what has received so far\n return resulting_string, 'TK_STRING'\n\n\n self.parser_pos += 1\n resulting_string += sep\n if sep == '/':\n # regexps may have modifiers /regexp/MOD, so fetch those too\n while self.parser_pos < len(self.input) and self.input[self.parser_pos] in self.wordchar:\n resulting_string += self.input[self.parser_pos]\n self.parser_pos += 1\n return resulting_string, 'TK_STRING'\n\n if c == '#':\n\n # she-bang\n if len(self.output_lines) == 1 and len(self.output_lines[0].text) == 0 and \\\n len(self.input) > self.parser_pos and self.input[self.parser_pos] == '!':\n resulting_string = c\n while self.parser_pos < len(self.input) and c != '\\n':\n c = self.input[self.parser_pos]\n resulting_string += c\n self.parser_pos += 1\n return resulting_string.strip() + '\\n', 'TK_UNKNOWN'\n\n\n # Spidermonkey-specific sharp variables for circular references\n # https://developer.mozilla.org/En/Sharp_variables_in_JavaScript\n # http://mxr.mozilla.org/mozilla-central/source/js/src/jsscan.cpp around line 1935\n sharp = '#'\n if self.parser_pos < len(self.input) and self.input[self.parser_pos] in self.digits:\n while True:\n c = self.input[self.parser_pos]\n sharp += c\n self.parser_pos += 1\n if self.parser_pos >= len(self.input) or c == '#' or c == '=':\n break\n if c == '#' or self.parser_pos >= len(self.input):\n pass\n elif self.input[self.parser_pos] == '[' and self.input[self.parser_pos + 1] == ']':\n sharp += '[]'\n self.parser_pos += 2\n elif self.input[self.parser_pos] == '{' and self.input[self.parser_pos + 1] == '}':\n sharp += '{}'\n self.parser_pos += 2\n return sharp, 'TK_WORD'\n\n if c == '<' and self.input[self.parser_pos - 1 : self.parser_pos + 3] == '<!--':\n self.parser_pos += 3\n c = '<!--'\n while self.parser_pos < len(self.input) and self.input[self.parser_pos] != '\\n':\n c += self.input[self.parser_pos]\n self.parser_pos += 1\n self.flags.in_html_comment = True\n return c, 'TK_COMMENT'\n\n if c == '-' and self.flags.in_html_comment and self.input[self.parser_pos - 1 : self.parser_pos + 2] == '-->':\n self.flags.in_html_comment = False\n self.parser_pos += 2\n return '-->', 'TK_COMMENT'\n\n if c == '.':\n return c, 'TK_DOT'\n\n if c in self.punct:\n while self.parser_pos < len(self.input) and c + self.input[self.parser_pos] in self.punct:\n c += self.input[self.parser_pos]\n self.parser_pos += 1\n if self.parser_pos >= len(self.input):\n break\n\n if c == ',':\n return c, 'TK_COMMA'\n if c == '=':\n return c, 'TK_EQUALS'\n\n return c, 'TK_OPERATOR'\n\n return c, 'TK_UNKNOWN'", "metadata": "root.Beautifier.get_next_token", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 576 }, { "content": " def handle_start_expr(self, token_text):\n if self.start_of_statement():\n # The conditional starts the statement if appropriate.\n pass\n\n next_mode = MODE.Expression\n\n if token_text == '[':\n if self.last_type == 'TK_WORD' or self.flags.last_text == ')':\n if self.flags.last_text in self.line_starters:\n self.output_space_before_token = True\n self.set_mode(next_mode)\n self.append_token(token_text)\n self.indent()\n if self.opts.space_in_paren:\n self.output_space_before_token = True\n return\n\n next_mode = MODE.ArrayLiteral\n\n if self.is_array(self.flags.mode):\n if self.flags.last_text == '[' or (\n self.flags.last_text == ',' and (self.last_last_text == ']' or self.last_last_text == '}')):\n # ], [ goes to a new line\n # }, [ goes to a new line\n if not self.opts.keep_array_indentation:\n self.append_newline()\n\n else:\n if self.flags.last_text == 'for':\n next_mode = MODE.ForInitializer\n elif self.flags.last_text in ['if', 'while']:\n next_mode = MODE.Conditional\n else:\n next_mode = MODE.Expression\n\n\n if self.flags.last_text == ';' or self.last_type == 'TK_START_BLOCK':\n self.append_newline()\n elif self.last_type in ['TK_END_EXPR', 'TK_START_EXPR', 'TK_END_BLOCK'] or self.flags.last_text == '.':\n # do nothing on (( and )( and ][ and ]( and .(\n # TODO: Consider whether forcing this is required. Review failing tests when removed.\n self.allow_wrap_or_preserved_newline(token_text, self.input_wanted_newline);\n self.output_wrapped = False;\n\n elif self.last_type not in ['TK_WORD', 'TK_OPERATOR']:\n self.output_space_before_token = True\n elif self.flags.last_word == 'function' or self.flags.last_word == 'typeof':\n # function() vs function (), typeof() vs typeof ()\n if self.opts.jslint_happy:\n self.output_space_before_token = True\n elif self.flags.last_text in self.line_starters or self.flags.last_text == 'catch':\n # TODO: option space_before_conditional\n self.output_space_before_token = True\n\n # Support of this kind of newline preservation:\n # a = (b &&\n # (c || d));\n if self.last_type in ['TK_EQUALS', 'TK_OPERATOR']:\n if not self.start_of_object_property():\n self.allow_wrap_or_preserved_newline(token_text)\n\n self.set_mode(next_mode)\n self.append_token(token_text)\n\n if self.opts.space_in_paren:\n self.output_space_before_token = True\n\n # In all cases, if we newline while inside an expression it should be indented.\n self.indent()", "metadata": "root.Beautifier.handle_start_expr", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 856 }, { "content": " def handle_end_expr(self, token_text):\n # statements inside expressions are not valid syntax, but...\n # statements must all be closed when their container closes\n while self.flags.mode == MODE.Statement:\n self.restore_mode()\n\n if self.token_text == ']' and self.is_array(self.flags.mode) and self.flags.multiline_frame and not self.opts.keep_array_indentation:\n self.append_newline()\n\n if self.flags.multiline_frame:\n self.allow_wrap_or_preserved_newline(token_text)\n\n if self.opts.space_in_paren:\n if self.last_type == 'TK_START_EXPR':\n # empty parens are always \"()\" and \"[]\", not \"( )\" or \"[ ]\"\n self.output_space_before_token = False\n self.trim_output()\n else:\n self.output_space_before_token = True\n\n if self.token_text == ']' and self.opts.keep_array_indentation:\n self.append_token(token_text)\n self.restore_mode()\n else:\n self.restore_mode()\n self.append_token(token_text)\n\n self.remove_redundant_indentation(self.previous_flags);\n\n # do {} while () // no statement required after\n if self.flags.do_while and self.previous_flags.mode == MODE.Conditional:\n self.previous_flags.mode = MODE.Expression\n self.flags.do_block = False\n self.flags.do_while = False", "metadata": "root.Beautifier.handle_end_expr", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 929 }, { "content": " def handle_start_block(self, token_text):\n self.set_mode(MODE.BlockStatement)\n\n empty_braces = self.is_next('}')\n empty_anonymous_function = empty_braces and self.flags.last_word == 'function' and \\\n self.last_type == 'TK_END_EXPR'\n\n if self.opts.brace_style == 'expand':\n if self.last_type != 'TK_OPERATOR' and \\\n (empty_anonymous_function or\n self.last_type == 'TK_EQUALS' or\n (self.is_special_word(self.flags.last_text) and self.flags.last_text != 'else')):\n self.output_space_before_token = True\n else:\n self.append_newline()\n else: # collapse\n if self.last_type not in ['TK_OPERATOR', 'TK_START_EXPR']:\n if self.last_type == 'TK_START_BLOCK':\n self.append_newline()\n else:\n self.output_space_before_token = True\n else:\n # if TK_OPERATOR or TK_START_EXPR\n if self.is_array(self.previous_flags.mode) and self.flags.last_text == ',':\n if self.last_last_text == '}':\n self.output_space_before_token = True\n else:\n self.append_newline()\n\n self.append_token(token_text)\n self.indent()", "metadata": "root.Beautifier.handle_start_block", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 964 }, { "content": " def handle_end_block(self, token_text):\n # statements must all be closed when their container closes\n while self.flags.mode == MODE.Statement:\n self.restore_mode()\n\n empty_braces = self.last_type == 'TK_START_BLOCK';\n if self.opts.brace_style == 'expand':\n if not empty_braces:\n self.append_newline()\n else:\n # skip {}\n if not empty_braces:\n if self.is_array(self.flags.mode) and self.opts.keep_array_indentation:\n self.opts.keep_array_indentation = False\n self.append_newline()\n self.opts.keep_array_indentation = True\n else:\n self.append_newline()\n\n self.restore_mode()\n self.append_token(token_text)", "metadata": "root.Beautifier.handle_end_block", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 997 }, { "content": " def handle_word(self, token_text):\n if self.start_of_statement():\n # The conditional starts the statement if appropriate.\n pass\n elif self.input_wanted_newline and \\\n not self.is_expression(self.flags.mode) and \\\n (self.last_type != 'TK_OPERATOR' or (self.flags.last_text == '--' or self.flags.last_text == '++')) and \\\n self.last_type != 'TK_EQUALS' and \\\n (self.opts.preserve_newlines or self.flags.last_text != 'var'):\n self.append_newline()\n\n if self.flags.do_block and not self.flags.do_while:\n if token_text == 'while':\n # do {} ## while ()\n self.output_space_before_token = True\n self.append_token(token_text)\n self.output_space_before_token = True\n self.flags.do_while = True\n return\n else:\n # do {} should always have while as the next word.\n # if we don't see the expected while, recover\n self.append_newline()\n self.flags.do_block = False\n\n # if may be followed by else, or not\n # Bare/inline ifs are tricky\n # Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();\n if self.flags.if_block:\n if token_text != 'else':\n while self.flags.mode == MODE.Statement:\n self.restore_mode()\n\n self.flags.if_block = False;\n\n if token_text == 'case' or (token_text == 'default' and self.flags.in_case_statement):\n self.append_newline()\n if self.flags.case_body or self.opts.jslint_happy:\n self.flags.case_body = False\n self.deindent()\n self.append_token(token_text)\n self.flags.in_case = True\n self.flags.in_case_statement = True\n return\n\n if token_text == 'function':\n if self.flags.var_line and self.flags.last_text != '=':\n self.flags.var_line_reindented = not self.opts.keep_function_indentation\n\n if self.flags.last_text in ['}', ';'] or (self.just_added_newline() and not self.flags.last_text in ['{', ':', '=', ',']):\n # make sure there is a nice clean space of at least one blank line\n # before a new function definition, except in arrays\n if not self.just_added_blankline() and not self.flags.had_comment:\n self.append_newline()\n self.append_newline(True)\n\n if self.last_type == 'TK_WORD':\n if self.flags.last_text in ['get', 'set', 'new', 'return']:\n self.output_space_before_token = True\n else:\n self.append_newline()\n elif self.last_type == 'TK_OPERATOR' or self.flags.last_text == '=':\n # foo = function\n self.output_space_before_token = True\n elif self.is_expression(self.flags.mode):\n # (function\n pass\n else:\n self.append_newline()\n\n if self.last_type in ['TK_COMMA', 'TK_START_EXPR', 'TK_EQUALS', 'TK_OPERATOR']:\n if not self.start_of_object_property():\n self.allow_wrap_or_preserved_newline(token_text)\n\n if token_text == 'function':\n self.append_token(token_text)\n self.flags.last_word = token_text\n return\n\n prefix = 'NONE'\n\n if self.last_type == 'TK_END_BLOCK':\n if token_text not in ['else', 'catch', 'finally']:\n prefix = 'NEWLINE'\n else:\n if self.opts.brace_style in ['expand', 'end-expand']:\n prefix = 'NEWLINE'\n else:\n prefix = 'SPACE'\n self.output_space_before_token = True\n elif self.last_type == 'TK_SEMICOLON' and self.flags.mode == MODE.BlockStatement:\n # TODO: Should this be for STATEMENT as well?\n prefix = 'NEWLINE'\n elif self.last_type == 'TK_SEMICOLON' and self.is_expression(self.flags.mode):\n prefix = 'SPACE'\n elif self.last_type == 'TK_STRING':\n prefix = 'NEWLINE'\n elif self.last_type == 'TK_WORD':\n prefix = 'SPACE'\n elif self.last_type == 'TK_START_BLOCK':\n prefix = 'NEWLINE'\n elif self.last_type == 'TK_END_EXPR':\n self.output_space_before_token = True\n prefix = 'NEWLINE'\n\n if token_text in self.line_starters:\n if self.flags.last_text == 'else':\n prefix = 'SPACE'\n else:\n prefix = 'NEWLINE'\n\n if token_text in ['else', 'catch', 'finally']:\n if self.last_type != 'TK_END_BLOCK' \\\n or self.opts.brace_style == 'expand' \\\n or self.opts.brace_style == 'end-expand':\n self.append_newline()\n else:\n self.trim_output(True)\n line = self.output_lines[-1]\n # If we trimmed and there's something other than a close block before us\n # put a newline back in. Handles '} // comment' scenario.\n if line.text[-1] != '}':\n self.append_newline()\n\n self.output_space_before_token = True\n\n elif prefix == 'NEWLINE':\n if self.is_special_word(self.flags.last_text):\n # no newline between return nnn\n self.output_space_before_token = True\n elif self.last_type != 'TK_END_EXPR':\n if (self.last_type != 'TK_START_EXPR' or token_text != 'var') and self.flags.last_text != ':':\n # no need to force newline on VAR -\n # for (var x = 0...\n if token_text == 'if' and self.flags.last_word == 'else' and self.flags.last_text != '{':\n self.output_space_before_token = True\n else:\n self.flags.var_line = False\n self.flags.var_line_reindented = False\n self.append_newline()\n elif token_text in self.line_starters and self.flags.last_text != ')':\n self.flags.var_line = False\n self.flags.var_line_reindented = False\n self.append_newline()\n elif self.is_array(self.flags.mode) and self.flags.last_text == ',' and self.last_last_text == '}':\n self.append_newline() # }, in lists get a newline\n elif prefix == 'SPACE':\n self.output_space_before_token = True\n\n\n self.append_token(token_text)\n self.flags.last_word = token_text\n\n if token_text == 'var':\n self.flags.var_line = True\n self.flags.var_line_reindented = False\n self.flags.var_line_tainted = False\n\n\n if token_text == 'do':\n self.flags.do_block = True\n\n if token_text == 'if':\n self.flags.if_block = True", "metadata": "root.Beautifier.handle_word", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1020 }, { "content": " def handle_semicolon(self, token_text):\n if self.start_of_statement():\n # The conditional starts the statement if appropriate.\n # Semicolon can be the start (and end) of a statement\n self.output_space_before_token = False\n while self.flags.mode == MODE.Statement and not self.flags.if_block and not self.flags.do_block:\n self.restore_mode()\n\n self.append_token(token_text)\n self.flags.var_line = False\n self.flags.var_line_reindented = False\n if self.flags.mode == MODE.ObjectLiteral:\n # OBJECT mode is weird and doesn't get reset too well.\n self.flags.mode = MODE.BlockStatement", "metadata": "root.Beautifier.handle_semicolon", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1186 }, { "content": " def handle_string(self, token_text):\n if self.start_of_statement():\n # The conditional starts the statement if appropriate.\n # One difference - strings want at least a space before\n self.output_space_before_token = True\n elif self.last_type == 'TK_WORD':\n self.output_space_before_token = True\n elif self.last_type in ['TK_COMMA', 'TK_START_EXPR', 'TK_EQUALS', 'TK_OPERATOR']:\n if not self.start_of_object_property():\n self.allow_wrap_or_preserved_newline(token_text)\n else:\n self.append_newline()\n\n self.append_token(token_text)", "metadata": "root.Beautifier.handle_string", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1202 }, { "content": " def handle_equals(self, token_text):\n if self.flags.var_line:\n # just got an '=' in a var-line, different line breaking rules will apply\n self.flags.var_line_tainted = True\n\n self.output_space_before_token = True\n self.append_token(token_text)\n self.output_space_before_token = True", "metadata": "root.Beautifier.handle_equals", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1218 }, { "content": " def handle_comma(self, token_text):\n if self.flags.var_line:\n if self.is_expression(self.flags.mode) or self.last_type == 'TK_END_BLOCK':\n # do not break on comma, for ( var a = 1, b = 2\n self.flags.var_line_tainted = False\n\n if self.flags.var_line:\n self.flags.var_line_reindented = True\n\n self.append_token(token_text)\n\n if self.flags.var_line_tainted:\n self.flags.var_line_tainted = False\n self.append_newline()\n else:\n self.output_space_before_token = True\n\n return\n\n if self.last_type == 'TK_END_BLOCK' and self.flags.mode != MODE.Expression:\n self.append_token(token_text)\n if self.flags.mode == MODE.ObjectLiteral and self.flags.last_text == '}':\n self.append_newline()\n else:\n self.output_space_before_token = True\n else:\n if self.flags.mode == MODE.ObjectLiteral:\n self.append_token(token_text)\n self.append_newline()\n else:\n # EXPR or DO_BLOCK\n self.append_token(token_text)\n self.output_space_before_token = True", "metadata": "root.Beautifier.handle_comma", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1228 }, { "content": " def handle_operator(self, token_text):\n space_before = True\n space_after = True\n\n if self.is_special_word(self.flags.last_text):\n # return had a special handling in TK_WORD\n self.output_space_before_token = True\n self.append_token(token_text)\n return\n\n # hack for actionscript's import .*;\n if token_text == '*' and self.last_type == 'TK_DOT' and not self.last_last_text.isdigit():\n self.append_token(token_text)\n return\n\n\n if token_text == ':' and self.flags.in_case:\n self.flags.case_body = True\n self.indent()\n self.append_token(token_text)\n self.append_newline()\n self.flags.in_case = False\n return\n\n if token_text == '::':\n # no spaces around the exotic namespacing syntax operator\n self.append_token(token_text)\n return\n\n # http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1\n # if there is a newline between -- or ++ and anything else we should preserve it.\n if self.input_wanted_newline and (token_text == '--' or token_text == '++'):\n self.append_newline()\n\n\n if token_text in ['--', '++', '!'] \\\n or (token_text in ['+', '-'] \\\n and (self.last_type in ['TK_START_BLOCK', 'TK_START_EXPR', 'TK_EQUALS', 'TK_OPERATOR'] \\\n or self.flags.last_text in self.line_starters or self.flags.last_text == ',')):\n\n space_before = False\n space_after = False\n\n if self.flags.last_text == ';' and self.is_expression(self.flags.mode):\n # for (;; ++i)\n # ^^\n space_before = True\n\n if self.last_type == 'TK_WORD' and self.flags.last_text in self.line_starters:\n space_before = True\n\n if self.flags.mode == MODE.BlockStatement and self.flags.last_text in ['{', ';']:\n # { foo: --i }\n # foo(): --bar\n self.append_newline()\n\n elif token_text == ':':\n if self.flags.ternary_depth == 0:\n if self.flags.mode == MODE.BlockStatement:\n self.flags.mode = MODE.ObjectLiteral\n space_before = False\n else:\n self.flags.ternary_depth -= 1\n elif token_text == '?':\n self.flags.ternary_depth += 1\n\n if space_before:\n self.output_space_before_token = True\n\n self.append_token(token_text)\n\n if space_after:\n self.output_space_before_token = True", "metadata": "root.Beautifier.handle_operator", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1263 }, { "content": " def handle_block_comment(self, token_text):\n lines = token_text.replace('\\x0d', '').split('\\x0a')\n javadoc = False\n\n # block comment starts with a new line\n self.append_newline(preserve_statement_flags = True)\n if len(lines) > 1:\n if not any(l for l in lines[1:] if ( l.strip() == '' or (l.lstrip())[0] != '*')):\n javadoc = True\n\n # first line always indented\n self.append_token(lines[0])\n for line in lines[1:]:\n self.append_newline(preserve_statement_flags = True)\n if javadoc:\n # javadoc: reformat and re-indent\n self.append_token(' ' + line.strip())\n else:\n # normal comments output raw\n self.output_lines[-1].text.append(line)\n\n self.append_newline(preserve_statement_flags = True)", "metadata": "root.Beautifier.handle_block_comment", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1339 }, { "content": " def handle_inline_comment(self, token_text):\n self.output_space_before_token = True\n self.append_token(token_text)\n self.output_space_before_token = True", "metadata": "root.Beautifier.handle_inline_comment", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1362 }, { "content": " def handle_comment(self, token_text):\n if self.input_wanted_newline:\n self.append_newline(preserve_statement_flags = True)\n\n if not self.input_wanted_newline:\n self.trim_output(True)\n\n self.output_space_before_token = True\n self.append_token(token_text)\n self.append_newline(preserve_statement_flags = True)", "metadata": "root.Beautifier.handle_comment", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1368 }, { "content": " def handle_dot(self, token_text):\n if self.is_special_word(self.flags.last_text):\n self.output_space_before_token = True\n else:\n # allow preserved newlines before dots in general\n # force newlines on dots after close paren when break_chained - for bar().baz()\n self.allow_wrap_or_preserved_newline(token_text,\n self.flags.last_text == ')' and self.opts.break_chained_methods)\n\n self.append_token(token_text)", "metadata": "root.Beautifier.handle_dot", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1380 }, { "content": " def handle_unknown(self, token_text):\n self.append_token(token_text)\n if token_text[len(token_text) - 1] == '\\n':\n self.append_newline()", "metadata": "root.Beautifier.handle_unknown", "header": "['class', 'Beautifier', ':', '___EOS___']", "index": 1391 }, { "content": "def mkdir_p(path):\n try:\n os.makedirs(path)\n except OSError as exc: # Python >2.5\n if exc.errno == errno.EEXIST and os.path.isdir(path):\n pass\n else: raise", "metadata": "root.mkdir_p", "header": "['module', '___EOS___']", "index": 1397 }, { "content": "def main():\n\n argv = sys.argv[1:]\n\n try:\n opts, args = getopt.getopt(argv, \"s:c:o:dPjbkil:xhtfvXw:\",\n ['indent-size=','indent-char=','outfile=', 'disable-preserve-newlines',\n 'space-in-paren', 'jslint-happy', 'brace-style=', 'keep-array-indentation',\n 'indent-level=', 'unescape-strings', 'help', 'usage', 'stdin', 'eval-code',\n 'indent-with-tabs', 'keep-function-indentation', 'version', 'e4x', 'wrap-line-length'])\n except getopt.GetoptError as ex:\n print(ex, file=sys.stderr)\n return usage(sys.stderr)\n\n js_options = default_options()\n\n file = None\n outfile = 'stdout'\n if len(args) == 1:\n file = args[0]\n\n for opt, arg in opts:\n if opt in ('--keep-array-indentation', '-k'):\n js_options.keep_array_indentation = True\n if opt in ('--keep-function-indentation','-f'):\n js_options.keep_function_indentation = True\n elif opt in ('--outfile', '-o'):\n outfile = arg\n elif opt in ('--indent-size', '-s'):\n js_options.indent_size = int(arg)\n elif opt in ('--indent-char', '-c'):\n js_options.indent_char = arg\n elif opt in ('--indent-with-tabs', '-t'):\n js_options.indent_with_tabs = True\n elif opt in ('--disable-preserve-newlines', '-d'):\n js_options.preserve_newlines = False\n elif opt in ('--space-in-paren', '-P'):\n js_options.space_in_paren = True\n elif opt in ('--jslint-happy', '-j'):\n js_options.jslint_happy = True\n elif opt in ('--eval-code'):\n js_options.eval_code = True\n elif opt in ('--brace-style', '-b'):\n js_options.brace_style = arg\n elif opt in ('--unescape-strings', '-x'):\n js_options.unescape_strings = True\n elif opt in ('--e4x', '-X'):\n js_options.e4x = True\n elif opt in ('--wrap-line-length ', '-w'):\n js_options.wrap_line_length = int(arg)\n elif opt in ('--stdin', '-i'):\n file = '-'\n elif opt in ('--version', '-v'):\n return print(__version__)\n elif opt in ('--help', '--usage', '-h'):\n return usage()\n\n\n if not file:\n print(\"Must define at least one file.\", file=sys.stderr)\n return usage(sys.stderr)\n else:\n try:\n if outfile == 'stdout':\n print(beautify_file(file, js_options))\n else:\n mkdir_p(os.path.dirname(outfile))\n with open(outfile, 'w') as f:\n f.write(beautify_file(file, js_options) + '\\n')\n except Exception as ex:\n print(ex, file=sys.stderr)\n return 1\n\n # Success\n return 0", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 1406 } ]
[ { "span": "import string", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "js", "beautif", "ier_", "._", "\\u\\u", "version\\u\\u_", "import_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "MIT", " ", "License", " ", "(", "MIT", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2007", "-", "2013", " ", "Ein", "ar", " ", "Lie", "lma", "nis", " ", "and", " ", "contributor", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "obtain", "ing", " ", "a", " ", "copy", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "to", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subject", " ", "to", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "include", "d", " ", "in", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ACTI", "ON", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",", " ", "OUT", " ", "OF", " ", "OR", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONNECTION", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Origina", "ll", "y", " ", "writt", "en", " ", "by", " ", "Ein", "ar", " ", "Lie", "lma", "nis", " ", "et", " ", "al", ".,", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Conversion", " ", "to", " ", "python", " ", "by", " ", "Ein", "ar", " ", "Lie", "lma", "nis", ",", " ", "ein", "ar", "@", "js", "beautif", "ier", ".", "org", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "ing", " ", "improvement", " ", "for", " ", "brace", "-", "less", " ", "and", " ", "semico", "lon", "-", "less", " ", "statements_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "by", " ", "Lia", "m", " ", "New", "man", " ", "<", "bitwise", "man", "@", "gma", "il", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "is", " ", "not", " ", "my", " ", "nativ", "e", " ", "language", ",", " ", "feel", " ", "free", " ", "to", " ", "push", " ", "thing", "s", " ", "aro", "und", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "eit", "her", " ", "from", " ", "command", " ", "line", " ", "(", "script", " ", "display", "s", " ", "its", " ", "usage", " ", "whe", "n", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", "out", " ", "any", " ", "parameter", "s", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", ",", " ", "alternative", "ly", ",", " ", "use", " ", "it", " ", "as", " ", "a", " ", "module", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "import", " ", "js", "beautif", "ier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "res", " ", "=", " ", "js", "beautif", "ier", ".", "beautif", "y", "('", "your", " ", "javascript", " ", "string", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "res", " ", "=", " ", "js", "beautif", "ier", ".", "beautif", "y", "\\u", "file", "('", "some", "\\u", "file", ".", "js", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "you", " ", "may", " ", "speci", "fy", " ", "some", " ", "options", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "opts", " ", "=", " ", "js", "beautif", "ier", ".", "default", "\\u", "options", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "opts", ".", "indent", "\\u", "size", " ", "=", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "res", " ", "=", " ", "js", "beautif", "ier", ".", "beautif", "y", "('", "some", " ", "javascript", "',", " ", "opts", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Her", "e", " ", "are", " ", "the", " ", "avail", "able", " ", "options", ":", " ", "(", "read", " ", "source", ")_", "\\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_", "#", " ", "Us", "ing", " ", "object", " ", "inst", "ead", " ", "of", " ", "string", " ", "to", " ", "allow", " ", "for", " ", "late", "r", " ", "expansion", " ", "of", " ", "info", " ", "abo", "ut", " ", "each", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Bea", "uti", "fier", "Options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "Options_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "indent", "\\u", "size_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent", "\\u", "char_", "=_", "'", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent", "\\u", "with", "\\u", "tabs_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "preserve", "\\u", "newlines_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "preserve", "\\u", "newlines_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "space", "\\u", "in", "\\u", "paren", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "e4", "x_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "js", "lint", "\\u", "happy", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "brace", "\\u", "style_", "=_", "'", "collapse", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keep", "\\u", "array", "\\u", "indentation_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keep", "\\u", "function", "\\u", "indentation_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "eval", "\\u", "code_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "unescape", "\\u", "strings_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wrap", "\\u", "line", "\\u", "length_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "break", "\\u", "chained", "\\u", "methods_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "Options_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"\"", "indent", "\\u", "size", " ", "=", " ", "%", "d", "\\", "10", ";", "indent", "\\u", "char", " ", "=", " ", "[", "%", "s", "]", "\\", "10", ";", "preserve", "\\u", "newline", "s", " ", "=", " ", "%", "s", "\\", "10", ";", "max", "\\u", "preserve", "\\u", "newline", "s", " ", "=", " ", "%", "d", "\\", "10", ";", "space", "\\u", "in", "\\u", "paren", " ", "=", " ", "%", "s", "\\", "10", ";", "js", "lint", "\\u", "happy", " ", "=", " ", "%", "s", "\\", "10", ";", "indent", "\\u", "with", "\\u", "tabs", " ", "=", " ", "%", "s", "\\", "10", ";", "brace", "\\u", "style", " ", "=", " ", "%", "s", "\\", "10", ";", "keep", "\\u", "array", "\\u", "indent", "ation", " ", "=", " ", "%", "s", "\\", "10", ";", "eval", "\\u", "code", " ", "=", " ", "%", "s", "\\", "10", ";", "wrap", "\\u", "line", "\\u", "length", " ", "=", " ", "%", "s", "\\", "10", ";", "unescape", "\\u", "string", "s", " ", "=", " ", "%", "s", "\\", "10", ";\"\"\"_", "%_", "(_", "self_", "._", "indent", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "indent", "\\u", "char_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "preserve", "\\u", "newlines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "max", "\\u", "preserve", "\\u", "newlines_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "space", "\\u", "in", "\\u", "paren", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "js", "lint", "\\u", "happy", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "indent", "\\u", "with", "\\u", "tabs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "brace", "\\u", "style_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "keep", "\\u", "array", "\\u", "indentation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "eval", "\\u", "code_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wrap", "\\u", "line", "\\u", "length_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "unescape", "\\u", "strings_", ",_", "\\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_", "Bea", "uti", "fier", "Flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "Flags_", ":_", "\\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_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mode_", "=_", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "text_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "word_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "var", "\\u", "line_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "var", "\\u", "line", "\\u", "tain", "ted_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "in", "\\u", "html", "\\u", "comment_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "multiline", "\\u", "frame_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "if", "\\u", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "do", "\\u", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "do", "\\u", "while_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "in", "\\u", "case_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "in", "\\u", "case", "\\u", "statement_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "case", "\\u", "body_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent", "ation", "\\u", "level_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "line", "\\u", "indent", "\\u", "level_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "line", "\\u", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tern", "ary", "\\u", "depth_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "had", "\\u", "comment_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "Flags_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "base_", "(_", "self_", ",_", "flags", "\\u", "base_", ",_", "adde", "d\\u", "newline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "indent", "\\u", "level_", "=_", "flags", "\\u", "base_", "._", "indent", "ation", "\\u", "level_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flags", "\\u", "base_", "._", "var", "\\u", "line_", "and_", "flags", "\\u", "base_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "indent", "\\u", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "adde", "d\\u", "newline_", "and_", "flags", "\\u", "base_", "._", "line", "\\u", "indent", "\\u", "level_", ">_", "next", "\\u", "indent", "\\u", "level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "indent", "\\u", "level_", "=_", "flags", "\\u", "base_", "._", "line", "\\u", "indent", "\\u", "level_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parent_", "=_", "flags", "\\u", "base_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "text_", "=_", "flags", "\\u", "base_", "._", "last", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "word_", "=_", "flags", "\\u", "base_", "._", "last", "\\u", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent", "ation", "\\u", "level_", "=_", "next", "\\u", "indent", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Output", "Line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Output", "Line_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "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_", "default", "\\u", "options_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Bea", "uti", "fier", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "beautif", "y_", "(_", "string_", ",_", "opts_", "=_", "default", "\\u", "options_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "Bea", "uti", "fier", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "b_", "._", "beautif", "y_", "(_", "string_", ",_", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "beautif", "y", "\\u", "file_", "(_", "file", "\\u", "name_", ",_", "opts_", "=_", "default", "\\u", "options_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "file", "\\u", "name_", "==_", "'-'_", ":_", "#", " ", "stdin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream_", "=_", "sys_", "._", "stdin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream_", "=_", "open_", "(_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "beautif", "y_", "(_", "''_", "._", "join_", "(_", "stream_", "._", "readlines_", "(_", ")_", ")_", ",_", "opts_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "usage_", "(_", "stream_", "=_", "sys_", "._", "stdout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "js", "beautif", "ier", ".", "py", "@\"_", "+_", "\\u\\u", "version\\u\\u_", "+_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", "Javascript", " ", "beautif", "ier", " ", "(", "http", "://", "js", "beautif", "ier", ".", "org", "/)", "\\", "10", ";", "\\", "10", ";", "Us", "age", ":", " ", "js", "beautif", "ier", ".", "py", " ", "[", "options", "]", " ", "<", "infile", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "infile", ">", " ", "can", " ", "be", " ", "\"-", "\",", " ", "whi", "ch", " ", "means", " ", "std", "in", ".", "\\", "10", ";", " ", " ", " ", " ", "<", "outfile", ">", " ", "default", "s", " ", "to", " ", "stdout", "\\", "10", ";", "\\", "10", ";", "Inp", "ut", " ", "options", ":", "\\", "10", ";", "\\", "10", ";", " ", "-", "i", ",", " ", " ", "--", "std", "in", " ", " ", " ", " ", "read", " ", "input", " ", "from", " ", "std", "in", "\\", "10", ";", "\\", "10", ";", "Output", " ", "options", ":", "\\", "10", ";", "\\", "10", ";", " ", "-", "s", ",", " ", " ", "--", "indent", "-", "size", "=", "NUMB", "ER", " ", " ", " ", " ", " ", "indent", "ation", " ", "size", ".", " ", "(", "default", " ", "4", ").", "\\", "10", ";", " ", "-", "c", ",", " ", " ", "--", "indent", "-", "char", "=", "CHAR", " ", " ", " ", "character", " ", "to", " ", "indent", " ", "with", ".", " ", "(", "default", " ", "space", ").", "\\", "10", ";", " ", "-", "t", ",", " ", " ", "--", "indent", "-", "with", "-", "tabs", " ", " ", " ", "Indent", " ", "with", " ", "tabs", ",", " ", "override", "s", " ", "-", "s", " ", "and", " ", "-", "c", "\\", "10", ";", " ", "-", "d", ",", " ", " ", "--", "disable", "-", "preserve", "-", "newline", "s", " ", " ", "do", " ", "not", " ", "preserve", " ", "exist", "ing", " ", "line", " ", "breaks", ".", "\\", "10", ";", " ", "-", "P", ",", " ", " ", "--", "space", "-", "in", "-", "paren", " ", " ", " ", " ", " ", "add", " ", "padd", "ing", " ", "space", "s", " ", "within", " ", "paren", ",", " ", "ie", ".", " ", "f", "(", " ", "a", ",", " ", "b", " ", ")", "\\", "10", ";", " ", "-", "j", ",", " ", " ", "--", "js", "lint", "-", "happy", " ", " ", " ", "more", " ", "js", "lint", "-", "compatible", " ", "output", "\\", "10", ";", " ", "-", "b", ",", " ", " ", "--", "brace", "-", "style", "=", "collapse", " ", " ", " ", "brace", " ", "style", " ", "(", "collapse", ",", " ", "expand", ",", " ", "end", "-", "expand", ")", "\\", "10", ";", " ", "-", "k", ",", " ", " ", "--", "keep", "-", "array", "-", "indent", "ation", " ", "keep", " ", "array", " ", "indent", "ation", ".", "\\", "10", ";", " ", "-", "o", ",", " ", " ", "--", "outfile", "=", "FILE", " ", " ", " ", "speci", "fy", " ", "a", " ", "file", " ", "to", " ", "output", " ", "to", " ", "(", "default", " ", "stdout", ")", "\\", "10", ";", " ", "-", "f", ",", " ", " ", "--", "keep", "-", "function", "-", "indent", "ation", " ", " ", "Do", " ", "not", " ", "re", "-", "indent", " ", "function", " ", "bodi", "es", " ", "defin", "ed", " ", "in", " ", "var", " ", "lines", ".", "\\", "10", ";", " ", "-", "x", ",", " ", " ", "--", "unescape", "-", "string", "s", " ", " ", " ", "Decode", " ", "printable", " ", "char", "s", " ", "encode", "d", " ", "in", " ", "\\\\\\\\", "x", "NN", " ", "notation", ".", "\\", "10", ";", " ", "-", "X", ",", " ", " ", "--", "e4", "x", " ", " ", "Pass", " ", "E4", "X", " ", "xml", " ", "literal", "s", " ", "through", " ", "unto", "uche", "d", "\\", "10", ";", " ", "-", "w", ",", " ", " ", "--", "wrap", "-", "line", "-", "length", " ", "Atte", "mpt", " ", "to", " ", "wrap", " ", "line", " ", "whe", "n", " ", "it", " ", "exceed", "s", " ", "this", " ", "length", ".", "\\", "10", ";", " ", " ", " ", " ", " ", "NOTE", ":", " ", "Line", " ", "continue", "s", " ", "unti", "l", " ", "next", " ", "wrap", " ", "point", " ", "is", " ", "found", ".", "\\", "10", ";", "\\", "10", ";", "Ra", "rely", " ", "need", "ed", " ", "options", ":", "\\", "10", ";", "\\", "10", ";", " ", "--", "eval", "-", "code", " ", " ", " ", " ", " ", "evaluate", " ", "code", " ", "if", " ", "a", " ", "JS", " ", "interprete", "r", " ", "is", "\\", "10", ";", " ", " ", " ", " ", " ", "install", "ed", ".", " ", "Ma", "y", " ", "be", " ", "usef", "ul", " ", "with", " ", "some", " ", "obf", "usc", "ated", "\\", "10", ";", " ", " ", " ", " ", " ", "script", " ", "but", " ", "poses", " ", "a", " ", "potenti", "al", " ", "security", " ", "issue", ".", "\\", "10", ";", "\\", "10", ";", " ", "-", "l", ",", " ", " ", "--", "indent", "-", "level", "=", "NUMB", "ER", " ", " ", " ", " ", "initial", " ", "indent", "ation", " ", "level", ".", " ", "(", "default", " ", "0", ").", "\\", "10", ";", "\\", "10", ";", " ", "-", "h", ",", " ", " ", "--", "help", ",", " ", "--", "usage", " ", " ", " ", " ", " ", " ", "print", "s", " ", "this", " ", "help", " ", "statem", "ent", ".", "\\", "10", ";", " ", "-", "v", ",", " ", "--", "version", " ", " ", " ", "Show", " ", "the", " ", "version", "\\", "10", ";", "\\", "10", ";\"\"\"_", ",_", "file_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream_", "==_", "sys_", "._", "stderr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "MODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Block", "Statement_", ",_", "Statement_", ",_", "Object", "Literal_", ",_", "Array", "Literal_", ",_", "For", "Initializer", "_", ",_", "Cond", "itional", "_", ",_", "Expression_", "=_", "range_", "(_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\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\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\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_", ",_", "opts_", "=_", "default", "\\u", "options_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "opts_", "=_", "opts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "blank", "\\u", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "blank", "\\u", "state_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "internal", " ", "flags_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "previ", "ous", "\\u", "flags_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flag", "\\u", "store_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "indent", "\\u", "with", "\\u", "tabs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "opts_", "._", "indent", "\\u", "char_", "=_", "\"\\\\", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opts_", "._", "indent", "\\u", "size_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "indent", "\\u", "string_", "=_", "self_", "._", "opts_", "._", "indent", "\\u", "char_", "*_", "self_", "._", "opts_", "._", "indent", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pre", "indent", "\\u", "string_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "type_", "=_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", "#", " ", "last", " ", "token", " ", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "last", "\\u", "text_", "=_", "''_", "#", " ", "pre", "-", "last", " ", "token", " ", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "input_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "lines_", "=_", "[_", "Output", "Line_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "wrapped_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "whitespace", "\\u", "bef", "ore", "\\u", "token_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "whitespace_", "=_", "[_", "\"\\\\", "n", "\"_", ",_", "\"\\\\", "r", "\"_", ",_", "\"\\\\", "t", "\"_", ",_", "\"", " ", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wordc", "har_", "=_", "'", "abcdefg", "hij", "kl", "mn", "op", "qr", "stu", "vw", "xyz", "ABCDE", "FG", "HI", "JK", "LM", "NOP", "QR", "STU", "VW", "XY", "Z", "0123456", "789", "\\u$", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "digits_", "=_", "'", "0123456", "789", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "punct", "_", "=_", "'+", " ", "-", " ", "*", " ", "/", " ", "%", " ", "&", " ", "++", " ", "--", " ", "=", " ", "+=", " ", "-=", " ", "*=", " ", "/", "=", " ", "%", "=", " ", "==", " ", "===", " ", "!=", " ", "!=", "=", " ", ">", " ", "<", " ", ">=", " ", "<=", " ", ">>", " ", "<<", " ", ">>>", " ", ">>>", "=", " ", ">>", "=", " ", "<<", "=", " ", "&&", " ", "&", "=", " ", "|", " ", "||", " ", "!", " ", "!!", " ", ",", " ", ":", " ", "?", " ", "^", " ", "^", "=", " ", "|", "=", " ", "::'", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "punct", "_", "+=_", "'", " ", "<", "?=", " ", "<", "?", " ", "?>", " ", "<", "%", "=", " ", "<", "%", " ", "%", ">'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "punct", "_", "=_", "self_", "._", "punct", "_", "._", "split_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Word", "s", " ", "whi", "ch", " ", "alw", "ay", "s", " ", "shou", "ld", " ", "start", " ", "on", " ", "a", " ", "new", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "line", "\\u", "starter", "s_", "=_", "'", "continue", ",", "try", ",", "throw", ",", "return", ",", "var", ",", "if", ",", "switch", ",", "case", ",", "default", ",", "for", ",", "whi", "le", ",", "break", ",", "function", "'_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "mode_", "(_", "MODE_", "._", "Block", "Statement_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "beautif", "y_", "(_", "self_", ",_", "s_", ",_", "opts_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "opts_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "opts_", "=_", "opts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "brace", "\\u", "style_", "not_", "in_", "[_", "'", "expand", "'_", ",_", "'", "collapse", "'_", ",_", "'", "end", "-", "expand", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "Exception_", "(_", "'", "opts", ".", "brace", "\\u", "style", " ", "must", " ", "be", " ", "\"", "expand", "\",", " ", "\"", "collapse", "\"", " ", "or", " ", "\"", "end", "-", "expand", "\".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "blank", "\\u", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "s_", "and_", "s_", "[_", "0_", "]_", "in_", "[_", "'", " ", "'_", ",_", "'\\\\", "t", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "pre", "indent", "\\u", "string_", "+=_", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "s_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "input_", "=_", "self_", "._", "unpack_", "(_", "s_", ",_", "self_", "._", "opts_", "._", "eval", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handlers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ":_", "self_", "._", "handle", "\\u", "start", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", ":_", "self_", "._", "handle", "\\u", "end", "\\u", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ":_", "self_", "._", "handle", "\\u", "start", "\\u", "block_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", ":_", "self_", "._", "handle", "\\u", "end", "\\u", "block_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "WORD", "'_", ":_", "self_", "._", "handle", "\\u", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "SEMI", "COLON", "'_", ":_", "self_", "._", "handle", "\\u", "semico", "lon_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "STRING", "'_", ":_", "self_", "._", "handle", "\\u", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "EQUAL", "S", "'_", ":_", "self_", "._", "handle", "\\u", "equals_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "OPERATOR", "'_", ":_", "self_", "._", "handle", "\\u", "operator_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "COMMA", "'_", ":_", "self_", "._", "handle", "\\u", "comma_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "BLOCK", "\\u", "COMMENT", "'_", ":_", "self_", "._", "handle", "\\u", "block", "\\u", "comment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "IN", "LINE", "\\u", "COMMENT", "'_", ":_", "self_", "._", "handle", "\\u", "inline", "\\u", "comment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "COMMENT", "'_", ":_", "self_", "._", "handle", "\\u", "comment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "DOT", "'_", ":_", "self_", "._", "handle", "\\u", "dot_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TK", "\\u", "UNK", "NOW", "N", "'_", ":_", "self_", "._", "handle", "\\u", "unknown_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "token", "\\u", "text_", ",_", "token", "\\u", "type_", "=_", "self_", "._", "get", "\\u", "next", "\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "(", "token", "\\u", "text", ",", " ", "token", "\\u", "type", ",", " ", "self", ".", "flags", ".", "mode", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "type_", "==_", "'", "TK", "\\u", "EO", "F", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keep", "\\u", "whitespace_", "=_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", "and_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", "=_", "self_", "._", "n", "\\u", "newlines_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "keep", "\\u", "whitespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "self_", "._", "n", "\\u", "newlines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "append", "\\u", "newline_", "(_", "i_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "not", " ", "keep", "\\u", "whitespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "opts_", "._", "max", "\\u", "preserve", "\\u", "newlines_", "!=_", "0_", "and_", "self_", "._", "n", "\\u", "newlines_", ">_", "self_", "._", "opts_", "._", "max", "\\u", "preserve", "\\u", "newlines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "n", "\\u", "newlines_", "=_", "self_", "._", "opts_", "._", "max", "\\u", "preserve", "\\u", "newlines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "preserve", "\\u", "newlines_", "and_", "self_", "._", "n", "\\u", "newlines_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "n", "\\u", "newlines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "append", "\\u", "newline_", "(_", "i_", "!=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handlers_", "[_", "token", "\\u", "type_", "]_", "(_", "self_", "._", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "clean", "est", " ", "handling", " ", "of", " ", "inline", " ", "comment", "s", " ", "is", " ", "to", " ", "treat", " ", "them", " ", "as", " ", "tho", "ugh", " ", "the", "y", " ", "are", "n", "'", "t", " ", "there", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ju", "st", " ", "continue", " ", "format", "ting", " ", "and", " ", "the", " ", "behavior", " ", "shou", "ld", " ", "be", " ", "logical", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "type_", "!=_", "'", "TK", "\\u", "IN", "LINE", "\\u", "COMMENT", "'_", "and_", "token", "\\u", "type_", "!=_", "'", "TK", "\\u", "COMMENT", "'_", "and_", "token", "\\u", "type_", "!=_", "'", "TK", "\\u", "BLOCK", "\\u", "COMMENT", "'_", "and_", "token", "\\u", "type_", "!=_", "'", "TK", "\\u", "UNK", "NOW", "N", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "last", "\\u", "text_", "=_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "type_", "=_", "token", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "=_", "self_", "._", "token", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "flags_", "._", "had", "\\u", "comment_", "=_", "token", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "COMMENT", "'_", ",_", "'", "TK", "\\u", "IN", "LINE", "\\u", "COMMENT", "'_", ",_", "'", "TK", "\\u", "BLOCK", "\\u", "COMMENT", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "swe", "et", "\\u", "code_", "=_", "''_", "._", "join_", "(_", "self_", "._", "output", "\\u", "lines_", "[_", "0_", "]_", "._", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line", "\\u", "index_", "in_", "range_", "(_", "1_", ",_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "swe", "et", "\\u", "code_", "+=_", "'\\\\", "n", "'_", "+_", "''_", "._", "join_", "(_", "self_", "._", "output", "\\u", "lines_", "[_", "line", "\\u", "index_", "]_", "._", "text_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "swe", "et", "\\u", "code_", "=_", "re_", "._", "sub_", "(_", "'[", "\\\\", "n", " ", "]+$", "'_", ",_", "''_", ",_", "swe", "et", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "swe", "et", "\\u", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unpack_", "(_", "self_", ",_", "source_", ",_", "eval", "code_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "js", "beautif", "ier_", "._", "unpack", "ers_", "as_", "unpack", "ers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "unpack", "ers_", "._", "run_", "(_", "source_", ",_", "eval", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "unpack", "ers_", "._", "Unpack", "ing", "Error_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "error", ":'_", ",_", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "trim", "\\u", "output_", "(_", "self_", ",_", "eat", "\\u", "newlines_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "trim", "\\u", "output", "\\u", "line_", "(_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "eat", "\\u", "newlines_", "and_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", ">_", "1_", "and_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "._", "text_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "lines_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "trim", "\\u", "output", "\\u", "line_", "(_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "trim", "\\u", "output", "\\u", "line_", "(_", "self_", ",_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "len_", "(_", "line_", "._", "text_", ")_", "and_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "._", "text_", "[_", "-_", "1_", "]_", "==_", "'", " ", "'_", "or_", "line_", "._", "text_", "[_", "-_", "1_", "]_", "==_", "self_", "._", "indent", "\\u", "string_", "or_", "line_", "._", "text_", "[_", "-_", "1_", "]_", "==_", "self_", "._", "pre", "indent", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "._", "text_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "special", "\\u", "word_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "in_", "[_", "'", "case", "'_", ",_", "'", "return", "'_", ",_", "'", "do", "'_", ",_", "'", "if", "'_", ",_", "'", "throw", "'_", ",_", "'", "else", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "array_", "(_", "self_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mode_", "==_", "MODE_", "._", "Array", "Literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "expression_", "(_", "self_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mode_", "in_", "[_", "MODE_", "._", "Expression_", ",_", "MODE_", "._", "For", "Initializer", "_", ",_", "MODE_", "._", "Cond", "itional", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "just", "\\u", "adde", "d\\u", "newline_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "len_", "(_", "line_", "._", "text_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "just", "\\u", "adde", "d\\u", "blank", "line_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", "==_", "1_", ":_", "\\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_", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "len_", "(_", "line_", "._", "text_", ")_", "==_", "0_", "\\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_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "self_", ",_", "token", "\\u", "text_", ",_", "force", "\\u", "line", "wrap_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "opts_", "._", "wrap", "\\u", "line", "\\u", "length_", ">_", "0_", "and_", "not_", "force", "\\u", "line", "wrap_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "neve", "r", " ", "wrap", " ", "the", " ", "first", " ", "token", " ", "of", " ", "a", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "line_", "._", "text_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proposed", "\\u", "line", "\\u", "length_", "=_", "len_", "(_", "''_", "._", "join_", "(_", "line_", "._", "text_", ")_", ")_", "+_", "len_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "proposed", "\\u", "line", "\\u", "length_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "proposed", "\\u", "line", "\\u", "length_", ">=_", "self_", "._", "opts_", "._", "wrap", "\\u", "line", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "force", "\\u", "line", "wrap_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "(_", "self_", "._", "opts_", "._", "preserve", "\\u", "newlines_", "and_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", ")_", "or_", "force", "\\u", "line", "wrap_", ")_", "and_", "not_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expression", "s", " ", "and", " ", "array", " ", "literal", "s", " ", "alr", "ead", "y", " ", "indent", " ", "thei", "r", " ", "content", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "or_", "self_", "._", "is", "\\u", "expression_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "wrapped_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\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_", "append", "\\u", "newline_", "(_", "self_", ",_", "force", "\\u", "newline_", "=_", "False_", ",_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "wrapped_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "';'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Statement_", "and_", "not_", "self_", "._", "flags_", "._", "if", "\\u", "block_", "and_", "not_", "self_", "._", "flags_", "._", "do", "\\u", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", ";_", "\\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_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", "==_", "1_", "and_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "newline", " ", "on", " ", "start", " ", "of", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "force", "\\u", "newline_", "or_", "not_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "multiline", "\\u", "frame_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "lines_", "._", "append_", "(_", "Output", "Line_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "append", "\\u", "token", "\\u", "line", "\\u", "indentation_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", "and_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "and_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prevent", " ", "remo", "ving", " ", "of", " ", "this", " ", "whitespace", " ", "as", " ", "redundant", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "._", "text_", "._", "append_", "(_", "''_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "self_", "._", "whitespace", "\\u", "bef", "ore", "\\u", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line_", "._", "text_", "._", "append_", "(_", "item_", ")_", "\\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_", "self_", "._", "pre", "indent", "\\u", "string_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "line_", "._", "text_", "._", "append_", "(_", "self_", "._", "pre", "indent", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "level_", "=_", "self_", "._", "flags_", "._", "indent", "ation", "\\u", "level_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "var", "\\u", "line_", "and_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "output", "\\u", "wrapped_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "indent", "\\u", "string_", "(_", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\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_", "append", "\\u", "indent", "\\u", "string_", "(_", "self_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Never", " ", "indent", " ", "your", " ", "first", " ", "output", " ", "indent", " ", "at", " ", "the", " ", "start", " ", "of", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "line", "\\u", "indent", "\\u", "level_", "=_", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "._", "text_", "._", "append_", "(_", "self_", "._", "indent", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\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_", "append", "\\u", "token", "\\u", "space", "\\u", "before_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "only", " ", "single", " ", "space", " ", "gets", " ", "draw", "n_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "and_", "len_", "(_", "line_", "._", "text_", ")_", "and_", "line_", "._", "text_", "[_", "-_", "1_", "]_", "not_", "in_", "[_", "'", " ", "'_", ",_", "self_", "._", "indent", "\\u", "string_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "._", "text_", "._", "append_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "append", "\\u", "token_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token", "\\u", "line", "\\u", "indentation_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "wrapped_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token", "\\u", "space", "\\u", "before_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "._", "text_", "._", "append_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "indent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "indent", "ation", "\\u", "level_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dei", "nden", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "allow", "\\u", "dei", "nden", "t_", "=_", "self_", "._", "flags_", "._", "indent", "ation", "\\u", "level_", ">_", "0_", "and_", "(_", "(_", "self_", "._", "flags_", "._", "parent_", "==_", "None_", ")_", "or_", "self_", "._", "flags_", "._", "indent", "ation", "\\u", "level_", ">_", "self_", "._", "flags_", "._", "parent_", "._", "indent", "ation", "\\u", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "allow", "\\u", "dei", "nden", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "indent", "ation", "\\u", "level_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "\\u", "redundant", "\\u", "indentation_", "(_", "self_", ",_", "frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "implementation", " ", "is", " ", "effective", " ", "but", " ", "has", " ", "some", " ", "issue", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "less", " ", "than", " ", "great", " ", "perform", "anc", "e", " ", "due", " ", "to", " ", "array", " ", "spl", "ici", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "can", " ", "caus", "e", " ", "line", " ", "wrap", " ", "to", " ", "happ", "en", " ", "too", " ", "soo", "n", " ", "due", " ", "to", " ", "indent", " ", "removal", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "after", " ", "wrap", " ", "points", " ", "are", " ", "calculated", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "issue", "s", " ", "are", " ", "mino", "r", " ", "compare", "d", " ", "to", " ", "ug", "ly", " ", "indent", "ation", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "frame_", "._", "multiline", "\\u", "frame_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "one", " ", "indent", " ", "from", " ", "each", " ", "line", " ", "insi", "de", " ", "this", " ", "section_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index_", "=_", "frame_", "._", "start", "\\u", "line", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "splice", "\\u", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index_", "<_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "skip", " ", "empty", " ", "lines_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "line_", "._", "text_", ")_", "==_", "0_", ":_", "\\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_", "#", " ", "skip", " ", "the", " ", "pre", "indent", " ", "string", " ", "if", " ", "present_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "pre", "indent", "\\u", "string_", "!=_", "''_", "and_", "line_", "._", "text_", "[_", "0_", "]_", "==_", "self_", "._", "pre", "indent", "\\u", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "splice", "\\u", "index_", "=_", "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 ", " _", "splice", "\\u", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "one", " ", "indent", ",", " ", "if", " ", "present_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "line_", "._", "text_", "[_", "splice", "\\u", "index_", "]_", "==_", "self_", "._", "indent", "\\u", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "line_", "._", "text_", "[_", "splice", "\\u", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\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_", "set\\u", "mode_", "(_", "self_", ",_", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flag", "\\u", "store_", "._", "append_", "(_", "self_", "._", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "previ", "ous", "\\u", "flags_", "=_", "self_", "._", "flags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "previ", "ous", "\\u", "flags_", "=_", "Bea", "uti", "fier", "Flags_", "(_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "flags_", "=_", "Bea", "uti", "fier", "Flags_", "(_", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "appl", "y", "\\u", "base_", "(_", "self_", "._", "previ", "ous", "\\u", "flags_", ",_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "start", "\\u", "line", "\\u", "index_", "=_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "restore", "\\u", "mode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "self_", "._", "flag", "\\u", "store_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "previ", "ous", "\\u", "flags_", "=_", "self_", "._", "flags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "=_", "self_", "._", "flag", "\\u", "store_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "of", "\\u", "object\\u", "property_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Object", "Literal_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "':'_", "and_", "self_", "._", "flags_", "._", "tern", "ary", "\\u", "depth_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "of", "\\u", "statement_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'", "do", "'_", "or_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'", "else", "'_", "and_", "self_", "._", "token", "\\u", "text_", "!=_", "'", "if", "'_", ")_", "or_", "(_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", "and_", "(_", "self_", "._", "previ", "ous", "\\u", "flags_", "._", "mode_", "==_", "MODE_", "._", "For", "Initializer", "_", "or_", "self_", "._", "previ", "ous", "\\u", "flags_", "._", "mode_", "==_", "MODE_", "._", "Cond", "itional", "_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Issue", " ", "#", "276", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "startin", "g", " ", "a", " ", "new", " ", "statem", "ent", " ", "with", " ", "[", "if", ",", " ", "for", ",", " ", "whi", "le", ",", " ", "do", "],", " ", "push", " ", "to", " ", "a", " ", "new", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "(", "a", ")", " ", "if", " ", "(", "b", ")", " ", "if", "(", "c", ")", " ", "d", "();", " ", "else", " ", "e", "();", " ", "else", " ", "f", "();", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "self_", "._", "token", "\\u", "text_", ",_", "self_", "._", "token", "\\u", "text_", "in_", "[_", "'", "do", "'_", ",_", "'", "for", "'_", ",_", "'", "if", "'_", ",_", "'", "whi", "le", "'_", "]_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "mode_", "(_", "MODE_", "._", "Statement_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Issue", " ", "#", "275", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "startin", "g", " ", "on", " ", "a", " ", "newline", ",", " ", "all", " ", "of", " ", "a", " ", "statem", "ent", " ", "shou", "ld", " ", "be", " ", "indented", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", ",", " ", "use", " ", "line", " ", "wrapp", "ing", " ", "logic", " ", "for", " ", "indent", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "indent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "wrapped_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "next_", "(_", "self_", ",_", "find_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "\\u", "pos_", "=_", "self_", "._", "parser", "\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "local", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\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_", "c_", "=_", "self_", "._", "input_", "[_", "local", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "(_", "c_", "in_", "self_", "._", "whitespace_", ")_", "and_", "c_", "!=_", "find_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "local", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\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_", "c_", "=_", "self_", "._", "input_", "[_", "local", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "c_", "==_", "find_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "next", "\\u", "token_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "n", "\\u", "newlines_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", ",_", "'", "TK", "\\u", "EO", "F", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "whitespace", "\\u", "bef", "ore", "\\u", "token_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "c_", "in_", "self_", "._", "whitespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "==_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "n", "\\u", "newlines_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "whitespace", "\\u", "bef", "ore", "\\u", "token_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "==_", "self_", "._", "indent", "\\u", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "whitespace", "\\u", "bef", "ore", "\\u", "token_", "._", "append_", "(_", "self_", "._", "indent", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "c_", "!=_", "'\\\\", "r", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "whitespace", "\\u", "bef", "ore", "\\u", "token_", "._", "append_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", ",_", "'", "TK", "\\u", "EO", "F", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "in_", "self_", "._", "wordc", "har_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "in_", "self_", "._", "wordc", "har_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "c_", "=_", "c_", "+_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", "==_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "small", " ", "and", " ", "sur", "pris", "ingl", "y", " ", "unu", "gly", " ", "hack", " ", "for", " ", "IE", "-1", "0", " ", "representation_", "\\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_", "._", "parser", "\\u", "pos_", "!=_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "in_", "'+", "-'_", "and_", "re_", "._", "match_", "(_", "'", "^", "[", "0", "-", "9", "]+", "[", "Ee", "]$", "'_", ",_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sign_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "self_", "._", "get", "\\u", "next", "\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "+=_", "sign_", "+_", "t_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "c_", ",_", "'", "TK", "\\u", "WORD", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'", "in", "'_", ":_", "#", " ", "in", " ", "is", " ", "an", " ", "opera", "tor", ",", " ", "need", " ", "to", " ", "hack", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "c_", ",_", "'", "TK", "\\u", "WORD", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "in_", "'(", "['_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "in_", "')]", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'{'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "';'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "comment_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inline", "\\u", "comment_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'*'_", ":_", "#", " ", "peek", " ", "/*", " ", "..", " ", "*/", " ", "comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "while_", "not_", "(_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'*'_", "and_", "self_", "._", "parser", "\\u", "pos_", "+_", "1_", "<_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "+_", "1_", "]_", "==_", "'/'_", ")_", "and_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "c_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comment_", "+=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", "in_", "'\\\\", "r", "\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "inline", "\\u", "comment_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\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_", "self_", "._", "parser", "\\u", "pos_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "inline", "\\u", "comment_", "and_", "self_", "._", "n", "\\u", "newlines_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "'/*", "'_", "+_", "comment_", "+_", "'*/", "'_", ",_", "'", "TK", "\\u", "IN", "LINE", "\\u", "COMMENT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "'/*", "'_", "+_", "comment_", "+_", "'*/", "'_", ",_", "'", "TK", "\\u", "BLOCK", "\\u", "COMMENT", "'_", "\\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_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'/'_", ":_", "#", " ", "peek", " ", "//", " ", "comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "comment_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "not_", "in_", "'\\\\", "r", "\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "comment_", "+=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "comment_", ",_", "'", "TK", "\\u", "COMMENT", "'_", "\\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_", "c_", "==_", "\"'\"_", "or_", "c_", "==_", "'\"'_", "or_", "(_", "(_", "c_", "==_", "'/'_", ")_", "or_", "(_", "self_", "._", "opts_", "._", "e4", "x_", "and_", "c_", "==_", "\"<\"_", "and_", "re_", "._", "match_", "(_", "'", "^", "<", "(!", "\\\\[", "CD", "ATA", "\\\\[", "[\\\\", "s", "\\\\", "S", "]*", "?\\\\", "]\\\\", "]|", "[-", "a", "-", "z", "A", "-", "Z", ":", "0", "-", "9", "\\u.", "]+", "|\\\\", "{[", "^", "{}", "]*\\\\", "})\\\\", "s", "*([", "-", "a", "-", "z", "A", "-", "Z", ":", "0", "-", "9", "\\u.", "]+", "=(", "\\\\{", "[", "^", "{}", "]*\\\\", "}|", "\"[", "^", "\"]", "*\"", "|\\\\", "'[", "^", "\\\\']", "*\\\\", "')", "\\\\", "s", "*)", "*\\\\", "/?", "\\\\", "s", "*>", "'_", ",_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "-_", "1_", ":_", "]_", ")_", ")_", ")_", "and_", "(_", "(_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "WORD", "'_", "and_", "self_", "._", "is", "\\u", "special", "\\u", "word_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", ")_", ")_", "or_", "(_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", "and_", "self_", "._", "previ", "ous", "\\u", "flags_", "._", "mode_", "in_", "[_", "MODE_", "._", "Cond", "itional", "_", ",_", "MODE_", "._", "For", "Initializer", "_", "]_", ")_", "or_", "(_", "self_", "._", "last", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "COMMENT", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ",_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", ",_", "'", "TK", "\\u", "EQUAL", "S", "'_", ",_", "'", "TK", "\\u", "EO", "F", "'_", ",_", "'", "TK", "\\u", "SEMI", "COLON", "'_", ",_", "'", "TK", "\\u", "COMMA", "'_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sep_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "esc_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "esc", "1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "esc", "2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "ing", "\\u", "string_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in", "\\u", "char", "\\u", "class_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sep_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "handle", " ", "regexp_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "in", "\\u", "char", "\\u", "class_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "esc_", "or_", "in", "\\u", "char", "\\u", "class_", "or_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "!=_", "sep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "result", "ing", "\\u", "string_", "+=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "esc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'\\\\\\\\'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'['_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "in", "\\u", "char", "\\u", "class_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "']'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "in", "\\u", "char", "\\u", "class_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "incomplete", " ", "regex", " ", "whe", "n", " ", "end", "-", "of", "-", "file", " ", "reache", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bai", "l", " ", "out", " ", "with", " ", "what", " ", "has", " ", "receive", "d", " ", "so", " ", "far_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "result", "ing", "\\u", "string_", ",_", "'", "TK", "\\u", "STRING", "'_", "\\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_", "elif_", "self_", "._", "opts_", "._", "e4", "x_", "and_", "sep_", "==_", "'<'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "handle", " ", "e4", "x", " ", "xml", " ", "literals_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "xml", "Reg", "Exp_", "=_", "re_", "._", "compile_", "(_", "'<", "(\\\\", "/?", ")(", "!\\\\", "[", "CD", "ATA", "\\\\[", "[\\\\", "s", "\\\\", "S", "]*", "?\\\\", "]\\\\", "]|", "[-", "a", "-", "z", "A", "-", "Z", ":", "0", "-", "9", "\\u.", "]+", "|\\\\", "{[", "^", "{}", "]*\\\\", "})\\\\", "s", "*([", "-", "a", "-", "z", "A", "-", "Z", ":", "0", "-", "9", "\\u.", "]+", "=(", "\\\\{", "[", "^", "{}", "]*\\\\", "}|", "\"[", "^", "\"]", "*\"", "|\\\\", "'[", "^", "\\\\']", "*\\\\", "')", "\\\\", "s", "*)", "*(", "\\\\/", "?)", "\\\\", "s", "*>", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xml", "Str_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "-_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "xml", "Reg", "Exp_", "._", "match_", "(_", "xml", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "root", "Tag_", "=_", "match_", "._", "group_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "depth_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "match_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "is", "End", "Tag_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "Name_", "=_", "match_", "._", "group_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Singleton", "Tag_", "=_", "(_", "match_", "._", "groups_", "(_", ")_", "[_", "-_", "1_", "]_", "!=_", "\"\"_", ")_", "or_", "(_", "match_", "._", "group_", "(_", "2_", ")_", "[_", "0_", ":_", "8_", "]_", "==_", "\"!", "[", "CD", "ATA", "[\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tag", "Name_", "==_", "root", "Tag_", "and_", "not_", "is", "Singleton", "Tag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "is", "End", "Tag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "depth_", "-=_", "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 ", " ", " _", "depth_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "depth_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match_", "=_", "xml", "Reg", "Exp_", "._", "search_", "(_", "xml", "Str_", ",_", "match_", "._", "end_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "xml", "Length_", "=_", "match_", "._", "end_", "(_", ")_", "#", " ", "+", " ", "len", "(", "match", ".", "group", "())", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "xml", "Length_", "=_", "len_", "(_", "xml", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "xml", "Length_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "xml", "Str_", "[_", ":_", "xml", "Length_", "]_", ",_", "'", "TK", "\\u", "STRING", "'_", "\\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_", "#", " ", "handle", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "while_", "esc_", "or_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "!=_", "sep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "result", "ing", "\\u", "string_", "+=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "esc", "1_", "and_", "esc", "1_", ">=_", "esc", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc", "1_", "=_", "int_", "(_", "result", "ing", "\\u", "string_", "[_", "-_", "esc", "2_", ":_", "]_", ",_", "16_", ")_", "\\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 ", " ", " _", "esc", "1_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "esc", "1_", "and_", "esc", "1_", ">=_", "0x20_", "and_", "esc", "1_", "<=_", "0x7", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc", "1_", "=_", "chr_", "(_", "esc", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "ing", "\\u", "string_", "=_", "result", "ing", "\\u", "string_", "[_", ":_", "-_", "2_", "-_", "esc", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "esc", "1_", "==_", "sep_", "or_", "esc", "1_", "==_", "'\\\\\\\\'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "result", "ing", "\\u", "string_", "+=_", "'\\\\\\\\'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result", "ing", "\\u", "string_", "+=_", "esc", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "esc", "1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "esc", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc", "1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "esc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'\\\\\\\\'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "unescape", "\\u", "strings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'", "x", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc", "1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "esc", "2_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'", "u", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "esc", "1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "esc", "2_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "incomplete", " ", "string", " ", "whe", "n", " ", "end", "-", "of", "-", "file", " ", "reache", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bai", "l", " ", "out", " ", "with", " ", "what", " ", "has", " ", "receive", "d", " ", "so", " ", "far_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "result", "ing", "\\u", "string_", ",_", "'", "TK", "\\u", "STRING", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "ing", "\\u", "string_", "+=_", "sep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sep_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "regexp", "s", " ", "may", " ", "have", " ", "modifiers", " ", "/", "regexp", "/", "MOD", ",", " ", "so", " ", "fetch", " ", "tho", "se", " ", "too", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "in_", "self_", "._", "wordc", "har_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result", "ing", "\\u", "string_", "+=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result", "ing", "\\u", "string_", ",_", "'", "TK", "\\u", "STRING", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'#'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "she", "-", "bang", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", ")_", "==_", "1_", "and_", "len_", "(_", "self_", "._", "output", "\\u", "lines_", "[_", "0_", "]_", "._", "text_", ")_", "==_", "0_", "and_", "len_", "(_", "self_", "._", "input_", ")_", ">_", "self_", "._", "parser", "\\u", "pos_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'!'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result", "ing", "\\u", "string_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "c_", "!=_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "c_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "ing", "\\u", "string_", "+=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result", "ing", "\\u", "string_", "._", "strip_", "(_", ")_", "+_", "'\\\\", "n", "'_", ",_", "'", "TK", "\\u", "UNK", "NOW", "N", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Spi", "der", "monkey", "-", "specific", " ", "sharp", " ", "variab", "les", " ", "for", " ", "circular", " ", "references_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "developer", ".", "moz", "illa", ".", "org", "/", "En", "/", "Shar", "p", "\\u", "variab", "les", "\\u", "in", "\\u", "Ja", "va", "Script_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "mx", "r", ".", "moz", "illa", ".", "org", "/", "moz", "illa", "-", "central", "/", "source", "/", "js", "/", "src", "/", "js", "scan", ".", "cpp", " ", "aro", "und", " ", "line", " ", "193", "5_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sharp", "_", "=_", "'#'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "in_", "self_", "._", "digits_", ":_", "\\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 ", " ", "_", "c_", "=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sharp", "_", "+=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", "or_", "c_", "==_", "'#'_", "or_", "c_", "==_", "'='_", ":_", "\\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_", "if_", "c_", "==_", "'#'_", "or_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'['_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "+_", "1_", "]_", "==_", "']'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sharp", "_", "+=_", "'[]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "==_", "'{'_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "+_", "1_", "]_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sharp", "_", "+=_", "'{}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sharp", "_", ",_", "'", "TK", "\\u", "WORD", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'<'_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "-_", "1_", ":_", "self_", "._", "parser", "\\u", "pos_", "+_", "3_", "]_", "==_", "'<!", "--'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parser", "\\u", "pos_", "+=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "'<!", "--'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "!=_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "+=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "flags_", "._", "in", "\\u", "html", "\\u", "comment_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "c_", ",_", "'", "TK", "\\u", "COMMENT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'-'_", "and_", "self_", "._", "flags_", "._", "in", "\\u", "html", "\\u", "comment_", "and_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "-_", "1_", ":_", "self_", "._", "parser", "\\u", "pos_", "+_", "2_", "]_", "==_", "'--", ">'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "in", "\\u", "html", "\\u", "comment_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'--", ">'_", ",_", "'", "TK", "\\u", "COMMENT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "DOT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "in_", "self_", "._", "punct", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "parser", "\\u", "pos_", "<_", "len_", "(_", "self_", "._", "input_", ")_", "and_", "c_", "+_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "in_", "self_", "._", "punct", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "+=_", "self_", "._", "input_", "[_", "self_", "._", "parser", "\\u", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser", "\\u", "pos_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "parser", "\\u", "pos_", ">=_", "len_", "(_", "self_", "._", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "','_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "COMMA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", "==_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", ",_", "'", "TK", "\\u", "EQUAL", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "c_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "c_", ",_", "'", "TK", "\\u", "UNK", "NOW", "N", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "start", "\\u", "expr_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start", "\\u", "of", "\\u", "statement_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "conditional", " ", "starts", " ", "the", " ", "statem", "ent", " ", "if", " ", "appropr", "iate", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "\\u", "mode_", "=_", "MODE_", "._", "Expression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'['_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "WORD", "'_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "')'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "self_", "._", "line", "\\u", "starter", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "mode_", "(_", "next", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "space", "\\u", "in", "\\u", "paren", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\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_", "next", "\\u", "mode_", "=_", "MODE_", "._", "Array", "Literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'['_", "or_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "','_", "and_", "(_", "self_", "._", "last", "\\u", "last", "\\u", "text_", "==_", "']'_", "or_", "self_", "._", "last", "\\u", "last", "\\u", "text_", "==_", "'}'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "],", " ", "[", " ", "go", "es", " ", "to", " ", "a", " ", "new", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "},", " ", "[", " ", "go", "es", " ", "to", " ", "a", " ", "new", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'", "for", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "mode_", "=_", "MODE_", "._", "For", "Initializer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "[_", "'", "if", "'_", ",_", "'", "whi", "le", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "mode_", "=_", "MODE_", "._", "Cond", "itional", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "mode_", "=_", "MODE_", "._", "Expression_", "\\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_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "';'_", "or_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ",_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", "]_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'.'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "not", "hing", " ", "on", " ", "((", " ", "and", " ", ")(", " ", "and", " ", "][", " ", "and", " ", "](", " ", "and", " ", ".(", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Consider", " ", "whe", "ther", " ", "forcing", " ", "this", " ", "is", " ", "require", "d", ".", " ", " ", "Review", " ", "faili", "ng", " ", "tests", " ", "whe", "n", " ", "remove", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "token", "\\u", "text_", ",_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "wrapped_", "=_", "False_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "not_", "in_", "[_", "'", "TK", "\\u", "WORD", "'_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "flags_", "._", "last", "\\u", "word_", "==_", "'", "function", "'_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "word_", "==_", "'", "typeof", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "function", "()", " ", "vs", " ", "function", " ", "()", ",", " ", "typeof", "()", " ", "vs", " ", "typeof", " ", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "opts_", "._", "js", "lint", "\\u", "happy", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "self_", "._", "line", "\\u", "starter", "s_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'", "catch", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "option", " ", "space", "\\u", "bef", "ore", "\\u", "conditional", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Supp", "ort", " ", "of", " ", "this", " ", "kind", " ", "of", " ", "newline", " ", "prese", "rva", "tion", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "=", " ", "(", "b", " ", "&&", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "c", " ", "||", " ", "d", "))", ";_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "EQUAL", "S", "'_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "start", "\\u", "of", "\\u", "object\\u", "property_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "mode_", "(_", "next", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "space", "\\u", "in", "\\u", "paren", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "all", " ", "case", "s", ",", " ", "if", " ", "we", " ", "newline", " ", "whi", "le", " ", "insi", "de", " ", "an", " ", "express", "ion", " ", "it", " ", "shou", "ld", " ", "be", " ", "indented", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "indent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "end", "\\u", "expr_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "statem", "ents", " ", "insi", "de", " ", "express", "ion", "s", " ", "are", " ", "not", " ", "valid", " ", "synta", "x", ",", " ", "but", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "statem", "ents", " ", "must", " ", "all", " ", "be", " ", "close", "d", " ", "whe", "n", " ", "thei", "r", " ", "container", " ", "closes", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Statement_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "token", "\\u", "text_", "==_", "']'_", "and_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "and_", "self_", "._", "flags_", "._", "multiline", "\\u", "frame_", "and_", "not_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "multiline", "\\u", "frame_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "space", "\\u", "in", "\\u", "paren", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "empty", " ", "paren", "s", " ", "are", " ", "alw", "ay", "s", " ", "\"(", ")\"", " ", "and", " ", "\"[", "]\"", ",", " ", "not", " ", "\"(", " ", ")\"", " ", "or", " ", "\"[", " ", "]\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "trim", "\\u", "output_", "(_", ")_", "\\u\\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_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "token", "\\u", "text_", "==_", "']'_", "and_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "remove", "\\u", "redundant", "\\u", "indentation_", "(_", "self_", "._", "previ", "ous", "\\u", "flags_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "do", " ", "{}", " ", "whi", "le", " ", "()", " ", "//", " ", "no", " ", "statem", "ent", " ", "require", "d", " ", "after_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "do", "\\u", "while_", "and_", "self_", "._", "previ", "ous", "\\u", "flags_", "._", "mode_", "==_", "MODE_", "._", "Cond", "itional", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "previ", "ous", "\\u", "flags_", "._", "mode_", "=_", "MODE_", "._", "Expression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "do", "\\u", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "do", "\\u", "while_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "start", "\\u", "block_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "mode_", "(_", "MODE_", "._", "Block", "Statement_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "empty", "\\u", "braces", "_", "=_", "self_", "._", "is", "\\u", "next_", "(_", "'}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "empty", "\\u", "anonym", "ous", "\\u", "function_", "=_", "empty", "\\u", "braces", "_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "word_", "==_", "'", "function", "'_", "and_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "brace", "\\u", "style_", "==_", "'", "expand", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "type_", "!=_", "'", "TK", "\\u", "OPERATOR", "'_", "and_", "(_", "empty", "\\u", "anonym", "ous", "\\u", "function_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "EQUAL", "S", "'_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "is", "\\u", "special", "\\u", "word_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", ")_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "'", "else", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "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 ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "collapse", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "type_", "not_", "in_", "[_", "'", "TK", "\\u", "OPERATOR", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "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_", "#", " ", "if", " ", "TK", "\\u", "OPERATOR", " ", "or", " ", "TK", "\\u", "START", "\\u", "EXPR", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "previ", "ous", "\\u", "flags_", "._", "mode_", ")_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "','_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "last", "\\u", "last", "\\u", "text_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "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 ", " ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\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_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "end", "\\u", "block_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "statem", "ents", " ", "must", " ", "all", " ", "be", " ", "close", "d", " ", "whe", "n", " ", "thei", "r", " ", "container", " ", "closes", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Statement_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "empty", "\\u", "braces", "_", "=_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "opts_", "._", "brace", "\\u", "style_", "==_", "'", "expand", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "empty", "\\u", "braces", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\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_", "#", " ", "skip", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "empty", "\\u", "braces", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "and_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "opts_", "._", "keep", "\\u", "array", "\\u", "indentation_", "=_", "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 ", " ", "_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "word_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start", "\\u", "of", "\\u", "statement_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "conditional", " ", "starts", " ", "the", " ", "statem", "ent", " ", "if", " ", "appropr", "iate", "._", "\\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_", "elif_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", "and_", "not_", "self_", "._", "is", "\\u", "expression_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "and_", "(_", "self_", "._", "last", "\\u", "type_", "!=_", "'", "TK", "\\u", "OPERATOR", "'_", "or_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'--'_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'+", "+'_", ")_", ")_", "and_", "self_", "._", "last", "\\u", "type_", "!=_", "'", "TK", "\\u", "EQUAL", "S", "'_", "and_", "(_", "self_", "._", "opts_", "._", "preserve", "\\u", "newlines_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "'", "var", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "do", "\\u", "block_", "and_", "not_", "self_", "._", "flags_", "._", "do", "\\u", "while_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "token", "\\u", "text_", "==_", "'", "whi", "le", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "{}", " ", "##", " ", "whi", "le", " ", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "do", "\\u", "while_", "=_", "True_", "\\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_", "#", " ", "do", " ", "{}", " ", "shou", "ld", " ", "alw", "ay", "s", " ", "have", " ", "whi", "le", " ", "as", " ", "the", " ", "next", " ", "word", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "see", " ", "the", " ", "expected", " ", "whi", "le", ",", " ", "recover_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "do", "\\u", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "may", " ", "be", " ", "followe", "d", " ", "by", " ", "else", ",", " ", "or", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bar", "e", "/", "inline", " ", "ifs", " ", "are", " ", "trick", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ne", "ed", " ", "to", " ", "unw", "ind", " ", "the", " ", "mode", "s", " ", "correct", "ly", ":", " ", "if", " ", "(", "a", ")", " ", "if", " ", "(", "b", ")", " ", "c", "();", " ", "else", " ", "d", "();", " ", "else", " ", "e", "();", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "if", "\\u", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "token", "\\u", "text_", "!=_", "'", "else", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Statement_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "flags_", "._", "if", "\\u", "block_", "=_", "False_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'", "case", "'_", "or_", "(_", "token", "\\u", "text_", "==_", "'", "default", "'_", "and_", "self_", "._", "flags_", "._", "in", "\\u", "case", "\\u", "statement_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "case", "\\u", "body_", "or_", "self_", "._", "opts_", "._", "js", "lint", "\\u", "happy", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "case", "\\u", "body_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dei", "nden", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "in", "\\u", "case_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "in", "\\u", "case", "\\u", "statement_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'", "function", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "var", "\\u", "line_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "not_", "self_", "._", "opts_", "._", "keep", "\\u", "function", "\\u", "indentation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "[_", "'}'_", ",_", "';'_", "]_", "or_", "(_", "self_", "._", "just", "\\u", "adde", "d\\u", "newline_", "(_", ")_", "and_", "not_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "[_", "'{'_", ",_", "':'_", ",_", "'='_", ",_", "','_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "there", " ", "is", " ", "a", " ", "nice", " ", "clean", " ", "space", " ", "of", " ", "at", " ", "leas", "t", " ", "one", " ", "blank", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bef", "ore", " ", "a", " ", "new", " ", "function", " ", "definit", "ion", ",", " ", "except", " ", "in", " ", "arrays_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "just", "\\u", "adde", "d\\u", "blank", "line_", "(_", ")_", "and_", "not_", "self_", "._", "flags_", "._", "had", "\\u", "comment_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "WORD", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "[_", "'", "get", "'_", ",_", "'", "set", "'_", ",_", "'", "new", "'_", ",_", "'", "return", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "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 ", " ", "_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "OPERATOR", "'_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "foo", " ", "=", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "expression_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "(", "function_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\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_", "._", "last", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "COMMA", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ",_", "'", "TK", "\\u", "EQUAL", "S", "'_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "start", "\\u", "of", "\\u", "object\\u", "property_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "token", "\\u", "text_", ")_", "\\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_", "token", "\\u", "text_", "==_", "'", "function", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "last", "\\u", "word_", "=_", "token", "\\u", "text_", "\\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_", "prefix_", "=_", "'", "NON", "E", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "token", "\\u", "text_", "not_", "in_", "[_", "'", "else", "'_", ",_", "'", "catch", "'_", ",_", "'", "final", "ly", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "NEWLINE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "opts_", "._", "brace", "\\u", "style_", "in_", "[_", "'", "expand", "'_", ",_", "'", "end", "-", "expand", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "prefix_", "=_", "'", "NEWLINE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "prefix_", "=_", "'", "SPACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "SEMI", "COLON", "'_", "and_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Block", "Statement_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Sho", "ul", "d", " ", "this", " ", "be", " ", "for", " ", "STATE", "MENT", " ", "as", " ", "well", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "NEWLINE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "SEMI", "COLON", "'_", "and_", "self_", "._", "is", "\\u", "expression_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "SPACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "STRING", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "NEWLINE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "WORD", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "SPACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "NEWLINE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "'", "NEWLINE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "in_", "self_", "._", "line", "\\u", "starter", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'", "else", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "SPACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "NEWLINE", "'_", "\\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_", "token", "\\u", "text_", "in_", "[_", "'", "else", "'_", ",_", "'", "catch", "'_", ",_", "'", "final", "ly", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "last", "\\u", "type_", "!=_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", "or_", "self_", "._", "opts_", "._", "brace", "\\u", "style_", "==_", "'", "expand", "'_", "or_", "self_", "._", "opts_", "._", "brace", "\\u", "style_", "==_", "'", "end", "-", "expand", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "trim", "\\u", "output_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "trimmed", " ", "and", " ", "there", "'", "s", " ", "somet", "hing", " ", "other", " ", "than", " ", "a", " ", "close", " ", "block", " ", "bef", "ore", " ", "us_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "a", " ", "newline", " ", "back", " ", "in", ".", " ", " ", "Handle", "s", " ", "'}", " ", "//", " ", "comment", "'", " ", "scen", "ario", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "line_", "._", "text_", "[_", "-_", "1_", "]_", "!=_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "prefix_", "==_", "'", "NEWLINE", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "special", "\\u", "word_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "newline", " ", "bet", "ween", " ", "return", " ", "nn", "n_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "!=_", "'", "TK", "\\u", "END", "\\u", "EXPR", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "last", "\\u", "type_", "!=_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", "or_", "token", "\\u", "text_", "!=_", "'", "var", "'_", ")_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "':'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "need", " ", "to", " ", "force", " ", "newline", " ", "on", " ", "VAR", " ", "-_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "(", "var", " ", "x", " ", "=", " ", "0.", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "token", "\\u", "text_", "==_", "'", "if", "'_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "word_", "==_", "'", "else", "'_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "'{'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "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 ", " ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "text_", "in_", "self_", "._", "line", "\\u", "starter", "s_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "!=_", "')'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "array_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "','_", "and_", "self_", "._", "last", "\\u", "last", "\\u", "text_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "#", " ", "},", " ", "in", " ", "lists", " ", "get", " ", "a", " ", "newline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "prefix_", "==_", "'", "SPACE", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "last", "\\u", "word_", "=_", "token", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'", "var", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "tain", "ted_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'", "do", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "do", "\\u", "block_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'", "if", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "if", "\\u", "block_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "semico", "lon_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start", "\\u", "of", "\\u", "statement_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "conditional", " ", "starts", " ", "the", " ", "statem", "ent", " ", "if", " ", "appropr", "iate", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Semi", "colon", " ", "can", " ", "be", " ", "the", " ", "start", " ", "(", "and", " ", "end", ")", " ", "of", " ", "a", " ", "statement_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Statement_", "and_", "not_", "self_", "._", "flags_", "._", "if", "\\u", "block_", "and_", "not_", "self_", "._", "flags_", "._", "do", "\\u", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "restore", "\\u", "mode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "var", "\\u", "line_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Object", "Literal_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "OBJ", "ECT", " ", "mode", " ", "is", " ", "weird", " ", "and", " ", "doe", "sn", "'", "t", " ", "get", " ", "reset", " ", "too", " ", "well", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "mode_", "=_", "MODE_", "._", "Block", "Statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "string_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "start", "\\u", "of", "\\u", "statement_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "conditional", " ", "starts", " ", "the", " ", "statem", "ent", " ", "if", " ", "appropr", "iate", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "difference", " ", "-", " ", "string", "s", " ", "want", " ", "at", " ", "leas", "t", " ", "a", " ", "space", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "WORD", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "last", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "COMMA", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ",_", "'", "TK", "\\u", "EQUAL", "S", "'_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "start", "\\u", "of", "\\u", "object\\u", "property_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "token", "\\u", "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 ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "equals_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "var", "\\u", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "just", " ", "got", " ", "an", " ", "'=", "'", " ", "in", " ", "a", " ", "var", "-", "line", ",", " ", "different", " ", "line", " ", "break", "ing", " ", "rule", "s", " ", "will", " ", "apply_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "tain", "ted_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "comma_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "var", "\\u", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "expression_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", "or_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "not", " ", "break", " ", "on", " ", "comma", ",", " ", "for", " ", "(", " ", "var", " ", "a", " ", "=", " ", "1", ",", " ", "b", " ", "=", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "tain", "ted_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "var", "\\u", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "rein", "dent", "ed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "tain", "ted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "var", "\\u", "line", "\\u", "tain", "ted_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "END", "\\u", "BLOCK", "'_", "and_", "self_", "._", "flags_", "._", "mode_", "!=_", "MODE_", "._", "Expression_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Object", "Literal_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "'}'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "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 ", " _", "if_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Object", "Literal_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "EXPR", " ", "or", " ", "DO", "\\u", "BLOCK_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "operator_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "space", "\\u", "before_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "space", "\\u", "after_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "special", "\\u", "word_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "had", " ", "a", " ", "special", " ", "handling", " ", "in", " ", "TK", "\\u", "WORD_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hack", " ", "for", " ", "action", "script", "'", "s", " ", "import", " ", ".*", ";_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'*'_", "and_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "DOT", "'_", "and_", "not_", "self_", "._", "last", "\\u", "last", "\\u", "text_", "._", "isdigit_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "':'_", "and_", "self_", "._", "flags_", "._", "in", "\\u", "case_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "case", "\\u", "body_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "indent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flags_", "._", "in", "\\u", "case_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "token", "\\u", "text_", "==_", "'::'", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "space", "s", " ", "aro", "und", " ", "the", " ", "exo", "tic", " ", "names", "pacing", " ", "synta", "x", " ", "operator_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "ecm", "a", "-", "international", ".", "org", "/", "ecm", "a", "-", "262", "/", "5.1", "/", "#", "sec", "-", "7.9", ".1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "there", " ", "is", " ", "a", " ", "newline", " ", "bet", "ween", " ", "--", " ", "or", " ", "++", " ", "and", " ", "anyt", "hing", " ", "else", " ", "we", " ", "shou", "ld", " ", "preserve", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", "and_", "(_", "token", "\\u", "text_", "==_", "'--'_", "or_", "token", "\\u", "text_", "==_", "'+", "+'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\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_", "token", "\\u", "text_", "in_", "[_", "'--'_", ",_", "'+", "+'_", ",_", "'!'_", "]_", "or_", "(_", "token", "\\u", "text_", "in_", "[_", "'+'_", ",_", "'-'_", "]_", "and_", "(_", "self_", "._", "last", "\\u", "type_", "in_", "[_", "'", "TK", "\\u", "START", "\\u", "BLOCK", "'_", ",_", "'", "TK", "\\u", "START", "\\u", "EXPR", "'_", ",_", "'", "TK", "\\u", "EQUAL", "S", "'_", ",_", "'", "TK", "\\u", "OPERATOR", "'_", "]_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "self_", "._", "line", "\\u", "starter", "s_", "or_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "','_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "space", "\\u", "before_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "space", "\\u", "after_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "';'_", "and_", "self_", "._", "is", "\\u", "expression_", "(_", "self_", "._", "flags_", "._", "mode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "(", ";", ";", " ", "++", "i", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "^", "^_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "space", "\\u", "before_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "type_", "==_", "'", "TK", "\\u", "WORD", "'_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "self_", "._", "line", "\\u", "starter", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "space", "\\u", "before_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Block", "Statement_", "and_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "in_", "[_", "'{'_", ",_", "';'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "{", " ", "foo", ":", " ", "--", "i", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "foo", "():", " ", "--", "bar_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\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_", "token", "\\u", "text_", "==_", "':'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "tern", "ary", "\\u", "depth_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "flags_", "._", "mode_", "==_", "MODE_", "._", "Block", "Statement_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "flags_", "._", "mode_", "=_", "MODE_", "._", "Object", "Literal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "space", "\\u", "before_", "=_", "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_", "._", "flags_", "._", "tern", "ary", "\\u", "depth_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token", "\\u", "text_", "==_", "'?'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flags_", "._", "tern", "ary", "\\u", "depth_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "space", "\\u", "before_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "space", "\\u", "after_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "block", "\\u", "comment_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "token", "\\u", "text_", "._", "replace_", "(_", "'\\\\", "x0", "d", "'_", ",_", "''_", ")_", "._", "split_", "(_", "'\\\\", "x0", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "java", "doc_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "block", " ", "comment", " ", "starts", " ", "with", " ", "a", " ", "new", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "lines_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "any_", "(_", "l_", "for_", "l_", "in_", "lines_", "[_", "1_", ":_", "]_", "if_", "(_", "l_", "._", "strip_", "(_", ")_", "==_", "''_", "or_", "(_", "l_", "._", "lstrip_", "(_", ")_", ")_", "[_", "0_", "]_", "!=_", "'*'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "java", "doc_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "line", " ", "alw", "ay", "s", " ", "indented", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "lines_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "lines_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "java", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "java", "doc", ":", " ", "reformat", " ", "and", " ", "re", "-", "indent_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "'", " ", "'_", "+_", "line_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "normal", " ", "comment", "s", " ", "output", " ", "raw_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "lines_", "[_", "-_", "1_", "]_", "._", "text_", "._", "append_", "(_", "line_", ")_", "\\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_", "._", "append", "\\u", "newline_", "(_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "inline", "\\u", "comment_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "comment_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "input", "\\u", "want", "ed", "\\u", "newline_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "trim", "\\u", "output_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "append", "\\u", "newline_", "(_", "preserve", "\\u", "statem", "ent", "\\u", "flags_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "dot_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "special", "\\u", "word_", "(_", "self_", "._", "flags_", "._", "last", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output", "\\u", "space", "\\u", "bef", "ore", "\\u", "token_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allow", " ", "preserved", " ", "newline", "s", " ", "bef", "ore", " ", "dot", "s", " ", "in", " ", "general_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "force", " ", "newline", "s", " ", "on", " ", "dot", "s", " ", "after", " ", "close", " ", "paren", " ", "whe", "n", " ", "break", "\\u", "chained", " ", "-", " ", "for", " ", "bar", "()", ".", "ba", "z", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "allow", "\\u", "wrap", "\\u", "or", "\\u", "preserved", "\\u", "newline_", "(_", "token", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "flags_", "._", "last", "\\u", "text_", "==_", "')'_", "and_", "self_", "._", "opts_", "._", "break", "\\u", "chained", "\\u", "methods_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bea", "uti", "fier", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "unknown_", "(_", "self_", ",_", "token", "\\u", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "token_", "(_", "token", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "token", "\\u", "text_", "[_", "len_", "(_", "token", "\\u", "text_", ")_", "-_", "1_", "]_", "==_", "'\\\\", "n", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "append", "\\u", "newline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "mkd", "ir", "\\u", "p_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "exc_", ":_", "#", " ", "Pyth", "on", " ", ">", "2.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exc_", "._", "errno_", "==_", "errno_", "._", "EE", "XIST", "_", "and_", "os_", "._", "path_", "._", "isdir_", "(_", "path_", ")_", ":_", "\\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_", ":_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argv_", "=_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", ",_", "args_", "=_", "getopt_", "._", "getopt_", "(_", "argv_", ",_", "\"", "s", ":", "c", ":", "o", ":", "d", "Pj", "bk", "il", ":", "xh", "tf", "v", "X", "w", ":\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "indent", "-", "size", "='_", ",_", "'", "indent", "-", "char", "='_", ",_", "'", "outfile", "='_", ",_", "'", "disable", "-", "preserve", "-", "newline", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "space", "-", "in", "-", "paren", "'_", ",_", "'", "js", "lint", "-", "happy", "'_", ",_", "'", "brace", "-", "style", "='_", ",_", "'", "keep", "-", "array", "-", "indent", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "indent", "-", "level", "='_", ",_", "'", "unescape", "-", "string", "s", "'_", ",_", "'", "help", "'_", ",_", "'", "usage", "'_", ",_", "'", "std", "in", "'_", ",_", "'", "eval", "-", "code", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "indent", "-", "with", "-", "tabs", "'_", ",_", "'", "keep", "-", "function", "-", "indent", "ation", "'_", ",_", "'", "version", "'_", ",_", "'", "e4", "x", "'_", ",_", "'", "wrap", "-", "line", "-", "length", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "getopt_", "._", "Get", "opt", "Error_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "ex_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "usage_", "(_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "js", "\\u", "options_", "=_", "default", "\\u", "options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "'", "stdout", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "args_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "opt_", ",_", "arg_", "in_", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "opt_", "in_", "(_", "'--", "keep", "-", "array", "-", "indent", "ation", "'_", ",_", "'-", "k", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "keep", "\\u", "array", "\\u", "indentation_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "opt_", "in_", "(_", "'--", "keep", "-", "function", "-", "indent", "ation", "'_", ",_", "'-", "f", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "keep", "\\u", "function", "\\u", "indentation_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "outfile", "'_", ",_", "'-", "o", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outfile_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "indent", "-", "size", "'_", ",_", "'-", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "indent", "\\u", "size_", "=_", "int_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "indent", "-", "char", "'_", ",_", "'-", "c", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "indent", "\\u", "char_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "indent", "-", "with", "-", "tabs", "'_", ",_", "'-", "t", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "indent", "\\u", "with", "\\u", "tabs_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "disable", "-", "preserve", "-", "newline", "s", "'_", ",_", "'-", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "preserve", "\\u", "newlines_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "space", "-", "in", "-", "paren", "'_", ",_", "'-", "P", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "space", "\\u", "in", "\\u", "paren", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "js", "lint", "-", "happy", "'_", ",_", "'-", "j", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "js", "lint", "\\u", "happy", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "eval", "-", "code", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "eval", "\\u", "code_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "brace", "-", "style", "'_", ",_", "'-", "b", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "brace", "\\u", "style_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "unescape", "-", "string", "s", "'_", ",_", "'-", "x", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "unescape", "\\u", "strings_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "e4", "x", "'_", ",_", "'-", "X", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "e4", "x_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "wrap", "-", "line", "-", "length", " ", "'_", ",_", "'-", "w", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js", "\\u", "options_", "._", "wrap", "\\u", "line", "\\u", "length_", "=_", "int_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "std", "in", "'_", ",_", "'-", "i", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file_", "=_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "version", "'_", ",_", "'-", "v", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "print_", "(_", "\\u\\u", "version\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'--", "help", "'_", ",_", "'--", "usage", "'_", ",_", "'-", "h", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Mus", "t", " ", "defin", "e", " ", "at", " ", "leas", "t", " ", "one", " ", "file", ".\"_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "usage_", "(_", "sys_", "._", "stderr_", ")_", "\\u\\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 ", " _", "if_", "outfile_", "==_", "'", "stdout", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "beautif", "y", "\\u", "file_", "(_", "file_", ",_", "js", "\\u", "options_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mkd", "ir", "\\u", "p_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "outfile_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "outfile_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f_", "._", "write_", "(_", "beautif", "y", "\\u", "file_", "(_", "file_", ",_", "js", "\\u", "options_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "ex_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Success_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 2 ]
Module is imported with 'import' and 'import from'
cdent/wsgi-intercept/wsgi_intercept/http_client_intercept.py
[ { "content": "\"\"\"Intercept HTTP connections that use httplib (Py2) or http.client (Py3).\n\"\"\"\n\ntry:\n import http.client as http_lib\nexcept ImportError:\n import httplib as http_lib\n\nfrom . import WSGI_HTTPConnection, WSGI_HTTPSConnection\n\ntry:\n from http.client import (\n HTTPConnection as OriginalHTTPConnection,\n HTTPSConnection as OriginalHTTPSConnection\n )\nexcept ImportError:\n from httplib import (\n HTTPConnection as OriginalHTTPConnection,\n HTTPSConnection as OriginalHTTPSConnection\n )\n\nHTTPInterceptorMixin = WSGI_HTTPConnection\nHTTPSInterceptorMixin = WSGI_HTTPSConnection\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import http.client as http_lib", "start_line": 4, "start_column": 4, "end_line": 4, "end_column": 34 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Interc", "ept", " ", "HTTP", " ", "connections", " ", "tha", "t", " ", "use", " ", "http", "lib", " ", "(", "Py", "2", ")", " ", "or", " ", "http", ".", "client", " ", "(", "Py", "3", ").", "\\", "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 ", " _", "import_", "http_", "._", "client_", "as_", "http", "\\u", "lib_", "\\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_", "httplib_", "as_", "http", "\\u", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "._", "import_", "WS", "GI", "\\u", "HTTP", "Connection_", ",_", "WS", "GI", "\\u", "HTTP", "SC", "onnect", "ion_", "\\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_", "http_", "._", "client_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "Connection_", "as_", "Origina", "l", "HTTP", "Connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "SC", "onnect", "ion_", "as_", "Origina", "l", "HTTP", "SC", "onnect", "ion_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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_", "httplib_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "Connection_", "as_", "Origina", "l", "HTTP", "Connection_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "SC", "onnect", "ion_", "as_", "Origina", "l", "HTTP", "SC", "onnect", "ion_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "HTTP", "Interc", "ept", "or", "Mixin_", "=_", "WS", "GI", "\\u", "HTTP", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HTTP", "SI", "nter", "cept", "or", "Mixin_", "=_", "WS", "GI", "\\u", "HTTP", "SC", "onnect", "ion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_keypairs.py
[ { "content": " def test_keypair_create(self):\n body = {'keypair': {'name': 'create_test'}}\n res_dict = self.controller.create(self.req, body=body)\n self.assertTrue(len(res_dict['keypair']['fingerprint']) > 0)\n self.assertTrue(len(res_dict['keypair']['private_key']) > 0)\n self._assert_keypair_type(res_dict)", "metadata": "root.KeypairsTestV21.test_keypair_create", "header": "['class', 'KeypairsTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 103 }, { "content": " def test_keypair_import(self):\n body = {\n 'keypair': {\n 'name': 'create_test',\n 'public_key': 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBYIznA'\n 'x9D7118Q1VKGpXy2HDiKyUTM8XcUuhQpo0srqb9rboUp4'\n 'a9NmCwpWpeElDLuva707GOUnfaBAvHBwsRXyxHJjRaI6Y'\n 'Qj2oLJwqvaSaWUbyT1vtryRqy6J3TecN0WINY71f4uymi'\n 'MZP0wby4bKBcYnac8KiCIlvkEl0ETjkOGUq8OyWRmn7lj'\n 'j5SESEUdBP0JnuTFKddWTU/wD6wydeJaUhBTqOlHn0kX1'\n 'GyqoNTE1UEhcM5ZRWgfUZfTjVyDF2kGj3vJLCJtJ8LoGc'\n 'j7YaN4uPg1rBle+izwE/tLonRrds+cev8p6krSSrxWOwB'\n 'bHkXa6OciiJDvkRzJXzf',\n },\n }\n res_dict = self.controller.create(self.req, body=body)\n # FIXME(ja): sholud we check that public_key was sent to create?\n self.assertTrue(len(res_dict['keypair']['fingerprint']) > 0)\n self.assertNotIn('private_key', res_dict['keypair'])\n self._assert_keypair_type(res_dict)", "metadata": "root.KeypairsTestV21.test_keypair_import", "header": "['class', 'KeypairsTestV21', '(', 'test', '.', 'TestCase', ')', ':', '___EOS___']", "index": 170 } ]
[ { "span": "self.assertTrue(len(res_dict['keypair']['fingerprint']) > 0)", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 68 }, { "span": "self.assertTrue(len(res_dict['keypair']['private_key']) > 0)", "start_line": 107, "start_column": 8, "end_line": 107, "end_column": 68 }, { "span": "self.assertTrue(len(res_dict['keypair']['fingerprint']) > 0)", "start_line": 187, "start_column": 8, "end_line": 187, "end_column": 68 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Keyp", "airs", "Test", "V2", "1_", "(_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "keypa", "ir", "\\u", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "{_", "'", "keypa", "ir", "'_", ":_", "{_", "'", "name", "'_", ":_", "'", "create", "\\u", "test", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res", "\\u", "dict_", "=_", "self_", "._", "controller_", "._", "create_", "(_", "self_", "._", "req_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "res", "\\u", "dict_", "[_", "'", "keypa", "ir", "'_", "]_", "[_", "'", "fingerprint", "'_", "]_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "res", "\\u", "dict_", "[_", "'", "keypa", "ir", "'_", "]_", "[_", "'", "private", "\\u", "key", "'_", "]_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "keypa", "ir", "\\u", "type_", "(_", "res", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Keyp", "airs", "Test", "V2", "1_", "(_", "test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "keypa", "ir", "\\u", "import_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keypa", "ir", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "create", "\\u", "test", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "public", "\\u", "key", "'_", ":_", "'", "ssh", "-", "rsa", " ", "AAAA", "B3", "Nz", "a", "C1", "yc", "2E", "AAAA", "DA", "QA", "BAA", "ABA", "QD", "BY", "Iz", "n", "A", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "x", "9", "D7", "118", "Q1", "VK", "Gp", "Xy", "2", "HD", "i", "Ky", "UT", "M", "8", "Xc", "Uu", "h", "Qp", "o0", "sr", "qb", "9", "rbo", "Up", "4", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a9", "Nm", "Cw", "p", "Wp", "e", "El", "DL", "uv", "a7", "0", "7", "GO", "Unf", "a", "BA", "v", "HB", "ws", "RX", "yx", "HJ", "j", "Ra", "I", "6", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Qj", "2o", "LJ", "wq", "va", "Sa", "WU", "by", "T1", "vt", "ry", "Rq", "y", "6", "J", "3", "Te", "c", "N", "0", "WIN", "Y", "7", "1f", "4", "uy", "mi", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MZ", "P0", "wb", "y", "4b", "KB", "c", "Y", "nac", "8", "Ki", "CI", "lv", "k", "El", "0E", "Tj", "k", "OG", "Uq", "8", "O", "y", "WR", "mn", "7", "lj", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "j", "5", "SES", "EU", "d", "BP", "0", "Jn", "u", "TF", "Kd", "d", "WT", "U", "/", "w", "D6", "wy", "de", "Ja", "U", "h", "BT", "q", "Ol", "Hn", "0", "k", "X1", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Gy", "qo", "NT", "E1", "UE", "hc", "M", "5", "ZR", "Wg", "f", "UZ", "f", "Tj", "Vy", "DF", "2", "k", "Gj", "3", "v", "JL", "CJ", "t", "J", "8", "Lo", "Gc", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "j", "7", "Ya", "N", "4", "u", "Pg", "1", "r", "Ble", "+", "iz", "w", "E", "/", "t", "Lon", "Rr", "ds", "+", "ce", "v", "8", "p6", "kr", "SS", "rx", "WO", "w", "B", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "b", "H", "k", "Xa", "6", "Oc", "ii", "JD", "vk", "R", "z", "JX", "zf", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res", "\\u", "dict_", "=_", "self_", "._", "controller_", "._", "create_", "(_", "self_", "._", "req_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME", "(", "ja", "):", " ", "sho", "lud", " ", "we", " ", "check", " ", "tha", "t", " ", "public", "\\u", "key", " ", "was", " ", "sent", " ", "to", " ", "create", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "res", "\\u", "dict_", "[_", "'", "keypa", "ir", "'_", "]_", "[_", "'", "fingerprint", "'_", "]_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "'", "private", "\\u", "key", "'_", ",_", "res", "\\u", "dict_", "[_", "'", "keypa", "ir", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "keypa", "ir", "\\u", "type_", "(_", "res", "\\u", "dict_", ")_", "\\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, 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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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_gotorewards.py
[ { "content": " def getObservation(self):\n (theta, thetad, omega, omegad, omegadd,\n xf, yf, xb, yb, psi) = 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": 99 }, { "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) = 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] ]", "metadata": "root.GotoTask.getObservation", "header": "['class', 'GotoTask', '(', 'BalanceTask', ')', ':', '___EOS___']", "index": 138 }, { "content": " def isFinished(self):\n # Criterion for ending an episode.\n # When the agent reaches the goal, the task is considered learned.\n # When the agent falls down, the episode is over.\n dist_to_goal = self.calc_dist_to_goal()\n heading = self.calc_angle_to_goal()\n heading2 = self.env.getPsi()\n\n if np.abs(self.env.getTilt()) > self.max_tilt:\n print 'distance to goal ', dist_to_goal\n return True\n\n if dist_to_goal < 1e-3:\n print 'reached goal'\n return True\n\n return False", "metadata": "root.GotoTask.isFinished", "header": "['class', 'GotoTask', '(', 'BalanceTask', ')', ':', '___EOS___']", "index": 147 }, { "content": " def getReward(self):\n \n r_factor = 0.0001\n x = np.abs(self.env.getTilt())\n PrevTilt = np.abs(self.env.TempTilt)\n if x>LinearFATileCoding3456BalanceTask.max_tilt:\n R = -15.0\n else:\n if x<1.0/3*LinearFATileCoding3456BalanceTask.max_tilt:\n R = 5.0\n elif 1.0/3*LinearFATileCoding3456BalanceTask.max_tilt<=x and x<=2.0/3*LinearFATileCoding3456BalanceTask.max_tilt:\n R = 1.0\n elif 2.0/3*LinearFATileCoding3456BalanceTask.max_tilt<=x and x<=LinearFATileCoding3456BalanceTask.max_tilt:\n R = -5.0\n if PrevTilt>x:\n R += 3000.0*(PrevTilt-x)\n if PrevTilt>2.0/3*LinearFATileCoding3456BalanceTask.max_tilt:\n R *= 2\n if PrevTilt<x:\n R += 3000.0*(PrevTilt-x)\n temp = self.calc_dist_to_goal()\n heading = self.calc_angle_to_goal()\n if (temp < 1e-3):\n R *= 10.0\n else:\n R -= 3000*np.abs(heading)\n return R", "metadata": "root.LinearFATileCoding3456GoToTaskReward1.getReward", "header": "['class', 'LinearFATileCoding3456GoToTaskReward1', '(', 'LinearFATileCoding3456GoToTask', ')', ':', '___EOS___']", "index": 539 }, { "content": " def getReward(self):\n \n r_factor = 0.0001\n x = np.abs(self.env.getTilt())\n PrevTilt = np.abs(self.env.TempTilt)\n if x>LinearFATileCoding3456BalanceTask.max_tilt:\n R = -15.0\n else:\n if x<1.0/3*LinearFATileCoding3456BalanceTask.max_tilt:\n R = 5.0\n elif 1.0/3*LinearFATileCoding3456BalanceTask.max_tilt<=x and x<=2.0/3*LinearFATileCoding3456BalanceTask.max_tilt:\n R = 1.0\n elif 2.0/3*LinearFATileCoding3456BalanceTask.max_tilt<=x and x<=LinearFATileCoding3456BalanceTask.max_tilt:\n R = -5.0\n if PrevTilt>x:\n R += 3000.0*(PrevTilt-x)\n if PrevTilt>2.0/3*LinearFATileCoding3456BalanceTask.max_tilt:\n R *= 2\n if PrevTilt<x:\n R += 3000.0*(PrevTilt-x)\n temp = self.calc_dist_to_goal()\n heading = self.calc_angle_to_goal()\n if (temp < 1e-3):\n R *= 10.0\n else:\n R -= 200*np.abs(heading)\n return R", "metadata": "root.LinearFATileCoding3456GoToTaskReward2.getReward", "header": "['class', 'LinearFATileCoding3456GoToTaskReward2', '(', 'LinearFATileCoding3456GoToTask', ')', ':', '___EOS___']", "index": 569 } ]
[ { "span": "theta,", "start_line": 100, "start_column": 9, "end_line": 100, "end_column": 14 }, { "span": "thetad,", "start_line": 100, "start_column": 16, "end_line": 100, "end_column": 22 }, { "span": "omega,", "start_line": 100, "start_column": 24, "end_line": 100, "end_column": 29 }, { "span": "omegad,", "start_line": 100, "start_column": 31, "end_line": 100, "end_column": 37 }, { "span": "omegadd,", "start_line": 100, "start_column": 39, "end_line": 100, "end_column": 46 }, { "span": "xf,", "start_line": 101, "start_column": 16, "end_line": 101, "end_column": 18 }, { "span": "yf,", "start_line": 101, "start_column": 20, "end_line": 101, "end_column": 22 }, { "span": "xb,", "start_line": 101, "start_column": 24, "end_line": 101, "end_column": 26 }, { "span": "yb,", "start_line": 101, "start_column": 28, "end_line": 101, "end_column": 30 }, { "span": "psi)", "start_line": 101, "start_column": 32, "end_line": 101, "end_column": 35 }, { "span": "theta,", "start_line": 141, "start_column": 9, "end_line": 141, "end_column": 14 }, { "span": "thetad,", "start_line": 141, "start_column": 16, "end_line": 141, "end_column": 22 }, { "span": "omega,", "start_line": 141, "start_column": 24, "end_line": 141, "end_column": 29 }, { "span": "omegad,", "start_line": 141, "start_column": 31, "end_line": 141, "end_column": 37 }, { "span": "omegadd,", "start_line": 141, "start_column": 39, "end_line": 141, "end_column": 46 }, { "span": "xf,", "start_line": 142, "start_column": 16, "end_line": 142, "end_column": 18 }, { "span": "yf,", "start_line": 142, "start_column": 20, "end_line": 142, "end_column": 22 }, { "span": "xb,", "start_line": 142, "start_column": 24, "end_line": 142, "end_column": 26 }, { "span": "yb,", "start_line": 142, "start_column": 28, "end_line": 142, "end_column": 30 }, { "span": "psi)", "start_line": 142, "start_column": 32, "end_line": 142, "end_column": 35 }, { "span": "heading ", "start_line": 152, "start_column": 8, "end_line": 152, "end_column": 15 }, { "span": "heading2 ", "start_line": 153, "start_column": 8, "end_line": 153, "end_column": 16 }, { "span": "r_factor ", "start_line": 541, "start_column": 8, "end_line": 541, "end_column": 16 }, { "span": "r_factor ", "start_line": 571, "start_column": 8, "end_line": 571, "end_column": 16 } ]
[]
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_", ")_", "=_", "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_", ")_", "=_", "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_", "]_", "]_", "\\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_", "is", "Finished_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Criterion", " ", "for", " ", "ending", " ", "an", " ", "episode", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Whe", "n", " ", "the", " ", "agent", " ", "reache", "s", " ", "the", " ", "goal", ",", " ", "the", " ", "task", " ", "is", " ", "consider", "ed", " ", "learned", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Whe", "n", " ", "the", " ", "agent", " ", "fall", "s", " ", "down", ",", " ", "the", " ", "episode", " ", "is", " ", "over", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dist", "\\u", "to", "\\u", "goal_", "=_", "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\\uNEWLINE\\u\\u\\u_", "heading", "2_", "=_", "self_", "._", "env_", "._", "get", "Psi", "_", "(_", ")_", "\\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 ", " _", "print_", "'", "distance", " ", "to", " ", "goal", " ", "'_", ",_", "dist", "\\u", "to", "\\u", "goal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dist", "\\u", "to", "\\u", "goal_", "<_", "1e-3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "reache", "d", " ", "goal", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Go", "To", "Task", "Reward", "1_", "(_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Go", "To", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Reward", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "factor_", "=_", "0.0001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "np_", "._", "abs_", "(_", "self_", "._", "env_", "._", "get", "Til", "t_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Prev", "Til", "t_", "=_", "np_", "._", "abs_", "(_", "self_", "._", "env_", "._", "Temp", "Til", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x_", ">_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "-_", "15.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "<_", "1.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "1.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", "<=_", "x_", "and_", "x_", "<=_", "2.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "2.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", "<=_", "x_", "and_", "x_", "<=_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "-_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Prev", "Til", "t_", ">_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "+=_", "3000", ".0_", "*_", "(_", "Prev", "Til", "t_", "-_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Prev", "Til", "t_", ">_", "2.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "*=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Prev", "Til", "t_", "<_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "+=_", "3000", ".0_", "*_", "(_", "Prev", "Til", "t_", "-_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "temp_", "=_", "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\\uNEWLINE\\u\\u\\u_", "if_", "(_", "temp_", "<_", "1e-3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "*=_", "10.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 ", " _", "R_", "-=_", "3000_", "*_", "np_", "._", "abs_", "(_", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Go", "To", "Task", "Reward", "2_", "(_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Go", "To", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Reward", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "factor_", "=_", "0.0001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "np_", "._", "abs_", "(_", "self_", "._", "env_", "._", "get", "Til", "t_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Prev", "Til", "t_", "=_", "np_", "._", "abs_", "(_", "self_", "._", "env_", "._", "Temp", "Til", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x_", ">_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "-_", "15.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "<_", "1.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "1.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", "<=_", "x_", "and_", "x_", "<=_", "2.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "2.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", "<=_", "x_", "and_", "x_", "<=_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "=_", "-_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Prev", "Til", "t_", ">_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "+=_", "3000", ".0_", "*_", "(_", "Prev", "Til", "t_", "-_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Prev", "Til", "t_", ">_", "2.0_", "/_", "3_", "*_", "Linea", "r", "FA", "Til", "e", "Codi", "ng", "3456", "Balance", "Task_", "._", "max", "\\u", "tilt", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "*=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Prev", "Til", "t_", "<_", "x_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "+=_", "3000", ".0_", "*_", "(_", "Prev", "Til", "t_", "-_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "temp_", "=_", "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\\uNEWLINE\\u\\u\\u_", "if_", "(_", "temp_", "<_", "1e-3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "R_", "*=_", "10.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 ", " _", "R_", "-=_", "200_", "*_", "np_", "._", "abs_", "(_", "heading_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "R_", "\\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, 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, 4, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jmg/elixir/tests/test_autoload.py
[ { "content": " def test_simple(self):\n conn = metadata.bind.connect()\n conn.execute(\"CREATE TABLE a (\"\n \"id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n \"name VARCHAR(32))\")\n conn.close()\n\n class A(Entity):\n pass\n\n setup_all()\n\n a1 = A(name=\"a1\")\n a2 = A(name=\"a2\")\n\n session.commit()\n session.expunge_all()\n\n a1 = A.get_by(name=\"a1\")\n a2 = A.get_by(name=\"a2\")\n assert a1.name == 'a1'\n assert a2.name == 'a2'", "metadata": "root.TestAutoload.test_simple", "header": "['class', 'TestAutoload', '(', 'object', ')', ':', '___EOS___']", "index": 33 }, { "content": " def test_fk_auto_join_sa(self):\n # SQLAlchemy produces the join in this case\n person_table = Table('person', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(32)))\n\n animal_table = Table('animal', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(30)),\n Column('owner_id', Integer, ForeignKey('person.id')))\n\n metadata.create_all()\n metadata.clear()\n\n class Person(Entity):\n pets = OneToMany('Animal')\n\n class Animal(Entity):\n owner = ManyToOne('Person')\n\n setup_all()\n\n snowball = Animal(name=\"Snowball\")\n snowball2 = Animal(name=\"Snowball II\")\n slh = Animal(name=\"Santa's Little Helper\")\n homer = Person(name=\"Homer\", pets=[slh, snowball])\n lisa = Person(name=\"Lisa\", pets=[snowball2])\n\n session.commit()\n session.expunge_all()\n\n homer = Person.get_by(name=\"Homer\")\n lisa = Person.get_by(name=\"Lisa\")\n slh = Animal.get_by(name=\"Santa's Little Helper\")\n\n assert len(homer.pets) == 2\n assert homer == slh.owner\n assert lisa.pets[0].name == \"Snowball II\"", "metadata": "root.TestAutoload.test_fk_auto_join_sa", "header": "['class', 'TestAutoload', '(', 'object', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_fk_auto_join_colname(self):\n person_table = Table('person', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(32)))\n\n animal_table = Table('animal', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(30)),\n Column('owner_id', Integer, ForeignKey('person.id')),\n Column('feeder_id', Integer, ForeignKey('person.id')))\n\n metadata.create_all()\n metadata.clear()\n\n class Person(Entity):\n pets = OneToMany('Animal', inverse='owner')\n animals = OneToMany('Animal', inverse='feeder')\n\n class Animal(Entity):\n owner = ManyToOne('Person', colname='owner_id')\n feeder = ManyToOne('Person', colname='feeder_id')\n\n setup_all()\n\n snowball = Animal(name=\"Snowball II\")\n slh = Animal(name=\"Santa's Little Helper\")\n homer = Person(name=\"Homer\", animals=[snowball, slh], pets=[slh])\n lisa = Person(name=\"Lisa\", pets=[snowball])\n\n session.commit()\n session.expunge_all()\n\n homer = Person.get_by(name=\"Homer\")\n lisa = Person.get_by(name=\"Lisa\")\n slh = Animal.get_by(name=\"Santa's Little Helper\")\n\n assert len(homer.animals) == 2\n assert homer == lisa.pets[0].feeder\n assert homer == slh.owner", "metadata": "root.TestAutoload.test_fk_auto_join_colname", "header": "['class', 'TestAutoload', '(', 'object', ')', ':', '___EOS___']", "index": 95 }, { "content": " def test_m2m(self):\n person_table = Table('person', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(32)))\n\n category_table = Table('category', metadata,\n Column('name', String(30), primary_key=True))\n\n person_category_table = Table('person_category', metadata,\n Column('person_id', Integer, ForeignKey('person.id')),\n Column('category_name', String(30), ForeignKey('category.name')))\n\n metadata.create_all()\n metadata.clear()\n\n class Person(Entity):\n categories = ManyToMany('Category',\n tablename='person_category')\n\n class Category(Entity):\n persons = ManyToMany('Person',\n tablename='person_category')\n\n setup_all()\n\n stupid = Category(name=\"Stupid\")\n simpson = Category(name=\"Simpson\")\n old = Category(name=\"Old\")\n\n grampa = Person(name=\"Abe\", categories=[simpson, old])\n homer = Person(name=\"Homer\", categories=[simpson, stupid])\n bart = Person(name=\"Bart\")\n lisa = Person(name=\"Lisa\")\n\n simpson.persons.extend([bart, lisa])\n\n session.commit()\n session.expunge_all()\n\n c = Category.get_by(name=\"Simpson\")\n grampa = Person.get_by(name=\"Abe\")\n\n assert len(c.persons) == 4\n assert c in grampa.categories", "metadata": "root.TestAutoload.test_m2m", "header": "['class', 'TestAutoload', '(', 'object', ')', ':', '___EOS___']", "index": 169 }, { "content": " def test_m2m_selfref(self):\n person_table = Table('person', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(32)))\n\n person_person_table = Table('person_person', metadata,\n Column('person_id1', Integer, ForeignKey('person.id')),\n Column('person_id2', Integer, ForeignKey('person.id')))\n\n metadata.create_all()\n metadata.clear()\n\n class Person(Entity):\n appreciate = ManyToMany('Person',\n tablename='person_person',\n local_colname='person_id1')\n isappreciatedby = ManyToMany('Person',\n tablename='person_person',\n # this one is not necessary\n local_colname='person_id2')\n\n setup_all()\n\n barney = Person(name=\"Barney\")\n homer = Person(name=\"Homer\", appreciate=[barney])\n\n session.commit()\n session.expunge_all()\n\n homer = Person.get_by(name=\"Homer\")\n barney = Person.get_by(name=\"Barney\")\n\n assert barney in homer.appreciate\n assert homer in barney.isappreciatedby", "metadata": "root.TestAutoload.test_m2m_selfref", "header": "['class', 'TestAutoload', '(', 'object', ')', ':', '___EOS___']", "index": 262 } ]
[ { "span": "a1 ", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 10 }, { "span": "a2 ", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 10 }, { "span": "homer ", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 13 }, { "span": "lisa ", "start_line": 82, "start_column": 8, "end_line": 82, "end_column": 12 }, { "span": "homer ", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 13 }, { "span": "lisa ", "start_line": 122, "start_column": 8, "end_line": 122, "end_column": 12 }, { "span": "grampa ", "start_line": 198, "start_column": 8, "end_line": 198, "end_column": 14 }, { "span": "homer ", "start_line": 286, "start_column": 8, "end_line": 286, "end_column": 13 } ]
[ { "span": "a1 ", "start_line": 51, "start_column": 8, "end_line": 51, "end_column": 10 }, { "span": "a2 ", "start_line": 52, "start_column": 8, "end_line": 52, "end_column": 10 }, { "span": "homer ", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 13 }, { "span": "lisa ", "start_line": 88, "start_column": 8, "end_line": 88, "end_column": 12 }, { "span": "homer ", "start_line": 127, "start_column": 8, "end_line": 127, "end_column": 13 }, { "span": "lisa ", "start_line": 128, "start_column": 8, "end_line": 128, "end_column": 12 }, { "span": "grampa ", "start_line": 209, "start_column": 8, "end_line": 209, "end_column": 14 }, { "span": "homer ", "start_line": 291, "start_column": 8, "end_line": 291, "end_column": 13 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Auto", "load_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "metadata_", "._", "bind_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "execute_", "(_", "\"", "CREATE", " ", "TAB", "LE", " ", "a", " ", "(\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "id", " ", "INTEG", "ER", " ", "PRIMA", "RY", " ", "KEY", " ", "AUTO", "INCREMENT", ",\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", " ", "VARCHA", "R", "(", "32", "))\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "A_", "(_", "Entity_", ")_", ":_", "\\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", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a1_", "=_", "A_", "(_", "name_", "=_", "\"", "a1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "A_", "(_", "name_", "=_", "\"", "a2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "exp", "unge", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a1_", "=_", "A_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "a1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "A_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "a2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "a1_", "._", "name_", "==_", "'", "a1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "a2_", "._", "name_", "==_", "'", "a2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auto", "load_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fk", "\\u", "auto", "\\u", "join", "\\u", "sa_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "SQL", "Al", "chem", "y", " ", "produce", "s", " ", "the", " ", "join", " ", "in", " ", "this", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "person", "\\u", "table_", "=_", "Table_", "(_", "'", "person", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "32_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "animal", "\\u", "table_", "=_", "Table_", "(_", "'", "animal", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "30_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "owner", "\\u", "id", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "person", ".", "id", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Person_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pets", "_", "=_", "One", "To", "Many", "_", "(_", "'", "Anima", "l", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Anima", "l_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "owner_", "=_", "Many", "To", "One_", "(_", "'", "Person", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "snow", "ball_", "=_", "Anima", "l_", "(_", "name_", "=_", "\"", "Snow", "bal", "l", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snow", "bal", "l2_", "=_", "Anima", "l_", "(_", "name_", "=_", "\"", "Snow", "bal", "l", " ", "II", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sl", "h_", "=_", "Anima", "l_", "(_", "name_", "=_", "\"", "Santa", "'", "s", " ", "Litt", "le", " ", "Help", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "home", "r_", "=_", "Person_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ",_", "pets", "_", "=_", "[_", "sl", "h_", ",_", "snow", "ball_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lis", "a_", "=_", "Person_", "(_", "name_", "=_", "\"", "Lis", "a", "\"_", ",_", "pets", "_", "=_", "[_", "snow", "bal", "l2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "exp", "unge", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "home", "r_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lis", "a_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Lis", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sl", "h_", "=_", "Anima", "l_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Santa", "'", "s", " ", "Litt", "le", " ", "Help", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "home", "r_", "._", "pets", "_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "home", "r_", "==_", "sl", "h_", "._", "owner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "lis", "a_", "._", "pets", "_", "[_", "0_", "]_", "._", "name_", "==_", "\"", "Snow", "bal", "l", " ", "II", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auto", "load_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fk", "\\u", "auto", "\\u", "join", "\\u", "colname_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "person", "\\u", "table_", "=_", "Table_", "(_", "'", "person", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "32_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "animal", "\\u", "table_", "=_", "Table_", "(_", "'", "animal", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "30_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "owner", "\\u", "id", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "person", ".", "id", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "feeder", "\\u", "id", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "person", ".", "id", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Person_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pets", "_", "=_", "One", "To", "Many", "_", "(_", "'", "Anima", "l", "'_", ",_", "inverse_", "=_", "'", "owner", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "animal", "s_", "=_", "One", "To", "Many", "_", "(_", "'", "Anima", "l", "'_", ",_", "inverse_", "=_", "'", "feeder", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Anima", "l_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "owner_", "=_", "Many", "To", "One_", "(_", "'", "Person", "'_", ",_", "colname_", "=_", "'", "owner", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feeder", "_", "=_", "Many", "To", "One_", "(_", "'", "Person", "'_", ",_", "colname_", "=_", "'", "feeder", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "snow", "ball_", "=_", "Anima", "l_", "(_", "name_", "=_", "\"", "Snow", "bal", "l", " ", "II", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sl", "h_", "=_", "Anima", "l_", "(_", "name_", "=_", "\"", "Santa", "'", "s", " ", "Litt", "le", " ", "Help", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "home", "r_", "=_", "Person_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ",_", "animal", "s_", "=_", "[_", "snow", "ball_", ",_", "sl", "h_", "]_", ",_", "pets", "_", "=_", "[_", "sl", "h_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lis", "a_", "=_", "Person_", "(_", "name_", "=_", "\"", "Lis", "a", "\"_", ",_", "pets", "_", "=_", "[_", "snow", "ball_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "exp", "unge", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "home", "r_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lis", "a_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Lis", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sl", "h_", "=_", "Anima", "l_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Santa", "'", "s", " ", "Litt", "le", " ", "Help", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "home", "r_", "._", "animal", "s_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "home", "r_", "==_", "lis", "a_", "._", "pets", "_", "[_", "0_", "]_", "._", "feeder", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "home", "r_", "==_", "sl", "h_", "._", "owner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auto", "load_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "m2", "m_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "person", "\\u", "table_", "=_", "Table_", "(_", "'", "person", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "32_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "category", "\\u", "table_", "=_", "Table_", "(_", "'", "category", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "30_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "person", "\\u", "category", "\\u", "table_", "=_", "Table_", "(_", "'", "person", "\\u", "category", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "person", "\\u", "id", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "person", ".", "id", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "category", "\\u", "name", "'_", ",_", "String_", "(_", "30_", ")_", ",_", "Fore", "ign", "Key_", "(_", "'", "category", ".", "name", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Person_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "categories_", "=_", "Many", "To", "Many", "_", "(_", "'", "Cate", "gory", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "'", "person", "\\u", "category", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Category_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "persons_", "=_", "Many", "To", "Many", "_", "(_", "'", "Person", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "'", "person", "\\u", "category", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stu", "pid_", "=_", "Category_", "(_", "name_", "=_", "\"", "Stu", "pid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simp", "son_", "=_", "Category_", "(_", "name_", "=_", "\"", "Simp", "son", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "Category_", "(_", "name_", "=_", "\"", "Old", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gram", "pa_", "=_", "Person_", "(_", "name_", "=_", "\"", "Ab", "e", "\"_", ",_", "categories_", "=_", "[_", "simp", "son_", ",_", "old_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "home", "r_", "=_", "Person_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ",_", "categories_", "=_", "[_", "simp", "son_", ",_", "stu", "pid_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bart", "_", "=_", "Person_", "(_", "name_", "=_", "\"", "Bar", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lis", "a_", "=_", "Person_", "(_", "name_", "=_", "\"", "Lis", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simp", "son_", "._", "persons_", "._", "extend_", "(_", "[_", "bart", "_", ",_", "lis", "a_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "exp", "unge", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "Category_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Simp", "son", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gram", "pa_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Ab", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "c_", "._", "persons_", ")_", "==_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "in_", "gram", "pa_", "._", "categories_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auto", "load_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "m2", "m", "\\u", "self", "ref_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "person", "\\u", "table_", "=_", "Table_", "(_", "'", "person", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "32_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "person", "\\u", "person", "\\u", "table_", "=_", "Table_", "(_", "'", "person", "\\u", "person", "'_", ",_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "person", "\\u", "id", "1", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "person", ".", "id", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "person", "\\u", "id2", "'_", ",_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "person", ".", "id", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Person_", "(_", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app", "reci", "ate_", "=_", "Many", "To", "Many", "_", "(_", "'", "Person", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "'", "person", "\\u", "person", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "colname_", "=_", "'", "person", "\\u", "id", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "isa", "ppr", "eci", "ated", "by_", "=_", "Many", "To", "Many", "_", "(_", "'", "Person", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tablename_", "=_", "'", "person", "\\u", "person", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "one", " ", "is", " ", "not", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "colname_", "=_", "'", "person", "\\u", "id2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bar", "ne", "y_", "=_", "Person_", "(_", "name_", "=_", "\"", "Bar", "ne", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "home", "r_", "=_", "Person_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ",_", "app", "reci", "ate_", "=_", "[_", "bar", "ne", "y_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "exp", "unge", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "home", "r_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Home", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bar", "ne", "y_", "=_", "Person_", "._", "get", "\\u", "by_", "(_", "name_", "=_", "\"", "Bar", "ne", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "bar", "ne", "y_", "in_", "home", "r_", "._", "app", "reci", "ate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "home", "r_", "in_", "bar", "ne", "y_", "._", "isa", "ppr", "eci", "ated", "by_", "\\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,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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, 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, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
datastax/cstar_perf/tool/cstar_perf/tool/fab_flamegraph.py
[ { "content": "\"\"\"\nFabric file to bootstrap Profiling Flamegraph on a set of nodes\n\"\"\"\n\nimport os\nimport logging\nimport time\nimport sh\nfrom fabric import api as fab\nfrom distutils import version as v\n\nlogging.basicConfig()\nlogger = logging.getLogger('flamegraph')\nlogger.setLevel(logging.INFO)\n\n# used internally, perf recording is stopped using SIGINT\nPERF_RECORDING_DURATION = 432000 # 5 days\ncommon_module = None\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 set_common_module(module):\n global common_module\n common_module = module", "metadata": "root.set_common_module", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def is_enabled(revision_config=None):\n is_compatible = True\n is_enabled = common_module.config.get('flamegraph', False)\n if revision_config:\n if revision_config.get('product', 'cassandra') == 'dse':\n logger.info('Flamegraph is not compatible with DSE yet')\n is_compatible = False\n jvm = revision_config.get('java_home', '')\n try:\n jvm = os.path.basename(jvm)\n jvm = jvm[jvm.index('1'):]\n if v.LooseVersion(jvm) < v.LooseVersion('1.8.0_60'):\n logger.info('Flamegraph is not compatible with java <1.8.0_60')\n is_compatible = False\n except ValueError:\n pass\n return is_enabled and is_compatible", "metadata": "root.is_enabled", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def get_flamegraph_paths():\n perf_map_agent_path = os.path.expanduser('~/fab/perf-map-agent')\n flamegraph_path = os.path.expanduser('~/fab/flamegraph')\n\n return (perf_map_agent_path, flamegraph_path)", "metadata": "root.get_flamegraph_paths", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def get_flamegraph_directory():\n return common_module.config.get('flamegraph_directory', '/tmp/flamegraph')", "metadata": "root.get_flamegraph_directory", "header": "['module', '___EOS___']", "index": 51 }, { "content": "@fab.parallel\ndef copy_flamegraph(local_directory, rev_num):\n logger.info(\"Copying Flamegraph data\")\n cfg = common_module.config['hosts'][fab.env.host]\n host_log_dir = os.path.join(local_directory, cfg['hostname'])\n flamegraph_directory = get_flamegraph_directory()\n os.makedirs(host_log_dir)\n with fab.settings(warn_only=True):\n fab.get(os.path.join(flamegraph_directory, 'flamegraph_revision_{}.svg'.format(rev_num)), host_log_dir)\n fab.get(os.path.join(flamegraph_directory, 'perf_revision_{}.data'.format(rev_num)), host_log_dir)", "metadata": "root.copy_flamegraph", "header": "['module', '___EOS___']", "index": 55 }, { "content": "@fab.parallel\ndef setup():\n logger.info(\"Setup Flamegraph dependencies\")\n flamegraph_directory = get_flamegraph_directory()\n perf_map_agent_path, flamegraph_path = get_flamegraph_paths()\n java_home = common_module.config['jdk7_home']\n common_module.run_python_script(\n 'flamegraph',\n 'setup',\n '\"{}\", \"{}\", \"{}\", \"{}\"'.format(flamegraph_directory, flamegraph_path, perf_map_agent_path, java_home)\n )", "metadata": "root.setup", "header": "['module', '___EOS___']", "index": 67 }, { "content": "@fab.parallel\ndef ensure_stopped_perf_agent():\n logger.info(\"Ensure there are no perf agent running\")\n common_module.run_python_script('flamegraph', 'ensure_stopped_perf_agent', '')", "metadata": "root.ensure_stopped_perf_agent", "header": "['module', '___EOS___']", "index": 80 }, { "content": "@fab.parallel\ndef stop_perf_agent():\n logger.info(\"Stopping Flamegraph perf agent\")\n common_module.run_python_script(\n 'utils',\n 'find_and_kill_process',\n '\"{}\", {}'.format(\"[^/]perf record -F\", 'child_process=True')\n )\n\n flamegraph_directory = get_flamegraph_directory()\n fab.run('sudo chmod o+r {}'.format(os.path.join(flamegraph_directory, '*')))", "metadata": "root.stop_perf_agent", "header": "['module', '___EOS___']", "index": 86 }, { "content": "@fab.parallel\ndef generate_flamegraph(rev_num):\n logger.info(\"Generate Flamegraph\")\n perf_map_agent_path, flamegraph_path = get_flamegraph_paths()\n java_home = common_module.config['jdk7_home']\n flamegraph_directory = get_flamegraph_directory()\n\n perf_data_file = os.path.join(flamegraph_directory, 'perf_revision_{}.data'.format(rev_num + 1))\n flamegraph_file = os.path.join(flamegraph_directory, 'flamegraph_revision_{}.svg'.format(rev_num + 1))\n stacks_file = os.path.join(flamegraph_directory, 'perf.stacks')\n collapsed_file = os.path.join(flamegraph_directory, 'perf.collapsed')\n\n # Generate java symbol map\n output = common_module.run_python_script(\n 'utils',\n 'find_process_pid',\n '\"{}\"'.format(\"java.*Cassandra\")\n )\n cassandra_pids = common_module.parse_output(output)\n for host, pid in cassandra_pids.iteritems():\n with common_module.fab.settings(hosts=[host]):\n fab.run('PATH={java_home}/bin:$PATH JAVA_HOME={java_home} {perf_path}/bin/create-java-perf-map.sh {pid}'.format(\n java_home=java_home, perf_path=perf_map_agent_path, pid=pid[0]))\n\n fab.run('sudo perf script -i {} > {}'.format(perf_data_file, stacks_file))\n fab.run(('{fg_path}/stackcollapse-perf.pl {stacks} | '\n 'tee {collapsed} | {fg_path}/flamegraph.pl --color=java > {fg_output}'\n ).format(fg_dir=flamegraph_directory, fg_output=flamegraph_file,\n stacks=stacks_file, collapsed=collapsed_file, fg_path=flamegraph_path))\n fab.run('sudo chmod o+r {}'.format(os.path.join(flamegraph_directory, '*')))", "metadata": "root.generate_flamegraph", "header": "['module', '___EOS___']", "index": 99 }, { "content": "@fab.parallel\ndef start_perf_agent(rev_num):\n logger.info(\"Starting Flamegraph perf agent\")\n perf_map_agent_path, flamegraph_path = get_flamegraph_paths()\n java_home = common_module.config['jdk7_home']\n output = common_module.run_python_script(\n 'utils',\n 'find_process_pid',\n '\"{}\"'.format(\"java.*Cassandra\")\n )\n cassandra_pids = common_module.parse_output(output)\n perf_bin = os.path.join(os.path.expanduser('~/fab/perf-map-agent'), 'bin/perf-java-flames')\n flamegraph_directory = get_flamegraph_directory()\n\n env_vars = {\n 'PATH': \"{}:{}\".format(os.path.join(java_home, 'bin'), \"$PATH\"),\n 'JAVA_HOME': java_home,\n 'FLAMEGRAPH_DIR': flamegraph_path,\n 'PERF_RECORD_SECONDS': PERF_RECORDING_DURATION,\n 'PERF_JAVA_TMP': flamegraph_directory,\n 'PERF_DATA_FILE': os.path.join(flamegraph_directory, 'perf_revision_{}.data'.format(rev_num + 1)),\n 'PERF_FLAME_OUTPUT': os.path.join(flamegraph_directory, 'flamegraph_revision_{}.svg'.format(rev_num + 1)),\n 'STACKS': \"{}/perf.stacks\".format(flamegraph_directory),\n 'COLLAPSED': \"{}/perf.collapsed\".format(flamegraph_directory)\n }\n\n for host, pid in cassandra_pids.iteritems():\n with common_module.fab.settings(hosts=[host]):\n common_module.runbg(\"{perf_bin} {pid}\".format(perf_bin=perf_bin, pid=pid[0]), env_vars)", "metadata": "root.start_perf_agent", "header": "['module', '___EOS___']", "index": 131 } ]
[ { "span": "import time", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "import sh", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Fabric", " ", "file", " ", "to", " ", "boots", "trap", " ", "Profil", "ing", " ", "Fla", "me", "graph", " ", "on", " ", "a", " ", "set", " ", "of", " ", "nodes", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "import_", "api_", "as_", "fab", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "distutils_", "import_", "version_", "as_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "flame", "graph", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "used", " ", "internal", "ly", ",", " ", "perf", " ", "record", "ing", " ", "is", " ", "stopp", "ed", " ", "usi", "ng", " ", "SIGINT_", "\\u\\u\\uNL\\u\\u\\u_", "PERF", "\\u", "RECORD", "ING", "\\u", "DURATION", "_", "=_", "432", "000_", "#", " ", "5", " ", "days_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "\\u", "module_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "set\\u", "common", "\\u", "module_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "common", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "\\u", "module_", "=_", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "enabled_", "(_", "revis", "ion", "\\u", "config_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "compatible_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "enabled_", "=_", "common", "\\u", "module_", "._", "config_", "._", "get_", "(_", "'", "flame", "graph", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "revis", "ion", "\\u", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "revis", "ion", "\\u", "config_", "._", "get_", "(_", "'", "product", "'_", ",_", "'", "cass", "andra", "'_", ")_", "==_", "'", "dse", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "Fla", "me", "graph", " ", "is", " ", "not", " ", "compatible", " ", "with", " ", "DS", "E", " ", "ye", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "compatible_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jvm_", "=_", "revis", "ion", "\\u", "config_", "._", "get_", "(_", "'", "java", "\\u", "home", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jvm_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "jvm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jvm_", "=_", "jvm_", "[_", "jvm_", "._", "index_", "(_", "'", "1", "'_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", "._", "Lo", "ose", "Version_", "(_", "jvm_", ")_", "<_", "v_", "._", "Lo", "ose", "Version_", "(_", "'", "1.8", ".0", "\\u", "60", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "Fla", "me", "graph", " ", "is", " ", "not", " ", "compatible", " ", "with", " ", "java", " ", "<", "1.8", ".0", "\\u", "60", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "compatible_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "is", "\\u", "enabled_", "and_", "is", "\\u", "compatible_", "\\u\\u\\uNEWLINE\\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", "flame", "graph", "\\u", "paths_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", "=_", "os_", "._", "path_", "._", "expanduser_", "(_", "'", "~", "/", "fab", "/", "perf", "-", "map", "-", "agent", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flame", "graph", "\\u", "path_", "=_", "os_", "._", "path_", "._", "expanduser_", "(_", "'", "~", "/", "fab", "/", "flame", "graph", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", ",_", "flame", "graph", "\\u", "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_", "get", "\\u", "flame", "graph", "\\u", "directory_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "common", "\\u", "module_", "._", "config_", "._", "get_", "(_", "'", "flame", "graph", "\\u", "director", "y", "'_", ",_", "'/", "tmp", "/", "flame", "graph", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "fab", "_", "._", "parallel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "copy", "\\u", "flame", "graph_", "(_", "local", "\\u", "directory_", ",_", "rev", "\\u", "num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Copy", "ing", " ", "Fla", "me", "graph", " ", "data", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg_", "=_", "common", "\\u", "module_", "._", "config_", "[_", "'", "host", "s", "'_", "]_", "[_", "fab", "_", "._", "env_", "._", "host_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "\\u", "log", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "local", "\\u", "directory_", ",_", "cfg_", "[_", "'", "host", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flame", "graph", "\\u", "directory_", "=_", "get", "\\u", "flame", "graph", "\\u", "directory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "makedirs_", "(_", "host", "\\u", "log", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "fab", "_", "._", "settings_", "(_", "warn", "\\u", "only_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fab", "_", "._", "get_", "(_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "flame", "graph", "\\u", "revis", "ion", "\\u{}", ".", "svg", "'_", "._", "format_", "(_", "rev", "\\u", "num_", ")_", ")_", ",_", "host", "\\u", "log", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fab", "_", "._", "get_", "(_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "perf", "\\u", "revis", "ion", "\\u{}", ".", "data", "'_", "._", "format_", "(_", "rev", "\\u", "num_", ")_", ")_", ",_", "host", "\\u", "log", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "fab", "_", "._", "parallel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "setup_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Set", "up", " ", "Fla", "me", "graph", " ", "dependen", "cies", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flame", "graph", "\\u", "directory_", "=_", "get", "\\u", "flame", "graph", "\\u", "directory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", ",_", "flame", "graph", "\\u", "path_", "=_", "get", "\\u", "flame", "graph", "\\u", "paths_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "java", "\\u", "home_", "=_", "common", "\\u", "module_", "._", "config_", "[_", "'", "jdk", "7", "\\u", "home", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "\\u", "module_", "._", "run", "\\u", "python", "\\u", "script_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "flame", "graph", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "setup", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\"{", "}\"", ",", " ", "\"{}\"", ",", " ", "\"{}\"", ",", " ", "\"{}\"'_", "._", "format_", "(_", "flame", "graph", "\\u", "directory_", ",_", "flame", "graph", "\\u", "path_", ",_", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", ",_", "java", "\\u", "home_", ")_", "\\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_", "@_", "fab", "_", "._", "parallel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ensure", "\\u", "stopp", "ed", "\\u", "perf", "\\u", "agent_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Ensur", "e", " ", "there", " ", "are", " ", "no", " ", "perf", " ", "agent", " ", "runn", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "\\u", "module_", "._", "run", "\\u", "python", "\\u", "script_", "(_", "'", "flame", "graph", "'_", ",_", "'", "ensure", "\\u", "stopp", "ed", "\\u", "perf", "\\u", "agent", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "fab", "_", "._", "parallel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "stop", "\\u", "perf", "\\u", "agent_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Stopp", "ing", " ", "Fla", "me", "graph", " ", "perf", " ", "agent", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "\\u", "module_", "._", "run", "\\u", "python", "\\u", "script_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "util", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "find", "\\u", "and", "\\u", "kill", "\\u", "process", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\"{", "}\"", ",", " ", "{}'_", "._", "format_", "(_", "\"[", "^", "/]", "perf", " ", "record", " ", "-", "F", "\"_", ",_", "'", "child", "\\u", "process", "=", "Tru", "e", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "flame", "graph", "\\u", "directory_", "=_", "get", "\\u", "flame", "graph", "\\u", "directory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fab", "_", "._", "run_", "(_", "'", "sudo", " ", "chm", "od", " ", "o", "+", "r", " ", "{}'_", "._", "format_", "(_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'*'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "fab", "_", "._", "parallel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "generat", "e\\u", "flame", "graph_", "(_", "rev", "\\u", "num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Generate", " ", "Fla", "me", "graph", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", ",_", "flame", "graph", "\\u", "path_", "=_", "get", "\\u", "flame", "graph", "\\u", "paths_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "java", "\\u", "home_", "=_", "common", "\\u", "module_", "._", "config_", "[_", "'", "jdk", "7", "\\u", "home", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flame", "graph", "\\u", "directory_", "=_", "get", "\\u", "flame", "graph", "\\u", "directory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "perf", "\\u", "data\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "perf", "\\u", "revis", "ion", "\\u{}", ".", "data", "'_", "._", "format_", "(_", "rev", "\\u", "num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flame", "graph", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "flame", "graph", "\\u", "revis", "ion", "\\u{}", ".", "svg", "'_", "._", "format_", "(_", "rev", "\\u", "num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "s", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "perf", ".", "stack", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "collapsed", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "perf", ".", "collapsed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Generate", " ", "java", " ", "symbol", " ", "map_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "common", "\\u", "module_", "._", "run", "\\u", "python", "\\u", "script_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "util", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "find", "\\u", "process", "\\u", "pid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\"{", "}\"'_", "._", "format_", "(_", "\"", "java", ".*", "Cass", "andra", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cass", "andra", "\\u", "pids_", "=_", "common", "\\u", "module_", "._", "parse", "\\u", "output_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "host_", ",_", "pid_", "in_", "cass", "andra", "\\u", "pids_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "common", "\\u", "module_", "._", "fab", "_", "._", "settings_", "(_", "hosts_", "=_", "[_", "host_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fab", "_", "._", "run_", "(_", "'", "PATH", "={", "java", "\\u", "home", "}/", "bin", ":$", "PATH", " ", "JAVA", "\\u", "HOM", "E", "={", "java", "\\u", "home", "}", " ", "{", "perf", "\\u", "path", "}/", "bin", "/", "create", "-", "java", "-", "perf", "-", "map", ".", "sh", " ", "{", "pid", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "java", "\\u", "home_", "=_", "java", "\\u", "home_", ",_", "perf", "\\u", "path_", "=_", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", ",_", "pid_", "=_", "pid_", "[_", "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_", "fab", "_", "._", "run_", "(_", "'", "sudo", " ", "perf", " ", "script", " ", "-", "i", " ", "{}", " ", ">", " ", "{}'_", "._", "format_", "(_", "perf", "\\u", "data\\u", "file_", ",_", "stack", "s", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fab", "_", "._", "run_", "(_", "(_", "'{", "fg", "\\u", "path", "}/", "stack", "collapse", "-", "perf", ".", "pl", " ", "{", "stack", "s", "}", " ", "|", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tee", " ", "{", "collapsed", "}", " ", "|", " ", "{", "fg", "\\u", "path", "}/", "flame", "graph", ".", "pl", " ", "--", "color", "=", "java", " ", ">", " ", "{", "fg", "\\u", "output", "}'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "format_", "(_", "fg", "\\u", "dir_", "=_", "flame", "graph", "\\u", "directory_", ",_", "fg", "\\u", "output_", "=_", "flame", "graph", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stacks_", "=_", "stack", "s", "\\u", "file_", ",_", "collapsed", "_", "=_", "collapsed", "\\u", "file_", ",_", "fg", "\\u", "path_", "=_", "flame", "graph", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fab", "_", "._", "run_", "(_", "'", "sudo", " ", "chm", "od", " ", "o", "+", "r", " ", "{}'_", "._", "format_", "(_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'*'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "fab", "_", "._", "parallel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "start", "\\u", "perf", "\\u", "agent_", "(_", "rev", "\\u", "num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Start", "ing", " ", "Fla", "me", "graph", " ", "perf", " ", "agent", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perf", "\\u", "map", "\\u", "agent", "\\u", "path_", ",_", "flame", "graph", "\\u", "path_", "=_", "get", "\\u", "flame", "graph", "\\u", "paths_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "java", "\\u", "home_", "=_", "common", "\\u", "module_", "._", "config_", "[_", "'", "jdk", "7", "\\u", "home", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "common", "\\u", "module_", "._", "run", "\\u", "python", "\\u", "script_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "util", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "find", "\\u", "process", "\\u", "pid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\"{", "}\"'_", "._", "format_", "(_", "\"", "java", ".*", "Cass", "andra", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cass", "andra", "\\u", "pids_", "=_", "common", "\\u", "module_", "._", "parse", "\\u", "output_", "(_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perf", "\\u", "bin_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "'", "~", "/", "fab", "/", "perf", "-", "map", "-", "agent", "'_", ")_", ",_", "'", "bin", "/", "perf", "-", "java", "-", "flame", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flame", "graph", "\\u", "directory_", "=_", "get", "\\u", "flame", "graph", "\\u", "directory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "env", "\\u", "vars_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PATH", "'_", ":_", "\"{}", ":{}\"_", "._", "format_", "(_", "os_", "._", "path_", "._", "join_", "(_", "java", "\\u", "home_", ",_", "'", "bin", "'_", ")_", ",_", "\"$", "PATH", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "JAVA", "\\u", "HOM", "E", "'_", ":_", "java", "\\u", "home_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "FLA", "ME", "GRAPH", "\\u", "DIR", "'_", ":_", "flame", "graph", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PERF", "\\u", "RECORD", "\\u", "SECOND", "S", "'_", ":_", "PERF", "\\u", "RECORD", "ING", "\\u", "DURATION", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PERF", "\\u", "JAVA", "\\u", "TMP", "'_", ":_", "flame", "graph", "\\u", "directory_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PERF", "\\u", "DATA", "\\u", "FILE", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "perf", "\\u", "revis", "ion", "\\u{}", ".", "data", "'_", "._", "format_", "(_", "rev", "\\u", "num_", "+_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PERF", "\\u", "FLA", "ME", "\\u", "OUTPU", "T", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "flame", "graph", "\\u", "directory_", ",_", "'", "flame", "graph", "\\u", "revis", "ion", "\\u{}", ".", "svg", "'_", "._", "format_", "(_", "rev", "\\u", "num_", "+_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "STACK", "S", "'_", ":_", "\"{}", "/", "perf", ".", "stack", "s", "\"_", "._", "format_", "(_", "flame", "graph", "\\u", "directory_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "COLL", "APS", "ED", "'_", ":_", "\"{}", "/", "perf", ".", "collapsed", "\"_", "._", "format_", "(_", "flame", "graph", "\\u", "directory_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "host_", ",_", "pid_", "in_", "cass", "andra", "\\u", "pids_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "common", "\\u", "module_", "._", "fab", "_", "._", "settings_", "(_", "hosts_", "=_", "[_", "host_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "\\u", "module_", "._", "run", "bg_", "(_", "\"{", "perf", "\\u", "bin", "}", " ", "{", "pid", "}\"_", "._", "format_", "(_", "perf", "\\u", "bin_", "=_", "perf", "\\u", "bin_", ",_", "pid_", "=_", "pid_", "[_", "0_", "]_", ")_", ",_", "env", "\\u", "vars_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/controller/dispatchers/ui/PolicyDispatcher.py
[ { "content": "import uuid\nfrom django.contrib.auth.decorators import login_required\nfrom django.core.urlresolvers import reverse\nfrom django.http import HttpResponseRedirect, HttpResponseNotAllowed, HttpResponse\nfrom django.views.generic import simple\nfrom vt_manager.controller.drivers.VTDriver import VTDriver\nfrom pypelib.RuleTable import RuleTable\nfrom vt_manager.controller.policies.RuleTableManager import RuleTableManager\nfrom pypelib.Rule import Rule \nfrom pypelib.utils.Exceptions import *\n\n\n\n\n'''\nPolicyTable objects may only be deleted via POST\n'''\n\n\n\n\n\t\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@login_required\ndef rule_table_view(request, TableName = None):\n\t\n\tif (not request.user.is_superuser):\n\n return simple.direct_to_template(request,\n template = 'not_admin.html',\n extra_context = {'user':request.user},\n )\n else: #Admin\n \ttry:\n \t\truleTable = RuleTableManager.getInstance(RuleTableManager.getDefaultName())\n # If everything runs smoothly, return normal template\n \t\treturn simple.direct_to_template(\n \t\t\trequest,\n \t\t\ttemplate = 'policyEngine/table_view.html',\n \t\t\textra_context = {'user': request.user,\n \t\t\t\t'table': ruleTable}\n \t\t\t)\n \t# Handle each exception and pass the error to template\n \texcept ZeroPolicyObjectsReturned:\n\t\t\treturn HttpResponseRedirect(\"/policies/\")\n \texcept MultiplePolicyObjectsReturned:\n\t\t\treturn HttpResponseRedirect(reverse('policy_edit', args=(RuleTableManager.getDefaultName(),)))", "metadata": "root.rule_table_view", "header": "['module', '___EOS___']", "index": 11 }, { "content": "def policy_create(request,table):\n\n\terrors = []\n rules = []\n\tmapps = RuleTableManager.getActionMappings()\n\tpriorityList = RuleTableManager.getPriorityList()\n\tcondMapps = RuleTableManager.getConditionMappings()\n\n\n\treturn simple.direct_to_template(request,\n template = 'policyEngine/policy_create.html',\n extra_context = {'user': request.user,\n 'CurrentTable': table,\n\t\t\t\t\t\t\t 'mappings':mapps,\n\t\t\t\t\t\t\t 'priorityList':priorityList,\n\t\t\t\t\t\t\t 'allMappings':RuleTableManager.GetResolverMappings(table),\n\t\t\t\t\t\t\t 'ConditionMappings':condMapps,\n 'ActionMappings':RuleTableManager.getActionMappings()},\n )", "metadata": "root.policy_create", "header": "['module', '___EOS___']", "index": 36 }, { "content": "def policy_edit(request,table):\n\n\tif \"HTTP_REFERER\" in request.META:\n\t\t# Checks if the referer page is the home or this page itself\n\t\tif \"/dashboard\" in request.META['HTTP_REFERER'] or \"/policies\" in request.META['HTTP_REFERER']:\n\t\t\truleTableSet = RuleTableManager.getAllInstances(RuleTableManager.getDefaultName())\n\t\t\treturn simple.direct_to_template(request,\n template = 'policyEngine/policy_edit.html',\n extra_context = {'user': request.user,\n 'CurrentTable': ruleTableSet}\n )\n\t# If the access flow is incorrect, send home\n\treturn HttpResponseRedirect(\"/\")", "metadata": "root.policy_edit", "header": "['module', '___EOS___']", "index": 56 }, { "content": "def policy_delete(request,table_uuid):\n\n\tif request.method == \"POST\":\n\t\tRuleTableManager.deleteInstance(table_uuid)\n\treturn HttpResponseRedirect(\"/policies\")", "metadata": "root.policy_delete", "header": "['module', '___EOS___']", "index": 73 }, { "content": "def rule_create(request,table_name=None):\n\n\terrors = list()\n\tformMode = request.POST.get(\"conditionMode\")\n\ttableName = request.POST.get(\"table\")\n\tPreviousPriority = request.POST.get(\"ppriority\")\n editing = request.POST.get(\"editing\")\n ruleid = request.POST.get(\"uuid\")\n ruleCondition = request.POST.get(\"condition\")\n ruleDesc = request.POST.get(\"description\")\n ruleError = request.POST.get(\"error_message\")\n ruleType = request.POST.get(\"type\")\n ruleAction = request.POST.get(\"action\")\n ruleValue = request.POST.get(\"value\")\n rulePriority = request.POST.get(\"priority\")\n ruleEnable = request.POST.get(\"enable\")\n previousTable = request.POST.get(\"hidden_name\")\n\texpertRule = request.POST.get(\"expertRule\")\n\tnewConditions = request.POST.get(\"conditionID\")\t\n\tsaved = request.POST.get(\"saved\")\n\n if rulePriority == 'Last' or rulePriority == '':\n priority = None\n else:\n priority = int(rulePriority)\n\n\tif formMode == \"easy\":\n\t#Avoid empty fields\n# \tif ruleDesc == \"\":\n# \terrors.append(\"Description Field is empty\")\n \tif ruleError == \"\":\n \terrors.append(\"Error Message field is empty\")\n \tif ruleCondition == \"\":\n \terrors.append(\"Condition field is empty\")\n\t\ttry:\n\t\t\tstr(ruleDesc)\n\t\texcept:\n\t\t\terrors.append(\"Only ascii characters are allowed in Description field\")\n\t\ttry:\n\t\t\tstr(ruleError)\n\t\texcept:\n\t\t\terrors.append(\"Only ascii characters are allowed in Error Message field\")\n\t\ttry:\n\t\t\tstr(ruleCondition)\n\t\texcept:\n\t\t\terrors.append(\"Only ascii characters are allowed in Conditions\")\n\n\t\n\n if request.POST.get(\"enable\") == 'enable':\n enable = True\n else:\n enable = False\n\tif ruleType == \"terminal\":\n\t\truleType = \"\"\n\t\n\tif saved == None:\n\t\tsaved = False\n\t#Rule String convertion required\n\tif formMode == \"easy\":\n\t\tif ruleAction != \"None\":\n\t\t\tstrings = \"if \" + ruleCondition + \" then \" + ruleValue + \" \" + ruleType + \" do \" + ruleAction + \" denyMessage \" + ruleError + \" #\" + ruleDesc\n\t\telse:\n\t\t\tstrings = \"if \" + ruleCondition + \" then \" + ruleValue + \" \" + ruleType + \" denyMessage \" + ruleError + \" #\" + ruleDesc\n\telse:\n\t\tstrings = expertRule\n\t\ttry:\n\t\t\tstr(expertRule)\n\t\texcept:\n\t\t\terrors.append(\"Only ascii characters are allowed in a Rule\")\n\t\n\ttry:\n\t\tif errors:\n raise Exception(\"\")\n\t\t\n\t\tif editing == '1':\n\t\t\t#Editing Rules Case:\n \tif previousTable == tableName:\n\t\t\t\ttry:\n\t\t\t\t\tRuleTableManager.editRule(strings,enable,priority,PreviousPriority,tableName)\n\t\t\t\texcept Exception as e:\n\t\t\t\t\traise e\n \t#else:\n\t\t\t\t#Moving a rule to a different RuleTable --> this is not possible yet \n \t#print 'Changing table...'\n \t#RuleTableManager.AddRule(strings,enable,priority,tableName=tableName)\n \t#print 'successful add to ' + tableName\n \t#RuleTableManager.RemoveRule(None,int(PreviousPriority),'oldTableName')\n \t#print 'remove from ' + previousTable + ' successful'\n \telse:\n \tRuleTableManager.AddRule(strings,enable,priority,tableName=tableName)\n\n return HttpResponseRedirect(\"/policies\")\t\t\n\n\texcept Exception as e:\n\n\t\terrors.append(e)\n\t\terrors.insert(0,\"The Rule cannot be generated. Reason(s):\")#Insterting the main message error in the first position of the table\n\t\tpriority = RuleTableManager.getPriorityList(tableName)\n\t\tpriority = RuleTableManager.getPriorityList(tableName)\n\t\t\n\t\t#if a rule index is the last, insert \"LAST\" in the rule priority instead the true index.\n\t\ttry:\n\t\t\tint(rulePriority)\n\t\t\tif int(rulePriority) in priority:\n\t\t\t\tpriority.pop(priority.index(int(rulePriority)))\n\t\texcept:\n\t\t\trulePriority = \"Last\"\n\n\t\tif ruleValue == \"accept\":\n\t\t\tvalue2 = [\"deny\"]\n\t\telse:\n\t\t\tvalue2 = [\"accept\"]\n\n\t\tif ruleType == \"nonterminal\":\n\t\t\ttype2 = [\"terminal\"]\n\t\telse:\n\t\t\truleType = \"terminal\"\n\t\t\ttype2 = [\"nonterminal\"]\n\n\n\t\tcontext = {'user': request.user,\n 'saved':True,\n 'CurrentTable':tableName,\n 'priority':PreviousPriority,\n 'enabled':ruleEnable,\n\t\t\t 'load':'True',\n 'valueS':ruleValue,\n 'valueD':value2,\n 'terminalS':ruleType,\n 'terminalD':type2,\n 'errorMsg':ruleError,\n 'description':ruleDesc,\n 'condition':\" \" + ruleCondition + \" \",\n 'ptable':tableName,\n\t\t\t 'edit': request.POST.get('edit'),\n 'action':ruleAction,\n 'PrioritySel':rulePriority,\n 'priorityList':priority,\n 'allMappings':RuleTableManager.GetResolverMappings(tableName),\n 'ConditionMappings':RuleTableManager.getConditionMappings(),\n 'ActionMappings':RuleTableManager.getActionMappings(),\n 'errors': errors,\n 'rule_uuid':ruleid,}\n\n\t\treturn simple.direct_to_template(request,\n \t \t\ttemplate = 'policyEngine/policy_create.html',\n \t\textra_context = context)", "metadata": "root.rule_create", "header": "['module', '___EOS___']", "index": 79 }, { "content": "def enable_disable(request, rule_uuid, table_name):\n\n\tRuleTableManager.EnableOrDisableRule(rule_uuid,table_name)\n\n\treturn HttpResponseRedirect(\"/policies\")\t", "metadata": "root.enable_disable", "header": "['module', '___EOS___']", "index": 228 }, { "content": "def condition_create(request, TableName):\n\treturn simple.direct_to_template(request,\n template = 'policyEngine/condition_create.html',\n extra_context = {'user': request.user,\n\t\t\t\t\t\t\t 'tableName' : TableName,\n\t\t\t\t\t\t\t 'mappings' : RuleTableManager.getConditionMappings()},\n )", "metadata": "root.condition_create", "header": "['module', '___EOS___']", "index": 234 }, { "content": "def rule_delete(request, table_name):\n\t\n\trule_uuid = request.POST.get(\"uuid\")\n\tRuleTableManager.deleteRule(rule_uuid,table_name)\n\n\treturn HttpResponseRedirect(\"/policies\")", "metadata": "root.rule_delete", "header": "['module', '___EOS___']", "index": 242 }, { "content": "def update_ruleTable_policy(request):\n\t\n\tpolicy = request.POST.get(\"defaultPolicy\")\n\ttableName = request.POST.get(\"table_name\")\n\tRuleTableManager.UpdateRuleTablePolicy(policy,tableName)\n\t \n\treturn HttpResponseRedirect(\"/policies\")", "metadata": "root.update_ruleTable_policy", "header": "['module', '___EOS___']", "index": 249 }, { "content": "def rule_edit(request,table_name,rule_uuid,context=None):\n\t\n\tload = request.POST.get('load')\n\tif not load == 'True':\n\t\trule = RuleTableManager.getRuleOrIndexOrIsEnabled(rule_uuid,'Rule',table_name)\n\t\trulevalues = RuleTableManager.getValue(rule)\n\t\truletypes = RuleTableManager.getType(rule)\n\t\t#Flag to be able to diferenciate edit state from creating estate \n \tedit = True\n\t\tactionList = RuleTableManager.SetActionList(rule,RuleTableManager.getActionMappings())\n\t\tpriorityList = RuleTableManager.SetPriorityList(rule,table_name)\n\t\terror = str(rule.getErrorMsg())\n\t\tdescription = str(rule.getDescription())\n\n\t\treturn simple.direct_to_template(request,\n template = 'policyEngine/policy_create.html',\n extra_context = {'user':request.user,\n 'edit':edit,\n 'rule':rule,\n 'priority':RuleTableManager.getRuleOrIndexOrIsEnabled(rule_uuid,'Index',table_name),\n\t\t\t\t\t\t\t\t 'enabled':RuleTableManager.getRuleOrIndexOrIsEnabled(rule_uuid,'Enabled',table_name),\n 'valueS':rulevalues[0],\n 'valueD':rulevalues[1],\n 'terminalS':ruletypes[0],\n 'terminalD':ruletypes[1],\n 'rule_uuid':rule_uuid,\n\t\t\t\t\t\t\t\t 'ptable':table_name,\n\t\t\t\t\t\t\t\t 'errorMsg':error,\n\t\t\t\t\t\t\t\t 'description':description,\n\t\t\t\t\t\t\t\t 'condition':rule.getConditionDump(),\n\t\t\t\t\t\t\t\t 'action':actionList[0],\n\t\t\t\t\t\t\t\t 'PrioritySel':priorityList[0], \n\t\t\t\t\t\t\t\t 'priorityList':priorityList[1],\n\t\t\t\t\t\t\t\t 'allMappings':RuleTableManager.GetResolverMappings(),\n\t\t\t\t\t\t\t\t 'ConditionMappings':RuleTableManager.getConditionMappings(),\n\t\t\t\t\t\t\t\t 'ActionMappings':RuleTableManager.getActionMappings(),\n 'CurrentTable':table_name},\n )\n\telse:\n\t\treturn rule_create(request,table_name)", "metadata": "root.rule_edit", "header": "['module', '___EOS___']", "index": 257 } ]
[ { "span": "import uuid", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 11 }, { "span": "from django.http import HttpResponseRedirect, HttpResponseNotAllowed, HttpResponse", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 82 }, { "span": "from vt_manager.controller.drivers.VTDriver import VTDriver", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 59 }, { "span": "from pypelib.RuleTable import RuleTable", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 39 }, { "span": "from pypelib.Rule import Rule ", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "decorators_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Respons", "e", "Redirect_", ",_", "Http", "Respons", "e", "Not", "Allowed_", ",_", "Http", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "import_", "simple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "drivers_", "._", "VT", "Driver_", "import_", "VT", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pype", "lib_", "._", "Rule", "Table_", "import_", "Rule", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "policies_", "._", "Rule", "Table", "Manager_", "import_", "Rule", "Table", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pype", "lib_", "._", "Rule_", "import_", "Rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pype", "lib_", "._", "utils_", "._", "Exceptions_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "'''", "\\", "10", ";", "Polic", "y", "Table", " ", "object", "s", " ", "may", " ", "only", " ", "be", " ", "delete", "d", " ", "via", " ", "POST", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rule", "\\u", "table", "\\u", "view_", "(_", "request_", ",_", "Table", "Name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "(_", "not_", "request_", "._", "user_", "._", "is", "\\u", "superuser_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "not", "\\u", "admin", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", "Admin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "\t_", "rule", "Table_", "=_", "Rule", "Table", "Manager_", "._", "get", "Instance_", "(_", "Rule", "Table", "Manager_", "._", "get", "Default", "Name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "every", "thing", " ", "runs", " ", "smooth", "ly", ",", " ", "return", " ", "normal", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "policy", "Engine", "/", "table", "\\u", "view", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "table", "'_", ":_", "rule", "Table_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Handle", " ", "each", " ", "exception", " ", "and", " ", "pass", " ", "the", " ", "error", " ", "to", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Zero", "Polic", "y", "Object", "s", "Return", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/", "poli", "cies", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Multipl", "e", "Polic", "y", "Object", "s", "Return", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "reverse_", "(_", "'", "policy", "\\u", "edit", "'_", ",_", "args_", "=_", "(_", "Rule", "Table", "Manager_", "._", "get", "Default", "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_", "policy", "\\u", "create_", "(_", "request_", ",_", "table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapp", "s_", "=_", "Rule", "Table", "Manager_", "._", "get", "Action", "Mappings", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priorit", "y", "List_", "=_", "Rule", "Table", "Manager_", "._", "get", "Prior", "it", "y", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cond", "Map", "ps_", "=_", "Rule", "Table", "Manager_", "._", "get", "Cond", "ition", "Mappings", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "policy", "Engine", "/", "policy", "\\u", "create", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Curr", "ent", "Table", "'_", ":_", "table_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mapping", "s", "'_", ":_", "mapp", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "List", "'_", ":_", "priorit", "y", "List_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "all", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "Get", "Resolv", "er", "Mappings", "_", "(_", "table_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cond", "ition", "Mappings", "'_", ":_", "cond", "Map", "ps_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Action", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Action", "Mappings", "_", "(_", ")_", "}_", ",_", "\\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_", "policy", "\\u", "edit_", "(_", "request_", ",_", "table_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "\"", "HTTP", "\\u", "REFE", "RER", "\"_", "in_", "request_", "._", "META_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", "s", " ", "if", " ", "the", " ", "refere", "r", " ", "page", " ", "is", " ", "the", " ", "home", " ", "or", " ", "this", " ", "page", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "\"/", "dash", "board", "\"_", "in_", "request_", "._", "META_", "[_", "'", "HTTP", "\\u", "REFE", "RER", "'_", "]_", "or_", "\"/", "poli", "cies", "\"_", "in_", "request_", "._", "META_", "[_", "'", "HTTP", "\\u", "REFE", "RER", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "rule", "Table", "Set_", "=_", "Rule", "Table", "Manager_", "._", "get", "All", "Instances_", "(_", "Rule", "Table", "Manager_", "._", "get", "Default", "Name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "policy", "Engine", "/", "policy", "\\u", "edit", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Curr", "ent", "Table", "'_", ":_", "rule", "Table", "Set_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "access", " ", "flow", " ", "is", " ", "incorrect", ",", " ", "send", " ", "home_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "policy", "\\u", "delete_", "(_", "request_", ",_", "table", "\\u", "uuid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "request_", "._", "method_", "==_", "\"", "POST", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "Rule", "Table", "Manager_", "._", "delete", "Instance_", "(_", "table", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/", "poli", "cies", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rule", "\\u", "create_", "(_", "request_", ",_", "table", "\\u", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "errors_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "Mode_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "condition", "Mode", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Name_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "table", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Prev", "ious", "Priority_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "ppr", "ior", "it", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "editin", "g_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "editin", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "id_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Condition_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "condition", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Desc_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "description", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Error_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "error", "\\u", "message", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Type_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "type", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Action_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "action", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Value_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "value", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Priority_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "priorit", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "Enable_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "enable", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previ", "ous", "Table_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "hidden", "\\u", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expert", "Rule_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "expert", "Rule", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "Conditions", "_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "condition", "ID", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "saved_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "saved", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rule", "Priority_", "==_", "'", "Las", "t", "'_", "or_", "rule", "Priority_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "priority_", "=_", "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 ", " _", "priority_", "=_", "int_", "(_", "rule", "Priority_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "form", "Mode_", "==_", "\"", "easy", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Av", "oid", " ", "empty", " ", "fields_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " \t", "if", " ", "rule", "Des", "c", " ", "==", " ", "\"\"", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\t", "error", "s", ".", "append", "(\"", "Descripti", "on", " ", "Field", " ", "is", " ", "empty", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " \t", "_", "if_", "rule", "Error_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " ", "\t_", "errors_", "._", "append_", "(_", "\"", "Error", " ", "Messag", "e", " ", "field", " ", "is", " ", "empty", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rule", "Condition_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " ", "\t_", "errors_", "._", "append_", "(_", "\"", "Cond", "ition", " ", "field", " ", "is", " ", "empty", "\"_", ")_", "\\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\t", "\t\t_", "str_", "(_", "rule", "Desc_", ")_", "\\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\t", "\t\t_", "errors_", "._", "append_", "(_", "\"", "On", "ly", " ", "ascii", " ", "character", "s", " ", "are", " ", "allow", "ed", " ", "in", " ", "Descripti", "on", " ", "field", "\"_", ")_", "\\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\t", "\t\t_", "str_", "(_", "rule", "Error_", ")_", "\\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\t", "\t\t_", "errors_", "._", "append_", "(_", "\"", "On", "ly", " ", "ascii", " ", "character", "s", " ", "are", " ", "allow", "ed", " ", "in", " ", "Error", " ", "Messag", "e", " ", "field", "\"_", ")_", "\\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\t", "\t\t_", "str_", "(_", "rule", "Condition_", ")_", "\\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\t", "\t\t_", "errors_", "._", "append_", "(_", "\"", "On", "ly", " ", "ascii", " ", "character", "s", " ", "are", " ", "allow", "ed", " ", "in", " ", "Conditions", "\"_", ")_", "\\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_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "enable", "\"_", ")_", "==_", "'", "enable", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "enable_", "=_", "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 ", " _", "enable_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rule", "Type_", "==_", "\"", "termina", "l", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "rule", "Type_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "saved_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "saved_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Rule", " ", "String", " ", "convert", "ion", " ", "required_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "form", "Mode_", "==_", "\"", "easy", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "rule", "Action_", "!=_", "\"", "Non", "e", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "strings_", "=_", "\"", "if", " ", "\"_", "+_", "rule", "Condition_", "+_", "\"", " ", "then", " ", "\"_", "+_", "rule", "Value_", "+_", "\"", " ", "\"_", "+_", "rule", "Type_", "+_", "\"", " ", "do", " ", "\"_", "+_", "rule", "Action_", "+_", "\"", " ", "deny", "Messag", "e", " ", "\"_", "+_", "rule", "Error_", "+_", "\"", " ", "#\"_", "+_", "rule", "Desc_", "\\u\\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_", "strings_", "=_", "\"", "if", " ", "\"_", "+_", "rule", "Condition_", "+_", "\"", " ", "then", " ", "\"_", "+_", "rule", "Value_", "+_", "\"", " ", "\"_", "+_", "rule", "Type_", "+_", "\"", " ", "deny", "Messag", "e", " ", "\"_", "+_", "rule", "Error_", "+_", "\"", " ", "#\"_", "+_", "rule", "Desc_", "\\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_", "strings_", "=_", "expert", "Rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "str_", "(_", "expert", "Rule_", ")_", "\\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\t", "\t\t_", "errors_", "._", "append_", "(_", "\"", "On", "ly", " ", "ascii", " ", "character", "s", " ", "are", " ", "allow", "ed", " ", "in", " ", "a", " ", "Rule", "\"_", ")_", "\\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\t", "\t_", "if_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Exception_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "editin", "g_", "==_", "'", "1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Editing", " ", "Rule", "s", " ", "Case", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " ", "\t_", "if_", "previ", "ous", "Table_", "==_", "table", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "Rule", "Table", "Manager_", "._", "edit", "Rule_", "(_", "strings_", ",_", "enable_", ",_", "priority_", ",_", "Prev", "ious", "Priority_", ",_", "table", "Name_", ")_", "\\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\t", "\t\t\t\t_", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Movi", "ng", " ", "a", " ", "rule", " ", "to", " ", "a", " ", "different", " ", "Rule", "Table", " ", "-->", " ", "this", " ", "is", " ", "not", " ", "possib", "le", " ", "ye", "t", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "Chang", "ing", " ", "table", "...'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Rule", "Table", "Manager", ".", "Add", "Rule", "(", "string", "s", ",", "enable", ",", "priorit", "y", ",", "table", "Name", "=", "table", "Name", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "success", "ful", " ", "add", " ", "to", " ", "'", " ", "+", " ", "table", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Rule", "Table", "Manager", ".", "Remove", "Rule", "(", "Non", "e", ",", "int", "(", "Prev", "ious", "Prior", "it", "y", "),", "'", "old", "Table", "Name", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "'", "remove", " ", "from", " ", "'", " ", "+", " ", " ", "previ", "ous", "Table", " ", "+", " ", "'", " ", "success", "ful", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " ", "\t_", "Rule", "Table", "Manager_", "._", "Add", "Rule_", "(_", "strings_", ",_", "enable_", ",_", "priority_", ",_", "table", "Name_", "=_", "table", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/", "poli", "cies", "\"_", ")_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "errors_", "._", "append_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "insert_", "(_", "0_", ",_", "\"", "The", " ", "Rule", " ", "cann", "ot", " ", "be", " ", "generat", "ed", ".", " ", "Rea", "son", "(", "s", "):\"_", ")_", "#", "Ins", "ter", "ting", " ", "the", " ", "main", " ", "message", " ", "error", " ", "in", " ", "the", " ", "first", " ", "position", " ", "of", " ", "the", " ", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priority_", "=_", "Rule", "Table", "Manager_", "._", "get", "Prior", "it", "y", "List_", "(_", "table", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priority_", "=_", "Rule", "Table", "Manager_", "._", "get", "Prior", "it", "y", "List_", "(_", "table", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "a", " ", "rule", " ", "index", " ", "is", " ", "the", " ", "last", ",", " ", "insert", " ", "\"", "LAS", "T", "\"", " ", "in", " ", "the", " ", "rule", " ", "priorit", "y", " ", "inst", "ead", " ", "the", " ", "true", " ", "index", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "int_", "(_", "rule", "Priority_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "rule", "Priority_", ")_", "in_", "priority_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "priority_", "._", "pop_", "(_", "priority_", "._", "index_", "(_", "int_", "(_", "rule", "Priority_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "rule", "Priority_", "=_", "\"", "Las", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rule", "Value_", "==_", "\"", "accept", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "value2_", "=_", "[_", "\"", "deny", "\"_", "]_", "\\u\\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_", "value2_", "=_", "[_", "\"", "accept", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rule", "Type_", "==_", "\"", "nont", "ermina", "l", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "type2_", "=_", "[_", "\"", "termina", "l", "\"_", "]_", "\\u\\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_", "rule", "Type_", "=_", "\"", "termina", "l", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type2_", "=_", "[_", "\"", "nont", "ermina", "l", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "saved", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Curr", "ent", "Table", "'_", ":_", "table", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "'_", ":_", "Prev", "ious", "Priority_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "enable", "d", "'_", ":_", "rule", "Enable_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "load", "'_", ":_", "'", "Tru", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "S", "'_", ":_", "rule", "Value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "D", "'_", ":_", "value2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "termina", "l", "S", "'_", ":_", "rule", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "termina", "l", "D", "'_", ":_", "type2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "Msg", "'_", ":_", "rule", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "rule", "Desc_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "condition", "'_", ":_", "\"", " ", "\"_", "+_", "rule", "Condition_", "+_", "\"", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ptable", "'_", ":_", "table", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "edit", "'_", ":_", "request_", "._", "POST_", "._", "get_", "(_", "'", "edit", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "'_", ":_", "rule", "Action_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Prior", "it", "y", "Sel", "'_", ":_", "rule", "Priority_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "List", "'_", ":_", "priority_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "all", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "Get", "Resolv", "er", "Mappings", "_", "(_", "table", "Name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cond", "ition", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Cond", "ition", "Mappings", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Action", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Action", "Mappings", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "s", "'_", ":_", "errors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rule", "\\u", "uuid", "'_", ":_", "rule", "id_", ",_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "policy", "Engine", "/", "policy", "\\u", "create", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enable", "\\u", "disable_", "(_", "request_", ",_", "rule", "\\u", "uuid_", ",_", "table", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "Rule", "Table", "Manager_", "._", "Enable", "Or", "Disa", "ble", "Rule_", "(_", "rule", "\\u", "uuid_", ",_", "table", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/", "poli", "cies", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "condition", "\\u", "create_", "(_", "request_", ",_", "Table", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "policy", "Engine", "/", "condition", "\\u", "create", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "table", "Name", "'_", ":_", "Table", "Name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mapping", "s", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Cond", "ition", "Mappings", "_", "(_", ")_", "}_", ",_", "\\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_", "rule", "\\u", "delete_", "(_", "request_", ",_", "table", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "rule", "\\u", "uuid_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "uuid", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Rule", "Table", "Manager_", "._", "delete", "Rule_", "(_", "rule", "\\u", "uuid_", ",_", "table", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/", "poli", "cies", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "rule", "Table", "\\u", "policy_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "policy_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "default", "Polic", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Name_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "\"", "table", "\\u", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Rule", "Table", "Manager_", "._", "Update", "Rule", "Table", "Policy_", "(_", "policy_", ",_", "table", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "\"/", "poli", "cies", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rule", "\\u", "edit_", "(_", "request_", ",_", "table", "\\u", "name_", ",_", "rule", "\\u", "uuid_", ",_", "context_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "load_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "load", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "load_", "==_", "'", "Tru", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "rule_", "=_", "Rule", "Table", "Manager_", "._", "get", "Rule", "Or", "Index", "Or", "Is", "Enabled_", "(_", "rule", "\\u", "uuid_", ",_", "'", "Rule", "'_", ",_", "table", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "values_", "=_", "Rule", "Table", "Manager_", "._", "get", "Value_", "(_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "types_", "=_", "Rule", "Table", "Manager_", "._", "get", "Type_", "(_", "rule_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Fla", "g", " ", "to", " ", "be", " ", "able", " ", "to", " ", "dif", "eren", "ciat", "e", " ", "edit", " ", "state", " ", "from", " ", "creati", "ng", " ", "esta", "te", " _", "\\u\\u\\uNL\\u\\u\\u_", "edit_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action", "List_", "=_", "Rule", "Table", "Manager_", "._", "Set", "Action", "List_", "(_", "rule_", ",_", "Rule", "Table", "Manager_", "._", "get", "Action", "Mappings", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priorit", "y", "List_", "=_", "Rule", "Table", "Manager_", "._", "Set", "Prior", "it", "y", "List_", "(_", "rule_", ",_", "table", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "str_", "(_", "rule_", "._", "get", "Error", "Msg_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "str_", "(_", "rule_", "._", "get", "Description_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "simple_", "._", "direct", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "template_", "=_", "'", "policy", "Engine", "/", "policy", "\\u", "create", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "context_", "=_", "{_", "'", "user", "'_", ":_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "edit", "'_", ":_", "edit_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rule", "'_", ":_", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Rule", "Or", "Index", "Or", "Is", "Enabled_", "(_", "rule", "\\u", "uuid_", ",_", "'", "Index", "'_", ",_", "table", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "enable", "d", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Rule", "Or", "Index", "Or", "Is", "Enabled_", "(_", "rule", "\\u", "uuid_", ",_", "'", "Enable", "d", "'_", ",_", "table", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "S", "'_", ":_", "rule", "values_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "D", "'_", ":_", "rule", "values_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "termina", "l", "S", "'_", ":_", "rule", "types_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "termina", "l", "D", "'_", ":_", "rule", "types_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rule", "\\u", "uuid", "'_", ":_", "rule", "\\u", "uuid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ptable", "'_", ":_", "table", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "Msg", "'_", ":_", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "condition", "'_", ":_", "rule_", "._", "get", "Cond", "ition", "Dump_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "'_", ":_", "action", "List_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Prior", "it", "y", "Sel", "'_", ":_", "priorit", "y", "List_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "List", "'_", ":_", "priorit", "y", "List_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "all", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "Get", "Resolv", "er", "Mappings", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cond", "ition", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Cond", "ition", "Mappings", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Action", "Mappings", "'_", ":_", "Rule", "Table", "Manager_", "._", "get", "Action", "Mappings", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Curr", "ent", "Table", "'_", ":_", "table", "\\u", "name_", "}_", ",_", "\\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\t", "\t_", "return_", "rule", "\\u", "create_", "(_", "request_", ",_", "table", "\\u", "name_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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