query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Except block handles 'BaseException'
ucbvislab/radiotool/radiotool/utils.py
[ { "content": "def linear(arr1, arr2):\n \"\"\"\n Create a linear blend of arr1 (fading out) and arr2 (fading in)\n \"\"\"\n n = N.shape(arr1)[0]\n try:\n channels = N.shape(arr1)[1]\n except:\n channels = 1\n\n f_in = N.linspace(0, 1, num=n)\n f_out = N.linspace(1, 0, num=n)\n\n # f_in = N.arange(n) / float(n - 1)\n # f_out = N.arange(n - 1, -1, -1) / float(n)\n\n if channels > 1:\n f_in = N.tile(f_in, (channels, 1)).T\n f_out = N.tile(f_out, (channels, 1)).T\n\n vals = f_out * arr1 + f_in * arr2\n return vals", "metadata": "root.linear", "header": "['module', '___EOS___']", "index": 90 }, { "content": "def equal_power(arr1, arr2):\n \"\"\"\n Create an equal power blend of arr1 (fading out) and arr2 (fading in)\n \"\"\"\n n = N.shape(arr1)[0]\n try:\n channels = N.shape(arr1)[1]\n except:\n channels = 1\n\n f_in = N.arange(n) / float(n - 1)\n f_out = N.arange(n - 1, -1, -1) / float(n)\n\n if channels > 1:\n f_in = N.tile(f_in, (channels, 1)).T\n f_out = N.tile(f_out, (channels, 1)).T\n\n vals = log_factor(f_out) * arr1 + log_factor(f_in) * arr2\n\n return limiter(vals)", "metadata": "root.equal_power", "header": "['module', '___EOS___']", "index": 114 }, { "content": "def wav_to_mp3(wavfn, delete_wav=False, lame_quality=\"V 2\"):\n mp3fn = \".\".join(wavfn.split('.')[:-1]) + '.mp3'\n check_output('lame -{} \"{}\"'.format(lame_quality, wavfn), shell=True)\n\n if LIBXMP:\n xmpfile = libxmp.XMPFiles(file_path=wavfn)\n xmpfile2 = libxmp.XMPFiles(file_path=mp3fn, open_forupdate=True)\n\n xmp = xmpfile.get_xmp()\n\n try:\n if xmpfile2.can_put_xmp(xmp):\n xmpfile2.put_xmp(xmp)\n else:\n print \"Could not convert xmp from wav to mp3\"\n except:\n print \"File has no xmp data\"\n\n xmpfile.close_file()\n xmpfile2.close_file()\n\n if delete_wav:\n check_output('rm \"{}\"'.format(wavfn), shell=True)", "metadata": "root.wav_to_mp3", "header": "['module', '___EOS___']", "index": 165 } ]
[ { "span": "except:", "start_line": 97, "start_column": 4, "end_line": 97, "end_column": 11 }, { "span": "except:", "start_line": 121, "start_column": 4, "end_line": 121, "end_column": 11 }, { "span": "except:", "start_line": 180, "start_column": 8, "end_line": 180, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "linear_", "(_", "arr", "1_", ",_", "arr", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "linear", " ", "blend", " ", "of", " ", "arr", "1", " ", "(", "fad", "ing", " ", "out", ")", " ", "and", " ", "arr", "2", " ", "(", "fad", "ing", " ", "in", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "N_", "._", "shape_", "(_", "arr", "1_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "channels_", "=_", "N_", "._", "shape_", "(_", "arr", "1_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "channels_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "in_", "=_", "N_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "num_", "=_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "\\u", "out_", "=_", "N_", "._", "linspace_", "(_", "1_", ",_", "0_", ",_", "num_", "=_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "in", " ", "=", " ", "N", ".", "aran", "ge", "(", "n", ")", " ", "/", " ", "float", "(", "n", " ", "-", " ", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "f", "\\u", "out", " ", "=", " ", "N", ".", "aran", "ge", "(", "n", " ", "-", " ", "1", ",", " ", "-1", ",", " ", "-1", ")", " ", "/", " ", "float", "(", "n", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "channels_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f", "\\u", "in_", "=_", "N_", "._", "tile_", "(_", "f", "\\u", "in_", ",_", "(_", "channels_", ",_", "1_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "\\u", "out_", "=_", "N_", "._", "tile_", "(_", "f", "\\u", "out_", ",_", "(_", "channels_", ",_", "1_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vals_", "=_", "f", "\\u", "out_", "*_", "arr", "1_", "+_", "f", "\\u", "in_", "*_", "arr", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "equal", "\\u", "power_", "(_", "arr", "1_", ",_", "arr", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "an", " ", "equal", " ", "power", " ", "blend", " ", "of", " ", "arr", "1", " ", "(", "fad", "ing", " ", "out", ")", " ", "and", " ", "arr", "2", " ", "(", "fad", "ing", " ", "in", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "N_", "._", "shape_", "(_", "arr", "1_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "channels_", "=_", "N_", "._", "shape_", "(_", "arr", "1_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "channels_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f", "\\u", "in_", "=_", "N_", "._", "arange_", "(_", "n_", ")_", "/_", "float_", "(_", "n_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "\\u", "out_", "=_", "N_", "._", "arange_", "(_", "n_", "-_", "1_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", "/_", "float_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "channels_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f", "\\u", "in_", "=_", "N_", "._", "tile_", "(_", "f", "\\u", "in_", ",_", "(_", "channels_", ",_", "1_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "\\u", "out_", "=_", "N_", "._", "tile_", "(_", "f", "\\u", "out_", ",_", "(_", "channels_", ",_", "1_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vals_", "=_", "log", "\\u", "factor_", "(_", "f", "\\u", "out_", ")_", "*_", "arr", "1_", "+_", "log", "\\u", "factor_", "(_", "f", "\\u", "in_", ")_", "*_", "arr", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "limiter", "_", "(_", "vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wav", "\\u", "to", "\\u", "mp3", "_", "(_", "wav", "fn_", ",_", "delete", "\\u", "wav_", "=_", "False_", ",_", "lame", "\\u", "quality_", "=_", "\"", "V", " ", "2", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mp3", "fn_", "=_", "\".\"_", "._", "join_", "(_", "wav", "fn_", "._", "split_", "(_", "'.'_", ")_", "[_", ":_", "-_", "1_", "]_", ")_", "+_", "'.", "mp3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "check", "\\u", "output_", "(_", "'", "lame", " ", "-{}", " ", "\"{}\"'_", "._", "format_", "(_", "lame", "\\u", "quality_", ",_", "wav", "fn_", ")_", ",_", "shell_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "LIB", "XM", "P_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xmp", "file_", "=_", "libx", "mp_", "._", "XM", "PF", "iles_", "(_", "file", "\\u", "path_", "=_", "wav", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmp", "file2_", "=_", "libx", "mp_", "._", "XM", "PF", "iles_", "(_", "file", "\\u", "path_", "=_", "mp3", "fn_", ",_", "open", "\\u", "for", "update_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xmp", "_", "=_", "xmp", "file_", "._", "get", "\\u", "xmp", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "xmp", "file2_", "._", "can", "\\u", "put", "\\u", "xmp", "_", "(_", "xmp", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xmp", "file2_", "._", "put", "\\u", "xmp", "_", "(_", "xmp", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Cou", "ld", " ", "not", " ", "convert", " ", "xmp", " ", "from", " ", "wav", " ", "to", " ", "mp3", "\"_", "\\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 ", " _", "print_", "\"", "File", " ", "has", " ", "no", " ", "xmp", " ", "data", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "xmp", "file_", "._", "close", "\\u", "file_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmp", "file2_", "._", "close", "\\u", "file_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "delete", "\\u", "wav_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "output_", "(_", "'", "rm", " ", "\"{}\"'_", "._", "format_", "(_", "wav", "fn_", ")_", ",_", "shell_", "=_", "True_", ")_" ]
[ 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, 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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 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 ]
Module is imported more than once
bitxbay/BitXBay/electru/build/lib/electrum/interface.py
[ { "content": "#!/usr/bin/env python\n#\n# Electrum - lightweight Bitcoin client\n# Copyright (C) 2011 thomasv@gitorious\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n\nimport random, ast, re, errno, os\nimport threading, traceback, sys, time, json, Queue\nimport socks\nimport socket\nimport ssl\n\nfrom version import ELECTRUM_VERSION, PROTOCOL_VERSION\nfrom util import print_error, print_msg\nfrom simple_config import SimpleConfig\n\n\nDEFAULT_TIMEOUT = 5\nproxy_modes = ['socks4', 'socks5', 'http']\n\n\n\n\n\n\n \n\n\n\n\n\n\nif __name__ == \"__main__\":\n\n check_certificates()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def send_http(self, messages, callback):\n import urllib2, json, time, cookielib\n print_error( \"send_http\", messages )\n \n if self.proxy:\n socks.setdefaultproxy(self.proxy_mode, self.proxy[\"host\"], int(self.proxy[\"port\"]) )\n socks.wrapmodule(urllib2)\n\n cj = cookielib.CookieJar()\n opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))\n urllib2.install_opener(opener)\n\n t1 = time.time()\n\n data = []\n ids = []\n for m in messages:\n method, params = m\n if type(params) != type([]): params = [params]\n data.append( { 'method':method, 'id':self.message_id, 'params':params } )\n self.unanswered_requests[self.message_id] = method, params, callback\n ids.append(self.message_id)\n self.message_id += 1\n\n if data:\n data_json = json.dumps(data)\n else:\n # poll with GET\n data_json = None \n\n \n headers = {'content-type': 'application/json'}\n if self.session_id:\n headers['cookie'] = 'SESSION=%s'%self.session_id\n\n try:\n req = urllib2.Request(self.connection_msg, data_json, headers)\n response_stream = urllib2.urlopen(req, timeout=DEFAULT_TIMEOUT)\n except Exception:\n return\n\n for index, cookie in enumerate(cj):\n if cookie.name=='SESSION':\n self.session_id = cookie.value\n\n response = response_stream.read()\n self.bytes_received += len(response)\n if response: \n response = json.loads( response )\n if type(response) is not type([]):\n self.queue_json_response(response)\n else:\n for item in response:\n self.queue_json_response(item)\n\n if response: \n self.poll_interval = 1\n else:\n if self.poll_interval < 15: \n self.poll_interval += 1\n #print self.poll_interval, response\n\n self.rtime = time.time() - t1\n self.is_connected = True\n return ids", "metadata": "root.Interface.send_http", "header": "['class', 'Interface', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 231 } ]
[ { "span": "import urllib2, json, time, cookielib", "start_line": 232, "start_column": 8, "end_line": 232, "end_column": 45 } ]
[ { "span": "import threading, traceback, sys, time, json, Queue", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 51 } ]
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_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Elect", "rum", " ", "-", " ", "light", "weight", " ", "Bit", "coin", " ", "client_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2011", " ", "tho", "mas", "v", "@", "git", "ori", "ous_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ":", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modify_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "as", " ", "publi", "shed", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ",", " ", "eit", "her", " ", "version", " ", "3", " ", "of", " ", "the", " ", "License", ",", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "along", " ", "with", " ", "this", " ", "program", ".", " ", "If", " ", "not", ",", " ", "see", " ", "<", "http", "://", "www", ".", "gnu", ".", "org", "/", "license", "s", "/>", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "random_", ",_", "ast_", ",_", "re_", ",_", "errno_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", ",_", "traceback_", ",_", "sys_", ",_", "time_", ",_", "json_", ",_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socks", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ssl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "version_", "import_", "ELECT", "RU", "M", "\\u", "VERSION_", ",_", "PROTOCOL", "\\u", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "util_", "import_", "print", "\\u", "error_", ",_", "print", "\\u", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "simple", "\\u", "config_", "import_", "Simple", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "TIMEOUT_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proxy", "\\u", "modes_", "=_", "[_", "'", "socks", "4", "'_", ",_", "'", "socks", "5", "'_", ",_", "'", "http", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "certificates", "_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "class_", "Interface_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "http_", "(_", "self_", ",_", "messages_", ",_", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "urllib2_", ",_", "json_", ",_", "time_", ",_", "cookie", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print", "\\u", "error_", "(_", "\"", "send", "\\u", "http", "\"_", ",_", "messages_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "proxy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "socks", "_", "._", "setdefault", "proxy_", "(_", "self_", "._", "proxy", "\\u", "mode_", ",_", "self_", "._", "proxy_", "[_", "\"", "host", "\"_", "]_", ",_", "int_", "(_", "self_", "._", "proxy_", "[_", "\"", "port", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "socks", "_", "._", "wrap", "module_", "(_", "urllib2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cj_", "=_", "cookie", "lib_", "._", "Cooki", "e", "Jar_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opener_", "=_", "urllib2_", "._", "build", "\\u", "opener_", "(_", "urllib2_", "._", "HTTP", "Cooki", "e", "Processor_", "(_", "cj_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urllib2_", "._", "install", "\\u", "opener_", "(_", "opener_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ids_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "method_", ",_", "params_", "=_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "params_", ")_", "!=_", "type_", "(_", "[_", "]_", ")_", ":_", "params_", "=_", "[_", "params_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "._", "append_", "(_", "{_", "'", "method", "'_", ":_", "method_", ",_", "'", "id", "'_", ":_", "self_", "._", "message", "\\u", "id_", ",_", "'", "params", "'_", ":_", "params_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "una", "nsw", "ere", "d\\u", "requests_", "[_", "self_", "._", "message", "\\u", "id_", "]_", "=_", "method_", ",_", "params_", ",_", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ids_", "._", "append_", "(_", "self_", "._", "message", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message", "\\u", "id_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "json_", "=_", "json_", "._", "dumps_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "poll", " ", "with", " ", "GET_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "json_", "=_", "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_", "headers_", "=_", "{_", "'", "content", "-", "type", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "session", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "[_", "'", "cookie", "'_", "]_", "=_", "'", "SES", "SION", "=", "%", "s", "'_", "%_", "self_", "._", "session", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req_", "=_", "urllib2_", "._", "Request_", "(_", "self_", "._", "connecti", "on", "\\u", "msg_", ",_", "data\\u", "json_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "stream_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ",_", "timeout_", "=_", "DEF", "AUL", "T", "\\u", "TIMEOUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "index_", ",_", "cookie_", "in_", "enumerate_", "(_", "cj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cookie_", "._", "name_", "==_", "'", "SES", "SION", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "session", "\\u", "id_", "=_", "cookie_", "._", "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_", "response_", "=_", "response", "\\u", "stream_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "bytes", "\\u", "received_", "+=_", "len_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "json_", "._", "loads_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "response_", ")_", "is_", "not_", "type_", "(_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queue", "\\u", "json", "\\u", "response_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "queue", "\\u", "json", "\\u", "response_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "poll", "\\u", "interval_", "=_", "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_", "self_", "._", "poll", "\\u", "interval_", "<_", "15_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "poll", "\\u", "interval_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "self", ".", "poll", "\\u", "interval", ",", " ", "response_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rti", "me_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "t1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "connected_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ids_", "\\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, 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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 ]
Unreachable code
deanhiller/databus/webapp/play1.3.x/python/Lib/multiprocessing/connection.py
[ { "content": "def SocketClient(address):\n '''\n Return a connection object connected to the socket given by `address`\n '''\n family = address_type(address)\n s = socket.socket( getattr(socket, family) )\n\n while 1:\n try:\n s.connect(address)\n except socket.error, e:\n if e.args[0] != errno.ECONNREFUSED: # connection refused\n debug('failed to connect to address %s', address)\n raise\n time.sleep(0.01)\n else:\n break\n else:\n raise\n\n fd = duplicate(s.fileno())\n conn = _multiprocessing.Connection(fd)\n s.close()\n return conn", "metadata": "root.SocketClient", "header": "['module', '___EOS___']", "index": 242 }, { "content": " def PipeClient(address):\n '''\n Return a connection object connected to the pipe given by `address`\n '''\n while 1:\n try:\n win32.WaitNamedPipe(address, 1000)\n h = win32.CreateFile(\n address, win32.GENERIC_READ | win32.GENERIC_WRITE,\n 0, win32.NULL, win32.OPEN_EXISTING, 0, win32.NULL\n )\n except WindowsError, e:\n if e.args[0] not in (win32.ERROR_SEM_TIMEOUT,\n win32.ERROR_PIPE_BUSY):\n raise\n else:\n break\n else:\n raise\n\n win32.SetNamedPipeHandleState(\n h, win32.PIPE_READMODE_MESSAGE, None, None\n )\n return _multiprocessing.PipeConnection(h)", "metadata": "root.PipeClient", "header": "['module', '___EOS___']", "index": 319 } ]
[ { "span": "raise", "start_line": 260, "start_column": 8, "end_line": 260, "end_column": 13 }, { "span": "raise", "start_line": 337, "start_column": 12, "end_line": 337, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Sock", "et", "Client_", "(_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "connecti", "on", " ", "object", " ", "connect", "ed", " ", "to", " ", "the", " ", "socket", " ", "give", "n", " ", "by", " ", "`", "address", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "family_", "=_", "address", "\\u", "type_", "(_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "socket_", "._", "socket_", "(_", "getattr_", "(_", "socket_", ",_", "family_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "1_", ":_", "\\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_", "._", "connect_", "(_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "socket_", "._", "error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "args_", "[_", "0_", "]_", "!=_", "errno_", "._", "ECO", "NN", "REF", "USED", "_", ":_", "#", " ", "connecti", "on", " ", "refuse", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "(_", "'", "fail", "ed", " ", "to", " ", "connect", " ", "to", " ", "address", " ", "%", "s", "'_", ",_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fd_", "=_", "duplicate_", "(_", "s_", "._", "fileno_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "\\u", "multiprocessing_", "._", "Connection_", "(_", "fd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "conn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Pipe", "Client_", "(_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "connecti", "on", " ", "object", " ", "connect", "ed", " ", "to", " ", "the", " ", "pipe", " ", "give", "n", " ", "by", " ", "`", "address", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "1_", ":_", "\\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 ", " _", "win32", "_", "._", "Wait", "Name", "d", "Pipe_", "(_", "address_", ",_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "win32", "_", "._", "Creat", "e", "File_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "address_", ",_", "win32", "_", "._", "GENERIC", "\\u", "READ_", "|_", "win32", "_", "._", "GENERIC", "\\u", "WRITE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "win32", "_", "._", "NULL_", ",_", "win32", "_", "._", "OPEN", "\\u", "EXIST", "ING_", ",_", "0_", ",_", "win32", "_", "._", "NULL_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Window", "s", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "args_", "[_", "0_", "]_", "not_", "in_", "(_", "win32", "_", "._", "ERROR", "\\u", "SEM", "\\u", "TIMEOUT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "win32", "_", "._", "ERROR", "\\u", "PIPE", "\\u", "BUS", "Y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win32", "_", "._", "Set", "Name", "d", "Pipe", "Handle", "State_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "h_", ",_", "win32", "_", "._", "PIPE", "\\u", "READ", "MODE", "\\u", "MESSAGE_", ",_", "None_", ",_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "multiprocessing_", "._", "Pipe", "Connection_", "(_", "h_", ")_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
mrjoes/tornadio/setup.py
[ { "content": "#!/usr/bin/env python\n\ntry:\n from setuptools import setup, find_packages\nexcept ImportError:\n from distribute_setup import use_setuptools\n use_setuptools()\n from setuptools import setup, find_packages\n\ntry:\n license = open('LICENSE').read()\nexcept:\n license = None\n\ntry:\n readme = open('README.rst').read()\nexcept:\n readme = None\n\nsetup(\n name='TornadIO',\n version='0.0.4',\n author='Serge S. Koval',\n author_email='serge.koval@gmail.com',\n packages=['tornadio'],\n scripts=[],\n url='http://github.com/MrJoes/tornadio/',\n license=license,\n description='Socket.io server implementation on top of Tornado framework',\n long_description=readme,\n requires=['simplejson', 'tornado'],\n install_requires=[\n 'simplejson >= 2.1.0',\n 'tornado >= 1.1.0'\n ]\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except:", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 7 }, { "span": "except:", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "setuptools_", "import_", "setup_", ",_", "find", "\\u", "packages_", "\\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_", "distribute", "\\u", "setup_", "import_", "use", "\\u", "setuptools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "use", "\\u", "setuptools_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "setuptools_", "import_", "setup_", ",_", "find", "\\u", "packages_", "\\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 ", " _", "license_", "=_", "open_", "(_", "'", "LICENSE", "'_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "license_", "=_", "None_", "\\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 ", " _", "readme_", "=_", "open_", "(_", "'", "READ", "ME", ".", "rst", "'_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "readme_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "Tor", "nad", "IO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "0.", "0.", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "'", "Ser", "ge", " ", "S", ".", " ", "Ko", "val", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author", "\\u", "email_", "=_", "'", "ser", "ge", ".", "kov", "al", "@", "gma", "il", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "[_", "'", "torn", "adio", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "scripts_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "git", "hub", ".", "com", "/", "Mr", "Jo", "es", "/", "torn", "adio", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "license_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "'", "Sock", "et", ".", "io", " ", "server", " ", "implementation", " ", "on", " ", "top", " ", "of", " ", "Tor", "nad", "o", " ", "frame", "work", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "readme_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requires_", "=_", "[_", "'", "simple", "json", "'_", ",_", "'", "torn", "ado", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "simple", "json", " ", ">=", " ", "2.1", ".0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "torn", "ado", " ", ">=", " ", "1.1", ".0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
jgurtowski/ectools/simulate_reads.py
[ { "content": "#!/usr/bin/env python\n\n##Simulates reads from genome\n\nimport sys\n\nfrom collections import namedtuple\nfrom seqio import fastaIterator\nfrom itertools import dropwhile,count,repeat\nimport misc\nimport random\n\n\n\n \n#read.lens is just a file with a list of read lengths\nif not len(sys.argv) == 5:\n print \"simulate_reads.py genome.fa read.lens error_rate out_prefix\"\n sys.exit(1)\n\n\nChromosome = namedtuple(\"Chromosome\", [\"name\",\"seq\"])\n\ngfh = open(sys.argv[1])\nlfh = open(sys.argv[2])\nerate = float(sys.argv[3])\nrout = open(sys.argv[4]+\".sim.fa\", \"w\")\n\n\n#read genome into mem\nchromosomes = map(lambda r: Chromosome._make((str(r.name),str(r.seq))), fastaIterator(gfh))\nchrom_lengths = map(lambda c: len(c.seq), chromosomes)\ngenome_length = sum(chrom_lengths)\nchrom_lengths_ivtf = map(misc.accumulator(0), map(lambda x: float(x)/genome_length , chrom_lengths))\n\ncount = 0\nfor l in lfh:\n #length of read to simulate\n readlen = int(l.strip())\n \n while True:\n #choose a chromosome\n U_c = random.random()\n chr_idx = misc.first_idx(lambda x : x > U_c, chrom_lengths_ivtf)\n chromosome = chromosomes[chr_idx]\n chromosome_len = chrom_lengths[chr_idx]\n\n #choose a random position\n U_p = int(random.random() * chromosome_len)\n \n if (U_p + readlen) > (chromosome_len - 1):\n continue\n\n #decide reverse_complement or not\n f = random.choice([(\"f\",lambda x: x), (\"r\",misc.reverse_complement)])\n \n sim_read = f[1](chromosome.seq[U_p:U_p + readlen])\n sim_read_name = \">\"+chromosome.name+\":\"+str(U_p)+\"-\"+str(U_p+readlen)+\":\"+f[0] \n \n ##add errors\n #how many errors? normal approx to binomial\n num_errors = abs(int(random.normalvariate(readlen*erate, readlen*erate*(1-erate))))\n for i in range(num_errors):\n position = int(random.random() * len(sim_read))\n f = random.choice([insertion,deletion,mismatch])\n sim_read = f(position,sim_read)\n\n sim_read_name += \" orig_len=%d e_len=%d e_num=%d\" % (readlen,len(sim_read),num_errors)\n \n rout.write(\"%s\\n%s\\n\" % (sim_read_name,sim_read))\n break\n count += 1\n if count % 10000 == 0:\n sys.stderr.write(\"Simulated: %d\\n\" % count) \n\ngfh.close() \nlfh.close()\nrout.close()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def insertion(pos, seq):\n return seq[:pos] + random.choice([\"A\",\"C\",\"G\",\"T\"]) + seq[pos:]", "metadata": "root.insertion", "header": "['module', '___EOS___']", "index": 12 }, { "content": "def deletion(pos,seq):\n return seq[:pos] + seq[pos+1:]", "metadata": "root.deletion", "header": "['module', '___EOS___']", "index": 15 }, { "content": "def mismatch(pos,seq):\n return seq[:pos] + random.choice([\"A\",\"C\",\"G\",\"T\"]) + seq[pos+1:]", "metadata": "root.mismatch", "header": "['module', '___EOS___']", "index": 18 } ]
[ { "span": "from itertools import dropwhile,count,repeat", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "Simulate", "s", " ", "reads", " ", "from", " ", "genome_", "\\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_", "from_", "collections_", "import_", "namedtuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "seq", "io_", "import_", "fasta", "Iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "drop", "while_", ",_", "count_", ",_", "repeat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "misc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "read", ".", "lens", " ", "is", " ", "just", " ", "a", " ", "file", " ", "with", " ", "a", " ", "list", " ", "of", " ", "read", " ", "lengths_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "len_", "(_", "sys_", "._", "argv_", ")_", "==_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "simulat", "e\\u", "reads", ".", "py", " ", "geno", "me", ".", "fa", " ", "read", ".", "lens", " ", "error", "\\u", "rate", " ", "out", "\\u", "prefix", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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_", "Chrom", "osom", "e_", "=_", "namedtuple_", "(_", "\"", "Chrom", "osom", "e", "\"_", ",_", "[_", "\"", "name", "\"_", ",_", "\"", "seq", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gf", "h_", "=_", "open_", "(_", "sys_", "._", "argv_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lf", "h_", "=_", "open_", "(_", "sys_", "._", "argv_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "erate", "_", "=_", "float_", "(_", "sys_", "._", "argv_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rout", "_", "=_", "open_", "(_", "sys_", "._", "argv_", "[_", "4_", "]_", "+_", "\".", "sim", ".", "fa", "\"_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "read", " ", "geno", "me", " ", "int", "o", " ", "mem_", "\\u\\u\\uNL\\u\\u\\u_", "chromosomes", "_", "=_", "map_", "(_", "lambda_", "r_", ":_", "Chrom", "osom", "e_", "._", "\\u", "make_", "(_", "(_", "str_", "(_", "r_", "._", "name_", ")_", ",_", "str_", "(_", "r_", "._", "seq_", ")_", ")_", ")_", ",_", "fasta", "Iterator_", "(_", "gf", "h_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chrom", "\\u", "lengths_", "=_", "map_", "(_", "lambda_", "c_", ":_", "len_", "(_", "c_", "._", "seq_", ")_", ",_", "chromosomes", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geno", "me", "\\u", "length_", "=_", "sum_", "(_", "chrom", "\\u", "lengths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chrom", "\\u", "length", "s", "\\u", "iv", "tf_", "=_", "map_", "(_", "misc_", "._", "accumulator_", "(_", "0_", ")_", ",_", "map_", "(_", "lambda_", "x_", ":_", "float_", "(_", "x_", ")_", "/_", "geno", "me", "\\u", "length_", ",_", "chrom", "\\u", "lengths_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "l_", "in_", "lf", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "length", " ", "of", " ", "read", " ", "to", " ", "simulate_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "read", "len_", "=_", "int_", "(_", "l_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "choose", " ", "a", " ", "chromosome_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "U", "\\u", "c_", "=_", "random_", "._", "random_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chr", "\\u", "idx_", "=_", "misc_", "._", "first", "\\u", "idx_", "(_", "lambda_", "x_", ":_", "x_", ">_", "U", "\\u", "c_", ",_", "chrom", "\\u", "length", "s", "\\u", "iv", "tf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chromosome_", "=_", "chromosomes", "_", "[_", "chr", "\\u", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chromo", "some", "\\u", "len_", "=_", "chrom", "\\u", "lengths_", "[_", "chr", "\\u", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "choose", " ", "a", " ", "random", " ", "position_", "\\u\\u\\uNL\\u\\u\\u_", "U", "\\u", "p_", "=_", "int_", "(_", "random_", "._", "random_", "(_", ")_", "*_", "chromo", "some", "\\u", "len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "U", "\\u", "p_", "+_", "read", "len_", ")_", ">_", "(_", "chromo", "some", "\\u", "len_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "decide", " ", "reverse", "\\u", "complement", " ", "or", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "random_", "._", "choice_", "(_", "[_", "(_", "\"", "f", "\"_", ",_", "lambda_", "x_", ":_", "x_", ")_", ",_", "(_", "\"", "r", "\"_", ",_", "misc_", "._", "reverse", "\\u", "complement_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sim", "\\u", "read_", "=_", "f_", "[_", "1_", "]_", "(_", "chromosome_", "._", "seq_", "[_", "U", "\\u", "p_", ":_", "U", "\\u", "p_", "+_", "read", "len_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sim", "\\u", "read", "\\u", "name_", "=_", "\">\"_", "+_", "chromosome_", "._", "name_", "+_", "\":\"_", "+_", "str_", "(_", "U", "\\u", "p_", ")_", "+_", "\"-\"_", "+_", "str_", "(_", "U", "\\u", "p_", "+_", "read", "len_", ")_", "+_", "\":\"_", "+_", "f_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", "add", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "#", "how", " ", "many", " ", "error", "s", "?", " ", "normal", " ", "approx", " ", "to", " ", "binomial", "_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "errors_", "=_", "abs_", "(_", "int_", "(_", "random_", "._", "normal", "varia", "te_", "(_", "read", "len_", "*_", "erate", "_", ",_", "read", "len_", "*_", "erate", "_", "*_", "(_", "1_", "-_", "erate", "_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "\\u", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "position_", "=_", "int_", "(_", "random_", "._", "random_", "(_", ")_", "*_", "len_", "(_", "sim", "\\u", "read_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "random_", "._", "choice_", "(_", "[_", "insertion", "_", ",_", "deletion_", ",_", "mismatch_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sim", "\\u", "read_", "=_", "f_", "(_", "position_", ",_", "sim", "\\u", "read_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sim", "\\u", "read", "\\u", "name_", "+=_", "\"", " ", "orig", "\\u", "len", "=", "%", "d", " ", "e\\u", "len", "=", "%", "d", " ", "e\\u", "num", "=", "%", "d", "\"_", "%_", "(_", "read", "len_", ",_", "len_", "(_", "sim", "\\u", "read_", ")_", ",_", "num", "\\u", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rout", "_", "._", "write_", "(_", "\"%", "s", "\\\\", "n", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "sim", "\\u", "read", "\\u", "name_", ",_", "sim", "\\u", "read_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "count_", "%_", "10000_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "\"", "Simulate", "d", ":", " ", "%", "d", "\\\\", "n", "\"_", "%_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gf", "h_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lf", "h_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rout", "_", "._", "close_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "insertion", "_", "(_", "pos_", ",_", "seq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "seq_", "[_", ":_", "pos_", "]_", "+_", "random_", "._", "choice_", "(_", "[_", "\"", "A", "\"_", ",_", "\"", "C", "\"_", ",_", "\"", "G", "\"_", ",_", "\"", "T", "\"_", "]_", ")_", "+_", "seq_", "[_", "pos_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "deletion_", "(_", "pos_", ",_", "seq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "seq_", "[_", ":_", "pos_", "]_", "+_", "seq_", "[_", "pos_", "+_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mismatch_", "(_", "pos_", ",_", "seq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "seq_", "[_", ":_", "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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
tjguk/winsys/winsys/tests/test_event_logs.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport sys\nfrom winsys._compat import unittest\nimport uuid\n\nimport winerror\nimport win32api\nimport win32con\nimport win32evtlog\nimport win32security\nimport pywintypes\n\nfrom winsys.tests import utils as testutils\nfrom winsys import event_logs, registry, utils\n\n\nLOG_NAME = event_logs.DEFAULT_LOG_NAME\nGUID = \"_winsys-%s\" % uuid.uuid1()\n\n#\n# Utility functions\n#\n\n#\n# TESTS\n#\n\n\nif __name__ == \"__main__\":\n unittest.main()\n if sys.stdout.isatty(): raw_input(\"Press enter...\")\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def yield_logs(computer=None, log_name=LOG_NAME):\n hLog = win32evtlog.OpenEventLog(computer, log_name)\n try:\n while True:\n entries = win32evtlog.ReadEventLog(\n hLog,\n win32evtlog.EVENTLOG_BACKWARDS_READ | win32evtlog.EVENTLOG_SEQUENTIAL_READ,\n 0\n )\n if entries:\n for entry in entries:\n yield entry\n else:\n break\n finally:\n win32evtlog.CloseEventLog(hLog)", "metadata": "root.yield_logs", "header": "['module', '___EOS___']", "index": 24 }, { "content": "@unittest.skipUnless(testutils.i_am_admin(), \"These tests must be run as Administrator\")\nclass TestEventLogs(unittest.TestCase):\n\n #\n # Fixtures\n #\n\n\n #\n # Event Source\n #\n\n\n\n\n\n\n\n\n\n\n #\n # Event logs\n #\n\n\n\n\n\n\n\n #\n # Module-level functions\n #", "metadata": "root.TestEventLogs", "header": "['module', '___EOS___']", "index": 45 }, { "content": " def setUp(self):\n event_logs.EventSource.create(GUID, LOG_NAME)\n self.registry_root = registry.registry(r\"HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog\")", "metadata": "root.TestEventLogs.setUp", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 51 }, { "content": " def tearDown(self):\n event_logs.event_source(r\"%s\\%s\" %(LOG_NAME, GUID)).delete()", "metadata": "root.TestEventLogs.tearDown", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 55 }, { "content": " def test_create_source(self):\n log_name = \"System\"\n guid = \"_winsys-test_create_source-%s\" % uuid.uuid1()\n try:\n source = event_logs.EventSource.create(guid, log_name)\n self.assertTrue(self.registry_root + log_name + guid)\n except:\n raise\n else:\n source.delete()\n self.assertFalse(bool(self.registry_root + log_name + guid))", "metadata": "root.TestEventLogs.test_create_source", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 61 }, { "content": " def test_create_source_at_default(self):\n guid = \"_winsys-test_create_source_at_default-%s\" % uuid.uuid1()\n try:\n source = event_logs.EventSource.create(guid)\n self.assertTrue(self.registry_root + event_logs.DEFAULT_LOG_NAME + guid)\n except:\n raise\n else:\n source.delete()\n self.assertFalse(bool(self.registry_root + event_logs.DEFAULT_LOG_NAME + guid))", "metadata": "root.TestEventLogs.test_create_source_at_default", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 73 }, { "content": " def test_event_sources(self):\n log_name = \"System\"\n self.assertEqual(\n set(s.name for s in event_logs.event_sources(log_name)),\n set(r.name for r in self.registry_root + log_name)\n )\n self.assertTrue(all(isinstance(s, event_logs.EventSource) for s in event_logs.event_sources(log_name)))", "metadata": "root.TestEventLogs.test_event_sources", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 84 }, { "content": " def test_event_source_from_event_source(self):\n for s in event_logs.event_sources():\n self.assertTrue(isinstance(s, event_logs.EventSource))\n self.assertTrue(event_logs.event_source(s) is s)\n break", "metadata": "root.TestEventLogs.test_event_source_from_event_source", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 92 }, { "content": " def test_event_source_from_none(self):\n self.assertTrue(event_logs.event_source(None) is None)", "metadata": "root.TestEventLogs.test_event_source_from_none", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 98 }, { "content": " def test_event_source_from_bad_string(self):\n with self.assertRaises(event_logs.x_event_logs):\n event_logs.event_source(\"\")", "metadata": "root.TestEventLogs.test_event_source_from_bad_string", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 101 }, { "content": " def test_event_source_from_good_string(self):\n self.assertTrue(\n isinstance(\n event_logs.event_source(r\"%s\\%s\" %(LOG_NAME, GUID)),\n event_logs.EventSource\n )\n )", "metadata": "root.TestEventLogs.test_event_source_from_good_string", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 105 }, { "content": " def test_event_source_from_good_string_default_log(self):\n self.assertTrue(\n isinstance(\n event_logs.event_source(GUID),\n event_logs.EventSource\n )\n )", "metadata": "root.TestEventLogs.test_event_source_from_good_string_default_log", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 113 }, { "content": " def test_event_source_as_string(self):\n self.assertTrue(event_logs.event_source(GUID).as_string())", "metadata": "root.TestEventLogs.test_event_source_as_string", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 121 }, { "content": " def test_event_source_log_event(self):\n data = str(GUID).encode(\"utf8\")\n event_logs.event_source(GUID).log_event(data=data)\n for event in yield_logs():\n if event.SourceName == GUID and event.Data == data:\n self.assertTrue(True)\n break\n else:\n self.assertTrue(False)", "metadata": "root.TestEventLogs.test_event_source_log_event", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 124 }, { "content": " def test_event_logs(self):\n self.assertEqual(\n set(s.name for s in event_logs.event_logs()),\n set(r.name for r in self.registry_root.keys())\n )\n self.assertTrue(all(isinstance(s, event_logs.EventLog) for s in event_logs.event_logs()))", "metadata": "root.TestEventLogs.test_event_logs", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 137 }, { "content": " def test_event_log_from_event_log(self):\n for l in event_logs.event_logs():\n self.assertTrue(isinstance(l, event_logs.EventLog))\n self.assertTrue(event_logs.event_log(l) is l)\n break", "metadata": "root.TestEventLogs.test_event_log_from_event_log", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 144 }, { "content": " def test_event_log_from_none(self):\n self.assertTrue(event_logs.event_log(None) is None)", "metadata": "root.TestEventLogs.test_event_log_from_none", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 150 }, { "content": " def test_event_log_from_bad_string(self):\n with self.assertRaises(event_logs.x_event_logs):\n event_logs.event_log (\"\")", "metadata": "root.TestEventLogs.test_event_log_from_bad_string", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 153 }, { "content": " def test_event_log_from_good_string(self):\n self.assertTrue(\n isinstance(\n event_logs.event_log(LOG_NAME),\n event_logs.EventLog\n )\n )", "metadata": "root.TestEventLogs.test_event_log_from_good_string", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 157 }, { "content": " def test_event_log_clear_no_save(self):\n log_name = \"Internet Explorer\"\n source_name = \"_winsys-%s\" % uuid.uuid1()\n source = event_logs.EventSource.create(source_name, log_name)\n log = event_logs.event_log(log_name)\n hLog = win32evtlog.OpenEventLog(None, log_name)\n try:\n log.log_event(source, message=\"hello\")\n self.assertNotEquals(win32evtlog.GetNumberOfEventLogRecords(hLog), 0)\n log.clear()\n self.assertEqual(win32evtlog.GetNumberOfEventLogRecords(hLog), 0)\n finally:\n win32evtlog.CloseEventLog(hLog)\n source.delete()", "metadata": "root.TestEventLogs.test_event_log_clear_no_save", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 165 }, { "content": " def test_event_log_clear_with_save(self):\n log_name = \"Internet Explorer\"\n source_name = \"_winsys-%s\" % uuid.uuid1()\n source = event_logs.EventSource.create(source_name, log_name)\n log = event_logs.event_log(log_name)\n hLog = win32evtlog.OpenEventLog(None, log_name)\n try:\n log.log_event(source, message=\"hello\")\n self.assertNotEquals(win32evtlog.GetNumberOfEventLogRecords(hLog), 0)\n log.clear()\n self.assertEqual(win32evtlog.GetNumberOfEventLogRecords(hLog), 0)\n finally:\n win32evtlog.CloseEventLog(hLog)\n source.delete()", "metadata": "root.TestEventLogs.test_event_log_clear_with_save", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 180 }, { "content": " def test_log_event(self):\n data = str(GUID).encode(\"utf8\")\n event_logs.log_event(\"%s\\\\%s\" %(LOG_NAME, GUID), data=data)\n for event in yield_logs():\n if event.SourceName == GUID and event.Data == data:\n self.assertTrue(True)\n break\n else:\n self.assertTrue(False)", "metadata": "root.TestEventLogs.test_log_event", "header": "['class', 'TestEventLogs', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# Fixtures', '___NL___', '#', '___NL___', '___EOS___']", "index": 198 } ]
[ { "span": "import winerror", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 15 }, { "span": "import win32api", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 15 }, { "span": "import win32con", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 15 }, { "span": "import win32security", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 20 }, { "span": "import pywintypes", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 17 }, { "span": "from winsys import event_logs, registry, utils", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "wins", "ys_", "._", "\\u", "compat_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "wine", "rror_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32con_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "evt", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "security_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pywi", "ntype", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "wins", "ys_", "._", "tests_", "import_", "utils_", "as_", "testutils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "wins", "ys_", "import_", "event", "\\u", "logs_", ",_", "registry_", ",_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOG", "\\u", "NAME_", "=_", "event", "\\u", "logs_", "._", "DEF", "AUL", "T", "\\u", "LOG", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "GUID", "_", "=_", "\"\\u", "wins", "ys", "-%", "s", "\"_", "%_", "uuid_", "._", "uuid1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Utili", "ty", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TESTS_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unittest_", "._", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "stdout_", "._", "isatty_", "(_", ")_", ":_", "raw", "\\u", "input_", "(_", "\"", "Press", " ", "enter", "...\"_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "yield", "\\u", "logs_", "(_", "computer_", "=_", "None_", ",_", "log", "\\u", "name_", "=_", "LOG", "\\u", "NAME_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h", "Log_", "=_", "win32", "evt", "log_", "._", "Open", "Event", "Log_", "(_", "computer_", ",_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "entries_", "=_", "win32", "evt", "log_", "._", "Read", "Event", "Log_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "h", "Log_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "win32", "evt", "log_", "._", "EVENT", "LOG", "\\u", "BACK", "WARD", "S", "\\u", "READ_", "|_", "win32", "evt", "log_", "._", "EVENT", "LOG", "\\u", "SEQ", "UE", "NTI", "AL", "\\u", "READ_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "entries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "entry_", "in_", "entries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "entry_", "\\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 ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "win32", "evt", "log_", "._", "Clos", "e", "Event", "Log_", "(_", "h", "Log_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "skip", "Unless_", "(_", "testutils_", "._", "i", "\\u", "am", "\\u", "admin_", "(_", ")_", ",_", "\"", "The", "se", " ", "tests", " ", "must", " ", "be", " ", "run", " ", "as", " ", "Administra", "tor", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\u\\u\\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_", "#", " ", "Event", " ", "Source_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Event", " ", "logs_", "\\u\\u\\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\\uNL\\u\\u\\u_", "#", " ", "Modul", "e-", "level", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "\\u", "logs_", "._", "Event", "Source_", "._", "create_", "(_", "GUID", "_", ",_", "LOG", "\\u", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "registr", "y", "\\u", "root_", "=_", "registry_", "._", "registry_", "(_", "r", "\"", "HK", "LM", "\\\\", "SYSTEM", "\\\\", "Curr", "ent", "Control", "Set", "\\\\", "Service", "s", "\\\\", "Event", "log", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "r", "\"%", "s", "\\\\", "%", "s", "\"_", "%_", "(_", "LOG", "\\u", "NAME_", ",_", "GUID", "_", ")_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "create", "\\u", "source_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "name_", "=_", "\"", "System", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "guid_", "=_", "\"\\u", "wins", "ys", "-", "test\\u", "create", "\\u", "source", "-%", "s", "\"_", "%_", "uuid_", "._", "uuid1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "event", "\\u", "logs_", "._", "Event", "Source_", "._", "create_", "(_", "guid_", ",_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "registr", "y", "\\u", "root_", "+_", "log", "\\u", "name_", "+_", "guid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bool_", "(_", "self_", "._", "registr", "y", "\\u", "root_", "+_", "log", "\\u", "name_", "+_", "guid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "source", "\\u", "at", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "guid_", "=_", "\"\\u", "wins", "ys", "-", "test\\u", "create", "\\u", "source", "\\u", "at", "\\u", "default", "-%", "s", "\"_", "%_", "uuid_", "._", "uuid1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "event", "\\u", "logs_", "._", "Event", "Source_", "._", "create_", "(_", "guid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "registr", "y", "\\u", "root_", "+_", "event", "\\u", "logs_", "._", "DEF", "AUL", "T", "\\u", "LOG", "\\u", "NAME_", "+_", "guid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bool_", "(_", "self_", "._", "registr", "y", "\\u", "root_", "+_", "event", "\\u", "logs_", "._", "DEF", "AUL", "T", "\\u", "LOG", "\\u", "NAME_", "+_", "guid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "sources_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "name_", "=_", "\"", "System", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "s_", "._", "name_", "for_", "s_", "in_", "event", "\\u", "logs_", "._", "event", "\\u", "sources_", "(_", "log", "\\u", "name_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "r_", "._", "name_", "for_", "r_", "in_", "self_", "._", "registr", "y", "\\u", "root_", "+_", "log", "\\u", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "isinstance_", "(_", "s_", ",_", "event", "\\u", "logs_", "._", "Event", "Source_", ")_", "for_", "s_", "in_", "event", "\\u", "logs_", "._", "event", "\\u", "sources_", "(_", "log", "\\u", "name_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "source", "\\u", "from", "\\u", "event", "\\u", "source_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "s_", "in_", "event", "\\u", "logs_", "._", "event", "\\u", "sources_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "s_", ",_", "event", "\\u", "logs_", "._", "Event", "Source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "s_", ")_", "is_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "source", "\\u", "from", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "None_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "source", "\\u", "from", "\\u", "bad", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "event", "\\u", "logs_", "._", "x", "\\u", "event", "\\u", "logs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "source", "\\u", "from", "\\u", "good", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "r", "\"%", "s", "\\\\", "%", "s", "\"_", "%_", "(_", "LOG", "\\u", "NAME_", ",_", "GUID", "_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "logs_", "._", "Event", "Source_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "source", "\\u", "from", "\\u", "good", "\\u", "string", "\\u", "default", "\\u", "log_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "GUID", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "logs_", "._", "Event", "Source_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "source", "\\u", "as", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "GUID", "_", ")_", "._", "as", "\\u", "string_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "source", "\\u", "log", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "str_", "(_", "GUID", "_", ")_", "._", "encode_", "(_", "\"", "utf", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "logs_", "._", "event", "\\u", "source_", "(_", "GUID", "_", ")_", "._", "log", "\\u", "event_", "(_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "yield", "\\u", "logs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", "._", "Sou", "rce", "Name_", "==_", "GUID", "_", "and_", "event_", "._", "Data_", "==_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "logs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "s_", "._", "name_", "for_", "s_", "in_", "event", "\\u", "logs_", "._", "event", "\\u", "logs_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "r_", "._", "name_", "for_", "r_", "in_", "self_", "._", "registr", "y", "\\u", "root_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "isinstance_", "(_", "s_", ",_", "event", "\\u", "logs_", "._", "Event", "Log_", ")_", "for_", "s_", "in_", "event", "\\u", "logs_", "._", "event", "\\u", "logs_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "log", "\\u", "from", "\\u", "event", "\\u", "log_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "l_", "in_", "event", "\\u", "logs_", "._", "event", "\\u", "logs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "l_", ",_", "event", "\\u", "logs_", "._", "Event", "Log_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "event", "\\u", "logs_", "._", "event", "\\u", "log_", "(_", "l_", ")_", "is_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "log", "\\u", "from", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "event", "\\u", "logs_", "._", "event", "\\u", "log_", "(_", "None_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "log", "\\u", "from", "\\u", "bad", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "event", "\\u", "logs_", "._", "x", "\\u", "event", "\\u", "logs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "\\u", "logs_", "._", "event", "\\u", "log_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "log", "\\u", "from", "\\u", "good", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "logs_", "._", "event", "\\u", "log_", "(_", "LOG", "\\u", "NAME_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "event", "\\u", "logs_", "._", "Event", "Log_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "test\\u", "event", "\\u", "log", "\\u", "clear", "\\u", "no", "\\u", "save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "name_", "=_", "\"", "Intern", "et", " ", "Explorer", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "\\u", "name_", "=_", "\"\\u", "wins", "ys", "-%", "s", "\"_", "%_", "uuid_", "._", "uuid1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "event", "\\u", "logs_", "._", "Event", "Source_", "._", "create_", "(_", "source", "\\u", "name_", ",_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "event", "\\u", "logs_", "._", "event", "\\u", "log_", "(_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "Log_", "=_", "win32", "evt", "log_", "._", "Open", "Event", "Log_", "(_", "None_", ",_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "log", "\\u", "event_", "(_", "source_", ",_", "message_", "=_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "win32", "evt", "log_", "._", "Get", "Number", "Of", "Event", "Log", "Records_", "(_", "h", "Log_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "win32", "evt", "log_", "._", "Get", "Number", "Of", "Event", "Log", "Records_", "(_", "h", "Log_", ")_", ",_", "0_", ")_", "\\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 ", " _", "win32", "evt", "log_", "._", "Clos", "e", "Event", "Log_", "(_", "h", "Log_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "event", "\\u", "log", "\\u", "clear", "\\u", "with", "\\u", "save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "name_", "=_", "\"", "Intern", "et", " ", "Explorer", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source", "\\u", "name_", "=_", "\"\\u", "wins", "ys", "-%", "s", "\"_", "%_", "uuid_", "._", "uuid1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "event", "\\u", "logs_", "._", "Event", "Source_", "._", "create_", "(_", "source", "\\u", "name_", ",_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "=_", "event", "\\u", "logs_", "._", "event", "\\u", "log_", "(_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h", "Log_", "=_", "win32", "evt", "log_", "._", "Open", "Event", "Log_", "(_", "None_", ",_", "log", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "log", "\\u", "event_", "(_", "source_", ",_", "message_", "=_", "\"", "hell", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "win32", "evt", "log_", "._", "Get", "Number", "Of", "Event", "Log", "Records_", "(_", "h", "Log_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "win32", "evt", "log_", "._", "Get", "Number", "Of", "Event", "Log", "Records_", "(_", "h", "Log_", ")_", ",_", "0_", ")_", "\\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 ", " _", "win32", "evt", "log_", "._", "Clos", "e", "Event", "Log_", "(_", "h", "Log_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Event", "Logs_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "tures", "_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "log", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "str_", "(_", "GUID", "_", ")_", "._", "encode_", "(_", "\"", "utf", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "event", "\\u", "logs_", "._", "log", "\\u", "event_", "(_", "\"%", "s", "\\\\\\\\", "%", "s", "\"_", "%_", "(_", "LOG", "\\u", "NAME_", ",_", "GUID", "_", ")_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "event_", "in_", "yield", "\\u", "logs_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event_", "._", "Sou", "rce", "Name_", "==_", "GUID", "_", "and_", "event_", "._", "Data_", "==_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 2,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daemon/examples/netns/ospfmanetmdrtest.py
[ { "content": " def __eq__(self, other):\n try:\n return self.prefix == other.prefix and self.gw == other.gw and \\\n self.metric == other.metric\n except:\n return False", "metadata": "root.Route.__eq__", "header": "['class', 'Route', '(', 'object', ')', ':', '___EOS___']", "index": 138 } ]
[ { "span": "except:", "start_line": 142, "start_column": 8, "end_line": 142, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Route_", "(_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "prefix_", "==_", "other_", "._", "prefix_", "and_", "self_", "._", "gw_", "==_", "other_", "._", "gw_", "and_", "self_", "._", "metric_", "==_", "other_", "._", "metric_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Unreachable code
petrvanblokland/Xierpa3/xierpa3/components/_legacy/featured.py
[ { "content": " def _buildFeaturedText(self, b, data):\n u\"\"\"Build the featured item. If @self.style.itemRandom@ is **True**, then select a random item from the list.\n If there is no **data.item** available, then ignore this method.\"\"\"\n return # TODO: fix this\n if not data.items:\n return\n s = self.style\n if s.itemRandom:\n item = choice(data.items)\n else:\n item = data.items[0]\n if s.label:\n b.h2(fontsize=s.labelSize, color=s.labelColor, margintop=s.labelMarginTop,\n marginbottom=s.labelMarginBottom, lineheight=s.labelLineHeight,\n media=(\n Media(min=self.C.M_TABLET_MIN, max=self.C.M_TABLET_MAX, fontsize=s.tabletLabelSize, color='red'),\n Media(max=self.C.M_MOBILE_MAX, color='blue')\n ))\n b.text(s.label)\n b._h2()\n b.a(href='/%s-%s' % (self.C.PARAM_ARTICLE, item.id), class_=self.C.CLASS_NAME)\n b.h2(fontsize=s.nameSize, fontweight=s.nameWeight, lineheight=s.nameLineHeight, \n color=s.nameColor, marginbottom=s.nameMarginBottom, display=s.nameDisplay,\n margintop=s.nameMarginTop)\n b.text(item.name) \n b._h2()\n b._a()\n if s.showPoster:\n b.a(href='/%s-%s' % (self.C.PARAM_ARTICLE, item.id), class_=self.C.CLASS_NAME)\n b.img(width=s.posterWidth, src=item.poster, float=self.C.LEFT, padding=0,\n margin=Margin(Em(0.5), Em(0.5), 0, 0),\n media=Media(max=self.C.M_MOBILE_MAX, display=self.C.NONE)\n )\n b._a()\n if s.showLevel:\n b.h5(class_=self.C.CLASS_LEVEL, color=s.levelColor, fontsize=s.levelSize, fontweight=s.levelWeight,\n margintop=s.levelMarginTop, lineheight=s.levelLineHeight)\n b.text(item.level or s.genericLevel)\n b.text(' level')\n b._h5()\n if item.author: # Test on text\n b.a(href='/%s-%s' % (self.C.PARAM_AUTHOR, item.author), class_=self.C.CLASS_AUTHOR)\n b.h5(fontsize=s.authorSize, fontweight=s.authorWeight, color=s.authorColor, \n lineheight=s.authorLineHeight, display=s.authorDisplay)\n b.text('By %s' % item.author)\n b._h5()\n b._a()\n if s.showCategory and item.category: # Text on text\n b.a(href='/%s-%s' % (self.C.PARAM_CATEGORY, item.category), class_=self.C.CLASS_CATEGORY)\n b.h5(fontsize=s.categorySize, fontweight=s.categoryWeight, lineheight=s.categoryLineHeight, \n color=s.categoryColor, margintop=Em(1), display=self.C.BLOCK)\n b.text(item.category)\n b._h5()\n b._a()\n if item.summary is not None: # Test on element. Summary elements tag must be defined by generic style.\n b.div(class_='featuredSummary', clear=self.C.BOTH, float=self.C.LEFT, width=Perc(100), \n color=s.summaryColor, fontsize=s.summarySize, lineheight=s.summaryLineHeight, \n margintop=s.summaryMarginTop, marginbottom=s.summaryMarginBottom)\n if isinstance(item.summary, basestring):\n b.text(item.summary)\n else:\n self.buildElement(b, item.summary)\n b._div()", "metadata": "root.FeaturedByText._buildFeaturedText", "header": "['class', 'FeaturedByText', '(', 'FeaturedBase', ')', ':', '___EOS___']", "index": 296 } ]
[ { "span": "if not data.items:", "start_line": 300, "start_column": 8, "end_line": 300, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Feature", "d", "By", "Text_", "(_", "Feature", "d", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "build", "Feature", "d", "Text_", "(_", "self_", ",_", "b_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u", "\"\"\"", "Build", " ", "the", " ", "feature", "d", " ", "item", ".", " ", "If", " ", "@", "self", ".", "style", ".", "item", "Random", "@", " ", "is", " ", "**", "Tru", "e", "**", ",", " ", "then", " ", "select", " ", "a", " ", "random", " ", "item", " ", "from", " ", "the", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "there", " ", "is", " ", "no", " ", "**", "data", ".", "item", "**", " ", "avail", "able", ",", " ", "then", " ", "ignore", " ", "this", " ", "method", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "#", " ", "TOD", "O", ":", " ", "fix", " ", "this_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "data_", "._", "items_", ":_", "\\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_", "s_", "=_", "self_", "._", "style_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s_", "._", "item", "Random_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "choice_", "(_", "data_", "._", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "data_", "._", "items_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "s_", "._", "label_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "h2_", "(_", "fontsize_", "=_", "s_", "._", "label", "Size_", ",_", "color_", "=_", "s_", "._", "label", "Color_", ",_", "marg", "int", "op_", "=_", "s_", "._", "label", "Marg", "in", "Top_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marg", "inb", "ott", "om_", "=_", "s_", "._", "label", "Marg", "in", "Bottom_", ",_", "line", "height_", "=_", "s_", "._", "label", "Line", "Height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "media_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Media_", "(_", "min_", "=_", "self_", "._", "C_", "._", "M", "\\u", "TAB", "LET", "\\u", "MIN_", ",_", "max_", "=_", "self_", "._", "C_", "._", "M", "\\u", "TAB", "LET", "\\u", "MAX_", ",_", "fontsize_", "=_", "s_", "._", "tablet", "Label", "Size_", ",_", "color_", "=_", "'", "red", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Media_", "(_", "max_", "=_", "self_", "._", "C_", "._", "M", "\\u", "MOB", "ILE", "\\u", "MAX_", ",_", "color_", "=_", "'", "blue", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "text_", "(_", "s_", "._", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "h2_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "._", "a_", "(_", "href_", "=_", "'/", "%", "s", "-%", "s", "'_", "%_", "(_", "self_", "._", "C_", "._", "PARAM", "\\u", "ARTI", "CLE", "_", ",_", "item_", "._", "id_", ")_", ",_", "class\\u_", "=_", "self_", "._", "C_", "._", "CLASS", "\\u", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "h2_", "(_", "fontsize_", "=_", "s_", "._", "name", "Size_", ",_", "font", "weight_", "=_", "s_", "._", "name", "Weight_", ",_", "line", "height_", "=_", "s_", "._", "name", "Line", "Height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "s_", "._", "name", "Color_", ",_", "marg", "inb", "ott", "om_", "=_", "s_", "._", "name", "Marg", "in", "Bottom_", ",_", "display_", "=_", "s_", "._", "name", "Display_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marg", "int", "op_", "=_", "s_", "._", "name", "Marg", "in", "Top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "text_", "(_", "item_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "h2_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "a_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s_", "._", "show", "Poster", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "a_", "(_", "href_", "=_", "'/", "%", "s", "-%", "s", "'_", "%_", "(_", "self_", "._", "C_", "._", "PARAM", "\\u", "ARTI", "CLE", "_", ",_", "item_", "._", "id_", ")_", ",_", "class\\u_", "=_", "self_", "._", "C_", "._", "CLASS", "\\u", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "img_", "(_", "width_", "=_", "s_", "._", "poster", "Width_", ",_", "src_", "=_", "item_", "._", "poster_", ",_", "float_", "=_", "self_", "._", "C_", "._", "LEFT_", ",_", "padding_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "margin_", "=_", "Margin_", "(_", "Em", "_", "(_", "0.5_", ")_", ",_", "Em", "_", "(_", "0.5_", ")_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "media_", "=_", "Media_", "(_", "max_", "=_", "self_", "._", "C_", "._", "M", "\\u", "MOB", "ILE", "\\u", "MAX_", ",_", "display_", "=_", "self_", "._", "C_", "._", "NONE_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "a_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "s_", "._", "show", "Level_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "h5_", "(_", "class\\u_", "=_", "self_", "._", "C_", "._", "CLASS", "\\u", "LEVEL_", ",_", "color_", "=_", "s_", "._", "level", "Color_", ",_", "fontsize_", "=_", "s_", "._", "level", "Size_", ",_", "font", "weight_", "=_", "s_", "._", "level", "Weight_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marg", "int", "op_", "=_", "s_", "._", "level", "Marg", "in", "Top_", ",_", "line", "height_", "=_", "s_", "._", "level", "Line", "Height_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "text_", "(_", "item_", "._", "level_", "or_", "s_", "._", "gener", "ic", "Level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "text_", "(_", "'", " ", "level", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "h5_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "author_", ":_", "#", " ", "Test", " ", "on", " ", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "a_", "(_", "href_", "=_", "'/", "%", "s", "-%", "s", "'_", "%_", "(_", "self_", "._", "C_", "._", "PARAM", "\\u", "AUTHOR", "_", ",_", "item_", "._", "author_", ")_", ",_", "class\\u_", "=_", "self_", "._", "C_", "._", "CLASS", "\\u", "AUTHOR", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "h5_", "(_", "fontsize_", "=_", "s_", "._", "author", "Size_", ",_", "font", "weight_", "=_", "s_", "._", "author", "Weight_", ",_", "color_", "=_", "s_", "._", "author", "Color_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "line", "height_", "=_", "s_", "._", "author", "Line", "Height_", ",_", "display_", "=_", "s_", "._", "author", "Display_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "text_", "(_", "'", "By", " ", "%", "s", "'_", "%_", "item_", "._", "author_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "h5_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "a_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "s_", "._", "show", "Category_", "and_", "item_", "._", "category_", ":_", "#", " ", "Text", " ", "on", " ", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "a_", "(_", "href_", "=_", "'/", "%", "s", "-%", "s", "'_", "%_", "(_", "self_", "._", "C_", "._", "PARAM", "\\u", "CATEGORY", "_", ",_", "item_", "._", "category_", ")_", ",_", "class\\u_", "=_", "self_", "._", "C_", "._", "CLASS", "\\u", "CATEGORY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "h5_", "(_", "fontsize_", "=_", "s_", "._", "category", "Size_", ",_", "font", "weight_", "=_", "s_", "._", "category", "Weight_", ",_", "line", "height_", "=_", "s_", "._", "category", "Line", "Height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "s_", "._", "category", "Color_", ",_", "marg", "int", "op_", "=_", "Em", "_", "(_", "1_", ")_", ",_", "display_", "=_", "self_", "._", "C_", "._", "BLOCK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "text_", "(_", "item_", "._", "category_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "h5_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "._", "\\u", "a_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "item_", "._", "summary_", "is_", "not_", "None_", ":_", "#", " ", "Test", " ", "on", " ", "element", ".", " ", "Summ", "ary", " ", "element", "s", " ", "tag", " ", "must", " ", "be", " ", "defin", "ed", " ", "by", " ", "gener", "ic", " ", "style", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "div_", "(_", "class\\u_", "=_", "'", "feature", "d", "Summ", "ary", "'_", ",_", "clear_", "=_", "self_", "._", "C_", "._", "BOTH_", ",_", "float_", "=_", "self_", "._", "C_", "._", "LEFT_", ",_", "width_", "=_", "Per", "c_", "(_", "100_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "s_", "._", "summar", "y", "Color_", ",_", "fontsize_", "=_", "s_", "._", "summar", "y", "Size_", ",_", "line", "height_", "=_", "s_", "._", "summar", "y", "Line", "Height_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marg", "int", "op_", "=_", "s_", "._", "summar", "y", "Marg", "in", "Top_", ",_", "marg", "inb", "ott", "om_", "=_", "s_", "._", "summar", "y", "Marg", "in", "Bottom_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "item_", "._", "summary_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "._", "text_", "(_", "item_", "._", "summary_", ")_", "\\u\\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_", "._", "build", "Element_", "(_", "b_", ",_", "item_", "._", "summary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "._", "\\u", "div_", "(_", ")_", "\\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, 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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 ]
Unused import
google/anvil-build/anvil/rules/preprocessor_rules.py
[ { "content": "# Copyright 2012 Google Inc. All Rights Reserved.\n\n\"\"\"Simple preprocessor rules for the build system.\n\"\"\"\n\n__author__ = 'benvanik@google.com (Ben Vanik)'\n\n\nimport io\nimport os\nimport re\nimport shutil\nimport string\n\nfrom anvil.context import RuleContext\nfrom anvil.rule import Rule, build_rule\nfrom anvil.task import Task, ExecutableTask\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@build_rule('template_files')\nclass TemplateFilesRule(Rule):\n \"\"\"Applies simple templating to a set of files.\n Processes each source file replacing a list of strings with corresponding\n strings.\n\n This uses the Python string templating functionality documented here:\n http://docs.python.org/library/string.html#template-strings\n\n Identifiers in the source template should be of the form \"${identifier}\", each\n of which maps to a key in the params dictionary.\n\n In order to prevent conflicts, it is strongly encouraged that a new_extension\n value is provided. If a source file has an extension it will be replaced with\n the specified one, and files without extensions will have it added.\n\n TODO(benvanik): more advanced template vars? perhaps regex?\n\n Inputs:\n srcs: Source file paths.\n new_extension: The extension to replace (or add) to all output files, with a\n leading dot ('.txt').\n params: A dictionary of key-value replacement parameters.\n\n Outputs:\n One file for each source file with the templating rules applied.\n \"\"\"\n\n\n class _Context(RuleContext):\n def begin(self):\n super(TemplateFilesRule._Context, self).begin()\n\n # Get all source -> output paths (and ensure directories exist)\n file_pairs = []\n for src_path in self.src_paths:\n out_path = self._get_out_path_for_src(src_path)\n if self.rule.new_extension:\n out_path = os.path.splitext(out_path)[0] + self.rule.new_extension\n self._ensure_output_exists(os.path.dirname(out_path))\n self._append_output_paths([out_path])\n file_pairs.append((src_path, out_path))\n\n # Skip if cache hit\n if self._check_if_cached():\n self._succeed()\n return\n\n # Async issue templating task\n d = self._run_task_async(_TemplateFilesTask(\n self.build_env, file_pairs, self.rule.params))\n self._chain(d)", "metadata": "root.TemplateFilesRule", "header": "['module', '___EOS___']", "index": 19 }, { "content": " def __init__(self, name, new_extension=None, params=None, *args, **kwargs):\n \"\"\"Initializes a file templating rule.\n\n Args:\n name: Rule name.\n new_extension: Replacement extension ('.txt').\n params: A dictionary of key-value replacement parameters.\n \"\"\"\n super(TemplateFilesRule, self).__init__(name, *args, **kwargs)\n self.new_extension = new_extension\n self.params = params", "metadata": "root.TemplateFilesRule.__init__", "header": "['class', 'TemplateFilesRule', '(', 'Rule', ')', ':', '___EOS___']", "index": 47 }, { "content": "class _TemplateFilesTask(Task):\n", "metadata": "root._TemplateFilesTask", "header": "['module', '___EOS___']", "index": 84 }, { "content": " def __init__(self, build_env, file_pairs, params, *args, **kwargs):\n super(_TemplateFilesTask, self).__init__(build_env, *args, **kwargs)\n self.file_pairs = file_pairs\n self.params = params", "metadata": "root._TemplateFilesTask.__init__", "header": "['class', '_TemplateFilesTask', '(', 'Task', ')', ':', '___EOS___']", "index": 85 }, { "content": " def execute(self):\n for file_pair in self.file_pairs:\n with io.open(file_pair[0], 'rt') as f:\n template_str = f.read()\n template = string.Template(template_str)\n result_str = template.substitute(self.params)\n with io.open(file_pair[1], 'wt') as f:\n f.write(result_str)\n return True", "metadata": "root._TemplateFilesTask.execute", "header": "['class', '_TemplateFilesTask', '(', 'Task', ')', ':', '___EOS___']", "index": 90 }, { "content": "@build_rule('strip_comments')\nclass StripCommentsRule(Rule):\n \"\"\"Applies simple comment stripping to a set of files.\n Processes each source file removing C/C++-style comments.\n\n Note that this is incredibly hacky and may break in all sorts of cases.\n\n In order to prevent conflicts, it is strongly encouraged that a new_extension\n value is provided. If a source file has an extension it will be replaced with\n the specified one, and files without extensions will have it added.\n\n Inputs:\n srcs: Source file paths.\n new_extension: The extension to replace (or add) to all output files, with a\n leading dot ('.txt').\n\n Outputs:\n One file for each source file with the comments removed.\n \"\"\"\n\n\n class _Context(RuleContext):\n def begin(self):\n super(StripCommentsRule._Context, self).begin()\n\n # Get all source -> output paths (and ensure directories exist)\n file_pairs = []\n for src_path in self.src_paths:\n out_path = self._get_out_path_for_src(src_path)\n if self.rule.new_extension:\n out_path = os.path.splitext(out_path)[0] + self.rule.new_extension\n self._ensure_output_exists(os.path.dirname(out_path))\n self._append_output_paths([out_path])\n file_pairs.append((src_path, out_path))\n\n # Skip if cache hit\n if self._check_if_cached():\n self._succeed()\n return\n\n # Async issue stripping task\n d = self._run_task_async(_StripCommentsRuleTask(\n self.build_env, file_pairs))\n self._chain(d)", "metadata": "root.StripCommentsRule", "header": "['module', '___EOS___']", "index": 101 }, { "content": " def __init__(self, name, new_extension=None, *args, **kwargs):\n \"\"\"Initializes a comment stripping rule.\n\n Args:\n name: Rule name.\n new_extension: Replacement extension ('.txt').\n \"\"\"\n super(StripCommentsRule, self).__init__(name, *args, **kwargs)\n self.new_extension = new_extension", "metadata": "root.StripCommentsRule.__init__", "header": "['class', 'StripCommentsRule', '(', 'Rule', ')', ':', '___EOS___']", "index": 121 }, { "content": "class _StripCommentsRuleTask(Task):\n", "metadata": "root._StripCommentsRuleTask", "header": "['module', '___EOS___']", "index": 156 }, { "content": " def __init__(self, build_env, file_pairs, *args, **kwargs):\n super(_StripCommentsRuleTask, self).__init__(build_env, *args, **kwargs)\n self.file_pairs = file_pairs", "metadata": "root._StripCommentsRuleTask.__init__", "header": "['class', '_StripCommentsRuleTask', '(', 'Task', ')', ':', '___EOS___']", "index": 157 }, { "content": " def execute(self):\n for file_pair in self.file_pairs:\n with io.open(file_pair[0], 'rt') as f:\n raw_str = f.read()\n\n # Code from Markus Jarderot, posted to stackoverflow\n def replacer(match):\n s = match.group(0)\n if s.startswith('/'):\n return \"\"\n else:\n return s\n pattern = re.compile(\n r'//.*?$|/\\*.*?\\*/|\\'(?:\\\\.|[^\\\\\\'])*\\'|\"(?:\\\\.|[^\\\\\"])*\"',\n re.DOTALL | re.MULTILINE)\n result_str = re.sub(pattern, replacer, raw_str)\n\n with io.open(file_pair[1], 'wt') as f:\n f.write(result_str)\n\n return True", "metadata": "root._StripCommentsRuleTask.execute", "header": "['class', '_StripCommentsRuleTask', '(', 'Task', ')', ':', '___EOS___']", "index": 161 }, { "content": "@build_rule('preprocess')\nclass PreprocessRule(Rule):\n \"\"\"Applies simple C-style preprocessing to a set of files.\n Processes each source file handling the built-in preprocessor rules.\n\n Note that this is incredibly hacky and may break in all sorts of cases.\n\n In order to prevent conflicts, it is strongly encouraged that a new_extension\n value is provided. If a source file has an extension it will be replaced with\n the specified one, and files without extensions will have it added.\n\n Inputs:\n srcs: Source file paths.\n new_extension: The extension to replace (or add) to all output files, with a\n leading dot ('.txt').\n defines: A list of values to be defined by default.\n Example - 'DEBUG'.\n\n Outputs:\n One file for each source file after preprocessing.\n \"\"\"\n\n\n class _Context(RuleContext):\n def begin(self):\n super(PreprocessRule._Context, self).begin()\n\n # Get all source -> output paths (and ensure directories exist)\n file_pairs = []\n for src_path in self.src_paths:\n out_path = self._get_out_path_for_src(src_path)\n if self.rule.new_extension:\n out_path = os.path.splitext(out_path)[0] + self.rule.new_extension\n self._ensure_output_exists(os.path.dirname(out_path))\n self._append_output_paths([out_path])\n file_pairs.append((src_path, out_path))\n\n # Skip if cache hit\n if self._check_if_cached():\n self._succeed()\n return\n\n # Async issue stripping task\n d = self._run_task_async(_PreprocessFilesTask(\n self.build_env, file_pairs, self.rule.defines))\n self._chain(d)", "metadata": "root.PreprocessRule", "header": "['module', '___EOS___']", "index": 184 }, { "content": " def __init__(self, name, new_extension=None, defines=None, *args, **kwargs):\n \"\"\"Initializes a preprocessing rule.\n\n Args:\n name: Rule name.\n new_extension: Replacement extension ('.txt').\n defines: A list of defines.\n \"\"\"\n super(PreprocessRule, self).__init__(name, *args, **kwargs)\n self.new_extension = new_extension\n self.defines = defines[:] if defines else []", "metadata": "root.PreprocessRule.__init__", "header": "['class', 'PreprocessRule', '(', 'Rule', ')', ':', '___EOS___']", "index": 206 }, { "content": "class _PreprocessFilesTask(Task):\n\n", "metadata": "root._PreprocessFilesTask", "header": "['module', '___EOS___']", "index": 243 }, { "content": " def __init__(self, build_env, file_pairs, defines, *args, **kwargs):\n super(_PreprocessFilesTask, self).__init__(build_env, *args, **kwargs)\n self.file_pairs = file_pairs\n self.defines = defines", "metadata": "root._PreprocessFilesTask.__init__", "header": "['class', '_PreprocessFilesTask', '(', 'Task', ')', ':', '___EOS___']", "index": 244 }, { "content": " def execute(self):\n for file_pair in self.file_pairs:\n with io.open(file_pair[0], 'rt') as f:\n source_lines = f.readlines()\n\n result_str = self._preprocess(source_lines, self.defines)\n\n with io.open(file_pair[1], 'wt') as f:\n f.write(result_str)\n\n return True", "metadata": "root._PreprocessFilesTask.execute", "header": "['class', '_PreprocessFilesTask', '(', 'Task', ')', ':', '___EOS___']", "index": 249 }, { "content": " def _preprocess(self, source_lines, global_defines):\n # All defines in global + #defined in file\n file_defines = set(global_defines)\n\n # A stack of #ifdef scopes - for a given line to be included all must be\n # set to true\n inclusion_scopes = [True]\n\n target_lines = []\n for line in source_lines:\n line_included = all(inclusion_scopes)\n\n if line[0] == '#':\n line_included = False\n if line.startswith('#ifdef '):\n value = line[7:].strip()\n inclusion_scopes.append(value in file_defines)\n elif line.startswith('#else'):\n inclusion_scopes[-1] = not inclusion_scopes[-1]\n elif line.startswith('#endif'):\n inclusion_scopes.pop()\n elif line.startswith('#define '):\n value = line[8:].strip()\n file_defines.add(value)\n elif line.startswith('#undef '):\n value = line[7:].strip()\n file_defines.remove(value)\n\n if line_included:\n target_lines.append(line)\n\n return '\\n'.join(target_lines)", "metadata": "root._PreprocessFilesTask._preprocess", "header": "['class', '_PreprocessFilesTask', '(', 'Task', ')', ':', '___EOS___']", "index": 261 } ]
[ { "span": "import shutil", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 13 }, { "span": "from anvil.task import Task, ExecutableTask", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2012", " ", "Goo", "gle", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Simple", " ", "preprocessor", " ", "rule", "s", " ", "for", " ", "the", " ", "build", " ", "system", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "ben", "vani", "k", "@", "google", ".", "com", " ", "(", "Ben", " ", "Van", "ik", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "io_", "\\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_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "anv", "il_", "._", "context_", "import_", "Rule", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "anv", "il_", "._", "rule_", "import_", "Rule_", ",_", "build", "\\u", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "anv", "il_", "._", "task_", "import_", "Task_", ",_", "Executable", "Task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "@_", "build", "\\u", "rule_", "(_", "'", "template", "\\u", "files", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Templa", "te", "Files", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Appl", "ies", " ", "simple", " ", "templa", "ting", " ", "to", " ", "a", " ", "set", " ", "of", " ", "files", ".", "\\", "10", ";", " ", " ", "Processe", "s", " ", "each", " ", "source", " ", "file", " ", "repla", "cing", " ", "a", " ", "list", " ", "of", " ", "string", "s", " ", "with", " ", "correspond", "ing", "\\", "10", ";", " ", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Thi", "s", " ", "use", "s", " ", "the", " ", "Pyth", "on", " ", "string", " ", "templa", "ting", " ", "functional", "it", "y", " ", "documente", "d", " ", "here", ":", "\\", "10", ";", " ", " ", "http", "://", "docs", ".", "python", ".", "org", "/", "librar", "y", "/", "string", ".", "html", "#", "template", "-", "string", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", "Identifie", "rs", " ", "in", " ", "the", " ", "source", " ", "template", " ", "shou", "ld", " ", "be", " ", "of", " ", "the", " ", "form", " ", "\"$", "{", "identifi", "er", "}\"", ",", " ", "each", "\\", "10", ";", " ", " ", "of", " ", "whi", "ch", " ", "maps", " ", "to", " ", "a", " ", "key", " ", "in", " ", "the", " ", "params", " ", "dictionar", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "In", " ", "order", " ", "to", " ", "prevent", " ", "confl", "icts", ",", " ", "it", " ", "is", " ", "strong", "ly", " ", "enco", "ura", "ged", " ", "tha", "t", " ", "a", " ", "new", "\\u", "extensi", "on", "\\", "10", ";", " ", " ", "value", " ", "is", " ", "provided", ".", " ", "If", " ", "a", " ", "source", " ", "file", " ", "has", " ", "an", " ", "extensi", "on", " ", "it", " ", "will", " ", "be", " ", "replaced", " ", "with", "\\", "10", ";", " ", " ", "the", " ", "specified", " ", "one", ",", " ", "and", " ", "files", " ", "with", "out", " ", "extensi", "ons", " ", "will", " ", "have", " ", "it", " ", "adde", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "TOD", "O", "(", "ben", "vani", "k", "):", " ", "more", " ", "advanced", " ", "template", " ", "vars", "?", " ", "per", "hap", "s", " ", "regex", "?", "\\", "10", ";", "\\", "10", ";", " ", " ", "Inp", "uts", ":", "\\", "10", ";", " ", " ", " ", " ", "srcs", ":", " ", "Sou", "rce", " ", "file", " ", "path", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "new", "\\u", "extensi", "on", ":", " ", "The", " ", "extensi", "on", " ", "to", " ", "replace", " ", "(", "or", " ", "add", ")", " ", "to", " ", "all", " ", "output", " ", "files", ",", " ", "with", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "lead", "ing", " ", "dot", " ", "('.", "txt", "')", ".", "\\", "10", ";", " ", " ", " ", " ", "params", ":", " ", "A", " ", "dictionar", "y", " ", "of", " ", "key", "-", "value", " ", "replace", "ment", " ", "parameter", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Output", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "One", " ", "file", " ", "for", " ", "each", " ", "source", " ", "file", " ", "with", " ", "the", " ", "templa", "ting", " ", "rule", "s", " ", "applied", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Context_", "(_", "Rule", "Context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "begin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Templa", "te", "Files", "Rule_", "._", "\\u", "Context_", ",_", "self_", ")_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "source", " ", "->", " ", "output", " ", "path", "s", " ", "(", "and", " ", "ensure", " ", "director", "ies", " ", "exist", ")_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "pairs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "src", "\\u", "path_", "in_", "self_", "._", "src", "\\u", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "path_", "=_", "self_", "._", "\\u", "get", "\\u", "out", "\\u", "path", "\\u", "for", "\\u", "src_", "(_", "src", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rule_", "._", "new", "\\u", "extension_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "path_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "out", "\\u", "path_", ")_", "[_", "0_", "]_", "+_", "self_", "._", "rule_", "._", "new", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "ensure", "\\u", "output", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "out", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "append", "\\u", "output", "\\u", "paths_", "(_", "[_", "out", "\\u", "path_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "pairs_", "._", "append_", "(_", "(_", "src", "\\u", "path_", ",_", "out", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ski", "p", " ", "if", " ", "cache", " ", "hit_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "check", "\\u", "if", "\\u", "cached_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "succeed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Async", " ", "issue", " ", "templa", "ting", " ", "task_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "run", "\\u", "task", "\\u", "async_", "(_", "\\u", "Templa", "te", "Files", "Task_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "build", "\\u", "env_", ",_", "file", "\\u", "pairs_", ",_", "self_", "._", "rule_", "._", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "chain_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "Files", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "new", "\\u", "extension_", "=_", "None_", ",_", "params_", "=_", "None_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "es", " ", "a", " ", "file", " ", "templa", "ting", " ", "rule", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "name", ":", " ", "Rule", " ", "name", ".", "\\", "10", ";", " ", " ", "new", "\\u", "extensi", "on", ":", " ", "Replace", "ment", " ", "extensi", "on", " ", "('.", "txt", "')", ".", "\\", "10", ";", " ", " ", "params", ":", " ", "A", " ", "dictionar", "y", " ", "of", " ", "key", "-", "value", " ", "replace", "ment", " ", "parameter", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Templa", "te", "Files", "Rule_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "new", "\\u", "extension_", "=_", "new", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Templa", "te", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Templa", "te", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\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_", ",_", "build", "\\u", "env_", ",_", "file", "\\u", "pairs_", ",_", "params_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "\\u", "Templa", "te", "Files", "Task_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "build", "\\u", "env_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file", "\\u", "pairs_", "=_", "file", "\\u", "pairs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "params_", "=_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Templa", "te", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "file", "\\u", "pair_", "in_", "self_", "._", "file", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "io_", "._", "open_", "(_", "file", "\\u", "pair_", "[_", "0_", "]_", ",_", "'", "rt", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "str_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "template_", "=_", "string_", "._", "Template_", "(_", "template", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "str_", "=_", "template_", "._", "substitute_", "(_", "self_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "io_", "._", "open_", "(_", "file", "\\u", "pair_", "[_", "1_", "]_", ",_", "'", "wt", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "result", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "build", "\\u", "rule_", "(_", "'", "strip", "\\u", "comment", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Strip", "Comme", "nts", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Appl", "ies", " ", "simple", " ", "comment", " ", "strip", "ping", " ", "to", " ", "a", " ", "set", " ", "of", " ", "files", ".", "\\", "10", ";", " ", " ", "Processe", "s", " ", "each", " ", "source", " ", "file", " ", "remo", "ving", " ", "C", "/", "C", "++", "-", "style", " ", "comment", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Not", "e", " ", "tha", "t", " ", "this", " ", "is", " ", "incr", "edi", "bly", " ", "hack", "y", " ", "and", " ", "may", " ", "break", " ", "in", " ", "all", " ", "sorts", " ", "of", " ", "case", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "In", " ", "order", " ", "to", " ", "prevent", " ", "confl", "icts", ",", " ", "it", " ", "is", " ", "strong", "ly", " ", "enco", "ura", "ged", " ", "tha", "t", " ", "a", " ", "new", "\\u", "extensi", "on", "\\", "10", ";", " ", " ", "value", " ", "is", " ", "provided", ".", " ", "If", " ", "a", " ", "source", " ", "file", " ", "has", " ", "an", " ", "extensi", "on", " ", "it", " ", "will", " ", "be", " ", "replaced", " ", "with", "\\", "10", ";", " ", " ", "the", " ", "specified", " ", "one", ",", " ", "and", " ", "files", " ", "with", "out", " ", "extensi", "ons", " ", "will", " ", "have", " ", "it", " ", "adde", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Inp", "uts", ":", "\\", "10", ";", " ", " ", " ", " ", "srcs", ":", " ", "Sou", "rce", " ", "file", " ", "path", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "new", "\\u", "extensi", "on", ":", " ", "The", " ", "extensi", "on", " ", "to", " ", "replace", " ", "(", "or", " ", "add", ")", " ", "to", " ", "all", " ", "output", " ", "files", ",", " ", "with", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "lead", "ing", " ", "dot", " ", "('.", "txt", "')", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Output", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "One", " ", "file", " ", "for", " ", "each", " ", "source", " ", "file", " ", "with", " ", "the", " ", "comment", "s", " ", "remove", "d", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Context_", "(_", "Rule", "Context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "begin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Strip", "Comme", "nts", "Rule_", "._", "\\u", "Context_", ",_", "self_", ")_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "source", " ", "->", " ", "output", " ", "path", "s", " ", "(", "and", " ", "ensure", " ", "director", "ies", " ", "exist", ")_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "pairs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "src", "\\u", "path_", "in_", "self_", "._", "src", "\\u", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "path_", "=_", "self_", "._", "\\u", "get", "\\u", "out", "\\u", "path", "\\u", "for", "\\u", "src_", "(_", "src", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rule_", "._", "new", "\\u", "extension_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "path_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "out", "\\u", "path_", ")_", "[_", "0_", "]_", "+_", "self_", "._", "rule_", "._", "new", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "ensure", "\\u", "output", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "out", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "append", "\\u", "output", "\\u", "paths_", "(_", "[_", "out", "\\u", "path_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "pairs_", "._", "append_", "(_", "(_", "src", "\\u", "path_", ",_", "out", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ski", "p", " ", "if", " ", "cache", " ", "hit_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "check", "\\u", "if", "\\u", "cached_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "succeed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Async", " ", "issue", " ", "strip", "ping", " ", "task_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "run", "\\u", "task", "\\u", "async_", "(_", "\\u", "Strip", "Comme", "nts", "Rule", "Task_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "build", "\\u", "env_", ",_", "file", "\\u", "pairs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "chain_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Strip", "Comme", "nts", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "new", "\\u", "extension_", "=_", "None_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "es", " ", "a", " ", "comment", " ", "strip", "ping", " ", "rule", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "name", ":", " ", "Rule", " ", "name", ".", "\\", "10", ";", " ", " ", "new", "\\u", "extensi", "on", ":", " ", "Replace", "ment", " ", "extensi", "on", " ", "('.", "txt", "')", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Strip", "Comme", "nts", "Rule_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "new", "\\u", "extension_", "=_", "new", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "\\u", "Strip", "Comme", "nts", "Rule", "Task_", "(_", "Task_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Strip", "Comme", "nts", "Rule", "Task_", "(_", "Task_", ")_", ":_", "\\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_", ",_", "build", "\\u", "env_", ",_", "file", "\\u", "pairs_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "\\u", "Strip", "Comme", "nts", "Rule", "Task_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "build", "\\u", "env_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file", "\\u", "pairs_", "=_", "file", "\\u", "pairs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Strip", "Comme", "nts", "Rule", "Task_", "(_", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "file", "\\u", "pair_", "in_", "self_", "._", "file", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "io_", "._", "open_", "(_", "file", "\\u", "pair_", "[_", "0_", "]_", ",_", "'", "rt", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "str_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Code", " ", "from", " ", "Mark", "us", " ", "Jar", "der", "ot", ",", " ", "poste", "d", " ", "to", " ", "stack", "overflow", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "replace", "r_", "(_", "match_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "match_", "._", "group_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s_", "._", "startswith_", "(_", "'/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pattern_", "=_", "re_", "._", "compile_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'//", ".*?", "$", "|/", "\\\\*", ".*?\\\\", "*/", "|\\\\", "'(?:", "\\\\\\\\.", "|[", "^", "\\\\\\\\\\\\", "'])", "*\\\\", "'|", "\"(?", ":\\\\", "\\\\.", "|[", "^", "\\\\\\\\\"", "])", "*\"", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "DOTALL_", "|_", "re_", "._", "MULTILINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "str_", "=_", "re_", "._", "sub_", "(_", "pattern_", ",_", "replace", "r_", ",_", "raw", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "io_", "._", "open_", "(_", "file", "\\u", "pair_", "[_", "1_", "]_", ",_", "'", "wt", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "result", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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_", "@_", "build", "\\u", "rule_", "(_", "'", "preproc", "ess", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Preprocess", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Appl", "ies", " ", "simple", " ", "C", "-", "style", " ", "preproc", "essi", "ng", " ", "to", " ", "a", " ", "set", " ", "of", " ", "files", ".", "\\", "10", ";", " ", " ", "Processe", "s", " ", "each", " ", "source", " ", "file", " ", "handling", " ", "the", " ", "bui", "lt", "-", "in", " ", "preprocessor", " ", "rule", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Not", "e", " ", "tha", "t", " ", "this", " ", "is", " ", "incr", "edi", "bly", " ", "hack", "y", " ", "and", " ", "may", " ", "break", " ", "in", " ", "all", " ", "sorts", " ", "of", " ", "case", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "In", " ", "order", " ", "to", " ", "prevent", " ", "confl", "icts", ",", " ", "it", " ", "is", " ", "strong", "ly", " ", "enco", "ura", "ged", " ", "tha", "t", " ", "a", " ", "new", "\\u", "extensi", "on", "\\", "10", ";", " ", " ", "value", " ", "is", " ", "provided", ".", " ", "If", " ", "a", " ", "source", " ", "file", " ", "has", " ", "an", " ", "extensi", "on", " ", "it", " ", "will", " ", "be", " ", "replaced", " ", "with", "\\", "10", ";", " ", " ", "the", " ", "specified", " ", "one", ",", " ", "and", " ", "files", " ", "with", "out", " ", "extensi", "ons", " ", "will", " ", "have", " ", "it", " ", "adde", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Inp", "uts", ":", "\\", "10", ";", " ", " ", " ", " ", "srcs", ":", " ", "Sou", "rce", " ", "file", " ", "path", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "new", "\\u", "extensi", "on", ":", " ", "The", " ", "extensi", "on", " ", "to", " ", "replace", " ", "(", "or", " ", "add", ")", " ", "to", " ", "all", " ", "output", " ", "files", ",", " ", "with", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "lead", "ing", " ", "dot", " ", "('.", "txt", "')", ".", "\\", "10", ";", " ", " ", " ", " ", "defin", "es", ":", " ", "A", " ", "list", " ", "of", " ", "values", " ", "to", " ", "be", " ", "defin", "ed", " ", "by", " ", "default", ".", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ple", " ", "-", " ", "'", "DEBU", "G", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", "Output", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "One", " ", "file", " ", "for", " ", "each", " ", "source", " ", "file", " ", "after", " ", "preproc", "essi", "ng", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "\\u", "Context_", "(_", "Rule", "Context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "begin_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Preprocess", "Rule_", "._", "\\u", "Context_", ",_", "self_", ")_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "all", " ", "source", " ", "->", " ", "output", " ", "path", "s", " ", "(", "and", " ", "ensure", " ", "director", "ies", " ", "exist", ")_", "\\u\\u\\uNL\\u\\u\\u_", "file", "\\u", "pairs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "src", "\\u", "path_", "in_", "self_", "._", "src", "\\u", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "path_", "=_", "self_", "._", "\\u", "get", "\\u", "out", "\\u", "path", "\\u", "for", "\\u", "src_", "(_", "src", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rule_", "._", "new", "\\u", "extension_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "path_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "out", "\\u", "path_", ")_", "[_", "0_", "]_", "+_", "self_", "._", "rule_", "._", "new", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "ensure", "\\u", "output", "\\u", "exists_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "out", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "append", "\\u", "output", "\\u", "paths_", "(_", "[_", "out", "\\u", "path_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "pairs_", "._", "append_", "(_", "(_", "src", "\\u", "path_", ",_", "out", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ski", "p", " ", "if", " ", "cache", " ", "hit_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "check", "\\u", "if", "\\u", "cached_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "succeed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Async", " ", "issue", " ", "strip", "ping", " ", "task_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "self_", "._", "\\u", "run", "\\u", "task", "\\u", "async_", "(_", "\\u", "Preprocess", "Files", "Task_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "build", "\\u", "env_", ",_", "file", "\\u", "pairs_", ",_", "self_", "._", "rule_", "._", "defines_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "chain_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Preprocess", "Rule_", "(_", "Rule_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "new", "\\u", "extension_", "=_", "None_", ",_", "defines_", "=_", "None_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "es", " ", "a", " ", "preproc", "essi", "ng", " ", "rule", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "name", ":", " ", "Rule", " ", "name", ".", "\\", "10", ";", " ", " ", "new", "\\u", "extensi", "on", ":", " ", "Replace", "ment", " ", "extensi", "on", " ", "('.", "txt", "')", ".", "\\", "10", ";", " ", " ", "defin", "es", ":", " ", "A", " ", "list", " ", "of", " ", "defin", "es", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Preprocess", "Rule_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "new", "\\u", "extension_", "=_", "new", "\\u", "extension_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "defines_", "=_", "defines_", "[_", ":_", "]_", "if_", "defines_", "else_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "\\u", "Preprocess", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\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_", "\\u", "Preprocess", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\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_", ",_", "build", "\\u", "env_", ",_", "file", "\\u", "pairs_", ",_", "defines_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "\\u", "Preprocess", "Files", "Task_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "build", "\\u", "env_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "file", "\\u", "pairs_", "=_", "file", "\\u", "pairs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "defines_", "=_", "defines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Preprocess", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "file", "\\u", "pair_", "in_", "self_", "._", "file", "\\u", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "io_", "._", "open_", "(_", "file", "\\u", "pair_", "[_", "0_", "]_", ",_", "'", "rt", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "\\u", "lines_", "=_", "f_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result", "\\u", "str_", "=_", "self_", "._", "\\u", "preprocess_", "(_", "source", "\\u", "lines_", ",_", "self_", "._", "defines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "io_", "._", "open_", "(_", "file", "\\u", "pair_", "[_", "1_", "]_", ",_", "'", "wt", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "result", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Preprocess", "Files", "Task_", "(_", "Task_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "preprocess_", "(_", "self_", ",_", "source", "\\u", "lines_", ",_", "global", "\\u", "defines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", " ", "defin", "es", " ", "in", " ", "global", " ", "+", " ", "#", "defin", "ed", " ", "in", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "defines_", "=_", "set_", "(_", "global", "\\u", "defines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "stack", " ", "of", " ", "#", "ifdef", " ", "scope", "s", " ", "-", " ", "for", " ", "a", " ", "give", "n", " ", "line", " ", "to", " ", "be", " ", "include", "d", " ", "all", " ", "must", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "to", " ", "true_", "\\u\\u\\uNL\\u\\u\\u_", "inclusion", "\\u", "scopes_", "=_", "[_", "True_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "source", "\\u", "lines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "\\u", "included_", "=_", "all_", "(_", "inclusion", "\\u", "scopes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "line_", "[_", "0_", "]_", "==_", "'#'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "\\u", "included_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "._", "startswith_", "(_", "'#", "ifdef", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "line_", "[_", "7_", ":_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inclusion", "\\u", "scopes_", "._", "append_", "(_", "value_", "in_", "file", "\\u", "defines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'#", "else", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inclusion", "\\u", "scopes_", "[_", "-_", "1_", "]_", "=_", "not_", "inclusion", "\\u", "scopes_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'#", "endi", "f", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inclusion", "\\u", "scopes_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'#", "defin", "e", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "line_", "[_", "8_", ":_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "defines_", "._", "add_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line_", "._", "startswith_", "(_", "'#", "undef", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "line_", "[_", "7_", ":_", "]_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "\\u", "defines_", "._", "remove_", "(_", "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_", "if_", "line", "\\u", "included_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "lines_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'\\\\", "n", "'_", "._", "join_", "(_", "target", "\\u", "lines_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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per.py
[ { "content": " def _decode_error_message(self, e):\n try:\n e = json.loads(e)['message']\n except:\n e = None\n\n return e", "metadata": "root.GlacierWrapper._decode_error_message", "header": "['class', 'GlacierWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 573 } ]
[ { "span": "except:", "start_line": 576, "start_column": 8, "end_line": 576, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Gla", "cier", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "decode", "\\u", "error", "\\u", "message_", "(_", "self_", ",_", "e_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "json_", "._", "loads_", "(_", "e_", ")_", "[_", "'", "message", "'_", "]_", "\\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 ", " _", "e_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "e_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
frappe/frappe/frappe/desk/query_builder.py
[ { "content": "@frappe.whitelist()\ndef runquery_csv():\n\tglobal out\n\n\t# run query\n\tres = runquery(from_export = 1)\n\n\tq = frappe.form_dict.get('query')\n\n\trep_name = frappe.form_dict.get('report_name')\n\tif not frappe.form_dict.get('simple_query'):\n\n\t\t# Report Name\n\t\tif not rep_name:\n\t\t\trep_name = get_sql_tables(q)[0]\n\n\tif not rep_name: rep_name = 'DataExport'\n\n\t# Headings\n\theads = []\n\n\trows = [[rep_name], out['colnames']] + out['values']\n\n\tfrom cStringIO import StringIO\n\timport csv\n\n\tf = StringIO()\n\twriter = csv.writer(f)\n\tfor r in rows:\n\t\t# encode only unicode type strings and not int, floats etc.\n\t\twriter.writerow(map(lambda v: isinstance(v, unicode) and v.encode('utf-8') or v, r))\n\n\tf.seek(0)\n\tout['result'] = unicode(f.read(), 'utf-8')\n\tout['type'] = 'csv'\n\tout['doctype'] = rep_name", "metadata": "root.runquery_csv", "header": "['module', '___EOS___']", "index": 218 } ]
[ { "span": "res ", "start_line": 223, "start_column": 1, "end_line": 223, "end_column": 4 }, { "span": "heads ", "start_line": 237, "start_column": 1, "end_line": 237, "end_column": 6 } ]
[]
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_", "@_", "frappe_", "._", "whitelist_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "run", "query", "\\u", "csv_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "out_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "query_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "run", "query_", "(_", "from", "\\u", "export_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "q_", "=_", "frappe_", "._", "form", "\\u", "dict_", "._", "get_", "(_", "'", "query", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rep", "\\u", "name_", "=_", "frappe_", "._", "form", "\\u", "dict_", "._", "get_", "(_", "'", "report", "\\u", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "frappe_", "._", "form", "\\u", "dict_", "._", "get_", "(_", "'", "simple", "\\u", "query", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Report", " ", "Name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "rep", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "rep", "\\u", "name_", "=_", "get", "\\u", "sql", "\\u", "tables_", "(_", "q_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "rep", "\\u", "name_", ":_", "rep", "\\u", "name_", "=_", "'", "Data", "Export", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Head", "ings_", "\\u\\u\\uNL\\u\\u\\u_", "heads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows_", "=_", "[_", "[_", "rep", "\\u", "name_", "]_", ",_", "out_", "[_", "'", "coln", "ames", "'_", "]_", "]_", "+_", "out_", "[_", "'", "values", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "writer_", "=_", "csv_", "._", "writer_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "encode", " ", "only", " ", "unicode", " ", "type", " ", "string", "s", " ", "and", " ", "not", " ", "int", ",", " ", "float", "s", " ", "etc", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "writer_", "._", "writerow_", "(_", "map_", "(_", "lambda_", "v_", ":_", "isinstance_", "(_", "v_", ",_", "unicode_", ")_", "and_", "v_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "or_", "v_", ",_", "r_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "[_", "'", "result", "'_", "]_", "=_", "unicode_", "(_", "f_", "._", "read_", "(_", ")_", ",_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "[_", "'", "type", "'_", "]_", "=_", "'", "csv", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "[_", "'", "doct", "ype", "'_", "]_", "=_", "rep", "\\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,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013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\nimport json\n\nimport mock\nfrom botocore import xform_name\nfrom botocore import model\nfrom botocore.compat import OrderedDict\n\nfrom awscli.testutils import unittest\nfrom awscli.testutils import BaseCLIDriverTest\nfrom awscli.testutils import temporary_file\nfrom awscli.help import OperationHelpCommand\nfrom awscli.argprocess import detect_shape_structure\nfrom awscli.argprocess import unpack_cli_arg\nfrom awscli.argprocess import ParamShorthand\nfrom awscli.argprocess import ParamShorthandDocGen\nfrom awscli.argprocess import ParamError\nfrom awscli.argprocess import ParamUnknownKeyError\nfrom awscli.argprocess import uri_param\nfrom awscli.arguments import CustomArgument, CLIArgument\nfrom awscli.arguments import ListArgument, BooleanArgument\nfrom awscli.arguments import create_argument_model_from_schema\n\n\n# These tests use real service types so that we can\n# verify the real shapes of services.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BaseArgProcessTest(BaseCLIDriverTest):\n", "metadata": "root.BaseArgProcessTest", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def get_param_model(self, dotted_name):\n service_name, operation_name, param_name = dotted_name.split('.')\n service_model = self.session.get_service_model(service_name)\n operation = service_model.operation_model(operation_name)\n input_shape = operation.input_shape\n required_arguments = input_shape.required_members\n is_required = param_name in required_arguments\n member_shape = input_shape.members[param_name]\n type_name = member_shape.type_name\n cli_arg_name = xform_name(param_name, '-')\n if type_name == 'boolean':\n cls = BooleanArgument\n elif type_name == 'list':\n cls = ListArgument\n else:\n cls = CLIArgument\n return cls(cli_arg_name, member_shape, mock.Mock(), is_required)", "metadata": "root.BaseArgProcessTest.get_param_model", "header": "['class', 'BaseArgProcessTest', '(', 'BaseCLIDriverTest', ')', ':', '___EOS___']", "index": 39 }, { "content": "class TestURIParams(BaseArgProcessTest):\n\n", "metadata": "root.TestURIParams", "header": "['module', '___EOS___']", "index": 58 }, { "content": " def test_uri_param(self):\n p = self.get_param_model('ec2.DescribeInstances.Filters')\n with temporary_file('r+') as f:\n json_argument = json.dumps([{\"Name\": \"instance-id\", \"Values\": [\"i-1234\"]}])\n f.write(json_argument)\n f.flush()\n result = uri_param('event-name', p, 'file://%s' % f.name)\n self.assertEqual(result, json_argument)", "metadata": "root.TestURIParams.test_uri_param", "header": "['class', 'TestURIParams', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 59 }, { "content": " def test_uri_param_no_paramfile_false(self):\n p = self.get_param_model('ec2.DescribeInstances.Filters')\n p.no_paramfile = False\n with temporary_file('r+') as f:\n json_argument = json.dumps([{\"Name\": \"instance-id\", \"Values\": [\"i-1234\"]}])\n f.write(json_argument)\n f.flush()\n result = uri_param('event-name', p, 'file://%s' % f.name)\n self.assertEqual(result, json_argument)", "metadata": "root.TestURIParams.test_uri_param_no_paramfile_false", "header": "['class', 'TestURIParams', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 68 }, { "content": " def test_uri_param_no_paramfile_true(self):\n p = self.get_param_model('ec2.DescribeInstances.Filters')\n p.no_paramfile = True\n with temporary_file('r+') as f:\n json_argument = json.dumps([{\"Name\": \"instance-id\", \"Values\": [\"i-1234\"]}])\n f.write(json_argument)\n f.flush()\n result = uri_param('event-name', p, 'file://%s' % f.name)\n self.assertEqual(result, None)", "metadata": "root.TestURIParams.test_uri_param_no_paramfile_true", "header": "['class', 'TestURIParams', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 78 }, { "content": "class TestArgShapeDetection(BaseArgProcessTest):\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestArgShapeDetection", "header": "['module', '___EOS___']", "index": 89 }, { "content": " def assert_shape_type(self, spec, expected_type):\n p = self.get_param_model(spec)\n actual_structure = detect_shape_structure(p.argument_model)\n self.assertEqual(actual_structure, expected_type)", "metadata": "root.TestArgShapeDetection.assert_shape_type", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 91 }, { "content": " def assert_custom_shape_type(self, schema, expected_type):\n argument_model = create_argument_model_from_schema(schema)\n argument = CustomArgument('test', argument_model=argument_model)\n actual_structure = detect_shape_structure(argument.argument_model)\n self.assertEqual(actual_structure, expected_type)", "metadata": "root.TestArgShapeDetection.assert_custom_shape_type", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 96 }, { "content": " def test_detect_scalar(self):\n self.assert_shape_type('iam.AddRoleToInstanceProfile.RoleName',\n 'scalar')", "metadata": "root.TestArgShapeDetection.test_detect_scalar", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 102 }, { "content": " def test_detect_list_of_strings(self):\n self.assert_shape_type('sns.AddPermission.AWSAccountId', 'list-scalar')", "metadata": "root.TestArgShapeDetection.test_detect_list_of_strings", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 106 }, { "content": " def test_detect_structure_of_scalars(self):\n self.assert_shape_type(\n 'elasticbeanstalk.CreateConfigurationTemplate.SourceConfiguration',\n 'structure(scalars)')", "metadata": "root.TestArgShapeDetection.test_detect_structure_of_scalars", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 109 }, { "content": " def test_list_structure_scalars(self):\n self.assert_shape_type(\n 'elb.RegisterInstancesWithLoadBalancer.Instances',\n 'list-structure(scalar)')", "metadata": "root.TestArgShapeDetection.test_list_structure_scalars", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 114 }, { "content": " def test_list_structure_scalars_2(self):\n self.assert_shape_type(\n 'elb.CreateLoadBalancer.Listeners',\n 'list-structure(scalars)')", "metadata": "root.TestArgShapeDetection.test_list_structure_scalars_2", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 119 }, { "content": " def test_list_structure_of_list_and_strings(self):\n self.assert_shape_type(\n 'ec2.DescribeInstances.Filters', 'list-structure(list-scalar, scalar)')", "metadata": "root.TestArgShapeDetection.test_list_structure_of_list_and_strings", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 124 }, { "content": " def test_map_scalar(self):\n self.assert_shape_type(\n 'sqs.SetQueueAttributes.Attributes', 'map-scalar')", "metadata": "root.TestArgShapeDetection.test_map_scalar", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 128 }, { "content": " def test_struct_list_scalar(self):\n self.assert_custom_shape_type({\n \"type\": \"object\",\n \"properties\": {\n \"Consistent\": {\n \"type\": \"boolean\",\n },\n \"Args\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }, 'structure(list-scalar, scalar)')", "metadata": "root.TestArgShapeDetection.test_struct_list_scalar", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 132 }, { "content": " def test_recursive_shape(self):\n shapes = {\n 'InputStructure': {\n 'type': 'structure',\n 'members': {\n 'A': {'shape': 'RecursiveShape'}\n }\n },\n 'RecursiveShape': {\n 'type': 'structure',\n 'members': {\n 'B': {'shape': 'StringType'},\n 'C': {'shape': 'RecursiveShape'},\n }\n },\n 'StringType': {\n 'type': 'string'\n }\n }\n shape = model.StructureShape(shape_name='InputStructure',\n shape_model=shapes['InputStructure'],\n shape_resolver=model.ShapeResolver(\n shape_map=shapes))\n self.assertIn('recursive', detect_shape_structure(shape))", "metadata": "root.TestArgShapeDetection.test_recursive_shape", "header": "['class', 'TestArgShapeDetection', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 148 }, { "content": "class TestParamShorthand(BaseArgProcessTest):\n maxDiff = None\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestParamShorthand", "header": "['module', '___EOS___']", "index": 174 }, { "content": " def setUp(self):\n super(TestParamShorthand, self).setUp()\n self.simplify = ParamShorthand()", "metadata": "root.TestParamShorthand.setUp", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 177 }, { "content": " def test_simplify_structure_scalars(self):\n p = self.get_param_model(\n 'elasticbeanstalk.CreateConfigurationTemplate.SourceConfiguration')\n value = 'ApplicationName=foo,TemplateName=bar'\n json_value = '{\"ApplicationName\": \"foo\", \"TemplateName\": \"bar\"}'\n returned = self.simplify(p, value)\n json_version = unpack_cli_arg(p, json_value)\n self.assertEqual(returned, json_version)", "metadata": "root.TestParamShorthand.test_simplify_structure_scalars", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 181 }, { "content": " def test_parse_boolean_shorthand(self):\n bool_param = mock.Mock()\n bool_param.cli_type_name = 'boolean'\n bool_param.argument_model.type_name = 'boolean'\n self.assertTrue(unpack_cli_arg(bool_param, True))\n self.assertTrue(unpack_cli_arg(bool_param, 'True'))\n self.assertTrue(unpack_cli_arg(bool_param, 'true'))\n\n self.assertFalse(unpack_cli_arg(bool_param, False))\n self.assertFalse(unpack_cli_arg(bool_param, 'False'))\n self.assertFalse(unpack_cli_arg(bool_param, 'false'))", "metadata": "root.TestParamShorthand.test_parse_boolean_shorthand", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 190 }, { "content": " def test_simplify_map_scalar(self):\n p = self.get_param_model('sqs.SetQueueAttributes.Attributes')\n returned = self.simplify(p, 'VisibilityTimeout=15')\n json_version = unpack_cli_arg(p, '{\"VisibilityTimeout\": \"15\"}')\n self.assertEqual(returned, {'VisibilityTimeout': '15'})\n self.assertEqual(returned, json_version)", "metadata": "root.TestParamShorthand.test_simplify_map_scalar", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 202 }, { "content": " def test_list_structure_scalars(self):\n p = self.get_param_model(\n 'elb.RegisterInstancesWithLoadBalancer.Instances')\n # Because this is a list type param, we'll use nargs\n # with argparse which means the value will be presented\n # to us as a list.\n returned = self.simplify(p, ['instance-1', 'instance-2'])\n self.assertEqual(returned, [{'InstanceId': 'instance-1'},\n {'InstanceId': 'instance-2'}])", "metadata": "root.TestParamShorthand.test_list_structure_scalars", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 209 }, { "content": " def test_list_structure_list_scalar(self):\n p = self.get_param_model('ec2.DescribeInstances.Filters')\n expected = [{\"Name\": \"instance-id\", \"Values\": [\"i-1\", \"i-2\"]},\n {\"Name\": \"architecture\", \"Values\": [\"i386\"]}]\n returned = self.simplify(\n p, [\"Name=instance-id,Values=i-1,i-2\",\n \"Name=architecture,Values=i386\"])\n self.assertEqual(returned, expected)\n\n # With spaces around the comma.\n returned2 = self.simplify(\n p, [\"Name=instance-id, Values=i-1,i-2\",\n \"Name=architecture, Values=i386\"])\n self.assertEqual(returned2, expected)\n\n # Strip off leading/trailing spaces.\n returned3 = self.simplify(\n p, [\"Name = instance-id, Values = i-1,i-2\",\n \"Name = architecture, Values = i386\"])\n self.assertEqual(returned3, expected)", "metadata": "root.TestParamShorthand.test_list_structure_list_scalar", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 219 }, { "content": " def test_parse_empty_values(self):\n # A value can be omitted and will default to an empty string.\n p = self.get_param_model('ec2.DescribeInstances.Filters')\n expected = [{\"Name\": \"\", \"Values\": [\"i-1\", \"i-2\"]},\n {\"Name\": \"architecture\", \"Values\": ['']}]\n returned = self.simplify(\n p, [\"Name=,Values=i-1,i-2\",\n \"Name=architecture,Values=\"])\n self.assertEqual(returned, expected)", "metadata": "root.TestParamShorthand.test_parse_empty_values", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 240 }, { "content": " def test_list_structure_list_scalar_2(self):\n p = self.get_param_model('emr.ModifyInstanceGroups.InstanceGroups')\n expected = [\n {\"InstanceGroupId\": \"foo\",\n \"InstanceCount\": 4},\n {\"InstanceGroupId\": \"bar\",\n \"InstanceCount\": 1}\n ]\n\n simplified = self.simplify(p, [\n \"InstanceGroupId=foo,InstanceCount=4\",\n \"InstanceGroupId=bar,InstanceCount=1\"\n ])\n\n self.assertEqual(simplified, expected)", "metadata": "root.TestParamShorthand.test_list_structure_list_scalar_2", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 250 }, { "content": " def test_empty_value_of_list_structure(self):\n p = self.get_param_model('emr.ModifyInstanceGroups.InstanceGroups')\n expected = []\n simplified = self.simplify(p, [])\n self.assertEqual(simplified, expected)", "metadata": "root.TestParamShorthand.test_empty_value_of_list_structure", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 266 }, { "content": " def test_list_structure_list_multiple_scalar(self):\n p = self.get_param_model(\n 'emr.ModifyInstanceGroups.InstanceGroups')\n returned = self.simplify(\n p,\n ['InstanceGroupId=foo,InstanceCount=3,'\n 'EC2InstanceIdsToTerminate=i-12345,i-67890'])\n self.assertEqual(returned, [{'EC2InstanceIdsToTerminate': [\n 'i-12345', 'i-67890'\n ],\n 'InstanceGroupId': 'foo',\n 'InstanceCount': 3}])", "metadata": "root.TestParamShorthand.test_list_structure_list_multiple_scalar", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 272 }, { "content": " def test_list_structure_scalars_2(self):\n p = self.get_param_model('elb.CreateLoadBalancer.Listeners')\n expected = [\n {\"Protocol\": \"protocol1\",\n \"LoadBalancerPort\": 1,\n \"InstanceProtocol\": \"instance_protocol1\",\n \"InstancePort\": 2,\n \"SSLCertificateId\": \"ssl_certificate_id1\"},\n {\"Protocol\": \"protocol2\",\n \"LoadBalancerPort\": 3,\n \"InstanceProtocol\": \"instance_protocol2\",\n \"InstancePort\": 4,\n \"SSLCertificateId\": \"ssl_certificate_id2\"},\n ]\n returned = unpack_cli_arg(\n p, ['{\"Protocol\": \"protocol1\", \"LoadBalancerPort\": 1, '\n '\"InstanceProtocol\": \"instance_protocol1\", '\n '\"InstancePort\": 2, \"SSLCertificateId\": '\n '\"ssl_certificate_id1\"}',\n '{\"Protocol\": \"protocol2\", \"LoadBalancerPort\": 3, '\n '\"InstanceProtocol\": \"instance_protocol2\", '\n '\"InstancePort\": 4, \"SSLCertificateId\": '\n '\"ssl_certificate_id2\"}',\n ])\n self.assertEqual(returned, expected)\n simplified = self.simplify(p, [\n 'Protocol=protocol1,LoadBalancerPort=1,'\n 'InstanceProtocol=instance_protocol1,'\n 'InstancePort=2,SSLCertificateId=ssl_certificate_id1',\n 'Protocol=protocol2,LoadBalancerPort=3,'\n 'InstanceProtocol=instance_protocol2,'\n 'InstancePort=4,SSLCertificateId=ssl_certificate_id2'\n ])\n self.assertEqual(simplified, expected)", "metadata": "root.TestParamShorthand.test_list_structure_scalars_2", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 285 }, { "content": " def test_keyval_with_long_values(self):\n p = self.get_param_model(\n 'dynamodb.UpdateTable.ProvisionedThroughput')\n value = 'WriteCapacityUnits=10,ReadCapacityUnits=10'\n returned = self.simplify(p, value)\n self.assertEqual(returned, {'WriteCapacityUnits': 10,\n 'ReadCapacityUnits': 10})", "metadata": "root.TestParamShorthand.test_keyval_with_long_values", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 320 }, { "content": " def test_error_messages_for_structure_scalar(self):\n p = self.get_param_model(\n 'elasticbeanstalk.CreateConfigurationTemplate.SourceConfiguration')\n value = 'ApplicationName:foo,TemplateName=bar'\n error_msg = \"Error parsing parameter '--source-configuration'.*Expected\"\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, value)", "metadata": "root.TestParamShorthand.test_error_messages_for_structure_scalar", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 328 }, { "content": " def test_improper_separator(self):\n # If the user uses ':' instead of '=', we should give a good\n # error message.\n p = self.get_param_model(\n 'elasticbeanstalk.CreateConfigurationTemplate.SourceConfiguration')\n value = 'ApplicationName:foo,TemplateName:bar'\n error_msg = \"Error parsing parameter '--source-configuration'.*Expected\"\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, value)", "metadata": "root.TestParamShorthand.test_improper_separator", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 336 }, { "content": " def test_improper_separator_for_filters_param(self):\n p = self.get_param_model('ec2.DescribeInstances.Filters')\n error_msg = \"Error parsing parameter '--filters'.*Expected\"\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, [\"Name:tag:Name,Values:foo\"])", "metadata": "root.TestParamShorthand.test_improper_separator_for_filters_param", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 346 }, { "content": " def test_csv_syntax_escaped(self):\n p = self.get_param_model('cloudformation.CreateStack.Parameters')\n returned = self.simplify(\n p, [\"ParameterKey=key,ParameterValue=foo\\,bar\"])\n expected = [{\"ParameterKey\": \"key\",\n \"ParameterValue\": \"foo,bar\"}]\n self.assertEqual(returned, expected)", "metadata": "root.TestParamShorthand.test_csv_syntax_escaped", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 352 }, { "content": " def test_csv_syntax_double_quoted(self):\n p = self.get_param_model('cloudformation.CreateStack.Parameters')\n returned = self.simplify(\n p, ['ParameterKey=key,ParameterValue=\"foo,bar\"'])\n expected = [{\"ParameterKey\": \"key\",\n \"ParameterValue\": \"foo,bar\"}]\n self.assertEqual(returned, expected)", "metadata": "root.TestParamShorthand.test_csv_syntax_double_quoted", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 360 }, { "content": " def test_csv_syntax_single_quoted(self):\n p = self.get_param_model('cloudformation.CreateStack.Parameters')\n returned = self.simplify(\n p, [\"ParameterKey=key,ParameterValue='foo,bar'\"])\n expected = [{\"ParameterKey\": \"key\",\n \"ParameterValue\": \"foo,bar\"}]\n self.assertEqual(returned, expected)", "metadata": "root.TestParamShorthand.test_csv_syntax_single_quoted", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 368 }, { "content": " def test_csv_syntax_errors(self):\n p = self.get_param_model('cloudformation.CreateStack.Parameters')\n error_msg = \"Error parsing parameter '--parameters'.*Expected\"\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, ['ParameterKey=key,ParameterValue=\"foo,bar'])\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, ['ParameterKey=key,ParameterValue=foo,bar\"'])\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, ['ParameterKey=key,ParameterValue=\"\"foo,bar\"'])\n with self.assertRaisesRegexp(ParamError, error_msg):\n self.simplify(p, ['ParameterKey=key,ParameterValue=\"foo,bar\\''])", "metadata": "root.TestParamShorthand.test_csv_syntax_errors", "header": "['class', 'TestParamShorthand', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 376 }, { "content": "class TestParamShorthandCustomArguments(BaseArgProcessTest):\n\n\n", "metadata": "root.TestParamShorthandCustomArguments", "header": "['module', '___EOS___']", "index": 389 }, { "content": " def setUp(self):\n super(TestParamShorthandCustomArguments, self).setUp()\n self.simplify = ParamShorthand()", "metadata": "root.TestParamShorthandCustomArguments.setUp", "header": "['class', 'TestParamShorthandCustomArguments', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 391 }, { "content": " def test_list_structure_list_scalar_custom_arg(self):\n schema = {\n 'type': 'array',\n 'items': {\n 'type': 'object',\n 'properties': {\n 'Name': {\n 'type': 'string'\n },\n 'Args': {\n 'type': 'array',\n 'items': {\n 'type': 'string'\n }\n }\n }\n }\n }\n argument_model = create_argument_model_from_schema(schema)\n cli_argument = CustomArgument('foo', argument_model=argument_model)\n\n expected = [\n {\"Name\": \"foo\",\n \"Args\": [\"a\", \"k1=v1\", \"b\"]},\n {\"Name\": \"bar\",\n \"Args\": [\"baz\"]},\n {\"Name\": \"single_kv\",\n \"Args\": [\"key=value\"]},\n {\"Name\": \"single_v\",\n \"Args\": [\"value\"]}\n ]\n\n simplified = self.simplify(cli_argument, [\n \"Name=foo,Args=[a,k1=v1,b]\",\n \"Name=bar,Args=baz\",\n \"Name=single_kv,Args=[key=value]\",\n \"Name=single_v,Args=[value]\"\n ])\n\n self.assertEqual(simplified, expected)", "metadata": "root.TestParamShorthandCustomArguments.test_list_structure_list_scalar_custom_arg", "header": "['class', 'TestParamShorthandCustomArguments', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 395 }, { "content": " def test_struct_list_scalars(self):\n schema = {\n \"type\": \"object\",\n \"properties\": {\n \"Consistent\": {\n \"type\": \"boolean\",\n },\n \"Args\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n argument_model = create_argument_model_from_schema(schema)\n cli_argument = CustomArgument('test', argument_model=argument_model)\n\n returned = self.simplify(cli_argument, 'Consistent=true,Args=foo1,foo2')\n self.assertEqual(returned, {'Consistent': True,\n 'Args': ['foo1', 'foo2']})", "metadata": "root.TestParamShorthandCustomArguments.test_struct_list_scalars", "header": "['class', 'TestParamShorthandCustomArguments', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 436 }, { "content": "class TestDocGen(BaseArgProcessTest):\n # These aren't very extensive doc tests, as we want to stay somewhat\n # flexible and allow the docs to slightly change without breaking these\n # tests.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestDocGen", "header": "['module', '___EOS___']", "index": 459 }, { "content": " def setUp(self):\n super(TestDocGen, self).setUp()\n self.shorthand_documenter = ParamShorthandDocGen()", "metadata": "root.TestDocGen.setUp", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 463 }, { "content": " def get_generated_example_for(self, argument):\n # Returns a string containing the generated documentation.\n return self.shorthand_documenter.generate_shorthand_example(\n argument.cli_name, argument.argument_model)", "metadata": "root.TestDocGen.get_generated_example_for", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 467 }, { "content": " def assert_generated_example_is(self, argument, expected_docs):\n generated_docs = self.get_generated_example_for(argument)\n self.assertEqual(generated_docs, expected_docs)", "metadata": "root.TestDocGen.assert_generated_example_is", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 472 }, { "content": " def assert_generated_example_contains(self, argument, expected_to_contain):\n generated_docs = self.get_generated_example_for(argument)\n self.assertIn(expected_to_contain, generated_docs)", "metadata": "root.TestDocGen.assert_generated_example_contains", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 476 }, { "content": " def test_gen_map_type_docs(self):\n argument = self.get_param_model('sqs.SetQueueAttributes.Attributes')\n expected_example_str = (\n \"KeyName1=string,KeyName2=string\\n\\n\"\n \"Where valid key names are:\\n\"\n \" Policy\"\n )\n self.assert_generated_example_contains(argument, expected_example_str)", "metadata": "root.TestDocGen.test_gen_map_type_docs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 480 }, { "content": " def test_gen_list_scalar_docs(self):\n argument = self.get_param_model(\n 'elb.RegisterInstancesWithLoadBalancer.Instances')\n doc_string = '--instances InstanceId1 InstanceId2 InstanceId3'\n self.assert_generated_example_is(argument, doc_string)", "metadata": "root.TestDocGen.test_gen_list_scalar_docs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 489 }, { "content": " def test_gen_list_structure_of_scalars_docs(self):\n argument = self.get_param_model('elb.CreateLoadBalancer.Listeners')\n generated_example = self.get_generated_example_for(argument)\n self.assertIn('Protocol=string', generated_example)\n self.assertIn('LoadBalancerPort=integer', generated_example)\n self.assertIn('InstanceProtocol=string', generated_example)\n self.assertIn('InstancePort=integer', generated_example)\n self.assertIn('SSLCertificateId=string', generated_example)", "metadata": "root.TestDocGen.test_gen_list_structure_of_scalars_docs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 495 }, { "content": " def test_gen_list_structure_multiple_scalar_docs(self):\n expected = (\n 'Scalar1=string,'\n 'Scalar2=string,'\n 'List1=string,string ...'\n )\n arg = model.DenormalizedStructureBuilder().with_members(OrderedDict([\n ('List', {'type': 'list',\n 'member': {\n 'type': 'structure',\n 'members': OrderedDict([\n ('Scalar1', {'type': 'string'}),\n ('Scalar2', {'type': 'string'}),\n ('List1', {\n 'type': 'list',\n 'member': {'type': 'string'},\n }),\n ]),\n }}),\n ])).build_model().members['List']\n rendered = self.shorthand_documenter.generate_shorthand_example(\n '--foo', arg)\n self.assertIn(expected, rendered)", "metadata": "root.TestDocGen.test_gen_list_structure_multiple_scalar_docs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 504 }, { "content": " def test_gen_list_structure_list_scalar_scalar_docs(self):\n # Verify that we have *two* top level list items displayed,\n # so we make it clear that multiple values are separated by spaces.\n argument = self.get_param_model('ec2.DescribeInstances.Filters')\n generated_example = self.get_generated_example_for(argument)\n self.assertIn('Name=string,Values=string,string',\n generated_example)", "metadata": "root.TestDocGen.test_gen_list_structure_list_scalar_scalar_docs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 528 }, { "content": " def test_gen_structure_list_scalar_docs(self):\n schema = {\n \"type\": \"object\",\n \"properties\": {\n \"Consistent\": {\n \"type\": \"boolean\",\n },\n \"Args\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n argument_model = create_argument_model_from_schema(schema)\n m = model.DenormalizedStructureBuilder().with_members(OrderedDict([\n ('Consistent', {'type': 'boolean'}),\n ('Args', { 'type': 'list', 'member': { 'type': 'string', }}),\n ])).build_model()\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n self.assertIn('Consistent=boolean,Args=string,string',\n generated_example)", "metadata": "root.TestDocGen.test_gen_structure_list_scalar_docs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 536 }, { "content": " def test_can_gen_recursive_structure(self):\n argument = self.get_param_model('dynamodb.PutItem.Item')\n generated_example = self.get_generated_example_for(argument)", "metadata": "root.TestDocGen.test_can_gen_recursive_structure", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 561 }, { "content": " def test_can_document_nested_structs(self):\n argument = self.get_param_model('ec2.RunInstances.BlockDeviceMappings')\n generated_example = self.get_generated_example_for(argument)\n self.assertIn('Ebs={SnapshotId=string', generated_example)", "metadata": "root.TestDocGen.test_can_document_nested_structs", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 565 }, { "content": " def test_can_document_nested_lists(self):\n m = model.DenormalizedStructureBuilder().with_members({\n 'A': {\n 'type': 'list',\n 'member': {\n 'type': 'list',\n 'member': {'type': 'string'},\n },\n },\n }).build_model()\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n self.assertIn('A=[[string,string],[string,string]]', generated_example)", "metadata": "root.TestDocGen.test_can_document_nested_lists", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 570 }, { "content": " def test_can_generated_nested_maps(self):\n m = model.DenormalizedStructureBuilder().with_members({\n 'A': {\n 'type': 'map',\n 'key': {'type': 'string'},\n 'value': {'type': 'string'}\n },\n }).build_model()\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n self.assertIn('A={KeyName1=string,KeyName2=string}', generated_example)", "metadata": "root.TestDocGen.test_can_generated_nested_maps", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 584 }, { "content": " def test_list_of_structures_with_triple_dots(self):\n list_shape = {\n 'type': 'list',\n 'member': {'shape': 'StructShape'},\n }\n shapes = {\n 'Top': list_shape,\n 'String': {'type': 'string'},\n 'StructShape': {\n 'type': 'structure',\n 'members': OrderedDict([\n ('A', {'shape': 'String'}),\n ('B', {'shape': 'String'}),\n ])\n }\n }\n m = model.ListShape(\n shape_name='Top',\n shape_model=list_shape,\n shape_resolver=model.ShapeResolver(shapes))\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n self.assertIn('A=string,B=string ...', generated_example)", "metadata": "root.TestDocGen.test_list_of_structures_with_triple_dots", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 596 }, { "content": " def test_handle_special_case_value_struct_not_documented(self):\n m = model.DenormalizedStructureBuilder().with_members({\n 'Value': {'type': 'string'}\n }).build_model()\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n # This is one of the special cases, we shouldn't generate any\n # shorthand example for this shape.\n self.assertIsNone(generated_example)", "metadata": "root.TestDocGen.test_handle_special_case_value_struct_not_documented", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 620 }, { "content": " def test_can_document_recursive_struct(self):\n # It's a little more work to set up a recursive\n # shape because DenormalizedStructureBuilder cannot handle\n # recursion.\n struct_shape = {\n 'type': 'structure',\n 'members': OrderedDict([\n ('Recurse', {'shape': 'SubShape'}),\n ('Scalar', {'shape': 'String'}),\n ]),\n }\n shapes = {\n 'Top': struct_shape,\n 'String': {'type': 'string'},\n 'SubShape': {\n 'type': 'structure',\n 'members': OrderedDict([\n ('SubRecurse', {'shape': 'Top'}),\n ('Scalar', {'shape': 'String'}),\n ]),\n }\n }\n m = model.StructureShape(\n shape_name='Top',\n shape_model=struct_shape,\n shape_resolver=model.ShapeResolver(shapes))\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n self.assertIn(\n 'Recurse={SubRecurse={( ... recursive ... ),Scalar=string},'\n 'Scalar=string},Scalar=string',\n generated_example)", "metadata": "root.TestDocGen.test_can_document_recursive_struct", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 630 }, { "content": " def test_skip_deeply_nested_shorthand(self):\n # The eventual goal is to have a better way to document\n # deeply nested shorthand params, but for now, we'll\n # only document shorthand params up to a certain stack level.\n m = model.DenormalizedStructureBuilder().with_members({\n 'A': {\n 'type': 'structure',\n 'members': {\n 'B': {\n 'type': 'structure',\n 'members': {\n 'C': {\n 'type': 'structure',\n 'members': {\n 'D': {'type': 'string'},\n }\n }\n }\n }\n }\n },\n }).build_model()\n generated_example = self.shorthand_documenter.generate_shorthand_example(\n '--foo', m)\n self.assertEqual(generated_example, '')", "metadata": "root.TestDocGen.test_skip_deeply_nested_shorthand", "header": "['class', 'TestDocGen', '(', 'BaseArgProcessTest', ')', ':', '___NEWLINE___', \"# These aren't very extensive doc tests, as we want to stay somewhat\", '___NL___', '# flexible and allow the docs to slightly change without breaking these', '___NL___', '# tests.', '___NL___', '___EOS___']", "index": 663 }, { "content": "class TestUnpackJSONParams(BaseArgProcessTest):\n", "metadata": "root.TestUnpackJSONParams", "header": "['module', '___EOS___']", "index": 690 }, { "content": " def setUp(self):\n super(TestUnpackJSONParams, self).setUp()\n self.simplify = ParamShorthand()", "metadata": "root.TestUnpackJSONParams.setUp", "header": "['class', 'TestUnpackJSONParams', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 691 }, { "content": " def test_json_with_spaces(self):\n p = self.get_param_model('ec2.RunInstances.BlockDeviceMappings')\n # If a user specifies the json with spaces, it will show up as\n # a multi element list. For example:\n # --block-device-mappings [{ \"DeviceName\":\"/dev/sdf\",\n # \"VirtualName\":\"ephemeral0\"}, {\"DeviceName\":\"/dev/sdg\",\n # \"VirtualName\":\"ephemeral1\" }]\n #\n # Will show up as:\n block_device_mapping = [\n '[{', 'DeviceName:/dev/sdf,', 'VirtualName:ephemeral0},',\n '{DeviceName:/dev/sdg,', 'VirtualName:ephemeral1', '}]']\n # The shell has removed the double quotes so this is invalid\n # JSON, but we should still raise a better exception.\n with self.assertRaises(ParamError) as e:\n unpack_cli_arg(p, block_device_mapping)\n # Parameter name should be in error message.\n self.assertIn('--block-device-mappings', str(e.exception))\n # The actual JSON itself should be in the error message.\n # Becaues this is a list, only the first element in the JSON\n # will show. This will at least let customers know what\n # we tried to parse.\n self.assertIn('[{', str(e.exception))", "metadata": "root.TestUnpackJSONParams.test_json_with_spaces", "header": "['class', 'TestUnpackJSONParams', '(', 'BaseArgProcessTest', ')', ':', '___EOS___']", "index": 695 } ]
[ { "span": "from awscli.help import OperationHelpCommand", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 44 }, { "span": "from awscli.argprocess import ParamUnknownKeyError", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 50 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2013", " ", "Ama", "zon", ".", "com", ",", " ", "Inc", ".", " ", "or", " ", "its", " ", "affi", "liat", "es", ".", " ", "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", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", "A", " ", "copy", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "License", " ", "is", " ", "located", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "aws", ".", "amaz", "on", ".", "com", "/", "apa", "che", "2.0", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "in", " ", "the", " ", "\"", "license", "\"", " ", "file", " ", "accom", "pan", "ying", " ", "this", " ", "file", ".", " ", "Thi", "s", " ", "file", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "import_", "xform", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "import_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "._", "compat_", "import_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "aws", "cli_", "._", "testutils_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "testutils_", "import_", "Base", "CLI", "Drive", "r", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "testutils_", "import_", "temporar", "y", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "help_", "import_", "Opera", "tion", "Help", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "detect", "\\u", "shape", "\\u", "structure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "unpack", "\\u", "cli", "\\u", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "Param", "Short", "hand_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "Param", "Short", "hand", "Doc", "Gen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "Param", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "Param", "Un", "know", "n", "Key", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "argp", "rocess", "_", "import_", "uri", "\\u", "param_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "arguments_", "import_", "Custom", "Argument_", ",_", "CLI", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "arguments_", "import_", "List", "Argument_", ",_", "Boo", "lean", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "arguments_", "import_", "create", "\\u", "argu", "ment", "\\u", "model", "\\u", "from", "\\u", "schema_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "tests", " ", "use", " ", "real", " ", "service", " ", "types", " ", "so", " ", "tha", "t", " ", "we", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "verify", " ", "the", " ", "real", " ", "shape", "s", " ", "of", " ", "service", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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_", "Base", "Arg", "Process", "Test_", "(_", "Base", "CLI", "Drive", "r", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Arg", "Process", "Test_", "(_", "Base", "CLI", "Drive", "r", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "param", "\\u", "model_", "(_", "self_", ",_", "dot", "ted", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "service", "\\u", "name_", ",_", "operati", "on", "\\u", "name_", ",_", "param", "\\u", "name_", "=_", "dot", "ted", "\\u", "name_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "model_", "=_", "self_", "._", "session_", "._", "get", "\\u", "service", "\\u", "model_", "(_", "service", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "operation_", "=_", "service", "\\u", "model_", "._", "operati", "on", "\\u", "model_", "(_", "operati", "on", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "shape_", "=_", "operation_", "._", "input", "\\u", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "require", "d\\u", "arguments_", "=_", "input", "\\u", "shape_", "._", "require", "d\\u", "members_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "required_", "=_", "param", "\\u", "name_", "in_", "require", "d\\u", "arguments_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "member", "\\u", "shape_", "=_", "input", "\\u", "shape_", "._", "members_", "[_", "param", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "type", "\\u", "name_", "=_", "member", "\\u", "shape_", "._", "type", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cli", "\\u", "arg", "\\u", "name_", "=_", "xform", "\\u", "name_", "(_", "param", "\\u", "name_", ",_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type", "\\u", "name_", "==_", "'", "boolean", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "Boo", "lean", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type", "\\u", "name_", "==_", "'", "list", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "List", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "CLI", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_", "(_", "cli", "\\u", "arg", "\\u", "name_", ",_", "member", "\\u", "shape_", ",_", "mock_", "._", "Mock_", "(_", ")_", ",_", "is", "\\u", "required_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "URI", "Params_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\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_", "Test", "URI", "Params_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "uri", "\\u", "param_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "temporar", "y", "\\u", "file_", "(_", "'", "r", "+'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "argument_", "=_", "json_", "._", "dumps_", "(_", "[_", "{_", "\"", "Name", "\"_", ":_", "\"", "instance", "-", "id", "\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "\"", "i", "-1", "234", "\"_", "]_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json", "\\u", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "uri", "\\u", "param_", "(_", "'", "event", "-", "name", "'_", ",_", "p_", ",_", "'", "file", "://", "%", "s", "'_", "%_", "f_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "json", "\\u", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "URI", "Params_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "uri", "\\u", "param", "\\u", "no", "\\u", "param", "file", "\\u", "false_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "no", "\\u", "param", "file_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "temporar", "y", "\\u", "file_", "(_", "'", "r", "+'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "argument_", "=_", "json_", "._", "dumps_", "(_", "[_", "{_", "\"", "Name", "\"_", ":_", "\"", "instance", "-", "id", "\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "\"", "i", "-1", "234", "\"_", "]_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json", "\\u", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "uri", "\\u", "param_", "(_", "'", "event", "-", "name", "'_", ",_", "p_", ",_", "'", "file", "://", "%", "s", "'_", "%_", "f_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "json", "\\u", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "URI", "Params_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "uri", "\\u", "param", "\\u", "no", "\\u", "param", "file", "\\u", "true_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "no", "\\u", "param", "file_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "temporar", "y", "\\u", "file_", "(_", "'", "r", "+'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "argument_", "=_", "json_", "._", "dumps_", "(_", "[_", "{_", "\"", "Name", "\"_", ":_", "\"", "instance", "-", "id", "\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "\"", "i", "-1", "234", "\"_", "]_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "json", "\\u", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "uri", "\\u", "param_", "(_", "'", "event", "-", "name", "'_", ",_", "p_", ",_", "'", "file", "://", "%", "s", "'_", "%_", "f_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "assert", "\\u", "shape", "\\u", "type_", "(_", "self_", ",_", "spec_", ",_", "expected", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "structure_", "=_", "detect", "\\u", "shape", "\\u", "structure_", "(_", "p_", "._", "argu", "ment", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "structure_", ",_", "expected", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "assert", "\\u", "custom", "\\u", "shape", "\\u", "type_", "(_", "self_", ",_", "schema_", ",_", "expected", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argu", "ment", "\\u", "model_", "=_", "create", "\\u", "argu", "ment", "\\u", "model", "\\u", "from", "\\u", "schema_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "argument_", "=_", "Custom", "Argument_", "(_", "'", "test", "'_", ",_", "argu", "ment", "\\u", "model_", "=_", "argu", "ment", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual", "\\u", "structure_", "=_", "detect", "\\u", "shape", "\\u", "structure_", "(_", "argument_", "._", "argu", "ment", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "actual", "\\u", "structure_", ",_", "expected", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "detect", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "'", "iam", ".", "Add", "Ro", "le", "To", "Insta", "nce", "Profil", "e", ".", "Ro", "le", "Name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scala", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "detect", "\\u", "list", "\\u", "of", "\\u", "strings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "'", "sns", ".", "Add", "Permi", "ssion", ".", "AW", "SA", "ccount", "Id", "'_", ",_", "'", "list", "-", "scala", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "detect", "\\u", "structure", "\\u", "of", "\\u", "scalars", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elastic", "beans", "talk", ".", "Creat", "e", "Configura", "tion", "Templa", "te", ".", "Sou", "rce", "Configura", "tion", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "structure", "(", "scalars", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "scalars", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elb", ".", "Register", "Insta", "nce", "s", "With", "Load", "Balance", "r", ".", "Insta", "nce", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "-", "structure", "(", "scala", "r", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "scalars", "\\u", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elb", ".", "Creat", "e", "Load", "Balance", "r", ".", "Listen", "ers", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "-", "structure", "(", "scalars", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "of", "\\u", "list", "\\u", "and", "\\u", "strings_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ",_", "'", "list", "-", "structure", "(", "list", "-", "scala", "r", ",", " ", "scala", "r", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "map", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "shape", "\\u", "type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sqs", ".", "Set", "Queue", "Attribute", "s", ".", "Attribute", "s", "'_", ",_", "'", "map", "-", "scala", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "struct", "\\u", "list", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "\\u", "custom", "\\u", "shape", "\\u", "type_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "object", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "proper", "ties", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cons", "iste", "nt", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "boolean", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "array", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "items", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "string", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "'", "structure", "(", "list", "-", "scala", "r", ",", " ", "scala", "r", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Arg", "Shape", "Detect", "ion_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "recurs", "ive", "\\u", "shape_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shapes_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Inp", "ut", "Structur", "e", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "A", "'_", ":_", "{_", "'", "shape", "'_", ":_", "'", "Recursive", "Shape", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Recursive", "Shape", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "B", "'_", ":_", "{_", "'", "shape", "'_", ":_", "'", "String", "Type", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "C", "'_", ":_", "{_", "'", "shape", "'_", ":_", "'", "Recursive", "Shape", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "String", "Type", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "string", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shape_", "=_", "model_", "._", "Structur", "e", "Shape_", "(_", "shape", "\\u", "name_", "=_", "'", "Inp", "ut", "Structur", "e", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "model_", "=_", "shapes_", "[_", "'", "Inp", "ut", "Structur", "e", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "resolver_", "=_", "model_", "._", "Shape", "Resolver_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "map_", "=_", "shapes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "recurs", "ive", "'_", ",_", "detect", "\\u", "shape", "\\u", "structure_", "(_", "shape_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "max", "Diff_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "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 ", " _", "super_", "(_", "Test", "Param", "Short", "hand_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "simplify_", "=_", "Param", "Short", "hand_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simplify", "\\u", "structure", "\\u", "scalars", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elastic", "beans", "talk", ".", "Creat", "e", "Configura", "tion", "Templa", "te", ".", "Sou", "rce", "Configura", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "Applica", "tion", "Name", "=", "foo", ",", "Templa", "te", "Name", "=", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "value_", "=_", "'{", "\"", "Applica", "tion", "Name", "\":", " ", "\"", "foo", "\",", " ", "\"", "Templa", "te", "Name", "\":", " ", "\"", "bar", "\"}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "version_", "=_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "p_", ",_", "json", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "json", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "\\u", "boolean", "\\u", "short", "hand_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bool\\u", "param_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bool\\u", "param_", "._", "cli", "\\u", "type", "\\u", "name_", "=_", "'", "boolean", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bool\\u", "param_", "._", "argu", "ment", "\\u", "model_", "._", "type", "\\u", "name_", "=_", "'", "boolean", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "bool\\u", "param_", ",_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "bool\\u", "param_", ",_", "'", "Tru", "e", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "bool\\u", "param_", ",_", "'", "true", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "bool\\u", "param_", ",_", "False_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "bool\\u", "param_", ",_", "'", "Fal", "se", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "bool\\u", "param_", ",_", "'", "fal", "se", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simplify", "\\u", "map", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "sqs", ".", "Set", "Queue", "Attribute", "s", ".", "Attribute", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "'", "Vis", "ibi", "lit", "y", "Time", "out", "=", "15", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "version_", "=_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "p_", ",_", "'{", "\"", "Vis", "ibi", "lit", "y", "Time", "out", "\":", " ", "\"", "15", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "{_", "'", "Vis", "ibi", "lit", "y", "Time", "out", "'_", ":_", "'", "15", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "json", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "scalars", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elb", ".", "Register", "Insta", "nce", "s", "With", "Load", "Balance", "r", ".", "Insta", "nce", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Be", "caus", "e", " ", "this", " ", "is", " ", "a", " ", "list", " ", "type", " ", "param", ",", " ", "we", "'", "ll", " ", "use", " ", "nargs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "argp", "arse", " ", "whi", "ch", " ", "means", " ", "the", " ", "value", " ", "will", " ", "be", " ", "presente", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "us", " ", "as", " ", "a", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "'", "instance", "-1", "'_", ",_", "'", "instance", "-", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "[_", "{_", "'", "Insta", "nce", "Id", "'_", ":_", "'", "instance", "-1", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "Insta", "nce", "Id", "'_", ":_", "'", "instance", "-", "2", "'_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "list", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\"", "Name", "\"_", ":_", "\"", "instance", "-", "id", "\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "\"", "i", "-1", "\"_", ",_", "\"", "i", "-", "2", "\"_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Name", "\"_", ":_", "\"", "architecture", "\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "\"", "i3", "86", "\"_", "]_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "\"", "Name", "=", "instance", "-", "id", ",", "Value", "s", "=", "i", "-1", ",", "i", "-", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "architecture", ",", "Value", "s", "=", "i3", "86", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "With", " ", "space", "s", " ", "aro", "und", " ", "the", " ", "comma", "._", "\\u\\u\\uNL\\u\\u\\u_", "return", "ed", "2_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "\"", "Name", "=", "instance", "-", "id", ",", " ", "Value", "s", "=", "i", "-1", ",", "i", "-", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "architecture", ",", " ", "Value", "s", "=", "i3", "86", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "ed", "2_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Strip", " ", "off", " ", "lead", "ing", "/", "trail", "ing", " ", "space", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "return", "ed", "3_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "\"", "Name", " ", "=", " ", "instance", "-", "id", ",", " ", "Value", "s", " ", "=", " ", "i", "-1", ",", "i", "-", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", " ", "=", " ", "architecture", ",", " ", "Value", "s", " ", "=", " ", "i3", "86", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "return", "ed", "3_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "parse", "\\u", "empty", "\\u", "values_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "value", " ", "can", " ", "be", " ", "omit", "ted", " ", "and", " ", "will", " ", "default", " ", "to", " ", "an", " ", "empty", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\"", "Name", "\"_", ":_", "\"\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "\"", "i", "-1", "\"_", ",_", "\"", "i", "-", "2", "\"_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Name", "\"_", ":_", "\"", "architecture", "\"_", ",_", "\"", "Value", "s", "\"_", ":_", "[_", "''_", "]_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "\"", "Name", "=", ",", "Value", "s", "=", "i", "-1", ",", "i", "-", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "architecture", ",", "Value", "s", "=\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "list", "\\u", "scala", "r", "\\u", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "emr", ".", "Modif", "y", "Insta", "nce", "Group", "s", ".", "Insta", "nce", "Group", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Insta", "nce", "Group", "Id", "\"_", ":_", "\"", "foo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Count", "\"_", ":_", "4_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Insta", "nce", "Group", "Id", "\"_", ":_", "\"", "bar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Count", "\"_", ":_", "1_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simplified", "_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Group", "Id", "=", "foo", ",", "Insta", "nce", "Count", "=", "4", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Group", "Id", "=", "bar", ",", "Insta", "nce", "Count", "=", "1", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "simplified", "_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "empty", "\\u", "value", "\\u", "of", "\\u", "list", "\\u", "structure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "emr", ".", "Modif", "y", "Insta", "nce", "Group", "s", ".", "Insta", "nce", "Group", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simplified", "_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "simplified", "_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "list", "\\u", "multiple", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "emr", ".", "Modif", "y", "Insta", "nce", "Group", "s", ".", "Insta", "nce", "Group", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Insta", "nce", "Group", "Id", "=", "foo", ",", "Insta", "nce", "Count", "=", "3", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "EC", "2", "Insta", "nce", "Id", "s", "To", "Terminate", "=", "i", "-1", "2345", ",", "i", "-", "67890", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "[_", "{_", "'", "EC", "2", "Insta", "nce", "Id", "s", "To", "Terminate", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "i", "-1", "2345", "'_", ",_", "'", "i", "-", "67890", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Insta", "nce", "Group", "Id", "'_", ":_", "'", "foo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Insta", "nce", "Count", "'_", ":_", "3_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "scalars", "\\u", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "elb", ".", "Creat", "e", "Load", "Balance", "r", ".", "Listen", "ers", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Proto", "col", "\"_", ":_", "\"", "protoc", "ol", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Load", "Balance", "r", "Port", "\"_", ":_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Proto", "col", "\"_", ":_", "\"", "instance", "\\u", "protoc", "ol", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Port", "\"_", ":_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SS", "LC", "ert", "ifica", "te", "Id", "\"_", ":_", "\"", "ssl", "\\u", "certifica", "te", "\\u", "id", "1", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Proto", "col", "\"_", ":_", "\"", "protoc", "ol", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Load", "Balance", "r", "Port", "\"_", ":_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Proto", "col", "\"_", ":_", "\"", "instance", "\\u", "protoc", "ol", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Insta", "nce", "Port", "\"_", ":_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SS", "LC", "ert", "ifica", "te", "Id", "\"_", ":_", "\"", "ssl", "\\u", "certifica", "te", "\\u", "id2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "'{", "\"", "Proto", "col", "\":", " ", "\"", "protoc", "ol", "1", "\",", " ", "\"", "Load", "Balance", "r", "Port", "\":", " ", "1", ",", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "Insta", "nce", "Proto", "col", "\":", " ", "\"", "instance", "\\u", "protoc", "ol", "1", "\",", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "Insta", "nce", "Port", "\":", " ", "2", ",", " ", "\"", "SS", "LC", "ert", "ifica", "te", "Id", "\":", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "ssl", "\\u", "certifica", "te", "\\u", "id", "1", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'{", "\"", "Proto", "col", "\":", " ", "\"", "protoc", "ol", "2", "\",", " ", "\"", "Load", "Balance", "r", "Port", "\":", " ", "3", ",", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "Insta", "nce", "Proto", "col", "\":", " ", "\"", "instance", "\\u", "protoc", "ol", "2", "\",", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "Insta", "nce", "Port", "\":", " ", "4", ",", " ", "\"", "SS", "LC", "ert", "ifica", "te", "Id", "\":", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "ssl", "\\u", "certifica", "te", "\\u", "id2", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "simplified", "_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Proto", "col", "=", "protoc", "ol", "1", ",", "Load", "Balance", "r", "Port", "=", "1", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Insta", "nce", "Proto", "col", "=", "instance", "\\u", "protoc", "ol", "1", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Insta", "nce", "Port", "=", "2", ",", "SS", "LC", "ert", "ifica", "te", "Id", "=", "ssl", "\\u", "certifica", "te", "\\u", "id", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Proto", "col", "=", "protoc", "ol", "2", ",", "Load", "Balance", "r", "Port", "=", "3", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Insta", "nce", "Proto", "col", "=", "instance", "\\u", "protoc", "ol", "2", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Insta", "nce", "Port", "=", "4", ",", "SS", "LC", "ert", "ifica", "te", "Id", "=", "ssl", "\\u", "certifica", "te", "\\u", "id2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "simplified", "_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "keyval", "\\u", "with", "\\u", "long", "\\u", "values_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dynamodb", ".", "Update", "Table", ".", "Provision", "ed", "Through", "put", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "Write", "Capacit", "y", "Unit", "s", "=", "10", ",", "Read", "Capacit", "y", "Unit", "s", "=", "10", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "p_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "{_", "'", "Write", "Capacit", "y", "Unit", "s", "'_", ":_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Read", "Capacit", "y", "Unit", "s", "'_", ":_", "10_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "error", "\\u", "message", "s", "\\u", "for", "\\u", "structure", "\\u", "scalar_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elastic", "beans", "talk", ".", "Creat", "e", "Configura", "tion", "Templa", "te", ".", "Sou", "rce", "Configura", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "Applica", "tion", "Name", ":", "foo", ",", "Templa", "te", "Name", "=", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "\"", "Error", " ", "pars", "ing", " ", "parameter", " ", "'--", "source", "-", "configura", "tion", "'.*", "Expect", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "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", "impro", "per", "\\u", "separator_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "user", " ", "use", "s", " ", "':", "'", " ", "inst", "ead", " ", "of", " ", "'=", "',", " ", "we", " ", "shou", "ld", " ", "give", " ", "a", " ", "good_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "error", " ", "message", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elastic", "beans", "talk", ".", "Creat", "e", "Configura", "tion", "Templa", "te", ".", "Sou", "rce", "Configura", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "Applica", "tion", "Name", ":", "foo", ",", "Templa", "te", "Name", ":", "bar", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "\"", "Error", " ", "pars", "ing", " ", "parameter", " ", "'--", "source", "-", "configura", "tion", "'.*", "Expect", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "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", "impro", "per", "\\u", "separator", "\\u", "for", "\\u", "filter", "s", "\\u", "param_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "\"", "Error", " ", "pars", "ing", " ", "parameter", " ", "'--", "filter", "s", "'.*", "Expect", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "\"", "Name", ":", "tag", ":", "Name", ",", "Value", "s", ":", "foo", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "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", "csv", "\\u", "synta", "x", "\\u", "escaped", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "cloudformation", ".", "Creat", "e", "Stack", ".", "Parameter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "\"", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "=", "foo", "\\\\", ",", "bar", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\"", "Parameter", "Key", "\"_", ":_", "\"", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Parameter", "Value", "\"_", ":_", "\"", "foo", ",", "bar", "\"_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "csv", "\\u", "synta", "x", "\\u", "double", "\\u", "quoted", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "cloudformation", ".", "Creat", "e", "Stack", ".", "Parameter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "'", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "=\"", "foo", ",", "bar", "\"'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\"", "Parameter", "Key", "\"_", ":_", "\"", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Parameter", "Value", "\"_", ":_", "\"", "foo", ",", "bar", "\"_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "csv", "\\u", "synta", "x", "\\u", "single", "\\u", "quoted", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "cloudformation", ".", "Creat", "e", "Stack", ".", "Parameter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "p_", ",_", "[_", "\"", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "='", "foo", ",", "bar", "'\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "{_", "\"", "Parameter", "Key", "\"_", ":_", "\"", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Parameter", "Value", "\"_", ":_", "\"", "foo", ",", "bar", "\"_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "csv", "\\u", "synta", "x", "\\u", "errors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "cloudformation", ".", "Creat", "e", "Stack", ".", "Parameter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "msg_", "=_", "\"", "Error", " ", "pars", "ing", " ", "parameter", " ", "'--", "parameter", "s", "'.*", "Expect", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "'", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "=\"", "foo", ",", "bar", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "'", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "=", "foo", ",", "bar", "\"'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "'", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "=\"\"", "foo", ",", "bar", "\"'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Rai", "ses", "Regexp_", "(_", "Param", "Error_", ",_", "error", "\\u", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "simplify_", "(_", "p_", ",_", "[_", "'", "Parameter", "Key", "=", "key", ",", "Parameter", "Value", "=\"", "foo", ",", "bar", "\\\\''_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "Param", "Short", "hand", "Custom", "Arguments_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand", "Custom", "Arguments_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\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", "Param", "Short", "hand", "Custom", "Arguments_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "simplify_", "=_", "Param", "Short", "hand_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand", "Custom", "Arguments_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list", "\\u", "structure", "\\u", "list", "\\u", "scala", "r", "\\u", "custom", "\\u", "arg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "array", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "items", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "object", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "proper", "ties", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Name", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "string", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Arg", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "array", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "items", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "string", "'_", "\\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_", "argu", "ment", "\\u", "model_", "=_", "create", "\\u", "argu", "ment", "\\u", "model", "\\u", "from", "\\u", "schema_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cli", "\\u", "argument_", "=_", "Custom", "Argument_", "(_", "'", "foo", "'_", ",_", "argu", "ment", "\\u", "model_", "=_", "argu", "ment", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Name", "\"_", ":_", "\"", "foo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "[_", "\"", "a", "\"_", ",_", "\"", "k", "1", "=", "v1", "\"_", ",_", "\"", "b", "\"_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Name", "\"_", ":_", "\"", "bar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "[_", "\"", "ba", "z", "\"_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Name", "\"_", ":_", "\"", "single", "\\u", "kv", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "[_", "\"", "key", "=", "value", "\"_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "Name", "\"_", ":_", "\"", "single", "\\u", "v", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "[_", "\"", "value", "\"_", "]_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "simplified", "_", "=_", "self_", "._", "simplify_", "(_", "cli", "\\u", "argument_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "foo", ",", "Arg", "s", "=[", "a", ",", "k", "1", "=", "v1", ",", "b", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "bar", ",", "Arg", "s", "=", "ba", "z", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "single", "\\u", "kv", ",", "Arg", "s", "=[", "key", "=", "value", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Name", "=", "single", "\\u", "v", ",", "Arg", "s", "=[", "value", "]\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "simplified", "_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Param", "Short", "hand", "Custom", "Arguments_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "struct", "\\u", "list", "\\u", "scalars", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "object", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "proper", "ties", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cons", "iste", "nt", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "boolean", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "array", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "items", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "string", "\"_", "\\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_", "argu", "ment", "\\u", "model_", "=_", "create", "\\u", "argu", "ment", "\\u", "model", "\\u", "from", "\\u", "schema_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cli", "\\u", "argument_", "=_", "Custom", "Argument_", "(_", "'", "test", "'_", ",_", "argu", "ment", "\\u", "model_", "=_", "argu", "ment", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "returned_", "=_", "self_", "._", "simplify_", "(_", "cli", "\\u", "argument_", ",_", "'", "Cons", "iste", "nt", "=", "true", ",", "Arg", "s", "=", "foo", "1", ",", "foo", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "returned_", ",_", "{_", "'", "Cons", "iste", "nt", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Arg", "s", "'_", ":_", "[_", "'", "foo", "1", "'_", ",_", "'", "foo", "2", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Test", "Doc", "Gen_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "=_", "Param", "Short", "hand", "Doc", "Gen_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "self_", ",_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Return", "s", " ", "a", " ", "string", " ", "contain", "ing", " ", "the", " ", "generat", "ed", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "argument_", "._", "cli", "\\u", "name_", ",_", "argument_", "._", "argu", "ment", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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_", "assert", "\\u", "generat", "ed", "\\u", "example", "\\u", "is_", "(_", "self_", ",_", "argument_", ",_", "expected", "\\u", "docs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generat", "ed", "\\u", "docs_", "=_", "self_", "._", "get", "\\u", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "generat", "ed", "\\u", "docs_", ",_", "expected", "\\u", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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_", "assert", "\\u", "generat", "ed", "\\u", "example", "\\u", "contains_", "(_", "self_", ",_", "argument_", ",_", "expected", "\\u", "to", "\\u", "contain", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "generat", "ed", "\\u", "docs_", "=_", "self_", "._", "get", "\\u", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "expected", "\\u", "to", "\\u", "contain", "_", ",_", "generat", "ed", "\\u", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "gen", "\\u", "map", "\\u", "type", "\\u", "docs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argument_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "sqs", ".", "Set", "Queue", "Attribute", "s", ".", "Attribute", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "example", "\\u", "str_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Key", "Name", "1", "=", "string", ",", "Key", "Name", "2", "=", "string", "\\\\", "n", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Whe", "re", " ", "valid", " ", "key", " ", "names", " ", "are", ":\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", " ", "Polic", "y", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "generat", "ed", "\\u", "example", "\\u", "contains_", "(_", "argument_", ",_", "expected", "\\u", "example", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "gen", "\\u", "list", "\\u", "scala", "r", "\\u", "docs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argument_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "elb", ".", "Register", "Insta", "nce", "s", "With", "Load", "Balance", "r", ".", "Insta", "nce", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc", "\\u", "string_", "=_", "'--", "instance", "s", " ", "Insta", "nce", "Id", "1", " ", "Insta", "nce", "Id", "2", " ", "Insta", "nce", "Id", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "\\u", "generat", "ed", "\\u", "example", "\\u", "is_", "(_", "argument_", ",_", "doc", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "gen", "\\u", "list", "\\u", "structure", "\\u", "of", "\\u", "scalars", "\\u", "docs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argument_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "elb", ".", "Creat", "e", "Load", "Balance", "r", ".", "Listen", "ers", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "get", "\\u", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Proto", "col", "=", "string", "'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Load", "Balance", "r", "Port", "=", "integ", "er", "'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Insta", "nce", "Proto", "col", "=", "string", "'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Insta", "nce", "Port", "=", "integ", "er", "'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "SS", "LC", "ert", "ifica", "te", "Id", "=", "string", "'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "gen", "\\u", "list", "\\u", "structure", "\\u", "multiple", "\\u", "scala", "r", "\\u", "docs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Scala", "r1", "=", "string", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Scala", "r2", "=", "string", ",'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "List", "1", "=", "string", ",", "string", " ", "...'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg_", "=_", "model_", "._", "Den", "ormal", "ize", "d", "Structur", "e", "Builder_", "(_", ")_", "._", "with", "\\u", "members_", "(_", "Order", "ed", "Dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "List", "'_", ",_", "{_", "'", "type", "'_", ":_", "'", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "Order", "ed", "Dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Scala", "r1", "'_", ",_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Scala", "r2", "'_", ",_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "List", "1", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ")_", "._", "build", "\\u", "model_", "(_", ")_", "._", "members_", "[_", "'", "List", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rendered_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "expected_", ",_", "rendered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "gen", "\\u", "list", "\\u", "structure", "\\u", "list", "\\u", "scala", "r", "\\u", "scala", "r", "\\u", "docs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Verify", " ", "tha", "t", " ", "we", " ", "have", " ", "*", "two", "*", " ", "top", " ", "level", " ", "list", " ", "items", " ", "displaye", "d", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "we", " ", "make", " ", "it", " ", "clear", " ", "tha", "t", " ", "multiple", " ", "values", " ", "are", " ", "separate", "d", " ", "by", " ", "space", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argument_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Describe", "Insta", "nce", "s", ".", "Filter", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "get", "\\u", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Name", "=", "string", ",", "Value", "s", "=", "string", ",", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "gen", "\\u", "structure", "\\u", "list", "\\u", "scala", "r", "\\u", "docs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "schema_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "object", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "proper", "ties", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cons", "iste", "nt", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "boolean", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Arg", "s", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "array", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "items", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "string", "\"_", "\\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_", "argu", "ment", "\\u", "model_", "=_", "create", "\\u", "argu", "ment", "\\u", "model", "\\u", "from", "\\u", "schema_", "(_", "schema_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "model_", "._", "Den", "ormal", "ize", "d", "Structur", "e", "Builder_", "(_", ")_", "._", "with", "\\u", "members_", "(_", "Order", "ed", "Dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Cons", "iste", "nt", "'_", ",_", "{_", "'", "type", "'_", ":_", "'", "boolean", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Arg", "s", "'_", ",_", "{_", "'", "type", "'_", ":_", "'", "list", "'_", ",_", "'", "member", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", ",_", "}_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ")_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Cons", "iste", "nt", "=", "boolean", ",", "Arg", "s", "=", "string", ",", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "can", "\\u", "gen", "\\u", "recurs", "ive", "\\u", "structure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argument_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "dynamodb", ".", "Put", "Item", ".", "Item", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "get", "\\u", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "can", "\\u", "document", "\\u", "nest", "ed", "\\u", "structs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argument_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Run", "Insta", "nce", "s", ".", "Block", "Dev", "ice", "Mappings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "get", "\\u", "generat", "ed", "\\u", "example", "\\u", "for_", "(_", "argument_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "Eb", "s", "={", "Snapshot", "Id", "=", "string", "'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "can", "\\u", "document", "\\u", "nest", "ed", "\\u", "lists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "model_", "._", "Den", "ormal", "ize", "d", "Structur", "e", "Builder_", "(_", ")_", "._", "with", "\\u", "members_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "A", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "A", "=[", "[", "string", ",", "string", "],[", "string", ",", "string", "]]'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "can", "\\u", "generat", "ed", "\\u", "nest", "ed", "\\u", "maps_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "model_", "._", "Den", "ormal", "ize", "d", "Structur", "e", "Builder_", "(_", ")_", "._", "with", "\\u", "members_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "A", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "map", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "A", "={", "Key", "Name", "1", "=", "string", ",", "Key", "Name", "2", "=", "string", "}'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "list", "\\u", "of", "\\u", "structure", "s", "\\u", "with", "\\u", "triple", "\\u", "dots_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "list", "\\u", "shape_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "{_", "'", "shape", "'_", ":_", "'", "Stru", "ct", "Shape", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shapes_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Top", "'_", ":_", "list", "\\u", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "String", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Stru", "ct", "Shape", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "Order", "ed", "Dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "A", "'_", ",_", "{_", "'", "shape", "'_", ":_", "'", "String", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "B", "'_", ",_", "{_", "'", "shape", "'_", ":_", "'", "String", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "model_", "._", "List", "Shape_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "name_", "=_", "'", "Top", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "model_", "=_", "list", "\\u", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "resolver_", "=_", "model_", "._", "Shape", "Resolver_", "(_", "shapes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "A", "=", "string", ",", "B", "=", "string", " ", "...'_", ",_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "handle", "\\u", "special", "\\u", "case", "\\u", "value", "\\u", "struct", "\\u", "not", "\\u", "documente", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "model_", "._", "Den", "ormal", "ize", "d", "Structur", "e", "Builder_", "(_", ")_", "._", "with", "\\u", "members_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Value", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "one", " ", "of", " ", "the", " ", "special", " ", "case", "s", ",", " ", "we", " ", "shou", "ld", "n", "'", "t", " ", "generat", "e", " ", "any_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "short", "hand", " ", "example", " ", "for", " ", "this", " ", "shape", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "can", "\\u", "document", "\\u", "recurs", "ive", "\\u", "struct_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "a", " ", "litt", "le", " ", "more", " ", "work", " ", "to", " ", "set", " ", "up", " ", "a", " ", "recursive_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shape", " ", "bec", "aus", "e", " ", "Den", "ormal", "ize", "d", "Structur", "e", "Build", "er", " ", "cann", "ot", " ", "handle_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "recursion", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "struct", "\\u", "shape_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "Order", "ed", "Dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Recurs", "e", "'_", ",_", "{_", "'", "shape", "'_", ":_", "'", "Sub", "Shape", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Scala", "r", "'_", ",_", "{_", "'", "shape", "'_", ":_", "'", "String", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shapes_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Top", "'_", ":_", "struct", "\\u", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "String", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sub", "Shape", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "Order", "ed", "Dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Sub", "Recurs", "e", "'_", ",_", "{_", "'", "shape", "'_", ":_", "'", "Top", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "Scala", "r", "'_", ",_", "{_", "'", "shape", "'_", ":_", "'", "String", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "model_", "._", "Structur", "e", "Shape_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "name_", "=_", "'", "Top", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "model_", "=_", "struct", "\\u", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "resolver_", "=_", "model_", "._", "Shape", "Resolver_", "(_", "shapes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Recurs", "e", "={", "Sub", "Recurs", "e", "={", "(", " ", "...", " ", "recurs", "ive", " ", "...", " ", "),", "Scala", "r", "=", "string", "},", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Scala", "r", "=", "string", "},", "Scala", "r", "=", "string", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "generat", "ed", "\\u", "example_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Doc", "Gen_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "se", " ", "are", "n", "'", "t", " ", "very", " ", "extensi", "ve", " ", "doc", " ", "tests", ",", " ", "as", " ", "we", " ", "want", " ", "to", " ", "stay", " ", "some", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flexib", "le", " ", "and", " ", "allow", " ", "the", " ", "docs", " ", "to", " ", "slight", "ly", " ", "change", " ", "with", "out", " ", "break", "ing", " ", "these", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tests", "._", "\\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", "skip", "\\u", "deep", "ly", "\\u", "nest", "ed", "\\u", "short", "hand_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "eventual", " ", "goal", " ", "is", " ", "to", " ", "have", " ", "a", " ", "bett", "er", " ", "way", " ", "to", " ", "document_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "deep", "ly", " ", "nest", "ed", " ", "short", "hand", " ", "params", ",", " ", "but", " ", "for", " ", "now", ",", " ", "we", "'", "ll_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "only", " ", "document", " ", "short", "hand", " ", "params", " ", "up", " ", "to", " ", "a", " ", "cert", "ain", " ", "stack", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "model_", "._", "Den", "ormal", "ize", "d", "Structur", "e", "Builder_", "(_", ")_", "._", "with", "\\u", "members_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "A", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "B", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "C", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "structure", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "D", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "string", "'_", "}_", ",_", "\\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\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "._", "build", "\\u", "model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generat", "ed", "\\u", "example_", "=_", "self_", "._", "short", "hand", "\\u", "documente", "r_", "._", "generat", "e\\u", "short", "hand", "\\u", "example_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "foo", "'_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "generat", "ed", "\\u", "example_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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", "Unpack", "JSO", "NP", "arams_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Unpack", "JSO", "NP", "arams_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\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_", "(_", "Test", "Unpack", "JSO", "NP", "arams_", ",_", "self_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "simplify_", "=_", "Param", "Short", "hand_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Unpack", "JSO", "NP", "arams_", "(_", "Base", "Arg", "Process", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "json", "\\u", "with", "\\u", "spaces_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "get", "\\u", "param", "\\u", "model_", "(_", "'", "ec", "2", ".", "Run", "Insta", "nce", "s", ".", "Block", "Dev", "ice", "Mappings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "user", " ", "speci", "fie", "s", " ", "the", " ", "json", " ", "with", " ", "space", "s", ",", " ", "it", " ", "will", " ", "show", " ", "up", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "multi", " ", "element", " ", "list", ".", " ", " ", "For", " ", "example", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", "block", "-", "device", "-", "mapping", "s", " ", "[{", " ", "\"", "Dev", "ice", "Name", "\":\"", "/", "dev", "/", "sdf", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Virt", "ual", "Name", "\":\"", "ephemeral", "0", "\"},", " ", "{", "\"", "Dev", "ice", "Name", "\":\"", "/", "dev", "/", "sd", "g", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Virt", "ual", "Name", "\":\"", "ephemeral", "1", "\"", " ", "}]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Wil", "l", " ", "show", " ", "up", " ", "as", ":_", "\\u\\u\\uNL\\u\\u\\u_", "block", "\\u", "device", "\\u", "mapping_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'[{", "'_", ",_", "'", "Dev", "ice", "Name", ":/", "dev", "/", "sdf", ",'_", ",_", "'", "Virt", "ual", "Name", ":", "ephemeral", "0", "},", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'{", "Dev", "ice", "Name", ":/", "dev", "/", "sd", "g", ",'_", ",_", "'", "Virt", "ual", "Name", ":", "ephemeral", "1", "'_", ",_", "'}", "]'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "shell", " ", "has", " ", "remove", "d", " ", "the", " ", "double", " ", "quote", "s", " ", "so", " ", "this", " ", "is", " ", "invalid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "JSO", "N", ",", " ", "but", " ", "we", " ", "shou", "ld", " ", "still", " ", "raise", " ", "a", " ", "bett", "er", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Param", "Error_", ")_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "unpack", "\\u", "cli", "\\u", "arg_", "(_", "p_", ",_", "block", "\\u", "device", "\\u", "mapping_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Parameter", " ", "name", " ", "shou", "ld", " ", "be", " ", "in", " ", "error", " ", "message", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'--", "block", "-", "device", "-", "mapping", "s", "'_", ",_", "str_", "(_", "e_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "actual", " ", "JSO", "N", " ", "its", "elf", " ", "shou", "ld", " ", "be", " ", "in", " ", "the", " ", "error", " ", "message", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Be", "cau", "es", " ", "this", " ", "is", " ", "a", " ", "list", ",", " ", "only", " ", "the", " ", "first", " ", "element", " ", "in", " ", "the", " ", "JSON_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "show", ".", " ", " ", "Thi", "s", " ", "will", " ", "at", " ", "leas", "t", " ", "let", " ", "customer", "s", " ", "know", " ", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "trie", "d", " ", "to", " ", "parse", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'[{", "'_", ",_", "str_", "(_", "e_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
Impactstory/total-impact-core/totalimpact/providers/vimeo.py
[ { "content": "from totalimpact.providers import provider\nfrom totalimpact.providers.provider import Provider, ProviderContentMalformedError\n\nimport simplejson, os, re\n\nimport logging\nlogger = logging.getLogger('ti.providers.vimeo')\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Vimeo(Provider): \n\n example_id = (\"url\", \"http://vimeo.com/48605764\")\n\n url = \"http://vimeo.com\"\n descr = \"Vimeo: Your videos belong here.\"\n biblio_url_template = \"http://vimeo.com/api/v2/video/%s.json\"\n aliases_url_template = \"http://vimeo.com/api/v2/video/%s.json\"\n metrics_url_template = \"http://vimeo.com/api/v2/video/%s.json\"\n provenance_url_template = \"http://vimeo.com/%s\"\n\n static_meta_dict = {\n \"plays\": {\n \"display_name\": \"plays\",\n \"provider\": \"Vimeo\",\n \"provider_url\": \"http://vimeo.com\",\n \"description\": \"The number of people who have played the video\",\n \"icon\": \"https://secure-a.vimeocdn.com/images_v6/favicon_32.ico\",\n },\n \"likes\": {\n \"display_name\": \"likes\",\n \"provider\": \"Vimeo\",\n \"provider_url\": \"http://vimeo.com\",\n \"description\": \"The number of people who have 'liked' the video\",\n \"icon\": \"https://secure-a.vimeocdn.com/images_v6/favicon_32.ico\",\n },\n \"comments\": {\n \"display_name\": \"comments\",\n \"provider\": \"Vimeo\",\n \"provider_url\": \"http://vimeo.com\",\n \"description\": \"The number of comments on a video\",\n \"icon\": \"https://secure-a.vimeocdn.com/images_v6/favicon_32.ico\",\n }\n } \n\n\n\n\n #override because need to break up id\n\n\n", "metadata": "root.Vimeo", "header": "['module', '___EOS___']", "index": 8 }, { "content": " def __init__(self):\n super(Vimeo, self).__init__()", "metadata": "root.Vimeo.__init__", "header": "['class', 'Vimeo', '(', 'Provider', ')', ':', '___EOS___']", "index": 43 }, { "content": " def is_relevant_alias(self, alias):\n (namespace, nid) = alias\n if ((\"url\" == namespace) and (\"vimeo.com/\" in nid)):\n return True\n else:\n return False", "metadata": "root.Vimeo.is_relevant_alias", "header": "['class', 'Vimeo', '(', 'Provider', ')', ':', '___EOS___']", "index": 46 }, { "content": " def _get_video_id(self, video_url):\n try:\n nid_as_vimeo_id = re.findall(\"vimeo.com\\/(\\d+)\", video_url)[0]\n except IndexError:\n raise ProviderContentMalformedError(\"No recognizable vimeo id\")\n return nid_as_vimeo_id", "metadata": "root.Vimeo._get_video_id", "header": "['class', 'Vimeo', '(', 'Provider', ')', ':', '___EOS___']", "index": 53 }, { "content": " def _get_templated_url(self, template, nid_as_video_url, method=None):\n nid_as_video_id = self._get_video_id(nid_as_video_url)\n url = template % (nid_as_video_id)\n return(url)", "metadata": "root.Vimeo._get_templated_url", "header": "['class', 'Vimeo', '(', 'Provider', ')', ':', '___EOS___']", "index": 61 }, { "content": " def _extract_biblio(self, page, id=None):\n\n json_response = provider._load_json(page)\n this_video_json = json_response[0]\n\n dict_of_keylists = {\n 'title': ['title'],\n 'authors': ['user_name'],\n 'published_date': ['upload_date'],\n 'url': ['url']\n }\n\n biblio_dict = provider._extract_from_data_dict(this_video_json, dict_of_keylists)\n\n try:\n biblio_dict[\"year\"] = biblio_dict[\"published_date\"][0:4]\n except KeyError:\n pass\n\n biblio_dict[\"repository\"] = \"Vimeo\"\n\n return biblio_dict ", "metadata": "root.Vimeo._extract_biblio", "header": "['class', 'Vimeo', '(', 'Provider', ')', ':', '___EOS___']", "index": 66 }, { "content": " def _extract_metrics(self, page, status_code=200, id=None): \n if status_code != 200:\n if status_code == 404:\n return {}\n else:\n raise(self._get_error(status_code))\n\n if not \"user_id\" in page:\n raise ProviderContentMalformedError\n\n json_response = provider._load_json(page)\n this_video_json = json_response[0]\n\n dict_of_keylists = {\n 'vimeo:plays' : ['stats_number_of_plays'],\n 'vimeo:likes' : ['stats_number_of_likes'],\n 'vimeo:comments' : ['stats_number_of_comments']\n }\n\n metrics_dict = provider._extract_from_data_dict(this_video_json, dict_of_keylists)\n\n return metrics_dict", "metadata": "root.Vimeo._extract_metrics", "header": "['class', 'Vimeo', '(', 'Provider', ')', ':', '___EOS___']", "index": 90 } ]
[ { "span": "import simplejson, os, re", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 25 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "import_", "provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "._", "provider_", "import_", "Provider_", ",_", "Provider", "Conten", "t", "Mal", "formed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "simplejson_", ",_", "os_", ",_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "ti", ".", "provide", "rs", ".", "vimeo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "example", "\\u", "id_", "=_", "(_", "\"", "url", "\"_", ",_", "\"", "http", "://", "vimeo", ".", "com", "/", "486", "057", "64", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"", "http", "://", "vimeo", ".", "com", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descr_", "=_", "\"", "Vi", "meo", ":", " ", "You", "r", " ", "videos", " ", "belo", "ng", " ", "here", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "biblio", "\\u", "url", "\\u", "template_", "=_", "\"", "http", "://", "vimeo", ".", "com", "/", "api", "/", "v2", "/", "video", "/", "%", "s", ".", "json", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alias", "es", "\\u", "url", "\\u", "template_", "=_", "\"", "http", "://", "vimeo", ".", "com", "/", "api", "/", "v2", "/", "video", "/", "%", "s", ".", "json", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metric", "s", "\\u", "url", "\\u", "template_", "=_", "\"", "http", "://", "vimeo", ".", "com", "/", "api", "/", "v2", "/", "video", "/", "%", "s", ".", "json", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provenance", "\\u", "url", "\\u", "template_", "=_", "\"", "http", "://", "vimeo", ".", "com", "/", "%", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "static", "\\u", "meta", "\\u", "dict_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "plays", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "\"", "plays", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "r", "\"_", ":_", "\"", "Vi", "meo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "r", "\\u", "url", "\"_", ":_", "\"", "http", "://", "vimeo", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "description", "\"_", ":_", "\"", "The", " ", "number", " ", "of", " ", "people", " ", "who", " ", "have", " ", "played", " ", "the", " ", "video", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "icon", "\"_", ":_", "\"", "https", "://", "secure", "-", "a", ".", "vimeo", "cdn", ".", "com", "/", "images", "\\u", "v6", "/", "fav", "icon", "\\u", "32.", "ico", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "likes", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "\"", "likes", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "r", "\"_", ":_", "\"", "Vi", "meo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "r", "\\u", "url", "\"_", ":_", "\"", "http", "://", "vimeo", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "description", "\"_", ":_", "\"", "The", " ", "number", " ", "of", " ", "people", " ", "who", " ", "have", " ", "'", "like", "d", "'", " ", "the", " ", "video", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "icon", "\"_", ":_", "\"", "https", "://", "secure", "-", "a", ".", "vimeo", "cdn", ".", "com", "/", "images", "\\u", "v6", "/", "fav", "icon", "\\u", "32.", "ico", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "comment", "s", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "\"", "comment", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "r", "\"_", ":_", "\"", "Vi", "meo", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "r", "\\u", "url", "\"_", ":_", "\"", "http", "://", "vimeo", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "description", "\"_", ":_", "\"", "The", " ", "number", " ", "of", " ", "comment", "s", " ", "on", " ", "a", " ", "video", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "icon", "\"_", ":_", "\"", "https", "://", "secure", "-", "a", ".", "vimeo", "cdn", ".", "com", "/", "images", "\\u", "v6", "/", "fav", "icon", "\\u", "32.", "ico", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "override", " ", "bec", "aus", "e", " ", "need", " ", "to", " ", "break", " ", "up", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Vi", "meo", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "self_", ",_", "alias_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "namespace_", ",_", "nid_", ")_", "=_", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "\"", "url", "\"_", "==_", "namespace_", ")_", "and_", "(_", "\"", "vimeo", ".", "com", "/\"_", "in_", "nid_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "video", "\\u", "id_", "(_", "self_", ",_", "video", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nid", "\\u", "as", "\\u", "vimeo", "\\u", "id_", "=_", "re_", "._", "findall_", "(_", "\"", "vimeo", ".", "com", "\\\\/", "(\\\\", "d", "+)\"_", ",_", "video", "\\u", "url_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Provider", "Conten", "t", "Mal", "formed", "Error_", "(_", "\"", "No", " ", "recog", "niz", "able", " ", "vimeo", " ", "id", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "nid", "\\u", "as", "\\u", "vimeo", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "template", "d\\u", "url_", "(_", "self_", ",_", "template_", ",_", "nid", "\\u", "as", "\\u", "video", "\\u", "url_", ",_", "method_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nid", "\\u", "as", "\\u", "video", "\\u", "id_", "=_", "self_", "._", "\\u", "get", "\\u", "video", "\\u", "id_", "(_", "nid", "\\u", "as", "\\u", "video", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "template_", "%_", "(_", "nid", "\\u", "as", "\\u", "video", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "extract", "\\u", "biblio", "_", "(_", "self_", ",_", "page_", ",_", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "response_", "=_", "provider_", "._", "\\u", "load", "\\u", "json_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "\\u", "video", "\\u", "json_", "=_", "json", "\\u", "response_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dict", "\\u", "of", "\\u", "keyli", "sts_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "[_", "'", "title", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "author", "s", "'_", ":_", "[_", "'", "user", "\\u", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "publi", "shed", "\\u", "date", "'_", ":_", "[_", "'", "upload", "\\u", "date", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "[_", "'", "url", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "biblio", "\\u", "dict_", "=_", "provider_", "._", "\\u", "extract", "\\u", "from", "\\u", "data\\u", "dict_", "(_", "this", "\\u", "video", "\\u", "json_", ",_", "dict", "\\u", "of", "\\u", "keyli", "sts_", ")_", "\\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 ", " _", "biblio", "\\u", "dict_", "[_", "\"", "year", "\"_", "]_", "=_", "biblio", "\\u", "dict_", "[_", "\"", "publi", "shed", "\\u", "date", "\"_", "]_", "[_", "0_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "biblio", "\\u", "dict_", "[_", "\"", "repos", "itor", "y", "\"_", "]_", "=_", "\"", "Vi", "meo", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "biblio", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vi", "meo", "_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "extract", "\\u", "metrics_", "(_", "self_", ",_", "page_", ",_", "status", "\\u", "code_", "=_", "200_", ",_", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "status", "\\u", "code_", "!=_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "status", "\\u", "code_", "==_", "404_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "self_", "._", "\\u", "get", "\\u", "error_", "(_", "status", "\\u", "code_", ")_", ")_", "\\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_", "\"", "user", "\\u", "id", "\"_", "in_", "page_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Provider", "Conten", "t", "Mal", "formed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "json", "\\u", "response_", "=_", "provider_", "._", "\\u", "load", "\\u", "json_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "this", "\\u", "video", "\\u", "json_", "=_", "json", "\\u", "response_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dict", "\\u", "of", "\\u", "keyli", "sts_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vimeo", ":", "plays", "'_", ":_", "[_", "'", "stats", "\\u", "number", "\\u", "of", "\\u", "plays", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vimeo", ":", "likes", "'_", ":_", "[_", "'", "stats", "\\u", "number", "\\u", "of", "\\u", "likes", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vimeo", ":", "comment", "s", "'_", ":_", "[_", "'", "stats", "\\u", "number", "\\u", "of", "\\u", "comment", "s", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "metric", "s", "\\u", "dict_", "=_", "provider_", "._", "\\u", "extract", "\\u", "from", "\\u", "data\\u", "dict_", "(_", "this", "\\u", "video", "\\u", "json_", ",_", "dict", "\\u", "of", "\\u", "keyli", "sts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "metric", "s", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
aerospike/aerospike-client-python/test/old_tests/test_admin_query_user.py
[ { "content": "# -*- coding: utf-8 -*-\n\nimport pytest\nimport sys\nimport time\nfrom .test_base_class import TestBaseClass\nfrom aerospike import exception as e\n\naerospike = pytest.importorskip(\"aerospike\")\ntry:\n import aerospike\nexcept:\n print(\"Please install aerospike python client.\")\n sys.exit(1)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def setup_method(self, method):\n \"\"\"\n Setup method\n \"\"\"\n hostlist, user, password = TestBaseClass().get_hosts()\n config = {\"hosts\": hostlist}\n TestQueryUser.Me = self\n self.client = aerospike.client(config).connect(user, password)\n try:\n self.client.admin_drop_user(\"example-test\")\n except:\n pass\n policy = {}\n user = \"example-test\"\n password = \"foo2\"\n roles = [\"read-write\", \"sys-admin\", \"read\"]\n\n self.client.admin_create_user(user, password, roles, policy)\n\n self.delete_users = []", "metadata": "root.TestQueryUser.setup_method", "header": "['class', 'TestQueryUser', '(', 'TestBaseClass', ')', ':', '___EOS___']", "index": 22 } ]
[ { "span": "except:", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 7 }, { "span": "except:", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "test\\u", "base", "\\u", "class_", "import_", "Test", "Base", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aeros", "pike", "_", "import_", "exception_", "as_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aeros", "pike", "_", "=_", "pytest_", "._", "import", "ors", "kip", "_", "(_", "\"", "aeros", "pike", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "aeros", "pike", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Ple", "ase", " ", "install", " ", "aeros", "pike", " ", "python", " ", "client", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "class_", "Test", "Query", "User_", "(_", "Test", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "up", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "list_", ",_", "user_", ",_", "password_", "=_", "Test", "Base", "Class_", "(_", ")_", "._", "get", "\\u", "hosts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "{_", "\"", "host", "s", "\"_", ":_", "host", "list_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Test", "Query", "User_", "._", "Me_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "aeros", "pike", "_", "._", "client_", "(_", "config_", ")_", "._", "connect_", "(_", "user_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "client_", "._", "admin", "\\u", "drop", "\\u", "user_", "(_", "\"", "example", "-", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "policy_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "\"", "example", "-", "test", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "\"", "foo", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "roles_", "=_", "[_", "\"", "read", "-", "write", "\"_", ",_", "\"", "sys", "-", "admin", "\"_", ",_", "\"", "read", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "admin", "\\u", "create", "\\u", "user_", "(_", "user_", ",_", "password_", ",_", "roles_", ",_", "policy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "delete", "\\u", "users_", "=_", "[_", "]_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/logging_tests/tests.py
[ { "content": " @override_settings(\n ADMINS=(('admin', 'admin@example.com'),),\n EMAIL_SUBJECT_PREFIX='',\n DEBUG=False,\n )\n def test_subject_accepts_newlines(self):\n \"\"\"\n Ensure that newlines in email reports' subjects are escaped to avoid\n AdminErrorHandler to fail.\n Refs #17281.\n \"\"\"\n message = u'Message \\r\\n with newlines'\n expected_subject = u'ERROR: Message \\\\r\\\\n with newlines'\n\n self.assertEqual(len(mail.outbox), 0)\n\n logger = getLogger('django.request')\n logger.error(message)\n\n self.assertEqual(len(mail.outbox), 1)\n self.assertFalse('\\n' in mail.outbox[0].subject)\n self.assertFalse('\\r' in mail.outbox[0].subject)\n self.assertEqual(mail.outbox[0].subject, expected_subject)", "metadata": "root.AdminEmailHandlerTest.test_subject_accepts_newlines", "header": "['class', 'AdminEmailHandlerTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 203 } ]
[ { "span": "self.assertFalse('\\n' in mail.outbox[0].subject)", "start_line": 223, "start_column": 8, "end_line": 223, "end_column": 56 }, { "span": "self.assertFalse('\\r' in mail.outbox[0].subject)", "start_line": 224, "start_column": 8, "end_line": 224, "end_column": 56 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Admi", "n", "Ema", "il", "Handle", "r", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ADMINS_", "=_", "(_", "(_", "'", "admin", "'_", ",_", "'", "admin", "@", "example", ".", "com", "'_", ")_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "EMA", "IL", "\\u", "SUBJECT", "\\u", "PREFIX_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "DEBUG_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "subject", "\\u", "accepts", "\\u", "newlines_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Ensur", "e", " ", "tha", "t", " ", "newline", "s", " ", "in", " ", "email", " ", "report", "s", "'", " ", "subject", "s", " ", "are", " ", "escaped", " ", "to", " ", "avoid", "\\", "10", ";", " ", " ", " ", " ", "Admi", "n", "Error", "Handle", "r", " ", "to", " ", "fail", ".", "\\", "10", ";", " ", " ", " ", " ", "Refs", " ", "#", "172", "81.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "u", "'", "Messag", "e", " ", "\\\\", "r", "\\\\", "n", " ", "with", " ", "newline", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "subject_", "=_", "u", "'", "ERROR", ":", " ", "Messag", "e", " ", "\\\\\\\\", "r", "\\\\\\\\", "n", " ", "with", " ", "newline", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "mail_", "._", "outbox_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "get", "Logger_", "(_", "'", "django", ".", "request", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "error_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "mail_", "._", "outbox_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\\\", "n", "'_", "in_", "mail_", "._", "outbox_", "[_", "0_", "]_", "._", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\\\", "r", "'_", "in_", "mail_", "._", "outbox_", "[_", "0_", "]_", "._", "subject_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "mail_", "._", "outbox_", "[_", "0_", "]_", "._", "subject_", ",_", "expected", "\\u", "subject_", ")_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
membase/membase-cli/diskqueue_stats.py
[ { "content": " def run(self, accessor):\n result = {}\n for bucket, stats_info in stats_buffer.buckets.iteritems():\n trend_error = []\n trend_warn = []\n values = stats_info[accessor[\"scale\"]][accessor[\"counter\"]]\n timestamps = values[\"timestamp\"]\n timestamps = [x - timestamps[0] for x in timestamps]\n nodeStats = values[\"nodeStats\"]\n samplesCount = values[\"samplesCount\"]\n for node, vals in nodeStats.iteritems():\n a, b = util.linreg(timestamps, vals)\n if a > accessor[\"threshold\"][\"high\"]:\n trend_error.append({\"node\":node, \"level\":\"red\", \"value\":a})\n elif a > accessor[\"threshold\"][\"low\"]:\n trend_warn.append({\"node\":node, \"level\":\"yellow\", \"value\":a})\n if len(trend_error) > 0:\n result[bucket] = {\"error\" : trend_error}\n if len(trend_warn) > 0:\n result[bucket] = {\"warn\" : trend_warn}\n return result", "metadata": "root.DiskQueueTrend.run", "header": "['class', 'DiskQueueTrend', ':', '___EOS___']", "index": 26 }, { "content": " def run(self, accessor):\n result = {}\n for bucket, stats_info in stats_buffer.buckets.iteritems():\n trend_error = []\n trend_warn = []\n values = stats_info[accessor[\"scale\"]][accessor[\"counter\"]]\n timestamps = values[\"timestamp\"]\n timestamps = [x - timestamps[0] for x in timestamps]\n nodeStats = values[\"nodeStats\"]\n samplesCount = values[\"samplesCount\"]\n for node, vals in nodeStats.iteritems():\n a, b = util.linreg(timestamps, vals)\n if a > accessor[\"threshold\"][\"high\"]:\n trend_error.append({\"node\":node, \"level\":\"red\", \"value\":a})\n elif a > accessor[\"threshold\"][\"low\"]:\n trend_warn.append({\"node\":node, \"level\":\"yellow\", \"value\":a})\n if len(trend_error) > 0:\n result[bucket] = {\"error\" : trend_error}\n if len(trend_warn) > 0:\n result[bucket] = {\"warn\" : trend_warn}\n return result", "metadata": "root.TapQueueTrend.run", "header": "['class', 'TapQueueTrend', ':', '___EOS___']", "index": 49 }, { "content": " def run(self, accessor):\n result = {}\n for bucket, stats_info in stats_buffer.buckets.iteritems():\n #print bucket, stats_info\n disk_queue_avg_error = []\n disk_queue_avg_warn = []\n drain_values = stats_info[accessor[\"scale\"]][accessor[\"counter\"][0]]\n len_values = stats_info[accessor[\"scale\"]][accessor[\"counter\"][1]]\n nodeStats = drain_values[\"nodeStats\"]\n samplesCount = drain_values[\"samplesCount\"]\n for node, vals in nodeStats.iteritems():\n avg = sum(vals) / samplesCount\n disk_len_vals = len_values[\"nodeStats\"][node]\n len_avg = sum(disk_len_vals) / samplesCount\n if avg < accessor[\"threshold\"][\"drainRate\"] and len_avg > accessor[\"threshold\"][\"diskLength\"]:\n disk_queue_avg_error.append({\"node\":node, \"level\":\"red\", \"value\":avg})\n if len(disk_queue_avg_error) > 0:\n result[bucket] = {\"error\" : disk_queue_avg_error}\n return result", "metadata": "root.DiskQueueDrainingRate.run", "header": "['class', 'DiskQueueDrainingRate', ':', '___EOS___']", "index": 72 } ]
[ { "span": "samplesCount ", "start_line": 35, "start_column": 12, "end_line": 35, "end_column": 24 }, { "span": "samplesCount ", "start_line": 58, "start_column": 12, "end_line": 58, "end_column": 24 }, { "span": "disk_queue_avg_warn ", "start_line": 77, "start_column": 12, "end_line": 77, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Disk", "Queue", "Tren", "d_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ",_", "accessor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bucket_", ",_", "stats", "\\u", "info_", "in_", "stats", "\\u", "buffer_", "._", "buckets_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trend", "\\u", "error_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trend", "\\u", "warn_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "stats", "\\u", "info_", "[_", "accessor_", "[_", "\"", "scale", "\"_", "]_", "]_", "[_", "accessor_", "[_", "\"", "counter", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamps_", "=_", "values_", "[_", "\"", "timestamp", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamps_", "=_", "[_", "x_", "-_", "timestamps_", "[_", "0_", "]_", "for_", "x_", "in_", "timestamps_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "Stats_", "=_", "values_", "[_", "\"", "node", "Stat", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samples", "Count_", "=_", "values_", "[_", "\"", "samples", "Count", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", ",_", "vals_", "in_", "node", "Stats_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", ",_", "b_", "=_", "util_", "._", "lin", "reg_", "(_", "timestamps_", ",_", "vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", ">_", "accessor_", "[_", "\"", "threshol", "d", "\"_", "]_", "[_", "\"", "high", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "trend", "\\u", "error_", "._", "append_", "(_", "{_", "\"", "node", "\"_", ":_", "node_", ",_", "\"", "level", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "value", "\"_", ":_", "a_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "a_", ">_", "accessor_", "[_", "\"", "threshol", "d", "\"_", "]_", "[_", "\"", "low", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "trend", "\\u", "warn_", "._", "append_", "(_", "{_", "\"", "node", "\"_", ":_", "node_", ",_", "\"", "level", "\"_", ":_", "\"", "yell", "ow", "\"_", ",_", "\"", "value", "\"_", ":_", "a_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "trend", "\\u", "error_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "bucket_", "]_", "=_", "{_", "\"", "error", "\"_", ":_", "trend", "\\u", "error_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "trend", "\\u", "warn_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "bucket_", "]_", "=_", "{_", "\"", "warn", "\"_", ":_", "trend", "\\u", "warn_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tap", "Queue", "Tren", "d_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ",_", "accessor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bucket_", ",_", "stats", "\\u", "info_", "in_", "stats", "\\u", "buffer_", "._", "buckets_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trend", "\\u", "error_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trend", "\\u", "warn_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "stats", "\\u", "info_", "[_", "accessor_", "[_", "\"", "scale", "\"_", "]_", "]_", "[_", "accessor_", "[_", "\"", "counter", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamps_", "=_", "values_", "[_", "\"", "timestamp", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamps_", "=_", "[_", "x_", "-_", "timestamps_", "[_", "0_", "]_", "for_", "x_", "in_", "timestamps_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "Stats_", "=_", "values_", "[_", "\"", "node", "Stat", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samples", "Count_", "=_", "values_", "[_", "\"", "samples", "Count", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", ",_", "vals_", "in_", "node", "Stats_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", ",_", "b_", "=_", "util_", "._", "lin", "reg_", "(_", "timestamps_", ",_", "vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", ">_", "accessor_", "[_", "\"", "threshol", "d", "\"_", "]_", "[_", "\"", "high", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "trend", "\\u", "error_", "._", "append_", "(_", "{_", "\"", "node", "\"_", ":_", "node_", ",_", "\"", "level", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "value", "\"_", ":_", "a_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "a_", ">_", "accessor_", "[_", "\"", "threshol", "d", "\"_", "]_", "[_", "\"", "low", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "trend", "\\u", "warn_", "._", "append_", "(_", "{_", "\"", "node", "\"_", ":_", "node_", ",_", "\"", "level", "\"_", ":_", "\"", "yell", "ow", "\"_", ",_", "\"", "value", "\"_", ":_", "a_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "trend", "\\u", "error_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "bucket_", "]_", "=_", "{_", "\"", "error", "\"_", ":_", "trend", "\\u", "error_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "trend", "\\u", "warn_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "bucket_", "]_", "=_", "{_", "\"", "warn", "\"_", ":_", "trend", "\\u", "warn_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Disk", "Queue", "Drain", "ing", "Rate_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "run_", "(_", "self_", ",_", "accessor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bucket_", ",_", "stats", "\\u", "info_", "in_", "stats", "\\u", "buffer_", "._", "buckets_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "bucket", ",", " ", "stats", "\\u", "info_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "disk", "\\u", "queue", "\\u", "avg", "\\u", "error_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disk", "\\u", "queue", "\\u", "avg", "\\u", "warn_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "drain", "\\u", "values_", "=_", "stats", "\\u", "info_", "[_", "accessor_", "[_", "\"", "scale", "\"_", "]_", "]_", "[_", "accessor_", "[_", "\"", "counter", "\"_", "]_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "len", "\\u", "values_", "=_", "stats", "\\u", "info_", "[_", "accessor_", "[_", "\"", "scale", "\"_", "]_", "]_", "[_", "accessor_", "[_", "\"", "counter", "\"_", "]_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "Stats_", "=_", "drain", "\\u", "values_", "[_", "\"", "node", "Stat", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samples", "Count_", "=_", "drain", "\\u", "values_", "[_", "\"", "samples", "Count", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", ",_", "vals_", "in_", "node", "Stats_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "avg_", "=_", "sum_", "(_", "vals_", ")_", "/_", "samples", "Count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disk", "\\u", "len", "\\u", "vals_", "=_", "len", "\\u", "values_", "[_", "\"", "node", "Stat", "s", "\"_", "]_", "[_", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "len", "\\u", "avg_", "=_", "sum_", "(_", "disk", "\\u", "len", "\\u", "vals_", ")_", "/_", "samples", "Count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "avg_", "<_", "accessor_", "[_", "\"", "threshol", "d", "\"_", "]_", "[_", "\"", "drain", "Rat", "e", "\"_", "]_", "and_", "len", "\\u", "avg_", ">_", "accessor_", "[_", "\"", "threshol", "d", "\"_", "]_", "[_", "\"", "disk", "Length", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "disk", "\\u", "queue", "\\u", "avg", "\\u", "error_", "._", "append_", "(_", "{_", "\"", "node", "\"_", ":_", "node_", ",_", "\"", "level", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "value", "\"_", ":_", "avg_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "disk", "\\u", "queue", "\\u", "avg", "\\u", "error_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "bucket_", "]_", "=_", "{_", "\"", "error", "\"_", ":_", "disk", "\\u", "queue", "\\u", "avg", "\\u", "error_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
viewfinderco/viewfinder/backend/storage/store_utils.py
[ { "content": "# Copyright 2013 Viewfinder Inc. All Rights Reserved.\n\n\"\"\"Object store high level utilities.\n\n\"\"\"\n\n__author__ = 'marc@emailscrubbed.com (Marc Berhault)'\n\nimport cStringIO\nimport gzip\nimport logging\nimport subprocess\nimport sys\nimport traceback\n\nfrom functools import partial\nfrom tornado import gen, options\nfrom viewfinder.backend.base import main\nfrom viewfinder.backend.db import db_client\nfrom viewfinder.backend.storage.object_store import ObjectStore\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def ListBuckets():\n \"\"\"Return the list of bucket names initialized in the object store.\"\"\"\n return ObjectStore.ListInstances()", "metadata": "root.ListBuckets", "header": "['module', '___EOS___']", "index": 21 }, { "content": "def IsBucket(name):\n \"\"\"Returns true if there is a bucket under this name in the object store.\"\"\"\n return ObjectStore.HasInstance(name)", "metadata": "root.IsBucket", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def ParseFullPath(full_path):\n \"\"\"Parse a full path and return a (bucket, relative_path). If the bucket is not registered, return None.\"\"\"\n bucket, _, path = full_path.partition('/')\n if not bucket or not IsBucket(bucket):\n return None\n else:\n return (bucket, path)", "metadata": "root.ParseFullPath", "header": "['module', '___EOS___']", "index": 31 }, { "content": "def PrefixFromPattern(pattern):\n \"\"\"Given a path pattern, return the prefix to use in ListKeys.\n If a pattern ends with '*', the prefix is the pattern without the '*', otherwise, we format is as a directory.\n \"\"\"\n if pattern.endswith('*'):\n return pattern[:-1]\n elif pattern.endswith('/'):\n return '' if pattern == '/' else pattern\n elif pattern == '':\n return pattern\n else:\n return pattern + '/'", "metadata": "root.PrefixFromPattern", "header": "['module', '___EOS___']", "index": 40 }, { "content": "@gen.engine\ndef FileExists(store, filename, callback):\n \"\"\"Returns true if a given S3 key exists.\"\"\"\n ret = yield gen.Task(store.ListKeys, prefix=filename, maxkeys=1)\n logging.info('File: %s -> ret: %r' % (filename, ret))\n callback(len(ret) > 0 and ret[0] == filename)", "metadata": "root.FileExists", "header": "['module', '___EOS___']", "index": 54 }, { "content": "@gen.engine\ndef ListAllKeys(store, callback, prefix=None, marker=None, batch_size=1000):\n \"\"\"List all keys (repeatedly call ListKeys).\"\"\"\n # maxkeys=1000 is the S3 ListKeys limit.\n batch_size = min(1000, batch_size)\n keys = []\n done = False\n while not done:\n new_keys = yield gen.Task(store.ListKeys, prefix=prefix, marker=marker, maxkeys=batch_size)\n keys.extend(new_keys)\n if len(new_keys) < batch_size:\n break\n marker = new_keys[-1]\n\n callback(keys)", "metadata": "root.ListAllKeys", "header": "['module', '___EOS___']", "index": 62 }, { "content": "@gen.engine\ndef ListAllCommonPrefixes(store, delimiter, callback, prefix=None, marker=None):\n \"\"\"List all common prefixes (repeatedly call ListCommonPrefixes).\"\"\"\n prefixes = set()\n keys = []\n\n while True:\n # maxkeys=1000 is the S3 ListKeys limit.\n new_prefixes, new_keys = yield gen.Task(store.ListCommonPrefixes, delimiter, prefix=prefix,\n marker=marker, maxkeys=1000)\n prefixes = prefixes.union(set(new_prefixes))\n keys.extend(new_keys)\n if (len(new_prefixes) + len(new_keys)) < 1000:\n break\n # maxkeys includes both prefixes and items. The marker for the next lookup is the lexicographically greatest\n # key we've received (either a prefix or an item).\n marker = ''\n if len(new_prefixes) > 0:\n marker = max(marker, new_prefixes[-1])\n if len(new_keys) > 0:\n marker = max(marker, new_keys[-1])\n callback((sorted(list(prefixes)), keys))", "metadata": "root.ListAllCommonPrefixes", "header": "['module', '___EOS___']", "index": 79 }, { "content": "@gen.engine\ndef ListFilesAndDirs(store, pattern, callback):\n \"\"\"List all subdirectories and files in a directory. Not recursive. Returns (subdirs, files).\"\"\"\n result = yield gen.Task(ListAllCommonPrefixes, store, '/', prefix=PrefixFromPattern(pattern))\n callback(result)", "metadata": "root.ListFilesAndDirs", "header": "['module', '___EOS___']", "index": 103 }, { "content": "@gen.engine\ndef ListRecursively(store, pattern, callback):\n \"\"\"Recursively list all files matching 'pattern'. This does not return directories.\"\"\"\n results = yield gen.Task(ListAllKeys, store, prefix=PrefixFromPattern(pattern))\n callback(results)", "metadata": "root.ListRecursively", "header": "['module', '___EOS___']", "index": 110 }, { "content": "@gen.engine\ndef GetFileContents(store, path, callback, auto_gunzip=True):\n \"\"\"Get the contents of a file in S3. If the extension is .gz, gunzip it first.\"\"\"\n buf = yield gen.Task(store.Get, path)\n if auto_gunzip and path.endswith('.gz'):\n iobuffer = cStringIO.StringIO(buf)\n gzipIO = gzip.GzipFile('rb', fileobj=iobuffer)\n contents = gzipIO.read()\n iobuffer.close()\n else:\n contents = buf\n\n callback(contents)", "metadata": "root.GetFileContents", "header": "['module', '___EOS___']", "index": 117 } ]
[ { "span": "import subprocess", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 17 }, { "span": "import sys", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 10 }, { "span": "import traceback", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 16 }, { "span": "from functools import partial", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 29 }, { "span": "from tornado import gen, options", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 32 }, { "span": "from viewfinder.backend.base import main", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 40 }, { "span": "from viewfinder.backend.db import db_client", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 43 } ]
[]
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_", "\"\"\"", "Object", " ", "store", " ", "high", " ", "level", " ", "util", "iti", "es", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "marc", "@", "email", "scrub", "bed", ".", "com", " ", "(", "Marc", " ", "Ber", "hau", "lt", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tornado_", "import_", "gen_", ",_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "base_", "import_", "main_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "db_", "import_", "db", "\\u", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "view", "finder_", "._", "backend_", "._", "storage_", "._", "object\\u", "store_", "import_", "Object", "Store_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "List", "Buck", "ets_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "list", " ", "of", " ", "bucket", " ", "names", " ", "initialize", "d", " ", "in", " ", "the", " ", "object", " ", "store", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Object", "Store_", "._", "List", "Instances_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Is", "Bucket_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "true", " ", "if", " ", "there", " ", "is", " ", "a", " ", "bucket", " ", "under", " ", "this", " ", "name", " ", "in", " ", "the", " ", "object", " ", "store", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Object", "Store_", "._", "Has", "Instance_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Pars", "e", "Full", "Path_", "(_", "full", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "a", " ", "full", " ", "path", " ", "and", " ", "return", " ", "a", " ", "(", "bucket", ",", " ", "relative", "\\u", "path", ").", " ", "If", " ", "the", " ", "bucket", " ", "is", " ", "not", " ", "register", "ed", ",", " ", "return", " ", "Non", "e", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bucket_", ",_", "\\u_", ",_", "path_", "=_", "full", "\\u", "path_", "._", "partition_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "bucket_", "or_", "not_", "Is", "Bucket_", "(_", "bucket_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "bucket_", ",_", "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_", "Pref", "ix", "Fro", "m", "Pattern_", "(_", "pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "a", " ", "path", " ", "pattern", ",", " ", "return", " ", "the", " ", "prefix", " ", "to", " ", "use", " ", "in", " ", "List", "Keys", ".", "\\", "10", ";", " ", " ", "If", " ", "a", " ", "pattern", " ", "ends", " ", "with", " ", "'*", "',", " ", "the", " ", "prefix", " ", "is", " ", "the", " ", "pattern", " ", "with", "out", " ", "the", " ", "'*", "',", " ", "other", "wis", "e", ",", " ", "we", " ", "format", " ", "is", " ", "as", " ", "a", " ", "director", "y", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pattern_", "._", "endswith_", "(_", "'*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "pattern_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "pattern_", "._", "endswith_", "(_", "'/'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "if_", "pattern_", "==_", "'/'_", "else_", "pattern_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "pattern_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "pattern_", "\\u\\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_", "pattern_", "+_", "'/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "File", "Exists_", "(_", "store_", ",_", "filename_", ",_", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "true", " ", "if", " ", "a", " ", "give", "n", " ", "S", "3", " ", "key", " ", "exist", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "yield_", "gen_", "._", "Task_", "(_", "store_", "._", "List", "Keys_", ",_", "prefix_", "=_", "filename_", ",_", "max", "keys_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "'", "File", ":", " ", "%", "s", " ", "->", " ", "ret", ":", " ", "%", "r", "'_", "%_", "(_", "filename_", ",_", "ret_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", "(_", "len_", "(_", "ret_", ")_", ">_", "0_", "and_", "ret_", "[_", "0_", "]_", "==_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "List", "All", "Keys_", "(_", "store_", ",_", "callback_", ",_", "prefix_", "=_", "None_", ",_", "marker_", "=_", "None_", ",_", "batch", "\\u", "size_", "=_", "1000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "List", " ", "all", " ", "keys", " ", "(", "repeated", "ly", " ", "call", " ", "List", "Keys", ").\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "max", "keys", "=", "1000", " ", "is", " ", "the", " ", "S", "3", " ", "List", "Keys", " ", "limit", "._", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "size_", "=_", "min_", "(_", "1000_", ",_", "batch", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "done_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "keys_", "=_", "yield_", "gen_", "._", "Task_", "(_", "store_", "._", "List", "Keys_", ",_", "prefix_", "=_", "prefix_", ",_", "marker_", "=_", "marker_", ",_", "max", "keys_", "=_", "batch", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "._", "extend_", "(_", "new", "\\u", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "new", "\\u", "keys_", ")_", "<_", "batch", "\\u", "size_", ":_", "\\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_", "marker_", "=_", "new", "\\u", "keys_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "callback_", "(_", "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_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "List", "All", "Common", "Prefixe", "s_", "(_", "store_", ",_", "delimiter_", ",_", "callback_", ",_", "prefix_", "=_", "None_", ",_", "marker_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "List", " ", "all", " ", "common", " ", "prefix", "es", " ", "(", "repeated", "ly", " ", "call", " ", "List", "Common", "Prefixe", "s", ").\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefixes_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "max", "keys", "=", "1000", " ", "is", " ", "the", " ", "S", "3", " ", "List", "Keys", " ", "limit", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "prefixes_", ",_", "new", "\\u", "keys_", "=_", "yield_", "gen_", "._", "Task_", "(_", "store_", "._", "List", "Common", "Prefixe", "s_", ",_", "delimiter_", ",_", "prefix_", "=_", "prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "marker_", ",_", "max", "keys_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefixes_", "=_", "prefixes_", "._", "union_", "(_", "set_", "(_", "new", "\\u", "prefixes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "._", "extend_", "(_", "new", "\\u", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "len_", "(_", "new", "\\u", "prefixes_", ")_", "+_", "len_", "(_", "new", "\\u", "keys_", ")_", ")_", "<_", "1000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "max", "keys", " ", "include", "s", " ", "bot", "h", " ", "prefix", "es", " ", "and", " ", "items", ".", " ", "The", " ", "marker", " ", "for", " ", "the", " ", "next", " ", "look", "up", " ", "is", " ", "the", " ", "lexi", "cog", "raph", "ical", "ly", " ", "great", "est_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "key", " ", "we", "'", "ve", " ", "receive", "d", " ", "(", "eit", "her", " ", "a", " ", "prefix", " ", "or", " ", "an", " ", "item", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "marker_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "new", "\\u", "prefixes_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "marker_", "=_", "max_", "(_", "marker_", ",_", "new", "\\u", "prefixes_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "new", "\\u", "keys_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "marker_", "=_", "max_", "(_", "marker_", ",_", "new", "\\u", "keys_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "callback_", "(_", "(_", "sorted_", "(_", "list_", "(_", "prefixes_", ")_", ")_", ",_", "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_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "List", "Files", "And", "Dirs_", "(_", "store_", ",_", "pattern_", ",_", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "List", " ", "all", " ", "subdir", "ector", "ies", " ", "and", " ", "files", " ", "in", " ", "a", " ", "director", "y", ".", " ", "Not", " ", "recurs", "ive", ".", " ", "Return", "s", " ", "(", "subdir", "s", ",", " ", "files", ").\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "yield_", "gen_", "._", "Task_", "(_", "List", "All", "Common", "Prefixe", "s_", ",_", "store_", ",_", "'/'_", ",_", "prefix_", "=_", "Pref", "ix", "Fro", "m", "Pattern_", "(_", "pattern_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", "(_", "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_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "List", "Recursive", "ly_", "(_", "store_", ",_", "pattern_", ",_", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Recursive", "ly", " ", "list", " ", "all", " ", "files", " ", "matchi", "ng", " ", "'", "pattern", "'.", " ", "Thi", "s", " ", "doe", "s", " ", "not", " ", "return", " ", "director", "ies", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "yield_", "gen_", "._", "Task_", "(_", "List", "All", "Keys_", ",_", "store_", ",_", "prefix_", "=_", "Pref", "ix", "Fro", "m", "Pattern_", "(_", "pattern_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", "(_", "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_", "@_", "gen_", "._", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Get", "File", "Contents_", "(_", "store_", ",_", "path_", ",_", "callback_", ",_", "auto", "\\u", "gun", "zip_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "content", "s", " ", "of", " ", "a", " ", "file", " ", "in", " ", "S", "3", ".", " ", "If", " ", "the", " ", "extensi", "on", " ", "is", " ", ".", "gz", ",", " ", "gun", "zip", " ", "it", " ", "first", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buf_", "=_", "yield_", "gen_", "._", "Task_", "(_", "store_", "._", "Get_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "auto", "\\u", "gun", "zip_", "and_", "path_", "._", "endswith_", "(_", "'.", "gz", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iob", "uffer_", "=_", "c", "String", "IO_", "._", "String", "IO_", "(_", "buf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gzip", "IO_", "=_", "gzip_", "._", "Gz", "ip", "File_", "(_", "'", "rb", "'_", ",_", "fileobj_", "=_", "iob", "uffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "contents_", "=_", "gzip", "IO_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iob", "uffer_", "._", "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 ", " _", "contents_", "=_", "buf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "callback_", "(_", "contents_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
ufora/ufora/ufora/cumulus/test/TestBase.py
[ { "content": " @Teardown.Teardown\n def test_sortALargeVectorWithFourWorkers(self):\n self.desirePublisher.desireNumberOfWorkers(4, blocking=True)\n \n expr = FORA.extractImplValContainer(\n FORA.eval(\n \"\"\"fun() {\n let v = Vector.range(12500000, {_%3.1415926});\n\n if (sorting.isSorted(sorting.sort(v))) 'sorted'\n }\"\"\"\n )\n )\n\n try:\n response = self.evaluateWithGateway(\n makeComputationDefinitionFromIVCs(\n expr,\n ForaNative.makeSymbol(\"Call\")\n ),\n timeout=120.0\n )\n except Queue.Empty:\n response = None\n\n if response is None:\n try:\n dumpFun = self.dumpSchedulerEventStreams\n dumpFun()\n except:\n logging.warn(\"Wanted to dump CumulusWorkerEvents, but couldn't\");\n\n\n self.assertTrue(response is not None)\n self.assertTrue(response[1].isResult())\n self.assertTrue(response[1].asResult.result.pyval == 'sorted', response[1].asResult.result.pyval)", "metadata": "root.CumulusTestCases.test_sortALargeVectorWithFourWorkers", "header": "['class', 'CumulusTestCases', '(', 'object', ')', ':', '___EOS___']", "index": 283 }, { "content": " @Teardown.Teardown\n def test_bigSumWithAdding(self):\n self.desirePublisher.desireNumberOfWorkers(1, blocking=True)\n \n expr = FORA.extractImplValContainer(\n FORA.eval(\n \"\"\"fun() { if (sum(0, 10**11) > 0) 'big_enough' }\"\"\"\n )\n )\n\n computationId = self.gateway.requestComputation(\n makeComputationDefinitionFromIVCs(\n expr,\n ForaNative.makeSymbol(\"Call\")\n )\n )\n\n time.sleep(5)\n \n self.desirePublisher.desireNumberOfWorkers(2, blocking=True)\n\n try:\n response = self.gateway.finalResponses.get(timeout=240.0)\n except Queue.Empty:\n response = None\n\n if response is None:\n try:\n dumpFun = self.dumpSchedulerEventStreams\n dumpFun()\n except:\n logging.warn(\"Wanted to dump CumulusWorkerEvents, but couldn't\");\n\n self.assertTrue(response is not None)\n \n self.assertTrue(response[1].isResult())\n self.assertTrue(response[1].asResult.result.pyval == 'big_enough', response[1].asResult.result.pyval)\n\n self.gateway.deprioritizeComputation(computationId)", "metadata": "root.CumulusTestCases.test_bigSumWithAdding", "header": "['class', 'CumulusTestCases', '(', 'object', ')', ':', '___EOS___']", "index": 320 }, { "content": " @Teardown.Teardown\n def test_sortALargeVectorWithAdding(self):\n self.desirePublisher.desireNumberOfWorkers(2, blocking=True)\n \n expr = FORA.extractImplValContainer(\n FORA.eval(\n \"\"\"fun() {\n let v = Vector.range(12500000, {_%3.1415926});\n\n if (sorting.isSorted(sorting.sort(v))) 'sorted_2'\n }\"\"\"\n )\n )\n\n computationId = self.gateway.requestComputation(\n makeComputationDefinitionFromIVCs(\n expr,\n ForaNative.makeSymbol(\"Call\")\n )\n )\n\n time.sleep(10)\n \n self.desirePublisher.desireNumberOfWorkers(4, blocking=True)\n\n try:\n response = self.gateway.finalResponses.get(timeout=360.0)\n except Queue.Empty:\n response = None\n\n self.gateway.deprioritizeComputation(computationId)\n\n if response is None:\n try:\n dumpFun = self.dumpSchedulerEventStreams\n dumpFun()\n except:\n logging.warn(\"Wanted to dump CumulusWorkerEvents, but couldn't\");\n\n self.assertTrue(response is not None)\n \n self.assertTrue(response[1].isResult())\n self.assertTrue(response[1].asResult.result.pyval == 'sorted_2', response[1].asResult.result.pyval)", "metadata": "root.CumulusTestCases.test_sortALargeVectorWithAdding", "header": "['class', 'CumulusTestCases', '(', 'object', ')', ':', '___EOS___']", "index": 396 }, { "content": " @Teardown.Teardown\n def test_sortALargeVectorWithRemoving(self):\n self.desirePublisher.desireNumberOfWorkers(4, blocking=True)\n \n expr = FORA.extractImplValContainer(\n FORA.eval(\n \"\"\"fun() {\n let v = Vector.range(12500000, {_%3.1415926});\n\n if (sorting.isSorted(sorting.sort(v))) 'sorted_3'\n }\"\"\"\n )\n )\n\n computationId = self.gateway.requestComputation(\n makeComputationDefinitionFromIVCs(\n expr,\n ForaNative.makeSymbol(\"Call\")\n )\n )\n\n time.sleep(10)\n \n self.desirePublisher.desireNumberOfWorkers(3, blocking=True)\n\n try:\n response = self.gateway.finalResponses.get(timeout=240.0)\n except Queue.Empty:\n response = None\n\n self.gateway.deprioritizeComputation(computationId)\n\n if response is None:\n try:\n dumpFun = self.dumpSchedulerEventStreams\n dumpFun()\n except:\n logging.warn(\"Wanted to dump CumulusWorkerEvents, but couldn't\");\n\n self.assertTrue(response is not None)\n self.assertTrue(response[1].isResult())\n self.assertTrue(response[1].asResult.result.pyval == 'sorted_3', response[1].asResult.result.pyval)", "metadata": "root.CumulusTestCases.test_sortALargeVectorWithRemoving", "header": "['class', 'CumulusTestCases', '(', 'object', ')', ':', '___EOS___']", "index": 440 } ]
[ { "span": "except:", "start_line": 312, "start_column": 12, "end_line": 312, "end_column": 19 }, { "span": "except:", "start_line": 350, "start_column": 12, "end_line": 350, "end_column": 19 }, { "span": "except:", "start_line": 432, "start_column": 12, "end_line": 432, "end_column": 19 }, { "span": "except:", "start_line": 476, "start_column": 12, "end_line": 476, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Cum", "ulus", "Test", "Cases_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "Tea", "rdo", "wn_", "._", "Tea", "rdo", "wn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sort", "AL", "arge", "Vector", "With", "Four", "Worke", "rs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "4_", ",_", "blocking_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "FOR", "A_", "._", "extract", "Impl", "Val", "Container_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "FOR", "A_", "._", "eval_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "fun", "()", " ", "{", "\\", "10", ";", " ", " ", "let", " ", "v", " ", "=", " ", "Vector", ".", "range", "(", "1250", "0000", ",", " ", "{\\u", "%", "3.14", "159", "2", "6", "})", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", "if", " ", "(", "sorting", ".", "is", "Sorte", "d", "(", "sorting", ".", "sort", "(", "v", ")))", " ", "'", "sorte", "d", "'", "\\", "10", ";", " ", " ", "}\"\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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 ", " _", "response_", "=_", "self_", "._", "evaluate", "With", "Gateway_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "make", "Computation", "Definit", "ion", "Fro", "m", "IV", "Cs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "For", "a", "Nat", "ive_", "._", "make", "Symbol_", "(_", "\"", "Call", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "120", ".0_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Queue_", "._", "Empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "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 ", " _", "dump", "Fun", "_", "=_", "self_", "._", "dump", "Schedule", "r", "Event", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump", "Fun", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warn_", "(_", "\"", "Wan", "ted", " ", "to", " ", "dump", " ", "Cum", "ulus", "Worke", "r", "Event", "s", ",", " ", "but", " ", "coul", "dn", "'", "t", "\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "is", "Result_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", "==_", "'", "sorte", "d", "'_", ",_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cum", "ulus", "Test", "Cases_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "Tea", "rdo", "wn_", "._", "Tea", "rdo", "wn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "big", "Sum", "With", "Add", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "1_", ",_", "blocking_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "FOR", "A_", "._", "extract", "Impl", "Val", "Container_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "FOR", "A_", "._", "eval_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "fun", "()", " ", "{", " ", "if", " ", "(", "sum", "(", "0", ",", " ", "10", "**", "11", ")", " ", ">", " ", "0", ")", " ", "'", "big", "\\u", "eno", "ugh", "'", " ", "}\"\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "computation", "Id_", "=_", "self_", "._", "gateway_", "._", "request", "Computation", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "make", "Computation", "Definit", "ion", "Fro", "m", "IV", "Cs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "For", "a", "Nat", "ive_", "._", "make", "Symbol_", "(_", "\"", "Call", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "2_", ",_", "blocking_", "=_", "True_", ")_", "\\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 ", " _", "response_", "=_", "self_", "._", "gateway_", "._", "final", "Responses", "_", "._", "get_", "(_", "timeout_", "=_", "240", ".0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Queue_", "._", "Empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "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 ", " _", "dump", "Fun", "_", "=_", "self_", "._", "dump", "Schedule", "r", "Event", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump", "Fun", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warn_", "(_", "\"", "Wan", "ted", " ", "to", " ", "dump", " ", "Cum", "ulus", "Worke", "r", "Event", "s", ",", " ", "but", " ", "coul", "dn", "'", "t", "\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "is", "Result_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", "==_", "'", "big", "\\u", "eno", "ugh", "'_", ",_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gateway_", "._", "dep", "rior", "iti", "ze", "Computation", "_", "(_", "computation", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cum", "ulus", "Test", "Cases_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "Tea", "rdo", "wn_", "._", "Tea", "rdo", "wn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sort", "AL", "arge", "Vector", "With", "Add", "ing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "2_", ",_", "blocking_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "FOR", "A_", "._", "extract", "Impl", "Val", "Container_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "FOR", "A_", "._", "eval_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "fun", "()", " ", "{", "\\", "10", ";", " ", " ", "let", " ", "v", " ", "=", " ", "Vector", ".", "range", "(", "1250", "0000", ",", " ", "{\\u", "%", "3.14", "159", "2", "6", "})", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", "if", " ", "(", "sorting", ".", "is", "Sorte", "d", "(", "sorting", ".", "sort", "(", "v", ")))", " ", "'", "sorte", "d\\u", "2", "'", "\\", "10", ";", " ", " ", "}\"\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "computation", "Id_", "=_", "self_", "._", "gateway_", "._", "request", "Computation", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "make", "Computation", "Definit", "ion", "Fro", "m", "IV", "Cs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "For", "a", "Nat", "ive_", "._", "make", "Symbol_", "(_", "\"", "Call", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "4_", ",_", "blocking_", "=_", "True_", ")_", "\\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 ", " _", "response_", "=_", "self_", "._", "gateway_", "._", "final", "Responses", "_", "._", "get_", "(_", "timeout_", "=_", "360.", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Queue_", "._", "Empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "gateway_", "._", "dep", "rior", "iti", "ze", "Computation", "_", "(_", "computation", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "response_", "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 ", " _", "dump", "Fun", "_", "=_", "self_", "._", "dump", "Schedule", "r", "Event", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump", "Fun", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warn_", "(_", "\"", "Wan", "ted", " ", "to", " ", "dump", " ", "Cum", "ulus", "Worke", "r", "Event", "s", ",", " ", "but", " ", "coul", "dn", "'", "t", "\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "is", "Result_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", "==_", "'", "sorte", "d\\u", "2", "'_", ",_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cum", "ulus", "Test", "Cases_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "Tea", "rdo", "wn_", "._", "Tea", "rdo", "wn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sort", "AL", "arge", "Vector", "With", "Remo", "ving", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "4_", ",_", "blocking_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "FOR", "A_", "._", "extract", "Impl", "Val", "Container_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "FOR", "A_", "._", "eval_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "fun", "()", " ", "{", "\\", "10", ";", " ", " ", "let", " ", "v", " ", "=", " ", "Vector", ".", "range", "(", "1250", "0000", ",", " ", "{\\u", "%", "3.14", "159", "2", "6", "})", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", "if", " ", "(", "sorting", ".", "is", "Sorte", "d", "(", "sorting", ".", "sort", "(", "v", ")))", " ", "'", "sorte", "d\\u", "3", "'", "\\", "10", ";", " ", " ", "}\"\"\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "computation", "Id_", "=_", "self_", "._", "gateway_", "._", "request", "Computation", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "make", "Computation", "Definit", "ion", "Fro", "m", "IV", "Cs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "For", "a", "Nat", "ive_", "._", "make", "Symbol_", "(_", "\"", "Call", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "desi", "re", "Publisher_", "._", "desi", "re", "Number", "Of", "Worke", "rs_", "(_", "3_", ",_", "blocking_", "=_", "True_", ")_", "\\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 ", " _", "response_", "=_", "self_", "._", "gateway_", "._", "final", "Responses", "_", "._", "get_", "(_", "timeout_", "=_", "240", ".0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Queue_", "._", "Empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "gateway_", "._", "dep", "rior", "iti", "ze", "Computation", "_", "(_", "computation", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "response_", "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 ", " _", "dump", "Fun", "_", "=_", "self_", "._", "dump", "Schedule", "r", "Event", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dump", "Fun", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warn_", "(_", "\"", "Wan", "ted", " ", "to", " ", "dump", " ", "Cum", "ulus", "Worke", "r", "Event", "s", ",", " ", "but", " ", "coul", "dn", "'", "t", "\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "is", "Result_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", "==_", "'", "sorte", "d\\u", "3", "'_", ",_", "response_", "[_", "1_", "]_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
OfflineIMAP/imapfw/imapfw/controllers/duplicate.py
[ { "content": " def _call(self, name, *args, **kwargs):\n try:\n values = getattr(self.duplicateDriver, name)(*args, **kwargs)\n except Exception as e:\n if self.mode == 'pass':\n pass\n elif self.mode == 'warn':\n self.ui.warn('TODO: warning not implemented')\n else:\n raise\n finally:\n return getattr(self.driver, name)(*args, **kwargs)", "metadata": "root.Duplicate._call", "header": "['class', 'Duplicate', '(', 'Controller', ')', ':', '___EOS___']", "index": 41 }, { "content": " def connect(self):\n values = self._call('connect')", "metadata": "root.Duplicate.connect", "header": "['class', 'Duplicate', '(', 'Controller', ')', ':', '___EOS___']", "index": 54 } ]
[ { "span": "values ", "start_line": 43, "start_column": 12, "end_line": 43, "end_column": 18 }, { "span": "values ", "start_line": 55, "start_column": 12, "end_line": 55, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Duplicate", "_", "(_", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "call_", "(_", "self_", ",_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "getattr_", "(_", "self_", "._", "duplicat", "e", "Driver_", ",_", "name_", ")_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "mode_", "==_", "'", "pass", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "mode_", "==_", "'", "warn", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ui_", "._", "warn_", "(_", "'", "TOD", "O", ":", " ", "warn", "ing", " ", "not", " ", "implemented", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "self_", "._", "driver_", ",_", "name_", ")_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Duplicate", "_", "(_", "Controller_", ")_", ":_", "\\u\\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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "self_", "._", "\\u", "call_", "(_", "'", "connect", "'_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
First parameter of a method is not named 'self'
cornell-brg/pymtl/pymtl/tools/simulation/SimulationTool_struct_test.py
[ { "content": " def __init__( s, nbits ):\n s.in_ = InPort ( nbits )\n s.out = OutPort( nbits )", "metadata": "root.PassThroughStruct.__init__", "header": "['class', 'PassThroughStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 48 }, { "content": " def elaborate_logic( s ):\n s.connect( s.in_, s.out )", "metadata": "root.PassThroughStruct.elaborate_logic", "header": "['class', 'PassThroughStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 51 }, { "content": " def __init__( s, nbits ):\n s.in_ = InPort ( Bits( nbits ) )\n s.out = OutPort( Bits( nbits ) )", "metadata": "root.PassThroughBitsStruct.__init__", "header": "['class', 'PassThroughBitsStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 62 }, { "content": " def elaborate_logic( s ):\n s.connect( s.in_, s.out )", "metadata": "root.PassThroughBitsStruct.elaborate_logic", "header": "['class', 'PassThroughBitsStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 65 }, { "content": " def __init__( s, nbits, nports ):\n s.nports = nports\n s.in_ = [ InPort ( nbits ) for x in range( nports ) ]\n s.out = [ OutPort( nbits ) for x in range( nports ) ]", "metadata": "root.PassThroughList.__init__", "header": "['class', 'PassThroughList', '(', 'Model', ')', ':', '___EOS___']", "index": 76 }, { "content": " def elaborate_logic( s ):\n for i in range( s.nports ):\n s.connect( s.in_[i], s.out[i] )", "metadata": "root.PassThroughList.elaborate_logic", "header": "['class', 'PassThroughList', '(', 'Model', ')', ':', '___EOS___']", "index": 80 }, { "content": " def __init__( s, nbits, nports ):\n s.nports = nports\n s.nbits = nbits\n s.in_ = [ InPort ( nbits ) for x in range( nports ) ]\n s.out = [ OutPort( nbits ) for x in range( nports ) ]", "metadata": "root.PassThroughListWire.__init__", "header": "['class', 'PassThroughListWire', '(', 'Model', ')', ':', '___EOS___']", "index": 113 }, { "content": " def elaborate_logic( s ):\n s.wire = [ Wire( s.nbits ) for x in range( s.nports ) ]\n for i in range( s.nports ):\n s.connect( s.in_[i], s.wire[i] )\n s.connect( s.wire[i], s.out[i] )", "metadata": "root.PassThroughListWire.elaborate_logic", "header": "['class', 'PassThroughListWire', '(', 'Model', ')', ':', '___EOS___']", "index": 118 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out = OutPort( nbits )", "metadata": "root.PassThroughWrapped.__init__", "header": "['class', 'PassThroughWrapped', '(', 'Model', ')', ':', '___EOS___']", "index": 153 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.pt = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.pt.in_ )\n s.connect( s.out, s.pt.out )", "metadata": "root.PassThroughWrapped.elaborate_logic", "header": "['class', 'PassThroughWrapped', '(', 'Model', ')', ':', '___EOS___']", "index": 157 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out = OutPort( nbits )", "metadata": "root.PassThroughWrappedChain.__init__", "header": "['class', 'PassThroughWrappedChain', '(', 'Model', ')', ':', '___EOS___']", "index": 172 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.pt0 = PassThroughStruct( s.nbits )\n s.pt1 = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.pt0.in_ )\n s.connect( s.pt0.out, s.pt1.in_ )\n s.connect( s.out, s.pt1.out )", "metadata": "root.PassThroughWrappedChain.elaborate_logic", "header": "['class', 'PassThroughWrappedChain', '(', 'Model', ')', ':', '___EOS___']", "index": 176 }, { "content": " def __init__( s, nbits ):\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.Splitter.__init__", "header": "['class', 'Splitter', '(', 'Model', ')', ':', '___EOS___']", "index": 223 }, { "content": " def elaborate_logic( s ):\n # s.connections\n s.connect( s.in_, s.out0 )\n s.connect( s.in_, s.out1 )", "metadata": "root.Splitter.elaborate_logic", "header": "['class', 'Splitter', '(', 'Model', ')', ':', '___EOS___']", "index": 227 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterWires.__init__", "header": "['class', 'SplitterWires', '(', 'Model', ')', ':', '___EOS___']", "index": 240 }, { "content": " def elaborate_logic( s ):\n # s.connections\n s.wire0 = Wire( s.nbits )\n s.wire1 = Wire( s.nbits )\n s.connect( s.in_, s.wire0 )\n s.connect( s.in_, s.wire1 )\n s.connect( s.wire0, s.out0 )\n s.connect( s.wire1, s.out1 )", "metadata": "root.SplitterWires.elaborate_logic", "header": "['class', 'SplitterWires', '(', 'Model', ')', ':', '___EOS___']", "index": 245 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterWrapped.__init__", "header": "['class', 'SplitterWrapped', '(', 'Model', ')', ':', '___EOS___']", "index": 262 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.spl = Splitter( s.nbits )\n # s.connections\n s.connect( s.in_, s.spl.in_ )\n s.connect( s.out0, s.spl.out0 )\n s.connect( s.out1, s.spl.out1 )", "metadata": "root.SplitterWrapped.elaborate_logic", "header": "['class', 'SplitterWrapped', '(', 'Model', ')', ':', '___EOS___']", "index": 267 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterPT_1.__init__", "header": "['class', 'SplitterPT_1', '(', 'Model', ')', ':', '___EOS___']", "index": 283 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.pt0 = PassThroughStruct( s.nbits )\n s.pt1 = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.pt0.in_ )\n s.connect( s.in_, s.pt1.in_ )\n s.connect( s.out0, s.pt0.out )\n s.connect( s.out1, s.pt1.out )", "metadata": "root.SplitterPT_1.elaborate_logic", "header": "['class', 'SplitterPT_1', '(', 'Model', ')', ':', '___EOS___']", "index": 288 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterPT_2.__init__", "header": "['class', 'SplitterPT_2', '(', 'Model', ')', ':', '___EOS___']", "index": 302 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.pt0 = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.pt0.in_ )\n s.connect( s.out0, s.pt0.out )\n s.connect( s.in_, s.out1 )", "metadata": "root.SplitterPT_2.elaborate_logic", "header": "['class', 'SplitterPT_2', '(', 'Model', ')', ':', '___EOS___']", "index": 307 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterPT_3.__init__", "header": "['class', 'SplitterPT_3', '(', 'Model', ')', ':', '___EOS___']", "index": 319 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.pt0 = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.pt0.in_ )\n s.connect( s.in_, s.out0 )\n s.connect( s.out1, s.pt0.out )", "metadata": "root.SplitterPT_3.elaborate_logic", "header": "['class', 'SplitterPT_3', '(', 'Model', ')', ':', '___EOS___']", "index": 324 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterPT_4.__init__", "header": "['class', 'SplitterPT_4', '(', 'Model', ')', ':', '___EOS___']", "index": 336 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.spl = Splitter ( s.nbits )\n s.pt0 = PassThroughStruct( s.nbits )\n s.pt1 = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.spl.in_ )\n s.connect( s.spl.out0, s.pt0.in_ )\n s.connect( s.spl.out1, s.pt1.in_ )\n s.connect( s.out0, s.pt0.out )\n s.connect( s.out1, s.pt1.out )", "metadata": "root.SplitterPT_4.elaborate_logic", "header": "['class', 'SplitterPT_4', '(', 'Model', ')', ':', '___EOS___']", "index": 341 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort ( nbits )\n s.out0 = OutPort( nbits )\n s.out1 = OutPort( nbits )", "metadata": "root.SplitterPT_5.__init__", "header": "['class', 'SplitterPT_5', '(', 'Model', ')', ':', '___EOS___']", "index": 357 }, { "content": " def elaborate_logic( s ):\n # Submodules\n s.spl = Splitter ( s.nbits )\n s.pt0 = PassThroughStruct( s.nbits )\n s.pt1 = PassThroughStruct( s.nbits )\n s.pt2 = PassThroughStruct( s.nbits )\n s.pt3 = PassThroughStruct( s.nbits )\n # s.connections\n s.connect( s.in_, s.spl.in_ )\n s.connect( s.spl.out0, s.pt0.in_ )\n s.connect( s.spl.out1, s.pt1.in_ )\n s.connect( s.pt0.out, s.pt2.in_ )\n s.connect( s.pt1.out, s.pt3.in_ )\n s.connect( s.out0, s.pt2.out )\n s.connect( s.out1, s.pt3.out )", "metadata": "root.SplitterPT_5.elaborate_logic", "header": "['class', 'SplitterPT_5', '(', 'Model', ')', ':', '___EOS___']", "index": 362 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = InPort( nbits )\n s.out = [ OutPort(1) for x in xrange( nbits ) ]", "metadata": "root.SimpleBitBlastStruct.__init__", "header": "['class', 'SimpleBitBlastStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 398 }, { "content": " def elaborate_logic( s ):\n for i in range( s.nbits ):\n s.connect( s.out[i], s.in_[i] )", "metadata": "root.SimpleBitBlastStruct.elaborate_logic", "header": "['class', 'SimpleBitBlastStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 403 }, { "content": " def __init__( s, nbits, groupings ):\n s.nbits = nbits\n s.groupings = groupings\n s.in_ = InPort( nbits )\n s.out = [ OutPort( groupings ) for x in\n xrange( 0, nbits, groupings ) ]", "metadata": "root.ComplexBitBlastStruct.__init__", "header": "['class', 'ComplexBitBlastStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 430 }, { "content": " def elaborate_logic( s ):\n outport_num = 0\n for i in range( 0, s.nbits, s.groupings ):\n s.connect( s.out[outport_num], s.in_[i:i+s.groupings] )\n outport_num += 1", "metadata": "root.ComplexBitBlastStruct.elaborate_logic", "header": "['class', 'ComplexBitBlastStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 437 }, { "content": " def __init__( s, nbits ):\n s.nbits = nbits\n s.in_ = [ InPort( 1 ) for x in xrange( nbits ) ]\n s.out = OutPort( nbits )", "metadata": "root.SimpleBitMergeStruct.__init__", "header": "['class', 'SimpleBitMergeStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 496 }, { "content": " def elaborate_logic( s ):\n for i in range( s.nbits ):\n s.connect( s.out[i], s.in_[i] )", "metadata": "root.SimpleBitMergeStruct.elaborate_logic", "header": "['class', 'SimpleBitMergeStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 501 }, { "content": " def __init__( s, nbits, groupings ):\n s.nbits = nbits\n s.groupings = groupings\n s.in_ = [ InPort( groupings) for x in\n xrange( 0, nbits, groupings ) ]\n s.out = OutPort(nbits)", "metadata": "root.ComplexBitMergeStruct.__init__", "header": "['class', 'ComplexBitMergeStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 540 }, { "content": " def elaborate_logic( s ):\n inport_num = 0\n for i in range( 0, s.nbits, s.groupings ):\n s.connect( s.out[i:i+s.groupings], s.in_[inport_num] )\n inport_num += 1", "metadata": "root.ComplexBitMergeStruct.elaborate_logic", "header": "['class', 'ComplexBitMergeStruct', '(', 'Model', ')', ':', '___EOS___']", "index": 547 }, { "content": " def __init__( s ):\n s.out = OutPort( 32 )", "metadata": "root.ConstantPort.__init__", "header": "['class', 'ConstantPort', '(', 'Model', ')', ':', '___EOS___']", "index": 594 }, { "content": " def elaborate_logic( s ):\n s.connect( s.out, 4 )", "metadata": "root.ConstantPort.elaborate_logic", "header": "['class', 'ConstantPort', '(', 'Model', ')', ':', '___EOS___']", "index": 596 }, { "content": " def __init__( s ):\n s.out = OutPort( 32 )", "metadata": "root.ConstantSlice.__init__", "header": "['class', 'ConstantSlice', '(', 'Model', ')', ':', '___EOS___']", "index": 619 }, { "content": " def elaborate_logic( s ):\n s.connect( s.out[ 0:16], 4 )\n s.connect( s.out[16:32], 8 )", "metadata": "root.ConstantSlice.elaborate_logic", "header": "['class', 'ConstantSlice', '(', 'Model', ')', ':', '___EOS___']", "index": 621 }, { "content": " def __init__( s, inout_nbits = 1, shamt_nbits = 1 ):\n s.in_ = InPort ( inout_nbits )\n s.shamt = InPort ( shamt_nbits )\n s.out = OutPort ( inout_nbits )", "metadata": "root.Shifter.__init__", "header": "['class', 'Shifter', '(', 'Model', ')', ':', '___EOS___']", "index": 645 }, { "content": " def elaborate_logic( s ):\n @s.combinational\n def comb_logic():\n s.out.v = s.in_ << s.shamt", "metadata": "root.Shifter.elaborate_logic", "header": "['class', 'Shifter', '(', 'Model', ')', ':', '___EOS___']", "index": 650 }, { "content": " def __init__( s ):\n s.in_ = InPort ( 8 )\n s.out = OutPort ( 8 )", "metadata": "root.ConstantModule.__init__", "header": "['class', 'ConstantModule', '(', 'Model', ')', ':', '___EOS___']", "index": 656 }, { "content": " def elaborate_logic( s ):\n s.shift = m = Shifter( 8, 2 )\n s.connect_dict({\n m.in_ : s.in_,\n m.shamt : 2,\n m.out : s.out,\n })", "metadata": "root.ConstantModule.elaborate_logic", "header": "['class', 'ConstantModule', '(', 'Model', ')', ':', '___EOS___']", "index": 660 }, { "content": " def __init__( s, src_nbits, dest_nbits ):\n s.src = BitField( src_nbits )\n s.dest = BitField( dest_nbits )", "metadata": "root.BitStructGlobal.__init__", "header": "['class', 'BitStructGlobal', '(', 'BitStructDefinition', ')', ':', '___EOS___']", "index": 757 }, { "content": " def __init__( s, MsgType ):\n s.in_ = InPort ( MsgType )\n s.out = OutPort( MsgType )\n s.connect( s.in_.src, s.out.dest )\n s.connect( s.in_.dest, s.out.src )", "metadata": "root.BitStructConnect.__init__", "header": "['class', 'BitStructConnect', '(', 'Model', ')', ':', '___EOS___']", "index": 762 } ]
[ { "span": "def __init__( s, nbits ):", "start_line": 48, "start_column": 2, "end_line": 48, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 51, "start_column": 2, "end_line": 51, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 62, "start_column": 2, "end_line": 62, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 65, "start_column": 2, "end_line": 65, "end_column": 27 }, { "span": "def __init__( s, nbits, nports ):", "start_line": 76, "start_column": 2, "end_line": 76, "end_column": 35 }, { "span": "def elaborate_logic( s ):", "start_line": 80, "start_column": 2, "end_line": 80, "end_column": 27 }, { "span": "def __init__( s, nbits, nports ):", "start_line": 113, "start_column": 2, "end_line": 113, "end_column": 35 }, { "span": "def elaborate_logic( s ):", "start_line": 118, "start_column": 2, "end_line": 118, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 153, "start_column": 2, "end_line": 153, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 157, "start_column": 2, "end_line": 157, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 172, "start_column": 2, "end_line": 172, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 176, "start_column": 2, "end_line": 176, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 223, "start_column": 2, "end_line": 223, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 227, "start_column": 2, "end_line": 227, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 240, "start_column": 2, "end_line": 240, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 245, "start_column": 2, "end_line": 245, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 262, "start_column": 2, "end_line": 262, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 267, "start_column": 2, "end_line": 267, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 283, "start_column": 2, "end_line": 283, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 288, "start_column": 2, "end_line": 288, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 302, "start_column": 2, "end_line": 302, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 307, "start_column": 2, "end_line": 307, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 319, "start_column": 2, "end_line": 319, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 324, "start_column": 2, "end_line": 324, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 336, "start_column": 2, "end_line": 336, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 341, "start_column": 2, "end_line": 341, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 357, "start_column": 2, "end_line": 357, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 362, "start_column": 2, "end_line": 362, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 398, "start_column": 2, "end_line": 398, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 403, "start_column": 2, "end_line": 403, "end_column": 27 }, { "span": "def __init__( s, nbits, groupings ):", "start_line": 430, "start_column": 2, "end_line": 430, "end_column": 38 }, { "span": "def elaborate_logic( s ):", "start_line": 437, "start_column": 2, "end_line": 437, "end_column": 27 }, { "span": "def __init__( s, nbits ):", "start_line": 496, "start_column": 2, "end_line": 496, "end_column": 27 }, { "span": "def elaborate_logic( s ):", "start_line": 501, "start_column": 2, "end_line": 501, "end_column": 27 }, { "span": "def __init__( s, nbits, groupings ):", "start_line": 540, "start_column": 2, "end_line": 540, "end_column": 38 }, { "span": "def elaborate_logic( s ):", "start_line": 547, "start_column": 2, "end_line": 547, "end_column": 27 }, { "span": "def __init__( s ):", "start_line": 594, "start_column": 2, "end_line": 594, "end_column": 20 }, { "span": "def elaborate_logic( s ):", "start_line": 596, "start_column": 2, "end_line": 596, "end_column": 27 }, { "span": "def __init__( s ):", "start_line": 619, "start_column": 2, "end_line": 619, "end_column": 20 }, { "span": "def elaborate_logic( s ):", "start_line": 621, "start_column": 2, "end_line": 621, "end_column": 27 }, { "span": "def __init__( s, inout_nbits = 1, shamt_nbits = 1 ):", "start_line": 645, "start_column": 2, "end_line": 645, "end_column": 54 }, { "span": "def elaborate_logic( s ):", "start_line": 650, "start_column": 2, "end_line": 650, "end_column": 27 }, { "span": "def __init__( s ):", "start_line": 656, "start_column": 2, "end_line": 656, "end_column": 20 }, { "span": "def elaborate_logic( s ):", "start_line": 660, "start_column": 2, "end_line": 660, "end_column": 27 }, { "span": "def __init__( s, src_nbits, dest_nbits ):", "start_line": 757, "start_column": 2, "end_line": 757, "end_column": 43 }, { "span": "def __init__( s, MsgType ):", "start_line": 762, "start_column": 2, "end_line": 762, "end_column": 29 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Pass", "Through", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Bit", "s", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "Bits_", "(_", "nbi", "ts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "Bits_", "(_", "nbi", "ts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Bit", "s", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "List_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ",_", "npo", "rts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "npo", "rts_", "=_", "npo", "rts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "[_", "In", "Port_", "(_", "nbi", "ts_", ")_", "for_", "x_", "in_", "range_", "(_", "npo", "rts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "[_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "for_", "x_", "in_", "range_", "(_", "npo", "rts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "List_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "s_", "._", "npo", "rts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", "[_", "i_", "]_", ",_", "s_", "._", "out_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "List", "Wire", "_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ",_", "npo", "rts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "npo", "rts_", "=_", "npo", "rts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "[_", "In", "Port_", "(_", "nbi", "ts_", ")_", "for_", "x_", "in_", "range_", "(_", "npo", "rts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "[_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "for_", "x_", "in_", "range_", "(_", "npo", "rts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "List", "Wire", "_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "wire_", "=_", "[_", "Wire", "_", "(_", "s_", "._", "nbi", "ts_", ")_", "for_", "x_", "in_", "range_", "(_", "s_", "._", "npo", "rts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "s_", "._", "npo", "rts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", "[_", "i_", "]_", ",_", "s_", "._", "wire_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "wire_", "[_", "i_", "]_", ",_", "s_", "._", "out_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Wrapp", "ed_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Wrapp", "ed_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "pt_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "pt_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out_", ",_", "s_", "._", "pt_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Wrapp", "ed", "Chain_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pass", "Through", "Wrapp", "ed", "Chain_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "pt", "0_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt1_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "pt", "0_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "pt", "0_", "._", "out_", ",_", "s_", "._", "pt1_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out_", ",_", "s_", "._", "pt1_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "Wire", "s_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "Wire", "s_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "wire", "0_", "=_", "Wire", "_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "wire", "1_", "=_", "Wire", "_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "wire", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "wire", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "wire", "0_", ",_", "s_", "._", "out", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "wire", "1_", ",_", "s_", "._", "out1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "Wrapp", "ed_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "Wrapp", "ed_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "spl_", "=_", "Splitter_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "spl_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out", "0_", ",_", "s_", "._", "spl_", "._", "out", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out1_", ",_", "s_", "._", "spl_", "._", "out1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "1_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "1_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "pt", "0_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt1_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "pt", "0_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "pt1_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out", "0_", ",_", "s_", "._", "pt", "0_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out1_", ",_", "s_", "._", "pt1_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "2_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "2_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "pt", "0_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "pt", "0_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out", "0_", ",_", "s_", "._", "pt", "0_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "3_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "3_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "pt", "0_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "pt", "0_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "out", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out1_", ",_", "s_", "._", "pt", "0_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "4_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "4_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "spl_", "=_", "Splitter_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt", "0_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt1_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "spl_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "spl_", "._", "out", "0_", ",_", "s_", "._", "pt", "0_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "spl_", "._", "out1_", ",_", "s_", "._", "pt1_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out", "0_", ",_", "s_", "._", "pt", "0_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out1_", ",_", "s_", "._", "pt1_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "5_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out", "0_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out1_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Splitter", "PT", "\\u", "5_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subm", "odule", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "spl_", "=_", "Splitter_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt", "0_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt1_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt2_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "pt", "3_", "=_", "Pass", "Through", "Struct_", "(_", "s_", "._", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "s", ".", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", ",_", "s_", "._", "spl_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "spl_", "._", "out", "0_", ",_", "s_", "._", "pt", "0_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "spl_", "._", "out1_", ",_", "s_", "._", "pt1_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "pt", "0_", "._", "out_", ",_", "s_", "._", "pt2_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "pt1_", "._", "out_", ",_", "s_", "._", "pt", "3_", "._", "in\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out", "0_", ",_", "s_", "._", "pt2_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out1_", ",_", "s_", "._", "pt", "3_", "._", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Bit", "Blast", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "[_", "Out", "Port_", "(_", "1_", ")_", "for_", "x_", "in_", "xrange_", "(_", "nbi", "ts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Bit", "Blast", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "s_", "._", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "out_", "[_", "i_", "]_", ",_", "s_", "._", "in\\u_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comple", "x", "Bit", "Blast", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ",_", "grouping", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "grouping", "s_", "=_", "grouping", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "[_", "Out", "Port_", "(_", "grouping", "s_", ")_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "(_", "0_", ",_", "nbi", "ts_", ",_", "grouping", "s_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comple", "x", "Bit", "Blast", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outp", "ort", "\\u", "num_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "s_", "._", "nbi", "ts_", ",_", "s_", "._", "grouping", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "out_", "[_", "outp", "ort", "\\u", "num_", "]_", ",_", "s_", "._", "in\\u_", "[_", "i_", ":_", "i_", "+_", "s_", "._", "grouping", "s_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outp", "ort", "\\u", "num_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Bit", "Merge", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "[_", "In", "Port_", "(_", "1_", ")_", "for_", "x_", "in_", "xrange_", "(_", "nbi", "ts_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "Bit", "Merge", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "s_", "._", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "out_", "[_", "i_", "]_", ",_", "s_", "._", "in\\u_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comple", "x", "Bit", "Merge", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "nbi", "ts_", ",_", "grouping", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "nbi", "ts_", "=_", "nbi", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "grouping", "s_", "=_", "grouping", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "in\\u_", "=_", "[_", "In", "Port_", "(_", "grouping", "s_", ")_", "for_", "x_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "(_", "0_", ",_", "nbi", "ts_", ",_", "grouping", "s_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comple", "x", "Bit", "Merge", "Struct_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inp", "ort", "\\u", "num_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "s_", "._", "nbi", "ts_", ",_", "s_", "._", "grouping", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "out_", "[_", "i_", ":_", "i_", "+_", "s_", "._", "grouping", "s_", "]_", ",_", "s_", "._", "in\\u_", "[_", "inp", "ort", "\\u", "num_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inp", "ort", "\\u", "num_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Const", "ant", "Port_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Const", "ant", "Port_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "out_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Const", "ant", "Slice_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Const", "ant", "Slice_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "connect_", "(_", "s_", "._", "out_", "[_", "0_", ":_", "16_", "]_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "out_", "[_", "16_", ":_", "32_", "]_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shi", "fte", "r_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "inou", "t", "\\u", "nbi", "ts_", "=_", "1_", ",_", "sha", "mt", "\\u", "nbi", "ts_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "inou", "t", "\\u", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "sha", "mt_", "=_", "In", "Port_", "(_", "sha", "mt", "\\u", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "inou", "t", "\\u", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Shi", "fte", "r_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "s_", "._", "combinat", "ional", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "comb", "\\u", "logic_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "out_", "._", "v_", "=_", "s_", "._", "in\\u_", "<<_", "s_", "._", "sha", "mt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Const", "ant", "Module_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Const", "ant", "Module_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ela", "bora", "te", "\\u", "logic_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "shift_", "=_", "m_", "=_", "Shi", "fte", "r_", "(_", "8_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect", "\\u", "dict_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "in\\u_", ":_", "s_", "._", "in\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "sha", "mt_", ":_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "._", "out_", ":_", "s_", "._", "out_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "Stru", "ct", "Global_", "(_", "Bit", "Stru", "ct", "Definition_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "src", "\\u", "nbi", "ts_", ",_", "dest", "\\u", "nbi", "ts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "src_", "=_", "Bit", "Field_", "(_", "src", "\\u", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "dest_", "=_", "Bit", "Field_", "(_", "dest", "\\u", "nbi", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "Stru", "ct", "Connect_", "(_", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "s_", ",_", "Msg", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "._", "in\\u_", "=_", "In", "Port_", "(_", "Msg", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "out_", "=_", "Out", "Port_", "(_", "Msg", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "connect_", "(_", "s_", "._", "in\\u_", "._", "src_", ",_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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
Impactstory/total-impact-core/totalimpact/providers/bibjson.py
[ { "content": "from StringIO import StringIO\nimport json, re\n\nfrom totalimpact.providers import provider\nfrom totalimpact.providers.provider import Provider, ProviderContentMalformedError, ProviderTimeout, ProviderServerError\nfrom totalimpact import unicode_helpers \n\nimport logging\nlogger = logging.getLogger('ti.providers.bibjson')\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Bibjson(Provider): \n\n example_id = None\n\n url = \"\"\n descr = \"\"\n\n\n\n\n\n", "metadata": "root.Bibjson", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def _to_unicode(self, text):\n text = unicode_helpers.to_unicode_or_bust(text)\n return text", "metadata": "root.Bibjson._to_unicode", "header": "['class', 'Bibjson', '(', 'Provider', ')', ':', '___EOS___']", "index": 18 }, { "content": " def parse(self, bibjson_list):\n ret = []\n for bibjson_entry in bibjson_list:\n full_entry = bibjson_entry\n try:\n full_entry[\"authors\"] = self._to_unicode(re.sub(\", \\d+\", \"\", full_entry[\"marker\"]))\n except (KeyError, AttributeError):\n full_entry[\"authors\"] = \"\"\n\n try:\n full_entry[\"first_author\"] = self._to_unicode(full_entry[\"marker\"].split(\",\")[0])\n except (KeyError, AttributeError):\n full_entry[\"first_author\"] = \"\"\n\n try:\n pages = full_entry[\"pages\"]\n full_entry[\"first_page\"] = pages.split(\"--\")[0]\n except KeyError:\n full_entry[\"first_page\"] = \"\"\n\n try:\n full_entry[\"title\"] = full_entry[\"booktitle\"]\n except (KeyError, AttributeError):\n pass\n\n ret.append(full_entry)\n\n return ret", "metadata": "root.Bibjson.parse", "header": "['class', 'Bibjson', '(', 'Provider', ')', ':', '___EOS___']", "index": 23 }, { "content": " def member_items(self, bibjson_contents, cache_enabled=True):\n logger.debug(u\"%20s getting member_items for bibjson\" % (self.provider_name))\n\n parsed_bibjson = self.parse(bibjson_contents)\n\n aliases = [(\"biblio\", entry) for entry in parsed_bibjson]\n\n return(aliases)", "metadata": "root.Bibjson.member_items", "header": "['class', 'Bibjson', '(', 'Provider', ')', ':', '___EOS___']", "index": 54 } ]
[ { "span": "from StringIO import StringIO", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 29 }, { "span": "import json, re", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from totalimpact.providers import provider", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 42 }, { "span": "from totalimpact.providers.provider import Provider, ProviderContentMalformedError, ProviderTimeout, ProviderServerError", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 120 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", ",_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "import_", "provider_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "._", "provider_", "import_", "Provider_", ",_", "Provider", "Conten", "t", "Mal", "formed", "Error_", ",_", "Provider", "Timeout_", ",_", "Provider", "Server", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "_", "import_", "unicode", "\\u", "helpers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "ti", ".", "provide", "rs", ".", "bib", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Bi", "bj", "son_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "example", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descr_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bi", "bj", "son_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "to", "\\u", "unicode_", "(_", "self_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "unicode", "\\u", "helpers_", "._", "to", "\\u", "unicode", "\\u", "or", "\\u", "bust", "_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bi", "bj", "son_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "bib", "json", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bib", "json", "\\u", "entry_", "in_", "bib", "json", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "entry_", "=_", "bib", "json", "\\u", "entry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "entry_", "[_", "\"", "author", "s", "\"_", "]_", "=_", "self_", "._", "\\u", "to", "\\u", "unicode_", "(_", "re_", "._", "sub_", "(_", "\",", " ", "\\\\", "d", "+\"_", ",_", "\"\"_", ",_", "full", "\\u", "entry_", "[_", "\"", "marker", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Key", "Error_", ",_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "entry_", "[_", "\"", "author", "s", "\"_", "]_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "entry_", "[_", "\"", "first", "\\u", "author", "\"_", "]_", "=_", "self_", "._", "\\u", "to", "\\u", "unicode_", "(_", "full", "\\u", "entry_", "[_", "\"", "marker", "\"_", "]_", "._", "split_", "(_", "\",\"_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Key", "Error_", ",_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "entry_", "[_", "\"", "first", "\\u", "author", "\"_", "]_", "=_", "\"\"_", "\\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 ", " _", "pages_", "=_", "full", "\\u", "entry_", "[_", "\"", "page", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "\\u", "entry_", "[_", "\"", "first", "\\u", "page", "\"_", "]_", "=_", "pages_", "._", "split_", "(_", "\"--\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "entry_", "[_", "\"", "first", "\\u", "page", "\"_", "]_", "=_", "\"\"_", "\\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 ", " _", "full", "\\u", "entry_", "[_", "\"", "title", "\"_", "]_", "=_", "full", "\\u", "entry_", "[_", "\"", "book", "title", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Key", "Error_", ",_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "._", "append_", "(_", "full", "\\u", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bi", "bj", "son_", "(_", "Provider_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "member", "\\u", "items_", "(_", "self_", ",_", "bib", "json", "\\u", "contents_", ",_", "cache", "\\u", "enabled_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "u", "\"%", "20", "s", " ", "getti", "ng", " ", "member", "\\u", "items", " ", "for", " ", "bib", "json", "\"_", "%_", "(_", "self_", "._", "provide", "r", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parsed", "\\u", "bib", "json_", "=_", "self_", "._", "parse_", "(_", "bib", "json", "\\u", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aliases_", "=_", "[_", "(_", "\"", "biblio", "\"_", ",_", "entry_", ")_", "for_", "entry_", "in_", "parsed", "\\u", "bib", "json_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "aliases_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 2, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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er/comicstreamerlib/server.py
[ { "content": " def validateAPIKey(self):\n if self.application.config['security']['use_api_key']:\n api_key = self.get_argument(u\"api_key\", default=\"\")\n if api_key == self.application.config['security']['api_key']:\n return True\n else:\n raise tornado.web.HTTPError(400)\n return False", "metadata": "root.GenericAPIHandler.validateAPIKey", "header": "['class', 'GenericAPIHandler', '(', 'BaseHandler', ')', ':', '___EOS___']", "index": 86 } ]
[ { "span": "return False", "start_line": 93, "start_column": 16, "end_line": 93, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Gene", "ric", "API", "Handler_", "(_", "Base", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "validat", "e", "API", "Key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "application_", "._", "config_", "[_", "'", "security", "'_", "]_", "[_", "'", "use", "\\u", "api", "\\u", "key", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "api", "\\u", "key_", "=_", "self_", "._", "get", "\\u", "argument_", "(_", "u", "\"", "api", "\\u", "key", "\"_", ",_", "default_", "=_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "api", "\\u", "key_", "==_", "self_", "._", "application_", "._", "config_", "[_", "'", "security", "'_", "]_", "[_", "'", "api", "\\u", "key", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "tornado_", "._", "web_", "._", "HTTP", "Error_", "(_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unnecessary pass
hwaf/hwaf/py-hwaftools/find_clhep.py
[ { "content": "@conf\ndef find_clhep(ctx, **kwargs):\n \n if not ctx.env.HWAF_FOUND_C_COMPILER:\n ctx.fatal('load a C compiler first')\n pass\n\n if not ctx.env.HWAF_FOUND_CXX_COMPILER:\n ctx.fatal('load a C++ compiler first')\n pass\n\n\n # find CLHEP\n clhep_cfg = \"clhep-config\"\n path_list = waflib.Utils.to_list(kwargs.get('path_list', []))\n if getattr(ctx.options, 'with_clhep', None):\n topdir = ctx.options.with_clhep\n topdir = ctx.hwaf_subst_vars(topdir)\n clhep_cfg = osp.abspath(osp.join(topdir, \"bin\", \"clhep-config\"))\n path_list.append(osp.join(topdir, \"bin\"))\n pass\n kwargs['path_list']=path_list\n \n ctx.find_program(\n clhep_cfg, \n var='CLHEP-CONFIG',\n **kwargs)\n clhep_cfg = ctx.env['CLHEP-CONFIG']\n\n ctx.check_with(\n ctx.check_cfg,\n \"clhep\",\n path=clhep_cfg,\n package=\"\",\n uselib_store=\"CLHEP\",\n args='--include --libs --ldflags',\n **kwargs)\n\n clhep_libs = '''\\\n CLHEP-Cast\n CLHEP-Evaluator\n CLHEP-Exceptions\n CLHEP-GenericFunctions\n CLHEP-Geometry\n CLHEP-Matrix\n CLHEP-Random\n CLHEP-RandomObjects\n CLHEP-RefCount\n CLHEP-Vector\n '''\n\n for lib in clhep_libs.split():\n libname = lib.strip()\n for n in ('INCLUDES',\n 'LIBPATH',\n 'LINKFLAGS'):\n k = '%s_CLHEP'%n\n ctx.env[k] = [ \n # sanitize paths\n p.replace(\"'\", \"\").replace('\"', '')\n for p in ctx.env[k] \n ]\n ctx.env['%s_%s'%(n,libname)] = ctx.env[k][:]\n # massage -lCLHEP-$(version)\n # into -lCLHEP-$(sublib)-$(version)\n ctx.env['LIB_%s'%libname] = [l.replace('CLHEP',libname)\n for l in ctx.env['LIB_CLHEP']]\n pass\n\n version = ctx.check_cxx(\n msg=\"Checking clhep version\",\n okmsg=\"ok\",\n fragment='''\\\n #include \"CLHEP/ClhepVersion.h\"\n #include <iostream>\n\n int main(int argc, char* argv[]) {\n std::cout << CLHEP::Version::String();\n return 0;\n }\n ''',\n use=\"CLHEP\",\n define_name = \"HWAF_CLHEP_VERSION\",\n define_ret = True,\n execute = True,\n mandatory=True,\n )\n ctx.start_msg(\"clhep version\")\n ctx.end_msg(version)\n\n ctx.env.CLHEP_VERSION = version\n ctx.env.HWAF_FOUND_CLHEP = 1\n return", "metadata": "root.find_clhep", "header": "['module', '___EOS___']", "index": 26 } ]
[ { "span": "pass", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 12 }, { "span": "pass", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 12 }, { "span": "pass", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 12 }, { "span": "pass", "start_line": 93, "start_column": 8, "end_line": 93, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find", "\\u", "cl", "hep", "_", "(_", "ctx_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "C", "\\u", "COMPILER", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "CXX", "\\u", "COMPILER", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", "++", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "CL", "HE", "P_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", "=_", "\"", "cl", "hep", "-", "config", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "list_", "=_", "waf", "lib_", "._", "Utils_", "._", "to", "\\u", "list_", "(_", "kwargs_", "._", "get_", "(_", "'", "path", "\\u", "list", "'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "getattr_", "(_", "ctx_", "._", "options_", ",_", "'", "with", "\\u", "cl", "hep", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topdi", "r_", "=_", "ctx_", "._", "options_", "._", "with", "\\u", "cl", "hep", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "topdi", "r_", "=_", "ctx_", "._", "hwa", "f", "\\u", "subst", "\\u", "vars_", "(_", "topdi", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", "=_", "osp_", "._", "abspath_", "(_", "osp_", "._", "join_", "(_", "topdi", "r_", ",_", "\"", "bin", "\"_", ",_", "\"", "cl", "hep", "-", "config", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "list_", "._", "append_", "(_", "osp_", "._", "join_", "(_", "topdi", "r_", ",_", "\"", "bin", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "path", "\\u", "list", "'_", "]_", "=_", "path", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "find", "\\u", "program_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "var_", "=_", "'", "CL", "HE", "P", "-", "CONFIG", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", "=_", "ctx_", "._", "env_", "[_", "'", "CL", "HE", "P", "-", "CONFIG", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "check", "\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "check", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cl", "hep", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "cl", "hep", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package_", "=_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "usel", "ib", "\\u", "store_", "=_", "\"", "CL", "HE", "P", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "'--", "include", " ", "--", "libs", " ", "--", "ldf", "lags", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cl", "hep", "\\u", "libs_", "=_", "'''", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Cast", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Eval", "uator", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Except", "ion", "s", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Gene", "ric", "Function", "s", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Geometr", "y", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Matrix", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Random", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Random", "Object", "s", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Ref", "Count", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Vector", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "lib_", "in_", "cl", "hep", "\\u", "libs_", "._", "split_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "libname", "_", "=_", "lib_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "(_", "'", "INCLUDE", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LIB", "PATH", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "'%", "s", "\\u", "CL", "HE", "P", "'_", "%_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "k_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sanitize", " ", "paths_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "replace_", "(_", "\"'\"_", ",_", "\"\"_", ")_", "._", "replace_", "(_", "'\"'_", ",_", "''_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "p_", "in_", "ctx_", "._", "env_", "[_", "k_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "'%", "s", "\\u", "%", "s", "'_", "%_", "(_", "n_", ",_", "libname", "_", ")_", "]_", "=_", "ctx_", "._", "env_", "[_", "k_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mass", "age", " ", "-", "l", "CL", "HE", "P", "-", "$(", "version", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "int", "o", " ", "-", "l", "CL", "HE", "P", "-", "$(", "subli", "b", ")-", "$(", "version", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "[_", "'", "LIB", "\\u", "%", "s", "'_", "%_", "libname", "_", "]_", "=_", "[_", "l_", "._", "replace_", "(_", "'", "CL", "HE", "P", "'_", ",_", "libname", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "l_", "in_", "ctx_", "._", "env_", "[_", "'", "LIB", "\\u", "CL", "HE", "P", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "version_", "=_", "ctx_", "._", "check", "\\u", "cxx", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Check", "ing", " ", "cl", "hep", " ", "version", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ok", "msg_", "=_", "\"", "ok", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "=_", "'''", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "#", "include", " ", "\"", "CL", "HE", "P", "/", "Cl", "hep", "Version", ".", "h", "\"", "\\", "10", ";", " ", " ", " ", " ", "#", "include", " ", "<", "ios", "tream", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "int", " ", "main", "(", "int", " ", "argc", ",", " ", "char", "*", " ", "argv", "[]", ")", " ", "{", "\\", "10", ";", " ", " ", "std", "::", "cout", " ", "<<", " ", "CL", "HE", "P", "::", "Version", "::", "String", "();", "\\", "10", ";", " ", " ", "return", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use_", "=_", "\"", "CL", "HE", "P", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defin", "e\\u", "name_", "=_", "\"", "HW", "AF", "\\u", "CL", "HE", "P", "\\u", "VERSI", "ON", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defin", "e\\u", "ret_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "execute_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "start", "\\u", "msg_", "(_", "\"", "cl", "hep", " ", "version", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "end", "\\u", "msg_", "(_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "CL", "HE", "P", "\\u", "VERSION_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "CL", "HE", "P_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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 ]
Unused import
dongying/dear/dear/spectrum/auditory.py
[ { "content": "#-*- coding: utf-8 -*-\n\nfrom _base import *\nfrom cqt import CNTPowerSpectrum, A0, A1, A2, C8, A8\nimport numpy as np \nimport scipy.signal as sig\n\ninf = float('inf')\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class GammatoneSpectrum(SpectrumBase):\n\n\n\n", "metadata": "root.GammatoneSpectrum", "header": "['module', '___EOS___']", "index": 10 }, { "content": " @staticmethod\n def erb_space(N, freq_base, freq_max):\n EarQ = 9.26449\n minBW = 24.7\n qw = EarQ * minBW\n arr = np.arange(1., N+1, 1., dtype=np.double)\n f_cents = np.exp(arr*(np.log(freq_base+qw)-np.log(freq_max+qw))/N)\\\n * (freq_max+qw) - qw\n return f_cents ", "metadata": "root.GammatoneSpectrum.erb_space", "header": "['class', 'GammatoneSpectrum', '(', 'SpectrumBase', ')', ':', '___EOS___']", "index": 12 }, { "content": " @staticmethod\n def make_erb_filter_coeffiences(samplerate, N=64, freq_base=A2, freq_max=C8):\n fc = GammatoneSpectrum.erb_space(N, freq_base, freq_max)\n #\n pi = np.pi\n sin = np.sin\n cos = np.cos\n exp = np.exp\n sqrt = np.sqrt\n #\n EarQ = 9.26449\n minBW = 24.7\n order = 1.\n #ERB = ((fc/EarQ)**order + minBW**order) ** (1./order)\n ERB = 0.108*fc + minBW\n BW = 1.019*2*pi*ERB\n #\n T = 1./samplerate\n fct = np.flipud(fc*T)\n bwt = np.flipud(BW*T)\n a0 = T\n a2 = 0\n b0 = 1\n b1 = -2*cos(2*pi*fct) / exp(bwt)\n b2 = exp(-2*bwt)\n a11 = -(2*T*cos(2*pi*fct)/exp(bwt)+2*T*sqrt(3+2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2\n a12 = -(2*T*cos(2*pi*fct)/exp(bwt)-2*T*sqrt(3+2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2\n a13 = -(2*T*cos(2*pi*fct)/exp(bwt)+2*T*sqrt(3-2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2\n a14 = -(2*T*cos(2*pi*fct)/exp(bwt)-2*T*sqrt(3-2**1.5)*sin(2*pi*fct)/exp(bwt)) / 2\n gain = np.abs(\n (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) - sqrt(3-2**1.5)*sin(2*pi*fct)))\\\n * (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) + sqrt(3-2**1.5)*sin(2*pi*fct)))\\\n * (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) - sqrt(3+2**1.5)*sin(2*pi*fct)))\\\n * (-2*exp(4j*pi*fct)*T + 2*exp(2j*pi*fct-bwt)*T*(cos(2*pi*fct) + sqrt(3+2**1.5)*sin(2*pi*fct)))\\\n / (-2/exp(2*bwt) - 2*exp(4j*pi*fct) + 2*(1+exp(4j*pi*fct))/exp(bwt)) ** 4)\n #\n #return a0,a11,a12,a13,a14,a2,b0,b1,b2,gain\n coeffies = np.zeros((5, N, 3))\n coeffies[0][...,0], coeffies[0][...,1], coeffies[0][...,2] = b0, b1, b2\n coeffies[1:,:,0], coeffies[1:,:,2] = a0, a2\n for i,p1 in enumerate([a11,a12,a13,a14]):\n coeffies[i+1,:,1] = p1\n coeffies[1,:,[0,1,2]] /= gain\n return coeffies", "metadata": "root.GammatoneSpectrum.make_erb_filter_coeffiences", "header": "['class', 'GammatoneSpectrum', '(', 'SpectrumBase', ')', ':', '___EOS___']", "index": 22 }, { "content": " @staticmethod\n def filter(samples, coefficiences, zi=None):\n n_filters = coefficiences.shape[1]\n if zi is None:\n zi = np.zeros((4, n_filters, coefficiences.shape[-1]-1))\n mtx = numpy.zeros((len(samples), n_filters))\n #\n for i in range(n_filters):\n b = coefficiences[0,i]\n a1, a2, a3, a4 = coefficiences[1:,i]\n s1, zi[0,i] = sig.lfilter(a1,b,samples,zi=zi[0,i])\n s2, zi[1,i] = sig.lfilter(a2,b,s1,zi=zi[1,i])\n s3, zi[2,i] = sig.lfilter(a3,b,s2,zi=zi[2,i])\n s4, zi[3,i] = sig.lfilter(a4,b,s3,zi=zi[3,i])\n #print s1,s2,s3,s4\n mtx[...,i] = s4\n return mtx, zi", "metadata": "root.GammatoneSpectrum.filter", "header": "['class', 'GammatoneSpectrum', '(', 'SpectrumBase', ')', ':', '___EOS___']", "index": 67 }, { "content": " def walk(self, N=64, freq_base=A2, freq_max=C8, start=0, end=None, each=True, combine=False, twin=0.020, thop=0.010):\n ''''''\n N = int(N)\n assert N > 0\n #\n samplerate = self.audio.samplerate\n assert 1 <= freq_base <= freq_max <= samplerate/2.0\n #\n #step = int(2**np.ceil(np.log2(float(samplerate) / N)))\n step = 1024\n win = step\n assert 0 < step <= win\n #\n coeffies = self.make_erb_filter_coeffiences(samplerate, N, freq_base, freq_max)\n zi = None\n #\n cstep = int(np.ceil(thop*samplerate))\n cwin = int(np.ceil(twin*samplerate))\n Y = np.zeros((0,N))\n if combine:\n assert 0 < thop <= twin\n assert 0 < cstep <= cwin\n #\n for samples in self.audio.walk(win, step, start, end, join_channels=True):\n y, zi = self.filter(samples, coeffies, zi)\n if not combine:\n if each:\n for frame in y: yield frame\n else:\n yield y\n else:\n Y = np.append(Y, y, 0)\n while Y.shape[0] >= cwin:\n wf, Y = Y[:cwin], Y[cstep:]\n yield np.sqrt(np.mean(np.square(wf), 0))\n if combine and Y.shape[0] > 0:\n yield np.sqrt(np.mean(np.square(Y), 0))", "metadata": "root.GammatoneSpectrum.walk", "header": "['class', 'GammatoneSpectrum', '(', 'SpectrumBase', ')', ':', '___EOS___']", "index": 85 }, { "content": "class Y1(GammatoneSpectrum):\n pass", "metadata": "root.Y1", "header": "['module', '___EOS___']", "index": 124 }, { "content": "class Y2(Y1):\n \n", "metadata": "root.Y2", "header": "['module', '___EOS___']", "index": 128 }, { "content": " @staticmethod\n def g(y, gamma=10):\n if not gamma or gamma >= inf:\n return 0.5\n return 1./(1+np.exp(-gamma*y)) - 0.5", "metadata": "root.Y2.g", "header": "['class', 'Y2', '(', 'Y1', ')', ':', '___EOS___']", "index": 130 }, { "content": " def walk(self, N=64, freq_base=A2, freq_max=C8, start=0, end=None, each=True, combine=False, twin=0.020, thop=0.010, gamma=10, cof=4000):\n ''''''\n samplerate = self.audio.samplerate\n level = 6\n vpre = np.zeros((1,N))\n ncof = min(0.99, float(cof)*2/samplerate)\n b,a = sig.butter(6, ncof)\n zi = np.zeros((N,level))\n cstep = int(np.ceil(thop*samplerate))\n cwin = int(np.ceil(twin*samplerate))\n Y = np.zeros((0,N))\n if combine:\n assert 0 < thop <= twin\n assert 0 < cstep <= cwin\n for y in super(Y2, self).walk(N,freq_base,freq_max,start,end,each=False,combine=False):\n yg = self.g(np.diff(np.append(vpre,y,0),1,0), gamma)\n ygt, zi = sig.lfilter(b, a, yg.T, zi=zi)\n if not combine:\n if each:\n for v in ygt.T: yield v\n else:\n yield ygt.T\n else:\n Y = np.append(Y, ygt.T, 0)\n while Y.shape[0] >= cwin:\n wf, Y = Y[:cwin], Y[cstep:]\n yield np.sqrt(np.mean(np.square(wf), 0))\n if combine and Y.shape[0] > 0:\n yield np.sqrt(np.mean(np.square(Y), 0))", "metadata": "root.Y2.walk", "header": "['class', 'Y2', '(', 'Y1', ')', ':', '___EOS___']", "index": 136 }, { "content": "class Y3(Y2):", "metadata": "root.Y3", "header": "['module', '___EOS___']", "index": 167 }, { "content": " def walk(self, N=64, freq_base=A2, freq_max=C8, start=0, end=None, each=True, combine=False, twin=0.020, thop=0.010, gamma=10, cof=4000):\n samplerate = self.audio.samplerate\n cstep = int(np.ceil(thop*samplerate))\n cwin = int(np.ceil(twin*samplerate))\n Y = np.zeros((0,N))\n if combine:\n assert 0 < thop <= twin\n assert 0 < cstep <= cwin\n for y in super(Y3, self).walk(N,freq_base,freq_max,start,end,each=False,combine=False,gamma=gamma,cof=cof):\n y[...,1:] = np.diff(y,1,1)\n if not combine:\n if each:\n for v in y: yield v\n else:\n yield y\n else:\n Y = np.append(Y, y, 0)\n while Y.shape[0] >= cwin:\n wf, Y = Y[:cwin], Y[cstep:]\n yield np.sqrt(np.mean(np.square(wf), 0))\n if combine and Y.shape[0] > 0:\n yield np.sqrt(np.mean(np.square(Y), 0))", "metadata": "root.Y3.walk", "header": "['class', 'Y3', '(', 'Y2', ')', ':', '___EOS___']", "index": 168 }, { "content": "class Y4(Y3):", "metadata": "root.Y4", "header": "['module', '___EOS___']", "index": 192 }, { "content": " def walk(self, N=64, freq_base=A2, freq_max=C8, start=0, end=None, each=True, combine=False, twin=0.020, thop=0.010, gamma=10, cof=4000):\n ''''''\n samplerate = self.audio.samplerate\n cstep = int(np.ceil(thop*samplerate))\n cwin = int(np.ceil(twin*samplerate))\n Y = np.zeros((0,N))\n if combine:\n assert 0 < thop <= twin\n assert 0 < cstep <= cwin\n #\n for y in super(Y4, self).walk(N,freq_base,freq_max,start,end,each=False,combine=False,gamma=gamma,cof=cof):\n y = np.maximum(0, y)\n if not combine:\n if each:\n for v in y: yield v\n else: yield y\n else:\n Y = np.append(Y, y, 0)\n while Y.shape[0] >= cwin:\n wf, Y = Y[:cwin], Y[cstep:]\n yield np.sqrt(np.mean(np.square(wf), 0))\n if combine and Y.shape[0] > 0:\n yield np.sqrt(np.mean(np.square(Y), 0))", "metadata": "root.Y4.walk", "header": "['class', 'Y4', '(', 'Y3', ')', ':', '___EOS___']", "index": 193 }, { "content": "class Y5(Y4):\n\n\n", "metadata": "root.Y5", "header": "['module', '___EOS___']", "index": 218 }, { "content": " @staticmethod\n def poisson(tinteg, tinv, tconst):\n w = np.arange(0.,tinteg+tinv,tinv,dtype=np.double)\n return np.exp(-np.flipud(w)/tconst)", "metadata": "root.Y5.poisson", "header": "['class', 'Y5', '(', 'Y4', ')', ':', '___EOS___']", "index": 220 }, { "content": " @staticmethod\n def rectangle(tinteg, tinv):\n w = np.ones(int(np.ceil(tinteg/tinv)), dtype=np.double)\n return w", "metadata": "root.Y5.rectangle", "header": "['class', 'Y5', '(', 'Y4', ')', ':', '___EOS___']", "index": 225 }, { "content": " def walk(self, N=64, freq_base=A2, freq_max=C8, start=0, end=None, each=True, combine=False, twin=0.020, thop=0.010, gamma=10, cof=4000, tinteg=0.020, tconst=0.008):\n ''''''\n samplerate = self.audio.samplerate\n tinv = 1./samplerate\n pwin = self.poisson(tinteg, tinv, tconst)\n #pwin = self.rectangle(tinteg, tinv)\n pwin /= len(pwin) # normalization\n lenpre = len(pwin)-1\n ypre = np.zeros((lenpre,N))\n #\n cstep = int(np.ceil(thop*samplerate))\n cwin = int(np.ceil(twin*samplerate))\n Y = np.zeros((0,N))\n if combine:\n assert 0 < thop <= twin\n assert 0 < cstep <= cwin\n #\n for y in super(Y5, self).walk(N,freq_base,freq_max,start,end,each=False,combine=False,gamma=gamma,cof=cof):\n ym = np.append(ypre, y, 0)\n ypre = ym[-lenpre:]\n for i,yband in enumerate(ym.T):\n y[...,i] = np.sqrt(np.convolve(np.square(yband), pwin, 'valid'))\n if not combine:\n if each:\n for v in y: yield v\n else: yield y\n else:\n Y = np.append(Y, y, 0)\n while Y.shape[0] >= cwin:\n wf, Y = Y[:cwin], Y[cstep:]\n yield np.sqrt(np.mean(np.square(wf), 0))\n if combine and Y.shape[0] > 0:\n yield np.sqrt(np.mean(np.square(Y), 0))", "metadata": "root.Y5.walk", "header": "['class', 'Y5', '(', 'Y4', ')', ':', '___EOS___']", "index": 230 } ]
[ { "span": "from cqt import CNTPowerSpectrum, A0, A1, A2, C8, A8", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 52 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#-", "*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "base_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cq", "t_", "import_", "CNT", "Power", "Spectrum_", ",_", "A0_", ",_", "A1_", ",_", "A2_", ",_", "C8", "_", ",_", "A8", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "signal_", "as_", "sig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inf_", "=_", "float_", "(_", "'", "inf", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Gamma", "tone", "Spectrum_", "(_", "Spect", "rum", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Gamma", "tone", "Spectrum_", "(_", "Spect", "rum", "Base_", ")_", ":_", "\\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_", "erb", "\\u", "space_", "(_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Ear", "Q_", "=_", "9.2", "644", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "BW", "_", "=_", "24.", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qw", "_", "=_", "Ear", "Q_", "*_", "min", "BW", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arr_", "=_", "np_", "._", "arange_", "(_", "1._", ",_", "N_", "+_", "1_", ",_", "1._", ",_", "dtype_", "=_", "np_", "._", "double_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "\\u", "cent", "s_", "=_", "np_", "._", "exp_", "(_", "arr_", "*_", "(_", "np_", "._", "log_", "(_", "freq", "\\u", "base_", "+_", "qw", "_", ")_", "-_", "np_", "._", "log_", "(_", "freq", "\\u", "max_", "+_", "qw", "_", ")_", ")_", "/_", "N_", ")_", "*_", "(_", "freq", "\\u", "max_", "+_", "qw", "_", ")_", "-_", "qw", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "f", "\\u", "cent", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gamma", "tone", "Spectrum_", "(_", "Spect", "rum", "Base_", ")_", ":_", "\\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_", "make", "\\u", "erb", "\\u", "filter", "\\u", "coef", "fie", "nces_", "(_", "samplerate", "_", ",_", "N_", "=_", "64_", ",_", "freq", "\\u", "base_", "=_", "A2_", ",_", "freq", "\\u", "max_", "=_", "C8", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fc_", "=_", "Gamma", "tone", "Spectrum_", "._", "erb", "\\u", "space_", "(_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "pi_", "=_", "np_", "._", "pi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sin_", "=_", "np_", "._", "sin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cos_", "=_", "np_", "._", "cos_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp_", "=_", "np_", "._", "exp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sqrt_", "=_", "np_", "._", "sqrt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "Ear", "Q_", "=_", "9.2", "644", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "BW", "_", "=_", "24.", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order_", "=_", "1._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "ER", "B", " ", "=", " ", "((", "fc", "/", "Ear", "Q", ")**", "order", " ", "+", " ", "min", "BW", "**", "order", ")", " ", "**", " ", "(", "1", "./", "order", ")_", "\\u\\u\\uNL\\u\\u\\u_", "ER", "B_", "=_", "0.10", "8_", "*_", "fc_", "+_", "min", "BW", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BW", "_", "=_", "1.01", "9_", "*_", "2_", "*_", "pi_", "*_", "ER", "B_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "T_", "=_", "1._", "/_", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fct", "_", "=_", "np_", "._", "flip", "ud_", "(_", "fc_", "*_", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bw", "t_", "=_", "np_", "._", "flip", "ud_", "(_", "BW", "_", "*_", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a0_", "=_", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b0_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b1_", "=_", "-_", "2_", "*_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b2_", "=_", "exp_", "(_", "-_", "2_", "*_", "bw", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1", "1_", "=_", "-_", "(_", "2_", "*_", "T_", "*_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", "+_", "2_", "*_", "T_", "*_", "sqrt_", "(_", "3_", "+_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1", "2_", "=_", "-_", "(_", "2_", "*_", "T_", "*_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", "-_", "2_", "*_", "T_", "*_", "sqrt_", "(_", "3_", "+_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1", "3_", "=_", "-_", "(_", "2_", "*_", "T_", "*_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", "+_", "2_", "*_", "T_", "*_", "sqrt_", "(_", "3_", "-_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1", "4_", "=_", "-_", "(_", "2_", "*_", "T_", "*_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", "-_", "2_", "*_", "T_", "*_", "sqrt_", "(_", "3_", "-_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gain_", "=_", "np_", "._", "abs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "-_", "2_", "*_", "exp_", "(_", "4j", "_", "*_", "pi_", "*_", "fct", "_", ")_", "*_", "T_", "+_", "2_", "*_", "exp_", "(_", "2j", "_", "*_", "pi_", "*_", "fct", "_", "-_", "bw", "t_", ")_", "*_", "T_", "*_", "(_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "-_", "sqrt_", "(_", "3_", "-_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", ")_", ")_", "*_", "(_", "-_", "2_", "*_", "exp_", "(_", "4j", "_", "*_", "pi_", "*_", "fct", "_", ")_", "*_", "T_", "+_", "2_", "*_", "exp_", "(_", "2j", "_", "*_", "pi_", "*_", "fct", "_", "-_", "bw", "t_", ")_", "*_", "T_", "*_", "(_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "+_", "sqrt_", "(_", "3_", "-_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", ")_", ")_", "*_", "(_", "-_", "2_", "*_", "exp_", "(_", "4j", "_", "*_", "pi_", "*_", "fct", "_", ")_", "*_", "T_", "+_", "2_", "*_", "exp_", "(_", "2j", "_", "*_", "pi_", "*_", "fct", "_", "-_", "bw", "t_", ")_", "*_", "T_", "*_", "(_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "-_", "sqrt_", "(_", "3_", "+_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", ")_", ")_", "*_", "(_", "-_", "2_", "*_", "exp_", "(_", "4j", "_", "*_", "pi_", "*_", "fct", "_", ")_", "*_", "T_", "+_", "2_", "*_", "exp_", "(_", "2j", "_", "*_", "pi_", "*_", "fct", "_", "-_", "bw", "t_", ")_", "*_", "T_", "*_", "(_", "cos_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", "+_", "sqrt_", "(_", "3_", "+_", "2_", "**_", "1.5_", ")_", "*_", "sin_", "(_", "2_", "*_", "pi_", "*_", "fct", "_", ")_", ")_", ")_", "/_", "(_", "-_", "2_", "/_", "exp_", "(_", "2_", "*_", "bw", "t_", ")_", "-_", "2_", "*_", "exp_", "(_", "4j", "_", "*_", "pi_", "*_", "fct", "_", ")_", "+_", "2_", "*_", "(_", "1_", "+_", "exp_", "(_", "4j", "_", "*_", "pi_", "*_", "fct", "_", ")_", ")_", "/_", "exp_", "(_", "bw", "t_", ")_", ")_", "**_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "a0", ",", "a1", "1", ",", "a1", "2", ",", "a1", "3", ",", "a1", "4", ",", "a2", ",", "b0", ",", "b1", ",", "b2", ",", "gain_", "\\u\\u\\uNL\\u\\u\\u_", "coef", "fie", "s_", "=_", "np_", "._", "zeros_", "(_", "(_", "5_", ",_", "N_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coef", "fie", "s_", "[_", "0_", "]_", "[_", "..._", ",_", "0_", "]_", ",_", "coef", "fie", "s_", "[_", "0_", "]_", "[_", "..._", ",_", "1_", "]_", ",_", "coef", "fie", "s_", "[_", "0_", "]_", "[_", "..._", ",_", "2_", "]_", "=_", "b0_", ",_", "b1_", ",_", "b2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coef", "fie", "s_", "[_", "1_", ":_", ",_", ":_", ",_", "0_", "]_", ",_", "coef", "fie", "s_", "[_", "1_", ":_", ",_", ":_", ",_", "2_", "]_", "=_", "a0_", ",_", "a2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "p1_", "in_", "enumerate_", "(_", "[_", "a1", "1_", ",_", "a1", "2_", ",_", "a1", "3_", ",_", "a1", "4_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coef", "fie", "s_", "[_", "i_", "+_", "1_", ",_", ":_", ",_", "1_", "]_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "coef", "fie", "s_", "[_", "1_", ",_", ":_", ",_", "[_", "0_", ",_", "1_", ",_", "2_", "]_", "]_", "/=_", "gain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "coef", "fie", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gamma", "tone", "Spectrum_", "(_", "Spect", "rum", "Base_", ")_", ":_", "\\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_", "filter_", "(_", "samples_", ",_", "coef", "fic", "ien", "ces_", ",_", "zi_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n", "\\u", "filters_", "=_", "coef", "fic", "ien", "ces_", "._", "shape_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "zi_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zi_", "=_", "np_", "._", "zeros_", "(_", "(_", "4_", ",_", "n", "\\u", "filters_", ",_", "coef", "fic", "ien", "ces_", "._", "shape_", "[_", "-_", "1_", "]_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mtx", "_", "=_", "numpy_", "._", "zeros_", "(_", "(_", "len_", "(_", "samples_", ")_", ",_", "n", "\\u", "filters_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n", "\\u", "filters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "coef", "fic", "ien", "ces_", "[_", "0_", ",_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", ",_", "a2_", ",_", "a3_", ",_", "a4_", "=_", "coef", "fic", "ien", "ces_", "[_", "1_", ":_", ",_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", ",_", "zi_", "[_", "0_", ",_", "i_", "]_", "=_", "sig_", "._", "lfil", "ter_", "(_", "a1_", ",_", "b_", ",_", "samples_", ",_", "zi_", "=_", "zi_", "[_", "0_", ",_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", ",_", "zi_", "[_", "1_", ",_", "i_", "]_", "=_", "sig_", "._", "lfil", "ter_", "(_", "a2_", ",_", "b_", ",_", "s1_", ",_", "zi_", "=_", "zi_", "[_", "1_", ",_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s3_", ",_", "zi_", "[_", "2_", ",_", "i_", "]_", "=_", "sig_", "._", "lfil", "ter_", "(_", "a3_", ",_", "b_", ",_", "s2_", ",_", "zi_", "=_", "zi_", "[_", "2_", ",_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s4_", ",_", "zi_", "[_", "3_", ",_", "i_", "]_", "=_", "sig_", "._", "lfil", "ter_", "(_", "a4_", ",_", "b_", ",_", "s3_", ",_", "zi_", "=_", "zi_", "[_", "3_", ",_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "s1", ",", "s2", ",", "s3", ",", "s4_", "\\u\\u\\uNL\\u\\u\\u_", "mtx", "_", "[_", "..._", ",_", "i_", "]_", "=_", "s4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "mtx", "_", ",_", "zi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gamma", "tone", "Spectrum_", "(_", "Spect", "rum", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "walk_", "(_", "self_", ",_", "N_", "=_", "64_", ",_", "freq", "\\u", "base_", "=_", "A2_", ",_", "freq", "\\u", "max_", "=_", "C8", "_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "None_", ",_", "each_", "=_", "True_", ",_", "combine_", "=_", "False_", ",_", "twin", "_", "=_", "0.02", "0_", ",_", "tho", "p_", "=_", "0.010", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "''''''", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "int_", "(_", "N_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "N_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "samplerate", "_", "=_", "self_", "._", "audio_", "._", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "1_", "<=_", "freq", "\\u", "base_", "<=_", "freq", "\\u", "max_", "<=_", "samplerate", "_", "/_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "step", " ", "=", " ", "int", "(", "2", "**", "np", ".", "ceil", "(", "np", ".", "log", "2", "(", "float", "(", "samplerate", ")", " ", "/", " ", "N", ")))", "_", "\\u\\u\\uNL\\u\\u\\u_", "step_", "=_", "1024_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win_", "=_", "step_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<_", "step_", "<=_", "win_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "coef", "fie", "s_", "=_", "self_", "._", "make", "\\u", "erb", "\\u", "filter", "\\u", "coef", "fie", "nces_", "(_", "samplerate", "_", ",_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zi_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "cst", "ep_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "tho", "p_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cw", "in_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "twin", "_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "np_", "._", "zeros_", "(_", "(_", "0_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0_", "<_", "tho", "p_", "<=_", "twin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<_", "cst", "ep_", "<=_", "cw", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "samples_", "in_", "self_", "._", "audio_", "._", "walk_", "(_", "win_", ",_", "step_", ",_", "start_", ",_", "end_", ",_", "join", "\\u", "channels_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", ",_", "zi_", "=_", "self_", "._", "filter_", "(_", "samples_", ",_", "coef", "fie", "s_", ",_", "zi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "each_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "frame_", "in_", "y_", ":_", "yield_", "frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "y_", "\\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 ", " _", "Y_", "=_", "np_", "._", "append_", "(_", "Y_", ",_", "y_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "Y_", "._", "shape_", "[_", "0_", "]_", ">=_", "cw", "in_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wf_", ",_", "Y_", "=_", "Y_", "[_", ":_", "cw", "in_", "]_", ",_", "Y_", "[_", "cst", "ep_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "wf_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "combine_", "and_", "Y_", "._", "shape_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Y1_", "(_", "Gamma", "tone", "Spectrum_", ")_", ":_", "\\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_", "Y2_", "(_", "Y1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Y2_", "(_", "Y1_", ")_", ":_", "\\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_", "g_", "(_", "y_", ",_", "gamma_", "=_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "gamma_", "or_", "gamma_", ">=_", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "1._", "/_", "(_", "1_", "+_", "np_", "._", "exp_", "(_", "-_", "gamma_", "*_", "y_", ")_", ")_", "-_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Y2_", "(_", "Y1_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "walk_", "(_", "self_", ",_", "N_", "=_", "64_", ",_", "freq", "\\u", "base_", "=_", "A2_", ",_", "freq", "\\u", "max_", "=_", "C8", "_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "None_", ",_", "each_", "=_", "True_", ",_", "combine_", "=_", "False_", ",_", "twin", "_", "=_", "0.02", "0_", ",_", "tho", "p_", "=_", "0.010", "_", ",_", "gamma_", "=_", "10_", ",_", "cof", "_", "=_", "4000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "''''''", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samplerate", "_", "=_", "self_", "._", "audio_", "._", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vpr", "e_", "=_", "np_", "._", "zeros_", "(_", "(_", "1_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nco", "f_", "=_", "min_", "(_", "0.99_", ",_", "float_", "(_", "cof", "_", ")_", "*_", "2_", "/_", "samplerate", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", ",_", "a_", "=_", "sig_", "._", "butte", "r_", "(_", "6_", ",_", "nco", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zi_", "=_", "np_", "._", "zeros_", "(_", "(_", "N_", ",_", "level_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cst", "ep_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "tho", "p_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cw", "in_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "twin", "_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "np_", "._", "zeros_", "(_", "(_", "0_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0_", "<_", "tho", "p_", "<=_", "twin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<_", "cst", "ep_", "<=_", "cw", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y_", "in_", "super_", "(_", "Y2_", ",_", "self_", ")_", "._", "walk_", "(_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ",_", "start_", ",_", "end_", ",_", "each_", "=_", "False_", ",_", "combine_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yg", "_", "=_", "self_", "._", "g_", "(_", "np_", "._", "diff_", "(_", "np_", "._", "append_", "(_", "vpr", "e_", ",_", "y_", ",_", "0_", ")_", ",_", "1_", ",_", "0_", ")_", ",_", "gamma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yg", "t_", ",_", "zi_", "=_", "sig_", "._", "lfil", "ter_", "(_", "b_", ",_", "a_", ",_", "yg", "_", "._", "T_", ",_", "zi_", "=_", "zi_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "each_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "v_", "in_", "yg", "t_", "._", "T_", ":_", "yield_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "yg", "t_", "._", "T_", "\\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 ", " _", "Y_", "=_", "np_", "._", "append_", "(_", "Y_", ",_", "yg", "t_", "._", "T_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "Y_", "._", "shape_", "[_", "0_", "]_", ">=_", "cw", "in_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wf_", ",_", "Y_", "=_", "Y_", "[_", ":_", "cw", "in_", "]_", ",_", "Y_", "[_", "cst", "ep_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "wf_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "combine_", "and_", "Y_", "._", "shape_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Y3_", "(_", "Y2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Y3_", "(_", "Y2_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "walk_", "(_", "self_", ",_", "N_", "=_", "64_", ",_", "freq", "\\u", "base_", "=_", "A2_", ",_", "freq", "\\u", "max_", "=_", "C8", "_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "None_", ",_", "each_", "=_", "True_", ",_", "combine_", "=_", "False_", ",_", "twin", "_", "=_", "0.02", "0_", ",_", "tho", "p_", "=_", "0.010", "_", ",_", "gamma_", "=_", "10_", ",_", "cof", "_", "=_", "4000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "samplerate", "_", "=_", "self_", "._", "audio_", "._", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cst", "ep_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "tho", "p_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cw", "in_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "twin", "_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "np_", "._", "zeros_", "(_", "(_", "0_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0_", "<_", "tho", "p_", "<=_", "twin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<_", "cst", "ep_", "<=_", "cw", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y_", "in_", "super_", "(_", "Y3_", ",_", "self_", ")_", "._", "walk_", "(_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ",_", "start_", ",_", "end_", ",_", "each_", "=_", "False_", ",_", "combine_", "=_", "False_", ",_", "gamma_", "=_", "gamma_", ",_", "cof", "_", "=_", "cof", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "[_", "..._", ",_", "1_", ":_", "]_", "=_", "np_", "._", "diff_", "(_", "y_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "each_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "v_", "in_", "y_", ":_", "yield_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "y_", "\\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 ", " _", "Y_", "=_", "np_", "._", "append_", "(_", "Y_", ",_", "y_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "Y_", "._", "shape_", "[_", "0_", "]_", ">=_", "cw", "in_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wf_", ",_", "Y_", "=_", "Y_", "[_", ":_", "cw", "in_", "]_", ",_", "Y_", "[_", "cst", "ep_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "wf_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "combine_", "and_", "Y_", "._", "shape_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Y", "4_", "(_", "Y3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Y", "4_", "(_", "Y3_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "walk_", "(_", "self_", ",_", "N_", "=_", "64_", ",_", "freq", "\\u", "base_", "=_", "A2_", ",_", "freq", "\\u", "max_", "=_", "C8", "_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "None_", ",_", "each_", "=_", "True_", ",_", "combine_", "=_", "False_", ",_", "twin", "_", "=_", "0.02", "0_", ",_", "tho", "p_", "=_", "0.010", "_", ",_", "gamma_", "=_", "10_", ",_", "cof", "_", "=_", "4000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "''''''", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samplerate", "_", "=_", "self_", "._", "audio_", "._", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cst", "ep_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "tho", "p_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cw", "in_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "twin", "_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "np_", "._", "zeros_", "(_", "(_", "0_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0_", "<_", "tho", "p_", "<=_", "twin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<_", "cst", "ep_", "<=_", "cw", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y_", "in_", "super_", "(_", "Y", "4_", ",_", "self_", ")_", "._", "walk_", "(_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ",_", "start_", ",_", "end_", ",_", "each_", "=_", "False_", ",_", "combine_", "=_", "False_", ",_", "gamma_", "=_", "gamma_", ",_", "cof", "_", "=_", "cof", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "=_", "np_", "._", "maximum_", "(_", "0_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "each_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "v_", "in_", "y_", ":_", "yield_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "yield_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Y_", "=_", "np_", "._", "append_", "(_", "Y_", ",_", "y_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "Y_", "._", "shape_", "[_", "0_", "]_", ">=_", "cw", "in_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wf_", ",_", "Y_", "=_", "Y_", "[_", ":_", "cw", "in_", "]_", ",_", "Y_", "[_", "cst", "ep_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "wf_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "combine_", "and_", "Y_", "._", "shape_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Y", "5_", "(_", "Y", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Y", "5_", "(_", "Y", "4_", ")_", ":_", "\\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_", "poisson", "_", "(_", "tint", "eg_", ",_", "tin", "v_", ",_", "tcon", "st_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "np_", "._", "arange_", "(_", "0._", ",_", "tint", "eg_", "+_", "tin", "v_", ",_", "tin", "v_", ",_", "dtype_", "=_", "np_", "._", "double_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "np_", "._", "exp_", "(_", "-_", "np_", "._", "flip", "ud_", "(_", "w_", ")_", "/_", "tcon", "st_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Y", "5_", "(_", "Y", "4_", ")_", ":_", "\\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_", "rectangle_", "(_", "tint", "eg_", ",_", "tin", "v_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "w_", "=_", "np_", "._", "ones_", "(_", "int_", "(_", "np_", "._", "ceil_", "(_", "tint", "eg_", "/_", "tin", "v_", ")_", ")_", ",_", "dtype_", "=_", "np_", "._", "double_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "w_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Y", "5_", "(_", "Y", "4_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "walk_", "(_", "self_", ",_", "N_", "=_", "64_", ",_", "freq", "\\u", "base_", "=_", "A2_", ",_", "freq", "\\u", "max_", "=_", "C8", "_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "None_", ",_", "each_", "=_", "True_", ",_", "combine_", "=_", "False_", ",_", "twin", "_", "=_", "0.02", "0_", ",_", "tho", "p_", "=_", "0.010", "_", ",_", "gamma_", "=_", "10_", ",_", "cof", "_", "=_", "4000_", ",_", "tint", "eg_", "=_", "0.02", "0_", ",_", "tcon", "st_", "=_", "0.008", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "''''''", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "samplerate", "_", "=_", "self_", "._", "audio_", "._", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tin", "v_", "=_", "1._", "/_", "samplerate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pw", "in_", "=_", "self_", "._", "poisson", "_", "(_", "tint", "eg_", ",_", "tin", "v_", ",_", "tcon", "st_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pw", "in", " ", "=", " ", "self", ".", "rectangle", "(", "tint", "eg", ",", " ", "tin", "v", ")_", "\\u\\u\\uNL\\u\\u\\u_", "pw", "in_", "/=_", "len_", "(_", "pw", "in_", ")_", "#", " ", "normalization_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "len", "pre_", "=_", "len_", "(_", "pw", "in_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yp", "re_", "=_", "np_", "._", "zeros_", "(_", "(_", "len", "pre_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "cst", "ep_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "tho", "p_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cw", "in_", "=_", "int_", "(_", "np_", "._", "ceil_", "(_", "twin", "_", "*_", "samplerate", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "np_", "._", "zeros_", "(_", "(_", "0_", ",_", "N_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "0_", "<_", "tho", "p_", "<=_", "twin", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "0_", "<_", "cst", "ep_", "<=_", "cw", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "y_", "in_", "super_", "(_", "Y", "5_", ",_", "self_", ")_", "._", "walk_", "(_", "N_", ",_", "freq", "\\u", "base_", ",_", "freq", "\\u", "max_", ",_", "start_", ",_", "end_", ",_", "each_", "=_", "False_", ",_", "combine_", "=_", "False_", ",_", "gamma_", "=_", "gamma_", ",_", "cof", "_", "=_", "cof", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ym_", "=_", "np_", "._", "append_", "(_", "yp", "re_", ",_", "y_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yp", "re_", "=_", "ym_", "[_", "-_", "len", "pre_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "yb", "and_", "in_", "enumerate_", "(_", "ym_", "._", "T_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "[_", "..._", ",_", "i_", "]_", "=_", "np_", "._", "sqrt_", "(_", "np_", "._", "convolve", "_", "(_", "np_", "._", "square_", "(_", "yb", "and_", ")_", ",_", "pw", "in_", ",_", "'", "valid", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "each_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "v_", "in_", "y_", ":_", "yield_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "yield_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Y_", "=_", "np_", "._", "append_", "(_", "Y_", ",_", "y_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "Y_", "._", "shape_", "[_", "0_", "]_", ">=_", "cw", "in_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wf_", ",_", "Y_", "=_", "Y_", "[_", ":_", "cw", "in_", "]_", ",_", "Y_", "[_", "cst", "ep_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "wf_", ")_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "combine_", "and_", "Y_", "._", "shape_", "[_", "0_", "]_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "np_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "Y_", ")_", ",_", "0_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
wevoteeducation/WeVoteBase/tag/tests.py
[ { "content": "# tag/tests.py\n# Brought to you by We Vote. Be good.\n# -*- coding: UTF-8 -*-\n\nfrom django.test import LiveServerTestCase\nfrom selenium.webdriver.firefox.webdriver import WebDriver\n\nfrom tag.models import Tag\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TagIntegrationTests(LiveServerTestCase):\n\n\n\n # TODO Build out these tests\n # http://www.effectivedjango.com/tutorial/views.html\n # def test_contact_listed(self):\n #\n # # create a test contact\n # Tag.objects.create(first_name='foo', last_name='bar')\n #\n # # make sure it's listed as <first> <last> on the list\n # self.selenium.get('%s%s' % (self.live_server_url, '/'))\n # self.assertEqual(\n # self.selenium.find_elements_by_css_selector('.contact')[0].text,\n # 'foo bar'\n # )\n #\n # def test_add_contact_linked(self):\n #\n # self.selenium.get('%s%s' % (self.live_server_url, '/'))\n # self.assert_(\n # self.selenium.find_element_by_link_text('add contact')\n # )\n #\n # def test_add_contact(self):\n #\n # self.selenium.get('%s%s' % (self.live_server_url, '/'))\n # self.selenium.find_element_by_link_text('add contact').click()\n #\n # self.selenium.find_element_by_id('id_first_name').send_keys('test')\n # self.selenium.find_element_by_id('id_last_name').send_keys('contact')\n # self.selenium.find_element_by_id('id_email').send_keys('test@example.com')\n #\n # self.selenium.find_element_by_id(\"save_contact\").click()\n # self.assertEqual(\n # self.selenium.find_elements_by_css_selector('.contact')[-1].text,\n # 'test contact'\n # )", "metadata": "root.TagIntegrationTests", "header": "['module', '___EOS___']", "index": 10 }, { "content": " @classmethod\n def setUpClass(cls):\n cls.selenium = WebDriver()\n super(TagIntegrationTests, cls).setUpClass()", "metadata": "root.TagIntegrationTests.setUpClass", "header": "['class', 'TagIntegrationTests', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 12 }, { "content": " @classmethod\n def tearDownClass(cls):\n cls.selenium.quit()\n super(TagIntegrationTests, cls).tearDownClass()", "metadata": "root.TagIntegrationTests.tearDownClass", "header": "['class', 'TagIntegrationTests', '(', 'LiveServerTestCase', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "from tag.models import Tag", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "tag", "/", "tests", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bro", "ugh", "t", " ", "to", " ", "you", " ", "by", " ", "We", " ", "Vote", ".", " ", "Be", " ", "good", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "UT", "F", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Live", "Server", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "selenium_", "._", "webdriver_", "._", "firefox", "_", "._", "webdriver_", "import_", "Web", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tag_", "._", "models_", "import_", "Tag_", "\\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_", "Ta", "g", "Integrati", "on", "Tests_", "(_", "Live", "Server", "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_", "#", " ", "TOD", "O", " ", "Build", " ", "out", " ", "these", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "effective", "django", ".", "com", "/", "tutorial", "/", "views", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "contact", "\\u", "liste", "d", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "create", " ", "a", " ", "test", " ", "contact_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ta", "g", ".", "object", "s", ".", "create", "(", "first", "\\u", "name", "='", "foo", "',", " ", "last", "\\u", "name", "='", "bar", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "make", " ", "sure", " ", "it", "'", "s", " ", "liste", "d", " ", "as", " ", "<", "first", ">", " ", "<", "last", ">", " ", "on", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "get", "('", "%", "s", "%", "s", "'", " ", "%", " ", "(", "self", ".", "live", "\\u", "server", "\\u", "url", ",", " ", "'/'", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "Equal", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "s", "\\u", "by", "\\u", "css", "\\u", "select", "or", "('.", "contact", "')", "[", "0", "].", "text", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "foo", " ", "bar", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "add", "\\u", "contact", "\\u", "linked", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "get", "('", "%", "s", "%", "s", "'", " ", "%", " ", "(", "self", ".", "live", "\\u", "server", "\\u", "url", ",", " ", "'/'", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "\\u(", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "\\u", "by", "\\u", "link", "\\u", "text", "('", "add", " ", "contact", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "test\\u", "add", "\\u", "contact", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "get", "('", "%", "s", "%", "s", "'", " ", "%", " ", "(", "self", ".", "live", "\\u", "server", "\\u", "url", ",", " ", "'/'", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "\\u", "by", "\\u", "link", "\\u", "text", "('", "add", " ", "contact", "')", ".", "click", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "\\u", "by", "\\u", "id", "('", "id", "\\u", "first", "\\u", "name", "')", ".", "send", "\\u", "keys", "('", "test", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "\\u", "by", "\\u", "id", "('", "id", "\\u", "last", "\\u", "name", "')", ".", "send", "\\u", "keys", "('", "contact", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "\\u", "by", "\\u", "id", "('", "id", "\\u", "email", "')", ".", "send", "\\u", "keys", "('", "test", "@", "example", ".", "com", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "\\u", "by", "\\u", "id", "(\"", "save", "\\u", "contact", "\")", ".", "click", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "assert", "Equal", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".", "sele", "niu", "m", ".", "find", "\\u", "element", "s", "\\u", "by", "\\u", "css", "\\u", "select", "or", "('.", "contact", "')", "[-", "1", "].", "text", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "test", " ", "contact", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ta", "g", "Integrati", "on", "Tests_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set", "Up", "Class_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "selenium_", "=_", "Web", "Driver_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Ta", "g", "Integrati", "on", "Tests_", ",_", "cls_", ")_", "._", "set", "Up", "Class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ta", "g", "Integrati", "on", "Tests_", "(_", "Live", "Server", "Test", "Case_", ")_", ":_", "\\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_", "tear", "Down", "Class_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "selenium_", "._", "quit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Ta", "g", "Integrati", "on", "Tests_", ",_", "cls_", ")_", "._", "tear", "Down", "Class_", "(_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
argoroots/Entu/app/main/db.py
[ { "content": " def set_mongodb_entity(self, entity_id):\n sql = \"\"\"\n SELECT\n REPLACE(REPLACE(e.entity_definition_keyname, '_', '-'), '.', '-') AS entity_definition,\n e.id AS entity_id,\n e.sharing AS entity_sharing,\n e.created AS entity_created,\n IF(CAST(e.created_by AS UNSIGNED) > 0, CAST(e.created_by AS UNSIGNED), NULL) AS entity_created_by,\n e.changed AS entity_changed,\n IF(CAST(e.changed_by AS UNSIGNED) > 0, CAST(e.changed_by AS UNSIGNED), NULL) AS entity_changed_by,\n e.deleted AS entity_deleted,\n IF(CAST(e.deleted_by AS UNSIGNED) > 0, CAST(e.deleted_by AS UNSIGNED), NULL) AS entity_deleted_by,\n e.is_deleted AS entity_is_deleted,\n e.old_id AS entity_old_id\n FROM\n entity AS e\n WHERE e.id = %s\n LIMIT 1;\n \"\"\"\n\n r = self.db_get(sql, entity_id)\n\n mysql_id = r.get('entity_id')\n\n e = {}\n e['_mid'] = mysql_id\n e['_definition'] = r.get('entity_definition')\n e['_sharing'] = r.get('entity_sharing')\n\n if r.get('entity_created'):\n e.setdefault('_created', {})['at'] = r.get('entity_created')\n if r.get('entity_created_by'):\n e.setdefault('_created', {})['by'] = r.get('entity_created_by')\n if e.get('_created'):\n e['_created']['type'] = 'action'\n e['_created'] = [e.get('_created')]\n\n if r.get('entity_changed'):\n e.setdefault('_changed', {})['at'] = r.get('entity_changed')\n if r.get('entity_changed_by'):\n e.setdefault('_changed', {})['by'] = r.get('entity_changed_by')\n if e.get('_changed'):\n e['_changed']['type'] = 'action'\n e['_changed'] = [e.get('_changed')]\n\n if r.get('entity_is_deleted') and r.get('entity_deleted'):\n e.setdefault('_deleted', {})['at'] = r.get('entity_deleted')\n if r.get('entity_is_deleted') and r.get('entity_deleted_by'):\n e.setdefault('_deleted', {})['by'] = r.get('entity_deleted_by')\n if e.get('_deleted'):\n e['_deleted']['type'] = 'action'\n e['_deleted'] = [e.get('_deleted')]\n\n viewers = self.__get_mongodb_right(mysql_id, ['viewer', 'expander', 'editor', 'owner'])\n if viewers:\n e['_viewer'] = [{'reference': x, 'type': 'reference'} for x in list(set(viewers))]\n\n expanders = self.__get_mongodb_right(mysql_id, ['expander', 'editor', 'owner'])\n if expanders:\n e['_expander'] = [{'reference': x, 'type': 'reference'} for x in list(set(expanders))]\n\n editors = self.__get_mongodb_right(mysql_id, ['editor', 'owner'])\n if editors:\n e['_editor'] = [{'reference': x, 'type': 'reference'} for x in list(set(editors))]\n\n owners = self.__get_mongodb_right(mysql_id, ['owner'])\n if owners:\n e['_owner'] = [{'reference': x, 'type': 'reference'} for x in list(set(owners))]\n\n parent = self.__get_mongodb_parent(entity_id=mysql_id, recursive=False)\n if parent:\n e['_parent'] = [{'reference': x, 'type': 'reference'} for x in list(set(parent))]\n\n ancestor = self.__get_mongodb_parent(entity_id=mysql_id, recursive=True)\n if ancestor:\n e['_ancestor'] = [{'reference': x, 'type': 'reference'} for x in list(set(ancestor))]\n\n sql = \"\"\"\n SELECT\n p.id AS property_id,\n REPLACE(REPLACE(pd.dataproperty, '-', '_'), '.', '_') AS property_dataproperty,\n pd.datatype AS property_datatype,\n pd.formula AS property_formula,\n pd.search AS property_search,\n IF(pd.multilingual = 1, IF(p.language = 'english', 'en', 'et'), NULL) AS property_language,\n TRIM(p.value_formula) AS value_formula,\n TRIM(p.value_string) AS value_string,\n TRIM(p.value_text) AS value_text,\n TRIM(p.value_display) AS value_display,\n p.value_integer,\n p.value_decimal,\n p.value_boolean,\n p.value_datetime,\n p.value_reference,\n p.value_file,\n IF(pd.datatype = 'file', (SELECT s3_key FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_s3,\n IF(pd.datatype = 'file', (SELECT md5 FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_md5,\n IF(pd.datatype = 'file', (SELECT filename FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_name,\n IF(pd.datatype = 'file', (SELECT filesize FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_size,\n IF(pd.datatype = 'file', (SELECT url FROM file WHERE id = p.value_file AND deleted IS NULL LIMIT 1), NULL) AS value_file_url,\n p.value_counter,\n p.created,\n IF(CAST(p.created_by AS UNSIGNED) > 0, CAST(p.created_by AS UNSIGNED), NULL) AS created_by,\n p.is_deleted,\n p.deleted,\n IF(CAST(p.deleted_by AS UNSIGNED) > 0, CAST(p.deleted_by AS UNSIGNED), NULL) AS deleted_by\n FROM\n property AS p,\n property_definition AS pd\n WHERE pd.keyname = p.property_definition_keyname\n AND p.entity_id = %s\n AND p.is_deleted = 0\n AND pd.dataproperty NOT IN ('entu-changed-by', 'entu-changed-at', 'entu-created-by', 'entu-created-at')\n AND pd.dataproperty NOT LIKE 'auth_%%'\n AND pd.datatype NOT IN ('counter')\n AND pd.formula = 0;\n \"\"\"\n\n properties = {}\n for r2 in self.db_query(sql, mysql_id):\n value = {}\n\n if r2.get('property_datatype') == 'string' and r2.get('value_string'):\n value['value'] = r2.get('value_string')\n elif r2.get('property_datatype') == 'text' and r2.get('value_text'):\n value['value'] = r2.get('value_text')\n elif r2.get('property_datatype') == 'integer' and r2.get('value_integer') != None:\n value['value'] = r2.get('value_integer')\n elif r2.get('property_datatype') == 'decimal' and r2.get('value_decimal') != None:\n value['value'] = float(r2.get('value_decimal'))\n elif r2.get('property_datatype') == 'boolean' and r2.get('value_boolean') != None:\n value['value'] = bool(r2.get('value_boolean'))\n elif r2.get('property_datatype') in ['date', 'datetime'] and r2.get('value_datetime') != None:\n value['value'] = r2.get('value_datetime')\n elif r2.get('property_datatype') == 'reference' and r2.get('value_reference'):\n value['reference'] = r2.get('value_reference')\n elif r2.get('property_datatype') == 'counter-value' and r2.get('value_string'):\n value['value'] = r2.get('value_string')\n elif r2.get('property_datatype') == 'file' and r2.get('value_file'):\n value['value'] = r2.get('value_file_name')\n if r2.get('value_file_url'):\n value['url'] = r2.get('file')\n else:\n value['size'] = r2.get('value_file_size')\n if r2.get('value_file_md5', None):\n value['md5'] = r2.get('value_file_md5')\n if r2.get('value_file_s3', None):\n value['s3'] = r2.get('value_file_s3')\n\n if not value:\n continue\n\n value['_mid'] = r2.get('property_id')\n value['type'] = r2.get('property_datatype')\n\n if r2.get('property_language'):\n value['language'] = r2.get('property_language')\n\n # if r2.get('created'):\n # value.setdefault('created', {})['at'] = r2.get('created')\n # if r2.get('created_by'):\n # value.setdefault('created', {})['by'] = r2.get('created_by')\n #\n # if r2.get('is_deleted') and r2.get('deleted'):\n # value.setdefault('deleted', {})['at'] = r2.get('deleted')\n # if r2.get('is_deleted') and r2.get('deleted_by'):\n # value.setdefault('deleted', {})['by'] = r2.get('deleted_by')\n\n e.setdefault(r2.get('property_dataproperty'), []).append(value)\n\n # if r2.get('value_display') and r2.get('property_search') == 1:\n # if r2.get('property_language'):\n # e.setdefault('_search', {}).setdefault(r2.get('property_language'), []).append(r2.get('value_display').lower())\n # else:\n # e.setdefault('_search', {}).setdefault('et', []).append(r2.get('value_display').lower())\n # e.setdefault('_search', {}).setdefault('en', []).append(r2.get('value_display').lower())\n\n # for l in ['et', 'en']:\n # if l in e.get('_search', {}):\n # e['_search'][l] = list(set(e['_search'][l]))\n\n #Create or replace Mongo object\n try:\n mongo_entity_version = self.mongodb().entityVersion.find_one({'_mid': mysql_id}, {'_id': False, '_entity': True})\n if mongo_entity_version:\n e['_entity'] = mongo_entity_version.get('_entity')\n else:\n e['_entity'] = self.mongodb().entity.insert_one({}).inserted_id\n self.mongodb().entityVersion.insert_one(e)\n except Exception, err:\n self.captureException()\n logging.error('MongoDb error: %s - %s' % (err, e))", "metadata": "root.Entity.set_mongodb_entity", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 531 }, { "content": " def get_allowed_parents(self, entity_id):\n \"\"\"\n Returns allowed parent definitions.\n\n \"\"\"\n\n sql = \"\"\"\n SELECT DISTINCT IF(entity_id, (SELECT entity_definition_keyname FROM entity WHERE id = relationship.entity_id LIMIT 1), entity_definition_keyname) AS keyname\n FROM relationship\n WHERE relationship_definition_keyname = 'allowed-child'\n AND related_entity_definition_keyname = (SELECT entity_definition_keyname FROM entity WHERE id = %s LIMIT 1)\n AND is_deleted = 0;\n \"\"\" % entity_id\n # logging.debug(sql)\n result = self.db_query(sql)\n\n defs = []\n for d in self.db_query(sql):\n defs.append({\n 'keyname': d.get('keyname'),\n 'label': self.__get_system_translation(field='label', entity_definition_keyname=d.get('keyname')),\n 'label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=d.get('keyname')),\n 'description': self.__get_system_translation(field='description', entity_definition_keyname=d.get('keyname')),\n 'menugroup': self.__get_system_translation(field='menu', entity_definition_keyname=d.get('keyname')),\n })\n\n return defs", "metadata": "root.Entity.get_allowed_parents", "header": "['class', 'Entity', '(', ')', ':', '___EOS___']", "index": 1872 } ]
[ { "span": "properties ", "start_line": 649, "start_column": 8, "end_line": 649, "end_column": 18 }, { "span": "result ", "start_line": 1886, "start_column": 8, "end_line": 1886, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "mongodb", "\\u", "entity_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "REPLACE", "(", "REPLACE", "(", "e", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ",", " ", "'\\u", "',", " ", "'-'", "),", " ", "'.'", ",", " ", "'-'", ")", " ", "AS", " ", "entity", "\\u", "definit", "ion", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "id", " ", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "shar", "ing", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "shar", "ing", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "created", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "created", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "e", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "e", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "entity", "\\u", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "change", "d", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "change", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "e", ".", "change", "d\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "e", ".", "change", "d\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "entity", "\\u", "change", "d\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "delete", "d", " ", " ", " ", " ", "AS", " ", "entity", "\\u", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "e", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "e", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "entity", "\\u", "delete", "d\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "is", "\\u", "delete", "d", " ", "AS", " ", "entity", "\\u", "is", "\\u", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "old", "\\u", "id", " ", "AS", " ", "entity", "\\u", "old", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "entity", " ", "AS", " ", "e", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "e", ".", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "LIMIT", " ", "1", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "self_", "._", "db", "\\u", "get_", "(_", "sql_", ",_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mysql", "\\u", "id_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "e_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "mid", "'_", "]_", "=_", "mysql", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "definit", "ion", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "definit", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "shar", "ing", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "shar", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "created", "'_", ",_", "{_", "}_", ")_", "[_", "'", "at", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "\\u", "by", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "created", "'_", ",_", "{_", "}_", ")_", "[_", "'", "by", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "created", "\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "get_", "(_", "'\\u", "created", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "created", "'_", "]_", "[_", "'", "type", "'_", "]_", "=_", "'", "action", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "created", "'_", "]_", "=_", "[_", "e_", "._", "get_", "(_", "'\\u", "created", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "change", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "at", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d\\u", "by", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "change", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "by", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "change", "d\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "get_", "(_", "'\\u", "change", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "change", "d", "'_", "]_", "[_", "'", "type", "'_", "]_", "=_", "'", "action", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "change", "d", "'_", "]_", "=_", "[_", "e_", "._", "get_", "(_", "'\\u", "change", "d", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "is", "\\u", "delete", "d", "'_", ")_", "and_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "delete", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "at", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "is", "\\u", "delete", "d", "'_", ")_", "and_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d\\u", "by", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "._", "setdefault_", "(_", "'\\u", "delete", "d", "'_", ",_", "{_", "}_", ")_", "[_", "'", "by", "'_", "]_", "=_", "r_", "._", "get_", "(_", "'", "entity", "\\u", "delete", "d\\u", "by", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "e_", "._", "get_", "(_", "'\\u", "delete", "d", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "delete", "d", "'_", "]_", "[_", "'", "type", "'_", "]_", "=_", "'", "action", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "[_", "'\\u", "delete", "d", "'_", "]_", "=_", "[_", "e_", "._", "get_", "(_", "'\\u", "delete", "d", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "viewer", "s_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "viewer", "'_", ",_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "viewer", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "viewer", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "viewer", "s_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expander", "s_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "expander", "'_", ",_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "expander", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "expander", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "expander", "s_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "editors", "_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "editor", "'_", ",_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "editors", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "editor", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "editors", "_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "owners_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "right_", "(_", "mysql", "\\u", "id_", ",_", "[_", "'", "owner", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "owners_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "owner", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "owners_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parent_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "parent_", "(_", "entity", "\\u", "id_", "=_", "mysql", "\\u", "id_", ",_", "recursive_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "parent", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "parent_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ancestor_", "=_", "self_", "._", "\\u\\u", "get", "\\u", "mongodb", "\\u", "parent_", "(_", "entity", "\\u", "id_", "=_", "mysql", "\\u", "id_", ",_", "recursive_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ancestor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "ancestor", "'_", "]_", "=_", "[_", "{_", "'", "reference", "'_", ":_", "x_", ",_", "'", "type", "'_", ":_", "'", "reference", "'_", "}_", "for_", "x_", "in_", "list_", "(_", "set_", "(_", "ancestor_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "id", " ", " ", "AS", " ", "property", "\\u", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "REPLACE", "(", "REPLACE", "(", "pd", ".", "datapro", "pert", "y", ",", " ", "'-'", ",", " ", "'\\u", "')", ",", " ", "'.'", ",", " ", "'\\u", "')", " ", " ", "AS", " ", "property", "\\u", "datapro", "pert", "y", ",", "\\", "10", ";", " ", " ", " ", " ", "pd", ".", "datatype", " ", " ", " ", " ", " ", "AS", " ", "property", "\\u", "datatype", ",", "\\", "10", ";", " ", " ", " ", " ", "pd", ".", "formula", " ", " ", " ", " ", " ", " ", "AS", " ", "property", "\\u", "formula", ",", "\\", "10", ";", " ", " ", " ", " ", "pd", ".", "search", " ", " ", " ", "AS", " ", "property", "\\u", "search", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "multil", "ingu", "al", " ", "=", " ", "1", ",", " ", "IF", "(", "p", ".", "language", " ", "=", " ", "'", "english", "',", " ", "'", "en", "',", " ", "'", "et", "')", ",", " ", "NULL", ")", " ", "AS", " ", "property", "\\u", "language", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "formula", ")", " ", " ", " ", "AS", " ", "value", "\\u", "formula", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "string", ")", " ", " ", " ", " ", "AS", " ", "value", "\\u", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "text", ")", " ", " ", "AS", " ", "value", "\\u", "text", ",", "\\", "10", ";", " ", " ", " ", " ", "TRI", "M", "(", "p", ".", "value", "\\u", "display", ")", " ", " ", " ", "AS", " ", "value", "\\u", "display", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "boolean", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "datetime", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "reference", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "s3", "\\u", "key", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "s3", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "md5", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "md5", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "filename", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "name", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "files", "ize", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "size", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "pd", ".", "datatype", " ", "=", " ", "'", "file", "',", " ", "(", "SELECT", " ", "url", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "id", " ", "=", " ", "p", ".", "value", "\\u", "file", " ", "AND", " ", "delete", "d", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", "),", " ", "NULL", ")", " ", "AS", " ", "value", "\\u", "file", "\\u", "url", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "value", "\\u", "counter", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "created", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "p", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "p", ".", "created", "\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "created", "\\u", "by", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "is", "\\u", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "p", ".", "delete", "d", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "CAST", "(", "p", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", ")", " ", ">", " ", "0", ",", " ", "CAST", "(", "p", ".", "delete", "d\\u", "by", " ", "AS", " ", "UNSIGNED", "),", " ", "NULL", ")", " ", "AS", " ", "delete", "d\\u", "by", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "property", " ", "AS", " ", "p", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", " ", "AS", " ", "pd", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "pd", ".", "keyn", "ame", " ", "=", " ", "p", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "entity", "\\u", "id", " ", "=", " ", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "p", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "datapro", "pert", "y", " ", "NOT", " ", "IN", " ", "('", "ent", "u", "-", "change", "d", "-", "by", "',", " ", "'", "ent", "u", "-", "change", "d", "-", "at", "',", " ", "'", "ent", "u", "-", "created", "-", "by", "',", " ", "'", "ent", "u", "-", "created", "-", "at", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "datapro", "pert", "y", " ", "NOT", " ", "LI", "KE", " ", "'", "auth", "\\u", "%%'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "datatype", " ", "NOT", " ", "IN", " ", "('", "counter", "')", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "pd", ".", "formula", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "properties_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r2_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ",_", "mysql", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "string", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "text", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "text", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "integ", "er", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "integ", "er", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "integ", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "decima", "l", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "decima", "l", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "float_", "(_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "decima", "l", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "boolean", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "boolean", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "bool_", "(_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "boolean", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "in_", "[_", "'", "date", "'_", ",_", "'", "datetime", "'_", "]_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "datetime", "'_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "reference", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "reference", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "reference", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "reference", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "counter", "-", "value", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "==_", "'", "file", "'_", "and_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "value", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "url", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "[_", "'", "url", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "[_", "'", "size", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "size", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "md5", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "[_", "'", "md5", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "md5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "s3", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "[_", "'", "s3", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "value", "\\u", "file", "\\u", "s3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "value_", ":_", "\\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_", "value_", "[_", "'\\u", "mid", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "[_", "'", "type", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datatype", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "language", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "[_", "'", "language", "'_", "]_", "=_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "language", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "created", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "created", "',", " ", "{})", "['", "at", "']", " ", "=", " ", "r2", ".", "get", "('", "created", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "created", "\\u", "by", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "created", "',", " ", "{})", "['", "by", "']", " ", "=", " ", "r2", ".", "get", "('", "created", "\\u", "by", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "is", "\\u", "delete", "d", "')", " ", "and", " ", "r2", ".", "get", "('", "delete", "d", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "delete", "d", "',", " ", "{})", "['", "at", "']", " ", "=", " ", "r2", ".", "get", "('", "delete", "d", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "is", "\\u", "delete", "d", "')", " ", "and", " ", "r2", ".", "get", "('", "delete", "d\\u", "by", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", ".", "setdefault", "('", "delete", "d", "',", " ", "{})", "['", "by", "']", " ", "=", " ", "r2", ".", "get", "('", "delete", "d\\u", "by", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "e_", "._", "setdefault_", "(_", "r2_", "._", "get_", "(_", "'", "property", "\\u", "datapro", "pert", "y", "'_", ")_", ",_", "[_", "]_", ")_", "._", "append_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "value", "\\u", "display", "')", " ", "and", " ", "r2", ".", "get", "('", "property", "\\u", "search", "')", " ", "==", " ", "1", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r2", ".", "get", "('", "property", "\\u", "language", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", ".", "setdefault", "('\\", "use", "arch", "',", " ", "{})", ".", "setdefault", "(", "r2", ".", "get", "('", "property", "\\u", "language", "')", ",", " ", "[]", ").", "append", "(", "r2", ".", "get", "('", "value", "\\u", "display", "')", ".", "lower", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", ".", "setdefault", "('\\", "use", "arch", "',", " ", "{})", ".", "setdefault", "('", "et", "',", " ", "[]", ").", "append", "(", "r2", ".", "get", "('", "value", "\\u", "display", "')", ".", "lower", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", ".", "setdefault", "('\\", "use", "arch", "',", " ", "{})", ".", "setdefault", "('", "en", "',", " ", "[]", ").", "append", "(", "r2", ".", "get", "('", "value", "\\u", "display", "')", ".", "lower", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "l", " ", "in", " ", "['", "et", "',", " ", "'", "en", "']", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "l", " ", "in", " ", "e", ".", "get", "('\\", "use", "arch", "',", " ", "{})", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "e", "['", "\\u", "search", "']", "[", "l", "]", " ", "=", " ", "list", "(", "set", "(", "e", "['", "\\u", "search", "']", "[", "l", "]))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Creat", "e", " ", "or", " ", "replace", " ", "Mon", "go", " ", "object_", "\\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 ", " _", "mongo", "\\u", "entity", "\\u", "version_", "=_", "self_", "._", "mongodb", "_", "(_", ")_", "._", "entity", "Version_", "._", "find", "\\u", "one_", "(_", "{_", "'\\u", "mid", "'_", ":_", "mysql", "\\u", "id_", "}_", ",_", "{_", "'\\u", "id", "'_", ":_", "False_", ",_", "'\\u", "entity", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mongo", "\\u", "entity", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "entity", "'_", "]_", "=_", "mongo", "\\u", "entity", "\\u", "version_", "._", "get_", "(_", "'\\u", "entity", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "[_", "'\\u", "entity", "'_", "]_", "=_", "self_", "._", "mongodb", "_", "(_", ")_", "._", "entity_", "._", "insert", "\\u", "one_", "(_", "{_", "}_", ")_", "._", "inserted", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "mongodb", "_", "(_", ")_", "._", "entity", "Version_", "._", "insert", "\\u", "one_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "captur", "e", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "error_", "(_", "'", "Mon", "go", "Db", " ", "error", ":", " ", "%", "s", " ", "-", " ", "%", "s", "'_", "%_", "(_", "err_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Entity_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "allow", "ed", "\\u", "parents_", "(_", "self_", ",_", "entity", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "allow", "ed", " ", "parent", " ", "definit", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", " ", "IF", "(", "entity", "\\u", "id", ",", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "relation", "ship", ".", "entity", "\\u", "id", " ", "LIMIT", " ", "1", "),", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", ")", " ", "AS", " ", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "allow", "ed", "-", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relate", "d\\u", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "(", "SELECT", " ", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "FROM", " ", "entity", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ")", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "is", "\\u", "delete", "d", " ", "=", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", ".", "debug", "(", "sql", ")_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "defs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "self_", "._", "db", "\\u", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defs_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "keyn", "ame", "'_", ":_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "\\u", "plural", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "label", "\\u", "plural", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "description", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "menu", "group", "'_", ":_", "self_", "._", "\\u\\u", "get", "\\u", "system", "\\u", "translation_", "(_", "field_", "=_", "'", "menu", "'_", ",_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "d_", "._", "get_", "(_", "'", "keyn", "ame", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defs_", "\\u\\u\\uNE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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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Conflicting attributes in base classes
cloudera/hue/desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/cursors.py
[ { "content": "class BaseCursor(object):\n \n \"\"\"A base for Cursor classes. Useful attributes:\n \n description\n A tuple of DB API 7-tuples describing the columns in\n the last executed query; see PEP-249 for details.\n\n description_flags\n Tuple of column flags for last query, one entry per column\n in the result set. Values correspond to those in\n MySQLdb.constants.FLAG. See MySQL documentation (C API)\n for more information. Non-standard extension.\n \n arraysize\n default number of rows fetchmany() will fetch\n\n \"\"\"\n\n from _mysql_exceptions import MySQLError, Warning, Error, InterfaceError, \\\n DatabaseError, DataError, OperationalError, IntegrityError, \\\n InternalError, ProgrammingError, NotSupportedError\n \n _defer_warnings = False\n \n \n\n\n\n\n\n \n \n \n\n \n\n \n \n\n \n\n\n Warning = Warning\n Error = Error\n InterfaceError = InterfaceError\n DatabaseError = DatabaseError\n DataError = DataError\n OperationalError = OperationalError\n IntegrityError = IntegrityError\n InternalError = InternalError\n ProgrammingError = ProgrammingError\n NotSupportedError = NotSupportedError", "metadata": "root.BaseCursor", "header": "['module', '___EOS___']", "index": 49 }, { "content": " def __init__(self, connection):\n from weakref import proxy\n \n self.connection = proxy(connection)\n self.description = None\n self.description_flags = None\n self.rowcount = -1\n self.arraysize = 1\n self._executed = None\n self.lastrowid = None\n self.messages = []\n self.errorhandler = connection.errorhandler\n self._result = None\n self._warnings = 0\n self._info = None\n self.rownumber = None", "metadata": "root.BaseCursor.__init__", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 74 }, { "content": " def __del__(self):\n self.close()\n self.errorhandler = None\n self._result = None", "metadata": "root.BaseCursor.__del__", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 91 }, { "content": " def close(self):\n \"\"\"Close the cursor. No further queries will be possible.\"\"\"\n if not self.connection: return\n while self.nextset(): pass\n self.connection = None", "metadata": "root.BaseCursor.close", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 96 }, { "content": " def _check_executed(self):\n if not self._executed:\n self.errorhandler(self, ProgrammingError, \"execute() first\")", "metadata": "root.BaseCursor._check_executed", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 102 }, { "content": " def _warning_check(self):\n from warnings import warn\n if self._warnings:\n warnings = self._get_db().show_warnings()\n if warnings:\n # This is done in two loops in case\n # Warnings are set to raise exceptions.\n for w in warnings:\n self.messages.append((self.Warning, w))\n for w in warnings:\n warn(w[-1], self.Warning, 3)\n elif self._info:\n self.messages.append((self.Warning, self._info))\n warn(self._info, self.Warning, 3)", "metadata": "root.BaseCursor._warning_check", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 106 }, { "content": " def nextset(self):\n \"\"\"Advance to the next result set.\n\n Returns None if there are no more result sets.\n \"\"\"\n if self._executed:\n self.fetchall()\n del self.messages[:]\n \n db = self._get_db()\n nr = db.next_result()\n if nr == -1:\n return None\n self._do_get_result()\n self._post_get_result()\n self._warning_check()\n return 1", "metadata": "root.BaseCursor.nextset", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 121 }, { "content": " def _post_get_result(self): pass", "metadata": "root.BaseCursor._post_get_result", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 139 }, { "content": " def _do_get_result(self):\n db = self._get_db()\n self._result = self._get_result()\n self.rowcount = db.affected_rows()\n self.rownumber = 0\n self.description = self._result and self._result.describe() or None\n self.description_flags = self._result and self._result.field_flags() or None\n self.lastrowid = db.insert_id()\n self._warnings = db.warning_count()\n self._info = db.info()", "metadata": "root.BaseCursor._do_get_result", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 141 }, { "content": " def setinputsizes(self, *args):\n \"\"\"Does nothing, required by DB API.\"\"\"", "metadata": "root.BaseCursor.setinputsizes", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 152 }, { "content": " def setoutputsizes(self, *args):\n \"\"\"Does nothing, required by DB API.\"\"\"", "metadata": "root.BaseCursor.setoutputsizes", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 155 }, { "content": " def _get_db(self):\n if not self.connection:\n self.errorhandler(self, ProgrammingError, \"cursor closed\")\n return self.connection", "metadata": "root.BaseCursor._get_db", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 158 }, { "content": " def execute(self, query, args=None):\n\n \"\"\"Execute a query.\n \n query -- string, query to execute on server\n args -- optional sequence or mapping, parameters to use with query.\n\n Note: If args is a sequence, then %s must be used as the\n parameter placeholder in the query. If a mapping is used,\n %(key)s must be used as the placeholder.\n\n Returns long integer rows affected, if any\n\n \"\"\"\n del self.messages[:]\n db = self._get_db()\n if isinstance(query, unicode):\n query = query.encode(db.unicode_literal.charset)\n if args is not None:\n if isinstance(args, dict):\n query = query % dict((key, db.literal(item))\n for key, item in args.iteritems())\n else:\n query = query % tuple([db.literal(item) for item in args])\n try:\n r = None\n r = self._query(query)\n except TypeError, m:\n if m.args[0] in (\"not enough arguments for format string\",\n \"not all arguments converted\"):\n self.messages.append((ProgrammingError, m.args[0]))\n self.errorhandler(self, ProgrammingError, m.args[0])\n else:\n self.messages.append((TypeError, m))\n self.errorhandler(self, TypeError, m)\n except (SystemExit, KeyboardInterrupt):\n raise\n except:\n exc, value, tb = sys.exc_info()\n del tb\n self.messages.append((exc, value))\n self.errorhandler(self, exc, value)\n self._executed = query\n if not self._defer_warnings: self._warning_check()\n return r", "metadata": "root.BaseCursor.execute", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 163 }, { "content": " def executemany(self, query, args):\n\n \"\"\"Execute a multi-row query.\n \n query -- string, query to execute on server\n\n args\n\n Sequence of sequences or mappings, parameters to use with\n query.\n \n Returns long integer rows affected, if any.\n \n This method improves performance on multiple-row INSERT and\n REPLACE. Otherwise it is equivalent to looping over args with\n execute().\n\n \"\"\"\n del self.messages[:]\n db = self._get_db()\n if not args: return\n if isinstance(query, unicode):\n query = query.encode(db.unicode_literal.charset)\n m = insert_values.search(query)\n if not m:\n r = 0\n for a in args:\n r = r + self.execute(query, a)\n return r\n p = m.start(1)\n e = m.end(1)\n qv = m.group(1)\n try:\n q = []\n for a in args:\n if isinstance(a, dict):\n q.append(qv % dict((key, db.literal(item))\n for key, item in a.iteritems()))\n else:\n q.append(qv % tuple([db.literal(item) for item in a]))\n except TypeError, msg:\n if msg.args[0] in (\"not enough arguments for format string\",\n \"not all arguments converted\"):\n self.errorhandler(self, ProgrammingError, msg.args[0])\n else:\n self.errorhandler(self, TypeError, msg)\n except (SystemExit, KeyboardInterrupt):\n raise\n except:\n exc, value, tb = sys.exc_info()\n del tb\n self.errorhandler(self, exc, value)\n r = self._query('\\n'.join([query[:p], ',\\n'.join(q), query[e:]]))\n if not self._defer_warnings: self._warning_check()\n return r", "metadata": "root.BaseCursor.executemany", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 209 }, { "content": " def callproc(self, procname, args=()):\n\n \"\"\"Execute stored procedure procname with args\n \n procname -- string, name of procedure to execute on server\n\n args -- Sequence of parameters to use with procedure\n\n Returns the original args.\n\n Compatibility warning: PEP-249 specifies that any modified\n parameters must be returned. This is currently impossible\n as they are only available by storing them in a server\n variable and then retrieved by a query. Since stored\n procedures return zero or more result sets, there is no\n reliable way to get at OUT or INOUT parameters via callproc.\n The server variables are named @_procname_n, where procname\n is the parameter above and n is the position of the parameter\n (from zero). Once all result sets generated by the procedure\n have been fetched, you can issue a SELECT @_procname_0, ...\n query using .execute() to get any OUT or INOUT values.\n\n Compatibility warning: The act of calling a stored procedure\n itself creates an empty result set. This appears after any\n result sets generated by the procedure. This is non-standard\n behavior with respect to the DB-API. Be sure to use nextset()\n to advance through all result sets; otherwise you may get\n disconnected.\n \"\"\"\n\n db = self._get_db()\n for index, arg in enumerate(args):\n q = \"SET @_%s_%d=%s\" % (procname, index,\n db.literal(arg))\n if isinstance(q, unicode):\n q = q.encode(db.unicode_literal.charset)\n self._query(q)\n self.nextset()\n \n q = \"CALL %s(%s)\" % (procname,\n ','.join(['@_%s_%d' % (procname, i)\n for i in range(len(args))]))\n if type(q) is UnicodeType:\n q = q.encode(db.unicode_literal.charset)\n self._query(q)\n self._executed = q\n if not self._defer_warnings: self._warning_check()\n return args", "metadata": "root.BaseCursor.callproc", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 265 }, { "content": " def _do_query(self, q):\n db = self._get_db()\n self._last_executed = q\n db.query(q)\n self._do_get_result()\n return self.rowcount", "metadata": "root.BaseCursor._do_query", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 314 }, { "content": " def _query(self, q): return self._do_query(q)", "metadata": "root.BaseCursor._query", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 321 }, { "content": " def _fetch_row(self, size=1):\n if not self._result:\n return ()\n return self._result.fetch_row(size, self._fetch_type)", "metadata": "root.BaseCursor._fetch_row", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 323 }, { "content": " def __iter__(self):\n return iter(self.fetchone, None)", "metadata": "root.BaseCursor.__iter__", "header": "['class', 'BaseCursor', '(', 'object', ')', ':', '___EOS___']", "index": 328 }, { "content": "class CursorStoreResultMixIn(object):\n\n \"\"\"This is a MixIn class which causes the entire result set to be\n stored on the client side, i.e. it uses mysql_store_result(). If the\n result set can be very large, consider adding a LIMIT clause to your\n query, or using CursorUseResultMixIn instead.\"\"\"\n\n\n\n\n\n\n \n", "metadata": "root.CursorStoreResultMixIn", "header": "['module', '___EOS___']", "index": 343 }, { "content": " def _get_result(self): return self._get_db().store_result()", "metadata": "root.CursorStoreResultMixIn._get_result", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 350 }, { "content": " def _query(self, q):\n rowcount = self._do_query(q)\n self._post_get_result()\n return rowcount", "metadata": "root.CursorStoreResultMixIn._query", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 352 }, { "content": " def _post_get_result(self):\n self._rows = self._fetch_row(0)\n self._result = None", "metadata": "root.CursorStoreResultMixIn._post_get_result", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 357 }, { "content": " def fetchone(self):\n \"\"\"Fetches a single row from the cursor. None indicates that\n no more rows are available.\"\"\"\n self._check_executed()\n if self.rownumber >= len(self._rows): return None\n result = self._rows[self.rownumber]\n self.rownumber = self.rownumber+1\n return result", "metadata": "root.CursorStoreResultMixIn.fetchone", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 361 }, { "content": " def fetchmany(self, size=None):\n \"\"\"Fetch up to size rows from the cursor. Result set may be smaller\n than size. If size is not defined, cursor.arraysize is used.\"\"\"\n self._check_executed()\n end = self.rownumber + (size or self.arraysize)\n result = self._rows[self.rownumber:end]\n self.rownumber = min(end, len(self._rows))\n return result", "metadata": "root.CursorStoreResultMixIn.fetchmany", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 370 }, { "content": " def fetchall(self):\n \"\"\"Fetchs all available rows from the cursor.\"\"\"\n self._check_executed()\n if self.rownumber:\n result = self._rows[self.rownumber:]\n else:\n result = self._rows\n self.rownumber = len(self._rows)\n return result", "metadata": "root.CursorStoreResultMixIn.fetchall", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 379 }, { "content": " def scroll(self, value, mode='relative'):\n \"\"\"Scroll the cursor in the result set to a new position according\n to mode.\n \n If mode is 'relative' (default), value is taken as offset to\n the current position in the result set, if set to 'absolute',\n value states an absolute target position.\"\"\"\n self._check_executed()\n if mode == 'relative':\n r = self.rownumber + value\n elif mode == 'absolute':\n r = value\n else:\n self.errorhandler(self, ProgrammingError,\n \"unknown scroll mode %s\" % repr(mode))\n if r < 0 or r >= len(self._rows):\n self.errorhandler(self, IndexError, \"out of range\")\n self.rownumber = r", "metadata": "root.CursorStoreResultMixIn.scroll", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 389 }, { "content": " def __iter__(self):\n self._check_executed()\n result = self.rownumber and self._rows[self.rownumber:] or self._rows\n return iter(result)", "metadata": "root.CursorStoreResultMixIn.__iter__", "header": "['class', 'CursorStoreResultMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 408 }, { "content": "class CursorTupleRowsMixIn(object):\n\n \"\"\"This is a MixIn class that causes all rows to be returned as tuples,\n which is the standard form required by DB API.\"\"\"\n\n _fetch_type = 0", "metadata": "root.CursorTupleRowsMixIn", "header": "['module', '___EOS___']", "index": 464 }, { "content": "class CursorDictRowsMixIn(object):\n\n \"\"\"This is a MixIn class that causes all rows to be returned as\n dictionaries. This is a non-standard feature.\"\"\"\n\n _fetch_type = 1\n\n\n", "metadata": "root.CursorDictRowsMixIn", "header": "['module', '___EOS___']", "index": 472 }, { "content": " def fetchoneDict(self):\n \"\"\"Fetch a single row as a dictionary. Deprecated:\n Use fetchone() instead. Will be removed in 1.3.\"\"\"\n from warnings import warn\n warn(\"fetchoneDict() is non-standard and will be removed in 1.3\",\n DeprecationWarning, 2)\n return self.fetchone()", "metadata": "root.CursorDictRowsMixIn.fetchoneDict", "header": "['class', 'CursorDictRowsMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 479 }, { "content": " def fetchmanyDict(self, size=None):\n \"\"\"Fetch several rows as a list of dictionaries. Deprecated:\n Use fetchmany() instead. Will be removed in 1.3.\"\"\"\n from warnings import warn\n warn(\"fetchmanyDict() is non-standard and will be removed in 1.3\",\n DeprecationWarning, 2)\n return self.fetchmany(size)", "metadata": "root.CursorDictRowsMixIn.fetchmanyDict", "header": "['class', 'CursorDictRowsMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 487 }, { "content": " def fetchallDict(self):\n \"\"\"Fetch all available rows as a list of dictionaries. Deprecated:\n Use fetchall() instead. Will be removed in 1.3.\"\"\"\n from warnings import warn\n warn(\"fetchallDict() is non-standard and will be removed in 1.3\",\n DeprecationWarning, 2)\n return self.fetchall()", "metadata": "root.CursorDictRowsMixIn.fetchallDict", "header": "['class', 'CursorDictRowsMixIn', '(', 'object', ')', ':', '___EOS___']", "index": 495 }, { "content": "class Cursor(CursorStoreResultMixIn, CursorTupleRowsMixIn,\n BaseCursor):\n\n \"\"\"This is the standard Cursor class that returns rows as tuples\n and stores the result set in the client.\"\"\"", "metadata": "root.Cursor", "header": "['module', '___EOS___']", "index": 513 }, { "content": "class DictCursor(CursorStoreResultMixIn, CursorDictRowsMixIn,\n BaseCursor):\n\n \"\"\"This is a Cursor class that returns rows as dictionaries and\n stores the result set in the client.\"\"\"", "metadata": "root.DictCursor", "header": "['module', '___EOS___']", "index": 520 } ]
[ { "span": "class Cursor(CursorStoreResultMixIn, CursorTupleRowsMixIn,\n BaseCursor):", "start_line": 513, "start_column": 0, "end_line": 514, "end_column": 25 }, { "span": "class DictCursor(CursorStoreResultMixIn, CursorDictRowsMixIn,\n BaseCursor):", "start_line": 520, "start_column": 0, "end_line": 521, "end_column": 29 } ]
[ { "span": "def _query(self, q): ", "start_line": 321, "start_column": 4, "end_line": 321, "end_column": 24 }, { "span": "def _query(self, q):", "start_line": 352, "start_column": 4, "end_line": 352, "end_column": 24 } ]
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_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "base", " ", "for", " ", "Curs", "or", " ", "classe", "s", ".", " ", "Us", "efu", "l", " ", "attribute", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "description", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "tuple", " ", "of", " ", "DB", " ", "API", " ", "7", "-", "tuple", "s", " ", "descri", "bing", " ", "the", " ", "column", "s", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "last", " ", "executed", " ", "query", ";", " ", "see", " ", "PE", "P", "-", "249", " ", "for", " ", "deta", "il", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "description", "\\u", "flags", "\\", "10", ";", " ", " ", " ", " ", "Tup", "le", " ", "of", " ", "column", " ", "flags", " ", "for", " ", "last", " ", "query", ",", " ", "one", " ", "entry", " ", "per", " ", "column", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "result", " ", "set", ".", " ", "Value", "s", " ", "correspond", " ", "to", " ", "tho", "se", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "My", "SQL", "db", ".", "constant", "s", ".", "FLAG", ".", " ", "See", " ", "My", "SQL", " ", "documentation", " ", "(", "C", " ", "API", ")", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "more", " ", "informati", "on", ".", " ", "Non", "-", "standard", " ", "extensi", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "arrays", "ize", "\\", "10", ";", " ", " ", " ", " ", "default", " ", "number", " ", "of", " ", "rows", " ", "fetch", "many", "()", " ", "will", " ", "fetch", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "mysql", "\\u", "exceptions_", "import_", "My", "SQL", "Error_", ",_", "Warning_", ",_", "Error_", ",_", "Interface", "Error_", ",_", "Databa", "se", "Error_", ",_", "Data", "Error_", ",_", "Opera", "tion", "al", "Error_", ",_", "Int", "egr", "it", "y", "Error_", ",_", "Intern", "al", "Error_", ",_", "Programm", "ing", "Error_", ",_", "Not", "Supp", "orte", "d", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "defer", "\\u", "warnings_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Warning_", "=_", "Warning_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Error_", "=_", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Interface", "Error_", "=_", "Interface", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Databa", "se", "Error_", "=_", "Databa", "se", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Data", "Error_", "=_", "Data", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Opera", "tion", "al", "Error_", "=_", "Opera", "tion", "al", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Int", "egr", "it", "y", "Error_", "=_", "Int", "egr", "it", "y", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Intern", "al", "Error_", "=_", "Intern", "al", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Programm", "ing", "Error_", "=_", "Programm", "ing", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Not", "Supp", "orte", "d", "Error_", "=_", "Not", "Supp", "orte", "d", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "connection_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "weakref_", "import_", "proxy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "connection_", "=_", "proxy_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description", "\\u", "flags_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rowcount_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "arrays", "ize_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "executed", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lastr", "owi", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "messages_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errorhandler_", "=_", "connection_", "._", "errorhandler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "warnings_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "info_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rown", "umber_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "del\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errorhandler_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clos", "e", " ", "the", " ", "cursor", ".", " ", "No", " ", "fur", "ther", " ", "querie", "s", " ", "will", " ", "be", " ", "possib", "le", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "connection_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "next", "set_", "(_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "executed", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "executed", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Programm", "ing", "Error_", ",_", "\"", "execute", "()", " ", "first", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "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", "warn", "ing", "\\u", "check_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "warnings_", "import_", "warn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "._", "show", "\\u", "warnings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "don", "e", " ", "in", " ", "two", " ", "loop", "s", " ", "in", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Warnings", " ", "are", " ", "set", " ", "to", " ", "raise", " ", "exception", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "w_", "in_", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "messages_", "._", "append_", "(_", "(_", "self_", "._", "Warning_", ",_", "w_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "w_", "in_", "warnings_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "warn_", "(_", "w_", "[_", "-_", "1_", "]_", ",_", "self_", "._", "Warning_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "\\u", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "messages_", "._", "append_", "(_", "(_", "self_", "._", "Warning_", ",_", "self_", "._", "\\u", "info_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn_", "(_", "self_", "._", "\\u", "info_", ",_", "self_", "._", "Warning_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "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_", "next", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Advance", " ", "to", " ", "the", " ", "next", " ", "result", " ", "set", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Non", "e", " ", "if", " ", "there", " ", "are", " ", "no", " ", "more", " ", "result", " ", "sets", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "executed", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fetchall_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "self_", "._", "messages_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nr_", "=_", "db_", "._", "next", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "nr_", "==_", "-_", "1_", ":_", "\\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_", "self_", "._", "\\u", "do", "\\u", "get", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "post", "\\u", "get", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "warn", "ing", "\\u", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "post", "\\u", "get", "\\u", "result_", "(_", "self_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "do", "\\u", "get", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "result_", "=_", "self_", "._", "\\u", "get", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rowcount_", "=_", "db_", "._", "affect", "ed", "\\u", "rows_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rown", "umber_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description_", "=_", "self_", "._", "\\u", "result_", "and_", "self_", "._", "\\u", "result_", "._", "describe_", "(_", ")_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description", "\\u", "flags_", "=_", "self_", "._", "\\u", "result_", "and_", "self_", "._", "\\u", "result_", "._", "field", "\\u", "flags_", "(_", ")_", "or_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lastr", "owi", "d_", "=_", "db_", "._", "insert", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "warnings_", "=_", "db_", "._", "warn", "ing", "\\u", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "info_", "=_", "db_", "._", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "seti", "nput", "sizes_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", "es", " ", "not", "hing", ",", " ", "require", "d", " ", "by", " ", "DB", " ", "API", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "seto", "ut", "puts", "izes", "_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", "es", " ", "not", "hing", ",", " ", "require", "d", " ", "by", " ", "DB", " ", "API", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "db_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "connection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Programm", "ing", "Error_", ",_", "\"", "cursor", " ", "close", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "query_", ",_", "args_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "a", " ", "query", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "query", " ", "--", " ", "string", ",", " ", "query", " ", "to", " ", "execute", " ", "on", " ", "server", "\\", "10", ";", " ", " ", " ", " ", "args", " ", "--", " ", "option", "al", " ", "sequence", " ", "or", " ", "mapping", ",", " ", "parameter", "s", " ", "to", " ", "use", " ", "with", " ", "query", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", ":", " ", "If", " ", "args", " ", "is", " ", "a", " ", "sequence", ",", " ", "then", " ", "%", "s", " ", "must", " ", "be", " ", "used", " ", "as", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "parameter", " ", "placehold", "er", " ", "in", " ", "the", " ", "query", ".", " ", "If", " ", "a", " ", "mapping", " ", "is", " ", "used", ",", "\\", "10", ";", " ", " ", " ", " ", "%", "(", "key", ")", "s", " ", "must", " ", "be", " ", "used", " ", "as", " ", "the", " ", "placehold", "er", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "long", " ", "integ", "er", " ", "rows", " ", "affect", "ed", ",", " ", "if", " ", "any", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "messages_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "query_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "query_", "._", "encode_", "(_", "db_", "._", "unicode", "\\u", "literal_", "._", "charset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "args_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "query_", "%_", "dict_", "(_", "(_", "key_", ",_", "db_", "._", "literal_", "(_", "item_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "item_", "in_", "args_", "._", "iteritems_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "query_", "%_", "tuple_", "(_", "[_", "db_", "._", "literal_", "(_", "item_", ")_", "for_", "item_", "in_", "args_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "\\u", "query_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ",_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "m_", "._", "args_", "[_", "0_", "]_", "in_", "(_", "\"", "not", " ", "eno", "ugh", " ", "argu", "ment", "s", " ", "for", " ", "format", " ", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "not", " ", "all", " ", "argu", "ment", "s", " ", "convert", "ed", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "messages_", "._", "append_", "(_", "(_", "Programm", "ing", "Error_", ",_", "m_", "._", "args_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Programm", "ing", "Error_", ",_", "m_", "._", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "messages_", "._", "append_", "(_", "(_", "Type", "Error_", ",_", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Type", "Error_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "System", "Exit_", ",_", "Key", "board", "Interrupt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\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_", ",_", "value_", ",_", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "tb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "messages_", "._", "append_", "(_", "(_", "exc_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errorhandler_", "(_", "self_", ",_", "exc_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "executed", "_", "=_", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "defer", "\\u", "warnings_", ":_", "self_", "._", "\\u", "warn", "ing", "\\u", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "executemany", "_", "(_", "self_", ",_", "query_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "a", " ", "multi", "-", "row", " ", "query", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "query", " ", "--", " ", "string", ",", " ", "query", " ", "to", " ", "execute", " ", "on", " ", "server", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "args", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sequ", "ence", " ", "of", " ", "sequence", "s", " ", "or", " ", "mapping", "s", ",", " ", "parameter", "s", " ", "to", " ", "use", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "query", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "long", " ", "integ", "er", " ", "rows", " ", "affect", "ed", ",", " ", "if", " ", "any", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "improve", "s", " ", "perform", "anc", "e", " ", "on", " ", "multiple", "-", "row", " ", "INSERT", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "REPLACE", ".", " ", "Ot", "her", "wis", "e", " ", "it", " ", "is", " ", "equivalent", " ", "to", " ", "looping", " ", "over", " ", "args", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "execute", "()", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "messages_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "args_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "query_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "query_", "._", "encode_", "(_", "db_", "._", "unicode", "\\u", "literal_", "._", "charset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "insert", "\\u", "values_", "._", "search_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "r_", "+_", "self_", "._", "execute_", "(_", "query_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "m_", "._", "start_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "m_", "._", "end_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qv", "_", "=_", "m_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "a_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "q_", "._", "append_", "(_", "qv", "_", "%_", "dict_", "(_", "(_", "key_", ",_", "db_", "._", "literal_", "(_", "item_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "item_", "in_", "a_", "._", "iteritems_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "q_", "._", "append_", "(_", "qv", "_", "%_", "tuple_", "(_", "[_", "db_", "._", "literal_", "(_", "item_", ")_", "for_", "item_", "in_", "a_", "]_", ")_", ")_", "\\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_", "Type", "Error_", ",_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "msg_", "._", "args_", "[_", "0_", "]_", "in_", "(_", "\"", "not", " ", "eno", "ugh", " ", "argu", "ment", "s", " ", "for", " ", "format", " ", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "not", " ", "all", " ", "argu", "ment", "s", " ", "convert", "ed", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Programm", "ing", "Error_", ",_", "msg_", "._", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Type", "Error_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "System", "Exit_", ",_", "Key", "board", "Interrupt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\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_", ",_", "value_", ",_", "tb_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "tb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errorhandler_", "(_", "self_", ",_", "exc_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "self_", "._", "\\u", "query_", "(_", "'\\\\", "n", "'_", "._", "join_", "(_", "[_", "query_", "[_", ":_", "p_", "]_", ",_", "',", "\\\\", "n", "'_", "._", "join_", "(_", "q_", ")_", ",_", "query_", "[_", "e_", ":_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "defer", "\\u", "warnings_", ":_", "self_", "._", "\\u", "warn", "ing", "\\u", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call", "proc_", "(_", "self_", ",_", "proc", "name_", ",_", "args_", "=_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "store", "d", " ", "procedure", " ", "proc", "name", " ", "with", " ", "args", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "proc", "name", " ", "--", " ", "string", ",", " ", "name", " ", "of", " ", "procedure", " ", "to", " ", "execute", " ", "on", " ", "server", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "args", " ", "--", " ", "Sequ", "ence", " ", "of", " ", "parameter", "s", " ", "to", " ", "use", " ", "with", " ", "procedure", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "original", " ", "args", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Compat", "ibi", "lit", "y", " ", "warn", "ing", ":", " ", "PE", "P", "-", "249", " ", "speci", "fie", "s", " ", "tha", "t", " ", "any", " ", "modifi", "ed", "\\", "10", ";", " ", " ", " ", " ", "parameter", "s", " ", "must", " ", "be", " ", "return", "ed", ".", " ", "Thi", "s", " ", "is", " ", "currentl", "y", " ", "impossible", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "the", "y", " ", "are", " ", "only", " ", "avail", "able", " ", "by", " ", "stor", "ing", " ", "them", " ", "in", " ", "a", " ", "server", "\\", "10", ";", " ", " ", " ", " ", "variab", "le", " ", "and", " ", "then", " ", "retrieved", " ", "by", " ", "a", " ", "query", ".", " ", "Sin", "ce", " ", "store", "d", "\\", "10", ";", " ", " ", " ", " ", "procedure", "s", " ", "return", " ", "zero", " ", "or", " ", "more", " ", "result", " ", "sets", ",", " ", "there", " ", "is", " ", "no", "\\", "10", ";", " ", " ", " ", " ", "reliab", "le", " ", "way", " ", "to", " ", "get", " ", "at", " ", "OUT", " ", "or", " ", "IN", "OUT", " ", "parameter", "s", " ", "via", " ", "call", "proc", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "server", " ", "variab", "les", " ", "are", " ", "named", " ", "@\\u", "proc", "name", "\\u", "n", ",", " ", "where", " ", "proc", "name", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "the", " ", "parameter", " ", "above", " ", "and", " ", "n", " ", "is", " ", "the", " ", "position", " ", "of", " ", "the", " ", "parameter", "\\", "10", ";", " ", " ", " ", " ", "(", "from", " ", "zero", ").", " ", "On", "ce", " ", "all", " ", "result", " ", "sets", " ", "generat", "ed", " ", "by", " ", "the", " ", "procedure", "\\", "10", ";", " ", " ", " ", " ", "have", " ", "bee", "n", " ", "fetched", ",", " ", "you", " ", "can", " ", "issue", " ", "a", " ", "SELECT", " ", "@\\u", "proc", "name", "\\u", "0", ",", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "query", " ", "usi", "ng", " ", ".", "execute", "()", " ", "to", " ", "get", " ", "any", " ", "OUT", " ", "or", " ", "IN", "OUT", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Compat", "ibi", "lit", "y", " ", "warn", "ing", ":", " ", "The", " ", "act", " ", "of", " ", "calling", " ", "a", " ", "store", "d", " ", "procedure", "\\", "10", ";", " ", " ", " ", " ", "its", "elf", " ", "create", "s", " ", "an", " ", "empty", " ", "result", " ", "set", ".", " ", "Thi", "s", " ", "appear", "s", " ", "after", " ", "any", "\\", "10", ";", " ", " ", " ", " ", "result", " ", "sets", " ", "generat", "ed", " ", "by", " ", "the", " ", "procedure", ".", " ", "Thi", "s", " ", "is", " ", "non", "-", "standard", "\\", "10", ";", " ", " ", " ", " ", "behavior", " ", "with", " ", "respec", "t", " ", "to", " ", "the", " ", "DB", "-", "API", ".", " ", "Be", " ", "sure", " ", "to", " ", "use", " ", "next", "set", "()", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "advance", " ", "through", " ", "all", " ", "result", " ", "sets", ";", " ", "other", "wis", "e", " ", "you", " ", "may", " ", "get", "\\", "10", ";", " ", " ", " ", " ", "disconnected", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "index_", ",_", "arg_", "in_", "enumerate_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "\"", "SET", " ", "@\\u", "%", "s", "\\u", "%", "d", "=", "%", "s", "\"_", "%_", "(_", "proc", "name_", ",_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "literal_", "(_", "arg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "q_", ",_", "unicode_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "q_", "._", "encode_", "(_", "db_", "._", "unicode", "\\u", "literal_", "._", "charset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "query_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "next", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "q_", "=_", "\"", "CALL", " ", "%", "s", "(%", "s", ")\"_", "%_", "(_", "proc", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "','_", "._", "join_", "(_", "[_", "'@", "\\u", "%", "s", "\\u", "%", "d", "'_", "%_", "(_", "proc", "name_", ",_", "i_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "args_", ")_", ")_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "q_", ")_", "is_", "Unic", "ode", "Type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "q_", "._", "encode_", "(_", "db_", "._", "unicode", "\\u", "literal_", "._", "charset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "query_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "executed", "_", "=_", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "defer", "\\u", "warnings_", ":_", "self_", "._", "\\u", "warn", "ing", "\\u", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "do", "\\u", "query_", "(_", "self_", ",_", "q_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "last", "\\u", "executed", "_", "=_", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "query_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "do", "\\u", "get", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "rowcount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "query_", "(_", "self_", ",_", "q_", ")_", ":_", "return_", "self_", "._", "\\u", "do", "\\u", "query_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fetch", "\\u", "row_", "(_", "self_", ",_", "size_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "result_", "._", "fetch", "\\u", "row_", "(_", "size_", ",_", "self_", "._", "\\u", "fetch", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Cursor_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "iter_", "(_", "self_", "._", "fetchone_", ",_", "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_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "a", " ", "Mix", "In", " ", "class", " ", "whi", "ch", " ", "caus", "es", " ", "the", " ", "entire", " ", "result", " ", "set", " ", "to", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "store", "d", " ", "on", " ", "the", " ", "client", " ", "side", ",", " ", "i", ".", "e", ".", " ", "it", " ", "use", "s", " ", "mysql", "\\u", "store", "\\u", "result", "()", ".", " ", "If", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "result", " ", "set", " ", "can", " ", "be", " ", "very", " ", "large", ",", " ", "consider", " ", "addin", "g", " ", "a", " ", "LIMIT", " ", "clause", " ", "to", " ", "your", "\\", "10", ";", " ", " ", " ", " ", "query", ",", " ", "or", " ", "usi", "ng", " ", "Curs", "or", "Us", "e", "Result", "Mix", "In", " ", "inst", "ead", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "result_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "\\u", "get", "\\u", "db_", "(_", ")_", "._", "store", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "query_", "(_", "self_", ",_", "q_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rowcount_", "=_", "self_", "._", "\\u", "do", "\\u", "query_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "post", "\\u", "get", "\\u", "result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rowcount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "post", "\\u", "get", "\\u", "result_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "rows_", "=_", "self_", "._", "\\u", "fetch", "\\u", "row_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetchone_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fetche", "s", " ", "a", " ", "single", " ", "row", " ", "from", " ", "the", " ", "cursor", ".", " ", "Non", "e", " ", "indicat", "es", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "no", " ", "more", " ", "rows", " ", "are", " ", "avail", "able", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "executed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rown", "umber_", ">=_", "len_", "(_", "self_", "._", "\\u", "rows_", ")_", ":_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "\\u", "rows_", "[_", "self_", "._", "rown", "umber_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rown", "umber_", "=_", "self_", "._", "rown", "umber_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch", "many_", "(_", "self_", ",_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fe", "tch", " ", "up", " ", "to", " ", "size", " ", "rows", " ", "from", " ", "the", " ", "cursor", ".", " ", "Result", " ", "set", " ", "may", " ", "be", " ", "small", "er", "\\", "10", ";", " ", " ", " ", " ", "than", " ", "size", ".", " ", "If", " ", "size", " ", "is", " ", "not", " ", "defin", "ed", ",", " ", "cursor", ".", "arrays", "ize", " ", "is", " ", "used", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "executed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "self_", "._", "rown", "umber_", "+_", "(_", "size_", "or_", "self_", "._", "arrays", "ize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "\\u", "rows_", "[_", "self_", "._", "rown", "umber_", ":_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rown", "umber_", "=_", "min_", "(_", "end_", ",_", "len_", "(_", "self_", "._", "\\u", "rows_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetchall_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fe", "tch", "s", " ", "all", " ", "avail", "able", " ", "rows", " ", "from", " ", "the", " ", "cursor", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "executed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "rown", "umber_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "rows_", "[_", "self_", "._", "rown", "umber_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "\\u", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rown", "umber_", "=_", "len_", "(_", "self_", "._", "\\u", "rows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scroll_", "(_", "self_", ",_", "value_", ",_", "mode_", "=_", "'", "relative", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Scroll", " ", "the", " ", "cursor", " ", "in", " ", "the", " ", "result", " ", "set", " ", "to", " ", "a", " ", "new", " ", "position", " ", "according", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "mode", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "mode", " ", "is", " ", "'", "relative", "'", " ", "(", "default", "),", " ", "value", " ", "is", " ", "take", "n", " ", "as", " ", "offset", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "current", " ", "position", " ", "in", " ", "the", " ", "result", " ", "set", ",", " ", "if", " ", "set", " ", "to", " ", "'", "abs", "olute", "',", "\\", "10", ";", " ", " ", " ", " ", "value", " ", "state", "s", " ", "an", " ", "abs", "olute", " ", "target", " ", "position", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "executed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mode_", "==_", "'", "relative", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "self_", "._", "rown", "umber_", "+_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "mode_", "==_", "'", "abs", "olute", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Programm", "ing", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "unknown", " ", "scroll", " ", "mode", " ", "%", "s", "\"_", "%_", "repr_", "(_", "mode_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r_", "<_", "0_", "or_", "r_", ">=_", "len_", "(_", "self_", "._", "\\u", "rows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errorhandler_", "(_", "self_", ",_", "Index", "Error_", ",_", "\"", "out", " ", "of", " ", "range", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rown", "umber_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "check", "\\u", "executed", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "rown", "umber_", "and_", "self_", "._", "\\u", "rows_", "[_", "self_", "._", "rown", "umber_", ":_", "]_", "or_", "self_", "._", "\\u", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "iter_", "(_", "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_", "Curs", "or", "Tup", "le", "Row", "s", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "a", " ", "Mix", "In", " ", "class", " ", "tha", "t", " ", "caus", "es", " ", "all", " ", "rows", " ", "to", " ", "be", " ", "return", "ed", " ", "as", " ", "tuple", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "is", " ", "the", " ", "standard", " ", "form", " ", "require", "d", " ", "by", " ", "DB", " ", "API", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "fetch", "\\u", "type_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Curs", "or", "Dict", "Row", "s", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "a", " ", "Mix", "In", " ", "class", " ", "tha", "t", " ", "caus", "es", " ", "all", " ", "rows", " ", "to", " ", "be", " ", "return", "ed", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "dictionar", "ies", ".", " ", "Thi", "s", " ", "is", " ", "a", " ", "non", "-", "standard", " ", "feature", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "fetch", "\\u", "type_", "=_", "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_", "[SEP]_", "class_", "Curs", "or", "Dict", "Row", "s", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fetch", "one", "Dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fe", "tch", " ", "a", " ", "single", " ", "row", " ", "as", " ", "a", " ", "dictionar", "y", ".", " ", "Dep", "reca", "ted", ":", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "fetch", "one", "()", " ", "inst", "ead", ".", " ", "Wil", "l", " ", "be", " ", "remove", "d", " ", "in", " ", "1.3", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "warnings_", "import_", "warn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn_", "(_", "\"", "fetch", "one", "Dict", "()", " ", "is", " ", "non", "-", "standard", " ", "and", " ", "will", " ", "be", " ", "remove", "d", " ", "in", " ", "1.3", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Dep", "reca", "tion", "Warning_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Dict", "Row", "s", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch", "many", "Dict_", "(_", "self_", ",_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fe", "tch", " ", "sever", "al", " ", "rows", " ", "as", " ", "a", " ", "list", " ", "of", " ", "dictionar", "ies", ".", " ", "Dep", "reca", "ted", ":", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "fetch", "many", "()", " ", "inst", "ead", ".", " ", "Wil", "l", " ", "be", " ", "remove", "d", " ", "in", " ", "1.3", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "warnings_", "import_", "warn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn_", "(_", "\"", "fetch", "many", "Dict", "()", " ", "is", " ", "non", "-", "standard", " ", "and", " ", "will", " ", "be", " ", "remove", "d", " ", "in", " ", "1.3", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Dep", "reca", "tion", "Warning_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "fetch", "many_", "(_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Curs", "or", "Dict", "Row", "s", "Mix", "In_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch", "all", "Dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fe", "tch", " ", "all", " ", "avail", "able", " ", "rows", " ", "as", " ", "a", " ", "list", " ", "of", " ", "dictionar", "ies", ".", " ", "Dep", "reca", "ted", ":", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "fetch", "all", "()", " ", "inst", "ead", ".", " ", "Wil", "l", " ", "be", " ", "remove", "d", " ", "in", " ", "1.3", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "warnings_", "import_", "warn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn_", "(_", "\"", "fetch", "all", "Dict", "()", " ", "is", " ", "non", "-", "standard", " ", "and", " ", "will", " ", "be", " ", "remove", "d", " ", "in", " ", "1.3", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Dep", "reca", "tion", "Warning_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "fetchall_", "(_", ")_", "\\u\\u\\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_", "Cursor_", "(_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", ",_", "Curs", "or", "Tup", "le", "Row", "s", "Mix", "In_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Base", "Cursor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "the", " ", "standard", " ", "Curs", "or", " ", "class", " ", "tha", "t", " ", "return", "s", " ", "rows", " ", "as", " ", "tuple", "s", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "store", "s", " ", "the", " ", "result", " ", "set", " ", "in", " ", "the", " ", "client", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Dict", "Cursor_", "(_", "Curs", "or", "Stor", "e", "Result", "Mix", "In_", ",_", "Curs", "or", "Dict", "Row", "s", "Mix", "In_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Base", "Cursor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "is", " ", "a", " ", "Curs", "or", " ", "class", " ", "tha", "t", " ", "return", "s", " ", "rows", " ", "as", " ", "dictionar", "ies", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "store", "s", " ", "the", " ", "result", " ", "set", " ", "in", " ", "the", " ", "client", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2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 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 ]
Except block handles 'BaseException'
zorna/zorna/zorna/site/templatetags/site_tags.py
[ { "content": " def render(self, context):\n request = context['request']\n try:\n context[self.var_name] = SiteOptions.objects.is_access_valid(\n request.user, self.key)\n except:\n pass\n return ''", "metadata": "root.check_if_has_access_to_option_node.render", "header": "['class', 'check_if_has_access_to_option_node', '(', 'template', '.', 'Node', ')', ':', '___EOS___']", "index": 16 } ]
[ { "span": "except:", "start_line": 21, "start_column": 8, "end_line": 21, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "check", "\\u", "if", "\\u", "has", "\\u", "access", "\\u", "to", "\\u", "option", "\\u", "node_", "(_", "template_", "._", "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_", "def_", "render_", "(_", "self_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "context_", "[_", "'", "request", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context_", "[_", "self_", "._", "var", "\\u", "name_", "]_", "=_", "Site", "Options_", "._", "objects_", "._", "is", "\\u", "access", "\\u", "valid_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "._", "user_", ",_", "self_", "._", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
ejeschke/ginga/ginga/mockw/CanvasRenderMock.py
[ { "content": " def draw_path(self, cpoints):\n for i in range(len(cpoints) - 1):\n cx1, cy1 = cpoints[i]\n cx2, cy2 = cpoints[i+1]\n #self.cr.draw_line(cx1, cy1, cx2, cy2)", "metadata": "root.RenderContext.draw_path", "header": "['class', 'RenderContext', '(', 'object', ')', ':', '___EOS___']", "index": 81 } ]
[ { "span": "cx1,", "start_line": 83, "start_column": 12, "end_line": 83, "end_column": 15 }, { "span": "cy1 ", "start_line": 83, "start_column": 17, "end_line": 83, "end_column": 20 }, { "span": "cx2,", "start_line": 84, "start_column": 12, "end_line": 84, "end_column": 15 }, { "span": "cy2 ", "start_line": 84, "start_column": 17, "end_line": 84, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Render", "Context_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "draw", "\\u", "path_", "(_", "self_", ",_", "cpo", "ints_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "cpo", "ints_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cx", "1_", ",_", "cy", "1_", "=_", "cpo", "ints_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cx", "2_", ",_", "cy", "2_", "=_", "cpo", "ints_", "[_", "i_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "cr", ".", "draw", "\\u", "line", "(", "cx", "1", ",", " ", "cy", "1", ",", " ", "cx", "2", ",", " ", "cy", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 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 ]
Duplicate key in dict literal
openstack/rack/rack/tests/api/v1/test_processes.py
[ { "content": " def test_update(self):\n\n def _fake_update(context, gid, pid, kwargs):\n process = _base(context)\n process.update(gid=gid)\n process.update(pid=pid)\n process.update(kwargs)\n process.update(args='{\"key\": \"value\"}')\n process.update(securitygroups=[{\"securitygroup_id\": None}])\n process.update(networks=[{\"network_id\": None}])\n return process\n\n def _update_process_mockdata(gid, pid):\n return {\n \"pid\": pid,\n \"ppid\": None,\n \"gid\": gid,\n \"nova_instance_id\": None,\n \"nova_flavor_id\": None,\n \"display_name\": None,\n \"glance_image_id\": None,\n \"keypair_id\": None,\n \"userdata\": None,\n \"status\": None,\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": \"ACTIVE\",\n \"userdata\": None,\n \"args\": '{\"key\": \"value\"}',\n \"securitygroups\": [{\"securitygroup_id\": None}],\n \"networks\": [{\"network_id\": None}]}\n\n def _get_update_response_body(process):\n return {\"process\": {\n \"pid\": process[\"pid\"],\n \"ppid\": process[\"ppid\"],\n \"gid\": process[\"gid\"],\n \"nova_instance_id\": process[\"nova_instance_id\"],\n \"nova_flavor_id\": process[\"nova_flavor_id\"],\n \"name\": process[\"display_name\"],\n \"glance_image_id\": process[\"glance_image_id\"],\n \"keypair_id\": process[\"keypair_id\"],\n \"userdata\": process[\"userdata\"],\n \"status\": process[\"status\"],\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": process[\"app_status\"],\n \"userdata\": process[\"userdata\"],\n \"args\": json.loads(process[\"args\"]),\n \"securitygroup_ids\": [None],\n \"networks\": [{\n \"fixed\": None, \"floating\": None, \"network_id\": None}]}}\n\n self.stubs.Set(db, \"process_update\", _fake_update)\n self.mox.ReplayAll()\n\n request_body = {\"process\": {\"app_status\": \"ACTIVE\"}}\n process = _update_process_mockdata(GID, PID1)\n expect = _get_update_response_body(process)\n\n url = get_base_url(GID) + \"/\" + PID1\n req = get_request(url, 'PUT', request_body)\n res = req.get_response(self.app)\n body = jsonutils.loads(res.body)\n self.assertEqual(res.status_code, 200)\n for key in body[\"process\"]:\n self.assertEqual(expect[\"process\"][key], body[\"process\"][key])", "metadata": "root.ProcessesTest.test_update", "header": "['class', 'ProcessesTest', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']", "index": 1322 }, { "content": " def test_update_proxy_all(self):\n self.mox.StubOutWithMock(db, \"process_get_all\")\n db.process_get_all(\n IsA(context.RequestContext), GID, filters=IsA(dict))\\\n .AndReturn([{\"pid\": PID1}])\n\n def _fake_update(context, gid, pid, kwargs):\n process = _base(context)\n process.update(gid=gid)\n process.update(pid=pid)\n process.update(kwargs)\n process.update(args='{\"key\": \"value\"}')\n process.update(is_proxy=True)\n process.update(securitygroups=[{\"securitygroup_id\": None}])\n process.update(networks=[{\"network_id\": None}])\n return process\n\n def _update_process_mockdata(gid, pid):\n return {\n \"pid\": pid,\n \"ppid\": None,\n \"gid\": gid,\n \"nova_instance_id\": None,\n \"nova_flavor_id\": None,\n \"display_name\": None,\n \"glance_image_id\": None,\n \"keypair_id\": None,\n \"userdata\": None,\n \"status\": None,\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": \"app_status_data\",\n \"ipc_endpoint\": \"ipc_endpoint_data\",\n \"shm_endpoint\": \"shm_endpoint_data\",\n \"fs_endpoint\": \"fs_endpoint_data\",\n \"userdata\": None,\n \"is_proxy\": True,\n \"args\": '{\"key\": \"value\"}',\n \"securitygroups\": [{\"securitygroup_id\": None}],\n \"networks\": [{\"network_id\": None}]}\n\n def _get_update_response_body(process):\n return {\"proxy\": {\n \"pid\": process[\"pid\"],\n \"ppid\": process[\"ppid\"],\n \"gid\": process[\"gid\"],\n \"nova_flavor_id\": process[\"nova_flavor_id\"],\n \"nova_instance_id\": process[\"nova_instance_id\"],\n \"name\": process[\"display_name\"],\n \"glance_image_id\": process[\"glance_image_id\"],\n \"keypair_id\": process[\"keypair_id\"],\n \"userdata\": process[\"userdata\"],\n \"status\": process[\"status\"],\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": process[\"app_status\"],\n \"ipc_endpoint\": process.get(\"ipc_endpoint\"),\n \"shm_endpoint\": process.get(\"shm_endpoint\"),\n \"fs_endpoint\": process.get(\"fs_endpoint\"),\n \"userdata\": process[\"userdata\"],\n \"args\": json.loads(process[\"args\"]),\n \"securitygroup_ids\": [None],\n \"networks\": [{\n \"fixed\": None, \"floating\": None, \"network_id\": None}]}}\n\n self.stubs.Set(db, \"process_update\", _fake_update)\n self.mox.ReplayAll()\n\n request_body = {\"proxy\": {\n \"app_status\": \"app_status_data\",\n \"ipc_endpoint\": \"ipc_endpoint_data\",\n \"shm_endpoint\": \"shm_endpoint_data\",\n \"fs_endpoint\": \"fs_endpoint_data\"}}\n process = _update_process_mockdata(GID, PID1)\n expect = _get_update_response_body(process)\n\n url = url = \"/v1/groups/\" + GID + \"/proxy\"\n req = get_request(url, 'PUT', request_body)\n res = req.get_response(self.app)\n body = jsonutils.loads(res.body)\n self.assertEqual(res.status_code, 200)\n for key in body[\"proxy\"]:\n self.assertEqual(expect[\"proxy\"][key], body[\"proxy\"][key])", "metadata": "root.ProcessesTest.test_update_proxy_all", "header": "['class', 'ProcessesTest', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']", "index": 1418 }, { "content": " def test_update_proxy_ipc_endpoint(self):\n self.mox.StubOutWithMock(db, \"process_get_all\")\n db.process_get_all(\n IsA(context.RequestContext), GID, filters=IsA(dict))\\\n .AndReturn([{\"pid\": PID1}])\n\n def _fake_update(context, gid, pid, kwargs):\n process = _base(context)\n process.update(gid=gid)\n process.update(pid=pid)\n process.update(kwargs)\n process.update(is_proxy=True)\n process.update(args='{\"key\": \"value\"}')\n process.update(securitygroups=[{\"securitygroup_id\": None}])\n process.update(networks=[{\"network_id\": None}])\n return process\n\n def _update_process_mockdata(gid, pid):\n return {\n \"pid\": pid,\n \"ppid\": None,\n \"gid\": gid,\n \"nova_instance_id\": None,\n \"nova_flavor_id\": None,\n \"display_name\": None,\n \"glance_image_id\": None,\n \"keypair_id\": None,\n \"userdata\": None,\n \"status\": None,\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": None,\n \"ipc_endpoint\": \"ipc_endpoint_data\",\n \"shm_endpoint\": None,\n \"fs_endpoint\": None,\n \"userdata\": None,\n \"args\": '{\"key\": \"value\"}',\n \"securitygroups\": [{\"securitygroup_id\": None}],\n \"networks\": [{\"network_id\": None}]}\n\n def _get_update_response_body(process):\n return {\"proxy\": {\n \"pid\": process[\"pid\"],\n \"ppid\": process[\"ppid\"],\n \"gid\": process[\"gid\"],\n \"nova_instance_id\": process[\"nova_instance_id\"],\n \"nova_flavor_id\": process[\"nova_flavor_id\"],\n \"name\": process[\"display_name\"],\n \"glance_image_id\": process[\"glance_image_id\"],\n \"keypair_id\": process[\"keypair_id\"],\n \"userdata\": process[\"userdata\"],\n \"status\": process[\"status\"],\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": None,\n \"ipc_endpoint\": process.get(\"ipc_endpoint\"),\n \"shm_endpoint\": None,\n \"fs_endpoint\": None,\n \"userdata\": process[\"userdata\"],\n \"args\": json.loads(process[\"args\"]),\n \"securitygroup_ids\": [None],\n \"networks\": [{\n \"fixed\": None, \"floating\": None, \"network_id\": None}]}}\n\n self.stubs.Set(db, \"process_update\", _fake_update)\n self.mox.ReplayAll()\n\n request_body = {\"proxy\": {\n \"ipc_endpoint\": \"ipc_endpoint_data\"}}\n process = _update_process_mockdata(GID, PID1)\n expect = _get_update_response_body(process)\n\n url = \"/v1/groups/\" + GID + \"/proxy\"\n req = get_request(url, 'PUT', request_body)\n res = req.get_response(self.app)\n body = jsonutils.loads(res.body)\n self.assertEqual(res.status_code, 200)\n for key in body[\"proxy\"]:\n self.assertEqual(expect[\"proxy\"][key], body[\"proxy\"][key])", "metadata": "root.ProcessesTest.test_update_proxy_ipc_endpoint", "header": "['class', 'ProcessesTest', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']", "index": 1502 }, { "content": " def test_update_proxy_shm_endpoint(self):\n self.mox.StubOutWithMock(db, \"process_get_all\")\n db.process_get_all(\n IsA(context.RequestContext), GID, filters=IsA(dict))\\\n .AndReturn([{\"pid\": PID1}])\n\n def _fake_update(context, gid, pid, kwargs):\n process = _base(context)\n process.update(gid=gid)\n process.update(pid=pid)\n process.update(kwargs)\n process.update(is_proxy=True)\n process.update(args='{\"key\": \"value\"}')\n process.update(securitygroups=[{\"securitygroup_id\": None}])\n process.update(networks=[{\"network_id\": None}])\n return process\n\n def _update_process_mockdata(gid, pid):\n return {\n \"pid\": pid,\n \"ppid\": None,\n \"gid\": gid,\n \"nova_instance_id\": None,\n \"nova_flavor_id\": None,\n \"display_name\": None,\n \"glance_image_id\": None,\n \"keypair_id\": None,\n \"userdata\": None,\n \"status\": None,\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": None,\n \"ipc_endpoint\": None,\n \"shm_endpoint\": \"shm_endpoint_data\",\n \"fs_endpoint\": None,\n \"userdata\": None,\n \"args\": '{\"key\": \"value\"}',\n \"securitygroups\": [{\"securitygroup_id\": None}],\n \"networks\": [{\"network_id\": None}]}\n\n def _get_update_response_body(process):\n return {\"proxy\": {\n \"pid\": process[\"pid\"],\n \"ppid\": process[\"ppid\"],\n \"gid\": process[\"gid\"],\n \"nova_instance_id\": process[\"nova_instance_id\"],\n \"nova_flavor_id\": process[\"nova_flavor_id\"],\n \"name\": process[\"display_name\"],\n \"glance_image_id\": process[\"glance_image_id\"],\n \"keypair_id\": process[\"keypair_id\"],\n \"userdata\": process[\"userdata\"],\n \"status\": process[\"status\"],\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": None,\n \"ipc_endpoint\": None,\n \"shm_endpoint\": process.get(\"shm_endpoint\"),\n \"fs_endpoint\": None,\n \"userdata\": process[\"userdata\"],\n \"args\": json.loads(process[\"args\"]),\n \"securitygroup_ids\": [None],\n \"networks\": [{\n \"fixed\": None, \"floating\": None, \"network_id\": None}]}}\n\n self.stubs.Set(db, \"process_update\", _fake_update)\n self.mox.ReplayAll()\n\n request_body = {\"proxy\": {\n \"shm_endpoint\": \"shm_endpoint_data\"}}\n process = _update_process_mockdata(GID, PID1)\n expect = _get_update_response_body(process)\n\n url = \"/v1/groups/\" + GID + \"/proxy\"\n req = get_request(url, 'PUT', request_body)\n res = req.get_response(self.app)\n body = jsonutils.loads(res.body)\n self.assertEqual(res.status_code, 200)\n for key in body[\"proxy\"]:\n self.assertEqual(expect[\"proxy\"][key], body[\"proxy\"][key])", "metadata": "root.ProcessesTest.test_update_proxy_shm_endpoint", "header": "['class', 'ProcessesTest', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']", "index": 1582 }, { "content": " def test_update_proxy_fs_endpoint(self):\n self.mox.StubOutWithMock(db, \"process_get_all\")\n db.process_get_all(\n IsA(context.RequestContext), GID, filters=IsA(dict))\\\n .AndReturn([{\"pid\": PID1}])\n\n def _fake_update(context, gid, pid, kwargs):\n process = _base(context)\n process.update(gid=gid)\n process.update(pid=pid)\n process.update(kwargs)\n process.update(is_proxy=True)\n process.update(args='{\"key\": \"value\"}')\n process.update(securitygroups=[{\"securitygroup_id\": None}])\n process.update(networks=[{\"network_id\": None}])\n return process\n\n def _update_process_mockdata(gid, pid):\n return {\n \"pid\": pid,\n \"ppid\": None,\n \"gid\": gid,\n \"nova_instance_id\": None,\n \"nova_flavor_id\": None,\n \"display_name\": None,\n \"glance_image_id\": None,\n \"keypair_id\": None,\n \"userdata\": None,\n \"status\": None,\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": None,\n \"ipc_endpoint\": None,\n \"shm_endpoint\": None,\n \"fs_endpoint\": \"fs_endpoint_data\",\n \"userdata\": None,\n \"args\": '{\"key\": \"value\"}',\n \"securitygroups\": [{\"securitygroup_id\": None}],\n \"networks\": [{\"network_id\": None}]}\n\n def _get_update_response_body(process):\n return {\"proxy\": {\n \"pid\": process[\"pid\"],\n \"ppid\": process[\"ppid\"],\n \"gid\": process[\"gid\"],\n \"nova_instance_id\": process[\"nova_instance_id\"],\n \"nova_flavor_id\": process[\"nova_flavor_id\"],\n \"name\": process[\"display_name\"],\n \"glance_image_id\": process[\"glance_image_id\"],\n \"keypair_id\": process[\"keypair_id\"],\n \"userdata\": process[\"userdata\"],\n \"status\": process[\"status\"],\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": None,\n \"ipc_endpoint\": None,\n \"shm_endpoint\": None,\n \"fs_endpoint\": process.get(\"fs_endpoint\"),\n \"userdata\": process[\"userdata\"],\n \"args\": json.loads(process[\"args\"]),\n \"securitygroup_ids\": [None],\n \"networks\": [{\n \"fixed\": None, \"floating\": None, \"network_id\": None}]}}\n\n self.stubs.Set(db, \"process_update\", _fake_update)\n self.mox.ReplayAll()\n\n request_body = {\"proxy\": {\n \"fs_endpoint\": \"fs_endpoint_data\"}}\n process = _update_process_mockdata(GID, PID1)\n expect = _get_update_response_body(process)\n\n url = \"/v1/groups/\" + GID + \"/proxy\"\n req = get_request(url, 'PUT', request_body)\n res = req.get_response(self.app)\n body = jsonutils.loads(res.body)\n self.assertEqual(res.status_code, 200)\n for key in body[\"proxy\"]:\n self.assertEqual(expect[\"proxy\"][key], body[\"proxy\"][key])", "metadata": "root.ProcessesTest.test_update_proxy_fs_endpoint", "header": "['class', 'ProcessesTest', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']", "index": 1662 }, { "content": " def test_update_proxy_app_status(self):\n self.mox.StubOutWithMock(db, \"process_get_all\")\n db.process_get_all(\n IsA(context.RequestContext), GID, filters=IsA(dict))\\\n .AndReturn([{\"pid\": PID1}])\n\n def _fake_update(context, gid, pid, kwargs):\n process = _base(context)\n process.update(gid=gid)\n process.update(pid=pid)\n process.update(kwargs)\n process.update(is_proxy=True)\n process.update(args='{\"key\": \"value\"}')\n process.update(securitygroups=[{\"securitygroup_id\": None}])\n process.update(networks=[{\"network_id\": None}])\n return process\n\n def _update_process_mockdata(gid, pid):\n return {\n \"pid\": pid,\n \"ppid\": None,\n \"gid\": gid,\n \"nova_instance_id\": None,\n \"nova_flavor_id\": None,\n \"display_name\": None,\n \"glance_image_id\": None,\n \"keypair_id\": None,\n \"userdata\": None,\n \"status\": None,\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": \"app_status_data\",\n \"ipc_endpoint\": None,\n \"shm_endpoint\": None,\n \"fs_endpoint\": None,\n \"userdata\": None,\n \"args\": '{\"key\": \"value\"}',\n \"securitygroups\": [{\"securitygroup_id\": None}],\n \"networks\": [{\"network_id\": None}]}\n\n def _get_update_response_body(process):\n return {\"proxy\": {\n \"pid\": process[\"pid\"],\n \"ppid\": process[\"ppid\"],\n \"gid\": process[\"gid\"],\n \"nova_instance_id\": process[\"nova_instance_id\"],\n \"nova_flavor_id\": process[\"nova_flavor_id\"],\n \"name\": process[\"display_name\"],\n \"glance_image_id\": process[\"glance_image_id\"],\n \"keypair_id\": process[\"keypair_id\"],\n \"userdata\": process[\"userdata\"],\n \"status\": process[\"status\"],\n \"user_id\": \"noauth\",\n \"project_id\": \"noauth\",\n \"app_status\": process.get(\"app_status\"),\n \"ipc_endpoint\": None,\n \"shm_endpoint\": None,\n \"fs_endpoint\": None,\n \"userdata\": process[\"userdata\"],\n \"args\": json.loads(process[\"args\"]),\n \"securitygroup_ids\": [None],\n \"networks\": [{\n \"fixed\": None, \"floating\": None, \"network_id\": None}]}}\n\n self.stubs.Set(db, \"process_update\", _fake_update)\n self.mox.ReplayAll()\n\n request_body = {\"proxy\": {\n \"app_status\": \"app_status_data\"}}\n process = _update_process_mockdata(GID, PID1)\n expect = _get_update_response_body(process)\n\n url = \"/v1/groups/\" + GID + \"/proxy\"\n req = get_request(url, 'PUT', request_body)\n res = req.get_response(self.app)\n body = jsonutils.loads(res.body)\n self.assertEqual(res.status_code, 200)\n for key in body[\"proxy\"]:\n self.assertEqual(expect[\"proxy\"][key], body[\"proxy\"][key])", "metadata": "root.ProcessesTest.test_update_proxy_app_status", "header": "['class', 'ProcessesTest', '(', 'test', '.', 'NoDBTestCase', ')', ':', '___EOS___']", "index": 1742 } ]
[ { "span": "\"userdata\":", "start_line": 1344, "start_column": 16, "end_line": 1344, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1364, "start_column": 16, "end_line": 1364, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1445, "start_column": 16, "end_line": 1445, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1469, "start_column": 16, "end_line": 1469, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1529, "start_column": 16, "end_line": 1529, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1552, "start_column": 16, "end_line": 1552, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1609, "start_column": 16, "end_line": 1609, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1632, "start_column": 16, "end_line": 1632, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1689, "start_column": 16, "end_line": 1689, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1712, "start_column": 16, "end_line": 1712, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1769, "start_column": 16, "end_line": 1769, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1792, "start_column": 16, "end_line": 1792, "end_column": 26 } ]
[ { "span": "\"userdata\":", "start_line": 1349, "start_column": 16, "end_line": 1349, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1369, "start_column": 16, "end_line": 1369, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1453, "start_column": 16, "end_line": 1453, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1477, "start_column": 16, "end_line": 1477, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1537, "start_column": 16, "end_line": 1537, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1560, "start_column": 16, "end_line": 1560, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1617, "start_column": 16, "end_line": 1617, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1640, "start_column": 16, "end_line": 1640, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1697, "start_column": 16, "end_line": 1697, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1720, "start_column": 16, "end_line": 1720, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1777, "start_column": 16, "end_line": 1777, "end_column": 26 }, { "span": "\"userdata\":", "start_line": 1800, "start_column": 16, "end_line": 1800, "end_column": 26 } ]
1
true
[ "[CLS]_", "Duplicate", "_", "key_", "in_", "dict_", "literal_", "[SEP]_", "class_", "Processe", "s", "Test_", "(_", "test_", "._", "No", "DB", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "fake", "\\u", "update_", "(_", "context_", ",_", "gid_", ",_", "pid_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "=_", "\\u", "base_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "gid_", "=_", "gid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "pid_", "=_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "args_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "security", "groups_", "=_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "networks_", "=_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "gid_", ",_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "pid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "gid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "\"", "ACTI", "VE", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "s", "\"_", ":_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "process", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "process_", "[_", "\"", "pid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "process_", "[_", "\"", "ppi", "d", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "process_", "[_", "\"", "gid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "process_", "[_", "\"", "display", "\\u", "name", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "keypa", "ir", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "process_", "[_", "\"", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "process_", "[_", "\"", "app", "\\u", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "json_", "._", "loads_", "(_", "process_", "[_", "\"", "args", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "\\u", "ids", "\"_", ":_", "[_", "None_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fixed", "\"_", ":_", "None_", ",_", "\"", "float", "ing", "\"_", ":_", "None_", ",_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stubs_", "._", "Set_", "(_", "db_", ",_", "\"", "process", "\\u", "update", "\"_", ",_", "\\u", "fake", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "body_", "=_", "{_", "\"", "process", "\"_", ":_", "{_", "\"", "app", "\\u", "status", "\"_", ":_", "\"", "ACTI", "VE", "\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "GID", "_", ",_", "PID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "get", "\\u", "base", "\\u", "url_", "(_", "GID", "_", ")_", "+_", "\"/\"_", "+_", "PID", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "get", "\\u", "request_", "(_", "url_", ",_", "'", "PU", "T", "'_", ",_", "request", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "self_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "jsonutils_", "._", "loads_", "(_", "res_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "body_", "[_", "\"", "process", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expect_", "[_", "\"", "process", "\"_", "]_", "[_", "key_", "]_", ",_", "body_", "[_", "\"", "process", "\"_", "]_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processe", "s", "Test_", "(_", "test_", "._", "No", "DB", "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", "proxy", "\\u", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "db_", ",_", "\"", "process", "\\u", "get", "\\u", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "process", "\\u", "get", "\\u", "all_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Is", "A_", "(_", "context_", "._", "Request", "Context_", ")_", ",_", "GID", "_", ",_", "filters_", "=_", "Is", "A_", "(_", "dict_", ")_", ")_", "._", "And", "Return_", "(_", "[_", "{_", "\"", "pid", "\"_", ":_", "PID", "1_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fake", "\\u", "update_", "(_", "context_", ",_", "gid_", ",_", "pid_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "=_", "\\u", "base_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "gid_", "=_", "gid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "pid_", "=_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "args_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "is", "\\u", "proxy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "security", "groups_", "=_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "networks_", "=_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "gid_", ",_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "pid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "gid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "\"", "app", "\\u", "status", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "\"", "ipc", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "\"", "shm", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "\"", "fs", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "is", "\\u", "proxy", "\"_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "s", "\"_", ":_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "process_", "[_", "\"", "pid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "process_", "[_", "\"", "ppi", "d", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "process_", "[_", "\"", "gid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "process_", "[_", "\"", "display", "\\u", "name", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "keypa", "ir", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "process_", "[_", "\"", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "process_", "[_", "\"", "app", "\\u", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "ipc", "\\u", "endpoint", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "shm", "\\u", "endpoint", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "fs", "\\u", "endpoint", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "json_", "._", "loads_", "(_", "process_", "[_", "\"", "args", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "\\u", "ids", "\"_", ":_", "[_", "None_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fixed", "\"_", ":_", "None_", ",_", "\"", "float", "ing", "\"_", ":_", "None_", ",_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stubs_", "._", "Set_", "(_", "db_", ",_", "\"", "process", "\\u", "update", "\"_", ",_", "\\u", "fake", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "body_", "=_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "\"", "app", "\\u", "status", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "\"", "ipc", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "\"", "shm", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "\"", "fs", "\\u", "endpoint", "\\u", "data", "\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "GID", "_", ",_", "PID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "url_", "=_", "\"/", "v1", "/", "group", "s", "/\"_", "+_", "GID", "_", "+_", "\"/", "proxy", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "get", "\\u", "request_", "(_", "url_", ",_", "'", "PU", "T", "'_", ",_", "request", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "self_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "jsonutils_", "._", "loads_", "(_", "res_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "body_", "[_", "\"", "proxy", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expect_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ",_", "body_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processe", "s", "Test_", "(_", "test_", "._", "No", "DB", "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", "\\u", "proxy", "\\u", "ipc", "\\u", "endpoint_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "db_", ",_", "\"", "process", "\\u", "get", "\\u", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "process", "\\u", "get", "\\u", "all_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Is", "A_", "(_", "context_", "._", "Request", "Context_", ")_", ",_", "GID", "_", ",_", "filters_", "=_", "Is", "A_", "(_", "dict_", ")_", ")_", "._", "And", "Return_", "(_", "[_", "{_", "\"", "pid", "\"_", ":_", "PID", "1_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fake", "\\u", "update_", "(_", "context_", ",_", "gid_", ",_", "pid_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "=_", "\\u", "base_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "gid_", "=_", "gid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "pid_", "=_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "is", "\\u", "proxy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "args_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "security", "groups_", "=_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "networks_", "=_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "gid_", ",_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "pid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "gid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "\"", "ipc", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "s", "\"_", ":_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "process_", "[_", "\"", "pid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "process_", "[_", "\"", "ppi", "d", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "process_", "[_", "\"", "gid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "process_", "[_", "\"", "display", "\\u", "name", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "keypa", "ir", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "process_", "[_", "\"", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "ipc", "\\u", "endpoint", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "json_", "._", "loads_", "(_", "process_", "[_", "\"", "args", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "\\u", "ids", "\"_", ":_", "[_", "None_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fixed", "\"_", ":_", "None_", ",_", "\"", "float", "ing", "\"_", ":_", "None_", ",_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stubs_", "._", "Set_", "(_", "db_", ",_", "\"", "process", "\\u", "update", "\"_", ",_", "\\u", "fake", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "body_", "=_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "\"", "ipc", "\\u", "endpoint", "\\u", "data", "\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "GID", "_", ",_", "PID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"/", "v1", "/", "group", "s", "/\"_", "+_", "GID", "_", "+_", "\"/", "proxy", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "get", "\\u", "request_", "(_", "url_", ",_", "'", "PU", "T", "'_", ",_", "request", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "self_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "jsonutils_", "._", "loads_", "(_", "res_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "body_", "[_", "\"", "proxy", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expect_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ",_", "body_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processe", "s", "Test_", "(_", "test_", "._", "No", "DB", "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", "\\u", "proxy", "\\u", "shm", "\\u", "endpoint_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "db_", ",_", "\"", "process", "\\u", "get", "\\u", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "process", "\\u", "get", "\\u", "all_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Is", "A_", "(_", "context_", "._", "Request", "Context_", ")_", ",_", "GID", "_", ",_", "filters_", "=_", "Is", "A_", "(_", "dict_", ")_", ")_", "._", "And", "Return_", "(_", "[_", "{_", "\"", "pid", "\"_", ":_", "PID", "1_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fake", "\\u", "update_", "(_", "context_", ",_", "gid_", ",_", "pid_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "=_", "\\u", "base_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "gid_", "=_", "gid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "pid_", "=_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "is", "\\u", "proxy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "args_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "security", "groups_", "=_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "networks_", "=_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "gid_", ",_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "pid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "gid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "\"", "shm", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "s", "\"_", ":_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "process_", "[_", "\"", "pid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "process_", "[_", "\"", "ppi", "d", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "process_", "[_", "\"", "gid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "process_", "[_", "\"", "display", "\\u", "name", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "keypa", "ir", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "process_", "[_", "\"", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "shm", "\\u", "endpoint", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "json_", "._", "loads_", "(_", "process_", "[_", "\"", "args", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "\\u", "ids", "\"_", ":_", "[_", "None_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fixed", "\"_", ":_", "None_", ",_", "\"", "float", "ing", "\"_", ":_", "None_", ",_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stubs_", "._", "Set_", "(_", "db_", ",_", "\"", "process", "\\u", "update", "\"_", ",_", "\\u", "fake", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "body_", "=_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "\"", "shm", "\\u", "endpoint", "\\u", "data", "\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "GID", "_", ",_", "PID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"/", "v1", "/", "group", "s", "/\"_", "+_", "GID", "_", "+_", "\"/", "proxy", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "get", "\\u", "request_", "(_", "url_", ",_", "'", "PU", "T", "'_", ",_", "request", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "self_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "jsonutils_", "._", "loads_", "(_", "res_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "body_", "[_", "\"", "proxy", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expect_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ",_", "body_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processe", "s", "Test_", "(_", "test_", "._", "No", "DB", "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", "\\u", "proxy", "\\u", "fs", "\\u", "endpoint_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "db_", ",_", "\"", "process", "\\u", "get", "\\u", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "process", "\\u", "get", "\\u", "all_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Is", "A_", "(_", "context_", "._", "Request", "Context_", ")_", ",_", "GID", "_", ",_", "filters_", "=_", "Is", "A_", "(_", "dict_", ")_", ")_", "._", "And", "Return_", "(_", "[_", "{_", "\"", "pid", "\"_", ":_", "PID", "1_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fake", "\\u", "update_", "(_", "context_", ",_", "gid_", ",_", "pid_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "=_", "\\u", "base_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "gid_", "=_", "gid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "pid_", "=_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "is", "\\u", "proxy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "args_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "security", "groups_", "=_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "networks_", "=_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "gid_", ",_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "pid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "gid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "\"", "fs", "\\u", "endpoint", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "s", "\"_", ":_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "process_", "[_", "\"", "pid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "process_", "[_", "\"", "ppi", "d", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "process_", "[_", "\"", "gid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "process_", "[_", "\"", "display", "\\u", "name", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "keypa", "ir", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "process_", "[_", "\"", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "fs", "\\u", "endpoint", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "json_", "._", "loads_", "(_", "process_", "[_", "\"", "args", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "\\u", "ids", "\"_", ":_", "[_", "None_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fixed", "\"_", ":_", "None_", ",_", "\"", "float", "ing", "\"_", ":_", "None_", ",_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stubs_", "._", "Set_", "(_", "db_", ",_", "\"", "process", "\\u", "update", "\"_", ",_", "\\u", "fake", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "body_", "=_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "\"", "fs", "\\u", "endpoint", "\\u", "data", "\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "GID", "_", ",_", "PID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"/", "v1", "/", "group", "s", "/\"_", "+_", "GID", "_", "+_", "\"/", "proxy", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "get", "\\u", "request_", "(_", "url_", ",_", "'", "PU", "T", "'_", ",_", "request", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "self_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "jsonutils_", "._", "loads_", "(_", "res_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "body_", "[_", "\"", "proxy", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expect_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ",_", "body_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Processe", "s", "Test_", "(_", "test_", "._", "No", "DB", "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", "\\u", "proxy", "\\u", "app", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mox_", "._", "Stu", "b", "Out", "With", "Mock_", "(_", "db_", ",_", "\"", "process", "\\u", "get", "\\u", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "process", "\\u", "get", "\\u", "all_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Is", "A_", "(_", "context_", "._", "Request", "Context_", ")_", ",_", "GID", "_", ",_", "filters_", "=_", "Is", "A_", "(_", "dict_", ")_", ")_", "._", "And", "Return_", "(_", "[_", "{_", "\"", "pid", "\"_", ":_", "PID", "1_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "fake", "\\u", "update_", "(_", "context_", ",_", "gid_", ",_", "pid_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "=_", "\\u", "base_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "gid_", "=_", "gid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "pid_", "=_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "is", "\\u", "proxy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "args_", "=_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "security", "groups_", "=_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "._", "update_", "(_", "networks_", "=_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "process_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "gid_", ",_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "pid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "gid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "display", "\\u", "name", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "\"", "app", "\\u", "status", "\\u", "data", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "'{", "\"", "key", "\":", " ", "\"", "value", "\"}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "s", "\"_", ":_", "[_", "{_", "\"", "security", "group", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pid", "\"_", ":_", "process_", "[_", "\"", "pid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ppi", "d", "\"_", ":_", "process_", "[_", "\"", "ppi", "d", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gid", "\"_", ":_", "process_", "[_", "\"", "gid", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "instance", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "nova", "\\u", "flavor", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "process_", "[_", "\"", "display", "\\u", "name", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "gla", "nce", "\\u", "image", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "keypa", "ir", "\\u", "id", "\"_", ":_", "process_", "[_", "\"", "keypa", "ir", "\\u", "id", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "status", "\"_", ":_", "process_", "[_", "\"", "status", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "project", "\\u", "id", "\"_", ":_", "\"", "noa", "uth", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "process_", "._", "get_", "(_", "\"", "app", "\\u", "status", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipc", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "shm", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fs", "\\u", "endpoint", "\"_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "userdata", "\"_", ":_", "process_", "[_", "\"", "userdata", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "json_", "._", "loads_", "(_", "process_", "[_", "\"", "args", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "security", "group", "\\u", "ids", "\"_", ":_", "[_", "None_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fixed", "\"_", ":_", "None_", ",_", "\"", "float", "ing", "\"_", ":_", "None_", ",_", "\"", "network", "\\u", "id", "\"_", ":_", "None_", "}_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stubs_", "._", "Set_", "(_", "db_", ",_", "\"", "process", "\\u", "update", "\"_", ",_", "\\u", "fake", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mox_", "._", "Repl", "ay", "All_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "body_", "=_", "{_", "\"", "proxy", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "app", "\\u", "status", "\"_", ":_", "\"", "app", "\\u", "status", "\\u", "data", "\"_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process_", "=_", "\\u", "update", "\\u", "process", "\\u", "mock", "data_", "(_", "GID", "_", ",_", "PID", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect_", "=_", "\\u", "get", "\\u", "update", "\\u", "response", "\\u", "body_", "(_", "process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "\"/", "v1", "/", "group", "s", "/\"_", "+_", "GID", "_", "+_", "\"/", "proxy", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "get", "\\u", "request_", "(_", "url_", ",_", "'", "PU", "T", "'_", ",_", "request", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req_", "._", "get", "\\u", "response_", "(_", "self_", "._", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "jsonutils_", "._", "loads_", "(_", "res_", "._", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "body_", "[_", "\"", "proxy", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "expect_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ",_", "body_", "[_", "\"", "proxy", "\"_", "]_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Non-callable called
CollabQ/CollabQ/openid/message.py
[ { "content": "class Message(object):\n \"\"\"\n In the implementation of this object, None represents the global\n namespace as well as a namespace with no key.\n\n @cvar namespaces: A dictionary specifying specific\n namespace-URI to alias mappings that should be used when\n generating namespace aliases.\n\n @ivar ns_args: two-level dictionary of the values in this message,\n grouped by namespace URI. The first level is the namespace\n URI.\n \"\"\"\n\n allowed_openid_namespaces = [OPENID1_NS, OPENID2_NS]\n\n\n\n fromPostArgs = classmethod(fromPostArgs)\n\n\n fromOpenIDArgs = classmethod(fromOpenIDArgs)\n\n\n\n\n\n\n\n fromKVForm = classmethod(fromKVForm)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.Message", "header": "['module', '___EOS___']", "index": 97 }, { "content": " def __init__(self, openid_namespace=None):\n \"\"\"Create an empty Message\"\"\"\n self.args = {}\n self.namespaces = NamespaceMap()\n if openid_namespace is None:\n self._openid_ns_uri = None\n else:\n self.setOpenIDNamespace(openid_namespace)", "metadata": "root.Message.__init__", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 113 }, { "content": " def fromPostArgs(cls, args):\n \"\"\"Construct a Message containing a set of POST arguments\"\"\"\n self = cls()\n\n # Partition into \"openid.\" args and bare args\n openid_args = {}\n for key, value in args.iteritems():\n if isinstance(value, list):\n raise TypeError(\"query dict must have one value for each key, \"\n \"not lists of values. Query is %r\" % (args,))\n\n\n try:\n prefix, rest = key.split('.', 1)\n except ValueError:\n prefix = None\n\n if prefix != 'openid':\n self.args[(BARE_NS, key)] = value\n else:\n openid_args[rest] = value\n\n self._fromOpenIDArgs(openid_args)\n\n return self", "metadata": "root.Message.fromPostArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 122 }, { "content": " def fromOpenIDArgs(cls, openid_args):\n \"\"\"Construct a Message from a parsed KVForm message\"\"\"\n self = cls()\n self._fromOpenIDArgs(openid_args)\n return self", "metadata": "root.Message.fromOpenIDArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 150 }, { "content": " def _fromOpenIDArgs(self, openid_args):\n global registered_aliases\n\n ns_args = []\n\n # Resolve namespaces\n for rest, value in openid_args.iteritems():\n try:\n ns_alias, ns_key = rest.split('.', 1)\n except ValueError:\n ns_alias = NULL_NAMESPACE\n ns_key = rest\n\n if ns_alias == 'ns':\n self.namespaces.addAlias(value, ns_key)\n elif ns_alias == NULL_NAMESPACE and ns_key == 'ns':\n # null namespace\n self.namespaces.addAlias(value, NULL_NAMESPACE)\n else:\n ns_args.append((ns_alias, ns_key, value))\n\n # Ensure that there is an OpenID namespace definition\n openid_ns_uri = self.namespaces.getNamespaceURI(NULL_NAMESPACE)\n if openid_ns_uri is None:\n openid_ns_uri = OPENID1_NS\n\n self.setOpenIDNamespace(openid_ns_uri)\n\n # Actually put the pairs into the appropriate namespaces\n for (ns_alias, ns_key, value) in ns_args:\n ns_uri = self.namespaces.getNamespaceURI(ns_alias)\n if ns_uri is None:\n # Only try to map an alias to a default if it's an\n # OpenID 1.x message.\n if openid_ns_uri == OPENID1_NS:\n for _alias, _uri in registered_aliases.iteritems():\n if _alias == ns_alias:\n ns_uri = _uri\n break\n\n if ns_uri is None:\n ns_uri = openid_ns_uri\n ns_key = '%s.%s' % (ns_alias, ns_key)\n else:\n self.namespaces.addAlias(ns_uri, ns_alias)\n\n self.setArg(ns_uri, ns_key, value)", "metadata": "root.Message._fromOpenIDArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 158 }, { "content": " def setOpenIDNamespace(self, openid_ns_uri):\n if openid_ns_uri not in self.allowed_openid_namespaces:\n raise ValueError('Invalid null namespace: %r' % (openid_ns_uri,))\n\n self.namespaces.addAlias(openid_ns_uri, NULL_NAMESPACE)\n self._openid_ns_uri = openid_ns_uri", "metadata": "root.Message.setOpenIDNamespace", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 206 }, { "content": " def getOpenIDNamespace(self):\n return self._openid_ns_uri", "metadata": "root.Message.getOpenIDNamespace", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 213 }, { "content": " def isOpenID1(self):\n return self.getOpenIDNamespace() == OPENID1_NS", "metadata": "root.Message.isOpenID1", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 216 }, { "content": " def isOpenID2(self):\n return self.getOpenIDNamespace() == OPENID2_NS", "metadata": "root.Message.isOpenID2", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 219 }, { "content": " def fromKVForm(cls, kvform_string):\n \"\"\"Create a Message from a KVForm string\"\"\"\n return cls.fromOpenIDArgs(kvform.kvToDict(kvform_string))", "metadata": "root.Message.fromKVForm", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 222 }, { "content": " def copy(self):\n return copy.deepcopy(self)", "metadata": "root.Message.copy", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 228 }, { "content": " def toPostArgs(self):\n \"\"\"Return all arguments with openid. in front of namespaced arguments.\n \"\"\"\n args = {}\n\n # Add namespace definitions to the output\n for ns_uri, alias in self.namespaces.iteritems():\n if alias == NULL_NAMESPACE:\n if ns_uri != OPENID1_NS:\n args['openid.ns'] = ns_uri\n else:\n # drop the default null namespace definition. This\n # potentially changes a message since we have no\n # way of knowing whether it was explicitly\n # specified at the time the message was\n # parsed. The vast majority of the time, this will\n # be the right thing to do. Possibly this could\n # look in the signed list.\n pass\n else:\n if self.getOpenIDNamespace() != OPENID1_NS:\n ns_key = 'openid.ns.' + alias\n args[ns_key] = ns_uri\n\n for (ns_uri, ns_key), value in self.args.iteritems():\n key = self.getKey(ns_uri, ns_key)\n args[key] = value\n\n return args", "metadata": "root.Message.toPostArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 231 }, { "content": " def toArgs(self):\n \"\"\"Return all namespaced arguments, failing if any\n non-namespaced arguments exist.\"\"\"\n # FIXME - undocumented exception\n post_args = self.toPostArgs()\n kvargs = {}\n for k, v in post_args.iteritems():\n if not k.startswith('openid.'):\n raise ValueError(\n 'This message can only be encoded as a POST, because it '\n 'contains arguments that are not prefixed with \"openid.\"')\n else:\n kvargs[k[7:]] = v\n\n return kvargs", "metadata": "root.Message.toArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 261 }, { "content": " def toFormMarkup(self, action_url, form_tag_attrs=None,\n submit_text=\"Continue\"):\n \"\"\"Generate HTML form markup that contains the values in this\n message, to be HTTP POSTed as x-www-form-urlencoded UTF-8.\n\n @param action_url: The URL to which the form will be POSTed\n @type action_url: str\n\n @param form_tag_attrs: Dictionary of attributes to be added to\n the form tag. 'accept-charset' and 'enctype' have defaults\n that can be overridden. If a value is supplied for\n 'action' or 'method', it will be replaced.\n @type form_tag_attrs: {unicode: unicode}\n\n @param submit_text: The text that will appear on the submit\n button for this form.\n @type submit_text: unicode\n\n @returns: A string containing (X)HTML markup for a form that\n encodes the values in this Message object.\n @rtype: str or unicode\n \"\"\"\n if ElementTree is None:\n raise RuntimeError('This function requires ElementTree.')\n\n form = ElementTree.Element('form')\n\n if form_tag_attrs:\n for name, attr in form_tag_attrs.iteritems():\n form.attrib[name] = attr\n\n form.attrib['action'] = action_url\n form.attrib['method'] = 'post'\n form.attrib['accept-charset'] = 'UTF-8'\n form.attrib['enctype'] = 'application/x-www-form-urlencoded'\n\n for name, value in self.toPostArgs().iteritems():\n attrs = {'type': 'hidden',\n 'name': name,\n 'value': value}\n form.append(ElementTree.Element('input', attrs))\n\n submit = ElementTree.Element(\n 'input', {'type':'submit', 'value':submit_text})\n form.append(submit)\n\n return ElementTree.tostring(form)", "metadata": "root.Message.toFormMarkup", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 277 }, { "content": " def toURL(self, base_url):\n \"\"\"Generate a GET URL with the parameters in this message\n attached as query parameters.\"\"\"\n return oidutil.appendArgs(base_url, self.toPostArgs())", "metadata": "root.Message.toURL", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 325 }, { "content": " def toKVForm(self):\n \"\"\"Generate a KVForm string that contains the parameters in\n this message. This will fail if the message contains arguments\n outside of the 'openid.' prefix.\n \"\"\"\n return kvform.dictToKV(self.toArgs())", "metadata": "root.Message.toKVForm", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 330 }, { "content": " def toURLEncoded(self):\n \"\"\"Generate an x-www-urlencoded string\"\"\"\n args = self.toPostArgs().items()\n args.sort()\n return urllib.urlencode(args)", "metadata": "root.Message.toURLEncoded", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 337 }, { "content": " def _fixNS(self, namespace):\n \"\"\"Convert an input value into the internally used values of\n this object\n\n @param namespace: The string or constant to convert\n @type namespace: str or unicode or BARE_NS or OPENID_NS\n \"\"\"\n if namespace == OPENID_NS:\n if self._openid_ns_uri is None:\n raise UndefinedOpenIDNamespace('OpenID namespace not set')\n else:\n namespace = self._openid_ns_uri\n\n if namespace != BARE_NS and type(namespace) not in [str, unicode]:\n raise TypeError(\n \"Namespace must be BARE_NS, OPENID_NS or a string. got %r\"\n % (namespace,))\n\n if namespace != BARE_NS and ':' not in namespace:\n fmt = 'OpenID 2.0 namespace identifiers SHOULD be URIs. Got %r'\n warnings.warn(fmt % (namespace,), DeprecationWarning)\n\n if namespace == 'sreg':\n fmt = 'Using %r instead of \"sreg\" as namespace'\n warnings.warn(fmt % (SREG_URI,), DeprecationWarning,)\n return SREG_URI\n\n return namespace", "metadata": "root.Message._fixNS", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 343 }, { "content": " def hasKey(self, namespace, ns_key):\n namespace = self._fixNS(namespace)\n return (namespace, ns_key) in self.args", "metadata": "root.Message.hasKey", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 372 }, { "content": " def getKey(self, namespace, ns_key):\n \"\"\"Get the key for a particular namespaced argument\"\"\"\n namespace = self._fixNS(namespace)\n if namespace == BARE_NS:\n return ns_key\n\n ns_alias = self.namespaces.getAlias(namespace)\n\n # No alias is defined, so no key can exist\n if ns_alias is None:\n return None\n\n if ns_alias == NULL_NAMESPACE:\n tail = ns_key\n else:\n tail = '%s.%s' % (ns_alias, ns_key)\n\n return 'openid.' + tail", "metadata": "root.Message.getKey", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 376 }, { "content": " def getArg(self, namespace, key, default=None):\n \"\"\"Get a value for a namespaced key.\n\n @param namespace: The namespace in the message for this key\n @type namespace: str\n\n @param key: The key to get within this namespace\n @type key: str\n\n @param default: The value to use if this key is absent from\n this message. Using the special value\n openid.message.no_default will result in this method\n raising a KeyError instead of returning the default.\n\n @rtype: str or the type of default\n @raises KeyError: if default is no_default\n @raises UndefinedOpenIDNamespace: if the message has not yet\n had an OpenID namespace set\n \"\"\"\n namespace = self._fixNS(namespace)\n args_key = (namespace, key)\n try:\n return self.args[args_key]\n except KeyError:\n if default is no_default:\n raise KeyError((namespace, key))\n else:\n return default", "metadata": "root.Message.getArg", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 395 }, { "content": " def getArgs(self, namespace):\n \"\"\"Get the arguments that are defined for this namespace URI\n\n @returns: mapping from namespaced keys to values\n @returntype: dict\n \"\"\"\n namespace = self._fixNS(namespace)\n return dict([\n (ns_key, value)\n for ((pair_ns, ns_key), value)\n in self.args.iteritems()\n if pair_ns == namespace\n ])", "metadata": "root.Message.getArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 424 }, { "content": " def updateArgs(self, namespace, updates):\n \"\"\"Set multiple key/value pairs in one call\n\n @param updates: The values to set\n @type updates: {unicode:unicode}\n \"\"\"\n namespace = self._fixNS(namespace)\n for k, v in updates.iteritems():\n self.setArg(namespace, k, v)", "metadata": "root.Message.updateArgs", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 438 }, { "content": " def setArg(self, namespace, key, value):\n \"\"\"Set a single argument in this namespace\"\"\"\n assert key is not None\n assert value is not None\n namespace = self._fixNS(namespace)\n self.args[(namespace, key)] = value\n if not (namespace is BARE_NS):\n self.namespaces.add(namespace)", "metadata": "root.Message.setArg", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 448 }, { "content": " def delArg(self, namespace, key):\n namespace = self._fixNS(namespace)\n del self.args[(namespace, key)]", "metadata": "root.Message.delArg", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 457 }, { "content": " def __repr__(self):\n return \"<%s.%s %r>\" % (self.__class__.__module__,\n self.__class__.__name__,\n self.args)", "metadata": "root.Message.__repr__", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 461 }, { "content": " def __eq__(self, other):\n return self.args == other.args", "metadata": "root.Message.__eq__", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 466 }, { "content": " def __ne__(self, other):\n return not (self == other)", "metadata": "root.Message.__ne__", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 470 }, { "content": " def getAliasedArg(self, aliased_key, default=None):\n if aliased_key == 'ns':\n return self.getOpenIDNamespace()\n\n if aliased_key.startswith('ns.'):\n uri = self.namespaces.getNamespaceURI(aliased_key[3:])\n if uri is None:\n return default\n else:\n return uri\n\n try:\n alias, key = aliased_key.split('.', 1)\n except ValueError:\n # need more than x values to unpack\n ns = None\n else:\n ns = self.namespaces.getNamespaceURI(alias)\n\n if ns is None:\n key = aliased_key\n ns = self.getOpenIDNamespace()\n\n return self.getArg(ns, key, default)", "metadata": "root.Message.getAliasedArg", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 474 } ]
[ { "span": "cls()", "start_line": 124, "start_column": 15, "end_line": 124, "end_column": 20 }, { "span": "cls()", "start_line": 152, "start_column": 15, "end_line": 152, "end_column": 20 } ]
[ { "span": "class Message(object):", "start_line": 97, "start_column": 0, "end_line": 97, "end_column": 22 }, { "span": "cls,", "start_line": 122, "start_column": 21, "end_line": 122, "end_column": 24 }, { "span": "cls,", "start_line": 150, "start_column": 23, "end_line": 150, "end_column": 26 } ]
1
false
[ "[CLS]_", "Non", "_", "-_", "callable_", "called_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "the", " ", "implementation", " ", "of", " ", "this", " ", "object", ",", " ", "Non", "e", " ", "represent", "s", " ", "the", " ", "global", "\\", "10", ";", " ", " ", " ", " ", "namespace", " ", "as", " ", "well", " ", "as", " ", "a", " ", "namespace", " ", "with", " ", "no", " ", "key", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "cvar", " ", "namespace", "s", ":", " ", "A", " ", "dictionar", "y", " ", "speci", "fy", "ing", " ", "specific", "\\", "10", ";", " ", " ", " ", " ", "namespace", "-", "URI", " ", "to", " ", "alias", " ", "mapping", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "used", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "generat", "ing", " ", "namespace", " ", "alias", "es", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ns", "\\u", "args", ":", " ", "two", "-", "level", " ", "dictionar", "y", " ", "of", " ", "the", " ", "values", " ", "in", " ", "this", " ", "message", ",", "\\", "10", ";", " ", " ", " ", " ", "groupe", "d", " ", "by", " ", "namespace", " ", "URI", ".", " ", "The", " ", "first", " ", "level", " ", "is", " ", "the", " ", "namespace", "\\", "10", ";", " ", " ", " ", " ", "URI", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "ed", "\\u", "openid", "\\u", "namespaces_", "=_", "[_", "OPEN", "ID", "1", "\\u", "NS_", ",_", "OPEN", "ID", "2", "\\u", "NS_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Post", "Args_", "=_", "classmethod_", "(_", "from", "Post", "Args_", ")_", "\\u\\u\\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", "Open", "IDA", "rgs_", "=_", "classmethod_", "(_", "from", "Open", "IDA", "rgs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "KV", "Form_", "=_", "classmethod_", "(_", "from", "KV", "Form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "openid", "\\u", "namespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "an", " ", "empty", " ", "Messag", "e", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "args_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "namespaces_", "=_", "Names", "pace", "Map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "openid", "\\u", "namespace_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "openid", "\\u", "ns", "\\u", "uri_", "=_", "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_", "._", "set", "Open", "ID", "Namespace_", "(_", "openid", "\\u", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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_", "from", "Post", "Args_", "(_", "cls_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Construct", " ", "a", " ", "Messag", "e", " ", "contain", "ing", " ", "a", " ", "set", " ", "of", " ", "POST", " ", "argu", "ment", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "=_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Partition", " ", "int", "o", " ", "\"", "openid", ".\"", " ", "args", " ", "and", " ", "bare", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "openid", "\\u", "args_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "args_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "query", " ", "dict", " ", "must", " ", "have", " ", "one", " ", "value", " ", "for", " ", "each", " ", "key", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "not", " ", "lists", " ", "of", " ", "values", ".", " ", " ", "Query", " ", "is", " ", "%", "r", "\"_", "%_", "(_", "args_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", ",_", "rest_", "=_", "key_", "._", "split_", "(_", "'.'_", ",_", "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 ", " _", "prefix_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "prefix_", "!=_", "'", "openid", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "args_", "[_", "(_", "BAR", "E", "\\u", "NS_", ",_", "key_", ")_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "openid", "\\u", "args_", "[_", "rest_", "]_", "=_", "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_", "self_", "._", "\\u", "from", "Open", "IDA", "rgs_", "(_", "openid", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "from", "Open", "IDA", "rgs_", "(_", "cls_", ",_", "openid", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Construct", " ", "a", " ", "Messag", "e", " ", "from", " ", "a", " ", "parsed", " ", "KV", "Form", " ", "message", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "=_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "from", "Open", "IDA", "rgs_", "(_", "openid", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "from", "Open", "IDA", "rgs_", "(_", "self_", ",_", "openid", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "register", "ed", "\\u", "aliases_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ns", "\\u", "args_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Resolv", "e", " ", "namespaces_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "rest_", ",_", "value_", "in_", "openid", "\\u", "args_", "._", "iteritems_", "(_", ")_", ":_", "\\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 ", " _", "ns", "\\u", "alias_", ",_", "ns", "\\u", "key_", "=_", "rest_", "._", "split_", "(_", "'.'_", ",_", "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 ", " _", "ns", "\\u", "alias_", "=_", "NULL", "\\u", "NAMESPACE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns", "\\u", "key_", "=_", "rest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ns", "\\u", "alias_", "==_", "'", "ns", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "namespaces_", "._", "add", "Alias_", "(_", "value_", ",_", "ns", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ns", "\\u", "alias_", "==_", "NULL", "\\u", "NAMESPACE_", "and_", "ns", "\\u", "key_", "==_", "'", "ns", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "null", " ", "namespace_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "namespaces_", "._", "add", "Alias_", "(_", "value_", ",_", "NULL", "\\u", "NAMESPACE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns", "\\u", "args_", "._", "append_", "(_", "(_", "ns", "\\u", "alias_", ",_", "ns", "\\u", "key_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "there", " ", "is", " ", "an", " ", "Open", "ID", " ", "namespace", " ", "definition_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "openid", "\\u", "ns", "\\u", "uri_", "=_", "self_", "._", "namespaces_", "._", "get", "Names", "pace", "URI_", "(_", "NULL", "\\u", "NAMESPACE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "openid", "\\u", "ns", "\\u", "uri_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "openid", "\\u", "ns", "\\u", "uri_", "=_", "OPEN", "ID", "1", "\\u", "NS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set", "Open", "ID", "Namespace_", "(_", "openid", "\\u", "ns", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Actual", "ly", " ", "put", " ", "the", " ", "pair", "s", " ", "int", "o", " ", "the", " ", "appropr", "iate", " ", "namespaces_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "ns", "\\u", "alias_", ",_", "ns", "\\u", "key_", ",_", "value_", ")_", "in_", "ns", "\\u", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns", "\\u", "uri_", "=_", "self_", "._", "namespaces_", "._", "get", "Names", "pace", "URI_", "(_", "ns", "\\u", "alias_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ns", "\\u", "uri_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", "ly", " ", "try", " ", "to", " ", "map", " ", "an", " ", "alias", " ", "to", " ", "a", " ", "default", " ", "if", " ", "it", "'", "s", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Open", "ID", " ", "1", ".", "x", " ", "message", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "openid", "\\u", "ns", "\\u", "uri_", "==_", "OPEN", "ID", "1", "\\u", "NS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "\\u", "alias_", ",_", "\\u", "uri_", "in_", "register", "ed", "\\u", "aliases_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "\\u", "alias_", "==_", "ns", "\\u", "alias_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ns", "\\u", "uri_", "=_", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ns", "\\u", "uri_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ns", "\\u", "uri_", "=_", "openid", "\\u", "ns", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns", "\\u", "key_", "=_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "ns", "\\u", "alias_", ",_", "ns", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "namespaces_", "._", "add", "Alias_", "(_", "ns", "\\u", "uri_", ",_", "ns", "\\u", "alias_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set", "Arg_", "(_", "ns", "\\u", "uri_", ",_", "ns", "\\u", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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_", "set", "Open", "ID", "Namespace_", "(_", "self_", ",_", "openid", "\\u", "ns", "\\u", "uri_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "openid", "\\u", "ns", "\\u", "uri_", "not_", "in_", "self_", "._", "allow", "ed", "\\u", "openid", "\\u", "namespaces_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Inva", "lid", " ", "null", " ", "namespace", ":", " ", "%", "r", "'_", "%_", "(_", "openid", "\\u", "ns", "\\u", "uri_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "namespaces_", "._", "add", "Alias_", "(_", "openid", "\\u", "ns", "\\u", "uri_", ",_", "NULL", "\\u", "NAMESPACE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "openid", "\\u", "ns", "\\u", "uri_", "=_", "openid", "\\u", "ns", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Open", "ID", "Namespace_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "openid", "\\u", "ns", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Open", "ID", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Open", "ID", "Namespace_", "(_", ")_", "==_", "OPEN", "ID", "1", "\\u", "NS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Open", "ID", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Open", "ID", "Namespace_", "(_", ")_", "==_", "OPEN", "ID", "2", "\\u", "NS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "from", "KV", "Form_", "(_", "cls_", ",_", "kv", "form", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "a", " ", "Messag", "e", " ", "from", " ", "a", " ", "KV", "Form", " ", "string", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "._", "from", "Open", "IDA", "rgs_", "(_", "kv", "form_", "._", "kv", "To", "Dict_", "(_", "kv", "form", "\\u", "string_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "copy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "copy_", "._", "deepcopy_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "Post", "Args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "all", " ", "argu", "ment", "s", " ", "with", " ", "openid", ".", " ", "in", " ", "front", " ", "of", " ", "namespace", "d", " ", "argu", "ment", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "namespace", " ", "definit", "ion", "s", " ", "to", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ns", "\\u", "uri_", ",_", "alias_", "in_", "self_", "._", "namespaces_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "alias_", "==_", "NULL", "\\u", "NAMESPACE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ns", "\\u", "uri_", "!=_", "OPEN", "ID", "1", "\\u", "NS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "args_", "[_", "'", "openid", ".", "ns", "'_", "]_", "=_", "ns", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "drop", " ", "the", " ", "default", " ", "null", " ", "namespace", " ", "definit", "ion", ".", " ", "Thi", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "potenti", "ally", " ", "change", "s", " ", "a", " ", "message", " ", "sinc", "e", " ", "we", " ", "have", " ", "no_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "way", " ", "of", " ", "know", "ing", " ", "whe", "ther", " ", "it", " ", "was", " ", "explicit", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "specified", " ", "at", " ", "the", " ", "time", " ", "the", " ", "message", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parsed", ".", " ", "The", " ", "vas", "t", " ", "major", "it", "y", " ", "of", " ", "the", " ", "time", ",", " ", "this", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "the", " ", "right", " ", "thing", " ", "to", " ", "do", ".", " ", "Poss", "ibl", "y", " ", "this", " ", "coul", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "look", " ", "in", " ", "the", " ", "sign", "ed", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "get", "Open", "ID", "Namespace_", "(_", ")_", "!=_", "OPEN", "ID", "1", "\\u", "NS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ns", "\\u", "key_", "=_", "'", "openid", ".", "ns", ".'_", "+_", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "[_", "ns", "\\u", "key_", "]_", "=_", "ns", "\\u", "uri_", "\\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_", "(_", "ns", "\\u", "uri_", ",_", "ns", "\\u", "key_", ")_", ",_", "value_", "in_", "self_", "._", "args_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "get", "Key_", "(_", "ns", "\\u", "uri_", ",_", "ns", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "Args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "all", " ", "namespace", "d", " ", "argu", "ment", "s", ",", " ", "faili", "ng", " ", "if", " ", "any", "\\", "10", ";", " ", " ", " ", " ", "non", "-", "namespace", "d", " ", "argu", "ment", "s", " ", "exist", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME", " ", "-", " ", "undo", "cum", "ente", "d", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "post", "\\u", "args_", "=_", "self_", "._", "to", "Post", "Args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kv", "args_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "post", "\\u", "args_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "k_", "._", "startswith_", "(_", "'", "openid", ".'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Thi", "s", " ", "message", " ", "can", " ", "only", " ", "be", " ", "encode", "d", " ", "as", " ", "a", " ", "POST", ",", " ", "bec", "aus", "e", " ", "it", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contain", "s", " ", "argu", "ment", "s", " ", "tha", "t", " ", "are", " ", "not", " ", "prefixed", " ", "with", " ", "\"", "openid", ".\"", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kv", "args_", "[_", "k_", "[_", "7_", ":_", "]_", "]_", "=_", "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_", "return_", "kv", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "Form", "Markup_", "(_", "self_", ",_", "action", "\\u", "url_", ",_", "form", "\\u", "tag", "\\u", "attrs_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "submit", "\\u", "text_", "=_", "\"", "Continu", "e", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "HTM", "L", " ", "form", " ", "markup", " ", "tha", "t", " ", "contain", "s", " ", "the", " ", "values", " ", "in", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "message", ",", " ", "to", " ", "be", " ", "HTTP", " ", "POST", "ed", " ", "as", " ", "x", "-", "www", "-", "form", "-", "url", "encode", "d", " ", "UT", "F", "-", "8", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "action", "\\u", "url", ":", " ", "The", " ", "URL", " ", "to", " ", "whi", "ch", " ", "the", " ", "form", " ", "will", " ", "be", " ", "POST", "ed", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "action", "\\u", "url", ":", " ", "str", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "form", "\\u", "tag", "\\u", "attr", "s", ":", " ", "Dict", "ionar", "y", " ", "of", " ", "attribute", "s", " ", "to", " ", "be", " ", "adde", "d", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "form", " ", "tag", ".", " ", "'", "accept", "-", "charset", "'", " ", "and", " ", "'", "enc", "type", "'", " ", "have", " ", "default", "s", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "can", " ", "be", " ", "overrid", "den", ".", " ", "If", " ", "a", " ", "value", " ", "is", " ", "supplie", "d", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "'", "action", "'", " ", "or", " ", "'", "method", "',", " ", "it", " ", "will", " ", "be", " ", "replaced", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "form", "\\u", "tag", "\\u", "attr", "s", ":", " ", "{", "unicode", ":", " ", "unicode", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "submit", "\\u", "text", ":", " ", "The", " ", "text", " ", "tha", "t", " ", "will", " ", "appear", " ", "on", " ", "the", " ", "submit", "\\", "10", ";", " ", " ", " ", " ", "button", " ", "for", " ", "this", " ", "form", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "submit", "\\u", "text", ":", " ", "unicode", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", "s", ":", " ", "A", " ", "string", " ", "contain", "ing", " ", "(", "X", ")", "HTM", "L", " ", "markup", " ", "for", " ", "a", " ", "form", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "encodes", " ", "the", " ", "values", " ", "in", " ", "this", " ", "Messag", "e", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "str", " ", "or", " ", "unicode", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Element", "Tree_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "Thi", "s", " ", "function", " ", "require", "s", " ", "Element", "Tree", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "Element", "Tree_", "._", "Element_", "(_", "'", "form", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "form", "\\u", "tag", "\\u", "attrs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "attr_", "in_", "form", "\\u", "tag", "\\u", "attrs_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "._", "attrib_", "[_", "name_", "]_", "=_", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "._", "attrib_", "[_", "'", "action", "'_", "]_", "=_", "action", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "attrib_", "[_", "'", "method", "'_", "]_", "=_", "'", "post", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "attrib_", "[_", "'", "accept", "-", "charset", "'_", "]_", "=_", "'", "UT", "F", "-", "8", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "attrib_", "[_", "'", "enc", "type", "'_", "]_", "=_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", ",_", "value_", "in_", "self_", "._", "to", "Post", "Args_", "(_", ")_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attrs_", "=_", "{_", "'", "type", "'_", ":_", "'", "hidden", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "value_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "append_", "(_", "Element", "Tree_", "._", "Element_", "(_", "'", "input", "'_", ",_", "attrs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "submit_", "=_", "Element", "Tree_", "._", "Element_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "input", "'_", ",_", "{_", "'", "type", "'_", ":_", "'", "submit", "'_", ",_", "'", "value", "'_", ":_", "submit", "\\u", "text_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "append_", "(_", "submit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Element", "Tree_", "._", "tostring_", "(_", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "URL_", "(_", "self_", ",_", "base", "\\u", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "a", " ", "GET", " ", "URL", " ", "with", " ", "the", " ", "parameter", "s", " ", "in", " ", "this", " ", "message", "\\", "10", ";", " ", " ", " ", " ", "attache", "d", " ", "as", " ", "query", " ", "parameter", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "oid", "util_", "._", "append", "Args_", "(_", "base", "\\u", "url_", ",_", "self_", "._", "to", "Post", "Args_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "KV", "Form_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "a", " ", "KV", "Form", " ", "string", " ", "tha", "t", " ", "contain", "s", " ", "the", " ", "parameter", "s", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "message", ".", " ", "Thi", "s", " ", "will", " ", "fail", " ", "if", " ", "the", " ", "message", " ", "contain", "s", " ", "argu", "ment", "s", "\\", "10", ";", " ", " ", " ", " ", "outsi", "de", " ", "of", " ", "the", " ", "'", "openid", ".'", " ", "prefix", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "kv", "form_", "._", "dict", "To", "KV", "_", "(_", "self_", "._", "to", "Args_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "URL", "Encode", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "an", " ", "x", "-", "www", "-", "url", "encode", "d", " ", "string", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "self_", "._", "to", "Post", "Args_", "(_", ")_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "urllib_", "._", "urlencode_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fix", "NS_", "(_", "self_", ",_", "namespace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", " ", "an", " ", "input", " ", "value", " ", "int", "o", " ", "the", " ", "internal", "ly", " ", "used", " ", "values", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "object", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "namespace", ":", " ", "The", " ", "string", " ", "or", " ", "constant", " ", "to", " ", "convert", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "namespace", ":", " ", "str", " ", "or", " ", "unicode", " ", "or", " ", "BAR", "E", "\\u", "NS", " ", "or", " ", "OPEN", "ID", "\\u", "NS", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "namespace_", "==_", "OPEN", "ID", "\\u", "NS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "openid", "\\u", "ns", "\\u", "uri_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Unde", "fined", "Open", "ID", "Namespace_", "(_", "'", "Open", "ID", " ", "namespace", " ", "not", " ", "set", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "namespace_", "=_", "self_", "._", "\\u", "openid", "\\u", "ns", "\\u", "uri_", "\\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_", "namespace_", "!=_", "BAR", "E", "\\u", "NS_", "and_", "type_", "(_", "namespace_", ")_", "not_", "in_", "[_", "str_", ",_", "unicode_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Names", "pace", " ", "must", " ", "be", " ", "BAR", "E", "\\u", "NS", ",", " ", "OPEN", "ID", "\\u", "NS", " ", "or", " ", "a", " ", "string", ".", " ", "got", " ", "%", "r", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "namespace_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "namespace_", "!=_", "BAR", "E", "\\u", "NS_", "and_", "':'_", "not_", "in_", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fmt_", "=_", "'", "Open", "ID", " ", "2.0", " ", "namespace", " ", "identifi", "ers", " ", "SHO", "UL", "D", " ", "be", " ", "URI", "s", ".", " ", "Got", " ", "%", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "fmt_", "%_", "(_", "namespace_", ",_", ")_", ",_", "Dep", "reca", "tion", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "namespace_", "==_", "'", "sre", "g", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fmt_", "=_", "'", "Us", "ing", " ", "%", "r", " ", "inst", "ead", " ", "of", " ", "\"", "sre", "g", "\"", " ", "as", " ", "namespace", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "fmt_", "%_", "(_", "SRE", "G", "\\u", "URI_", ",_", ")_", ",_", "Dep", "reca", "tion", "Warning_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "SRE", "G", "\\u", "URI_", "\\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_", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "Key_", "(_", "self_", ",_", "namespace_", ",_", "ns", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "namespace_", ",_", "ns", "\\u", "key_", ")_", "in_", "self_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Key_", "(_", "self_", ",_", "namespace_", ",_", "ns", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "key", " ", "for", " ", "a", " ", "partic", "ular", " ", "namespace", "d", " ", "argu", "ment", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "namespace_", "==_", "BAR", "E", "\\u", "NS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ns", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ns", "\\u", "alias_", "=_", "self_", "._", "namespaces_", "._", "get", "Alias_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", " ", "alias", " ", "is", " ", "defin", "ed", ",", " ", "so", " ", "no", " ", "key", " ", "can", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ns", "\\u", "alias_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ns", "\\u", "alias_", "==_", "NULL", "\\u", "NAMESPACE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tail_", "=_", "ns", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tail_", "=_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "ns", "\\u", "alias_", ",_", "ns", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'", "openid", ".'_", "+_", "tail_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Arg_", "(_", "self_", ",_", "namespace_", ",_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "a", " ", "value", " ", "for", " ", "a", " ", "namespace", "d", " ", "key", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "namespace", ":", " ", "The", " ", "namespace", " ", "in", " ", "the", " ", "message", " ", "for", " ", "this", " ", "key", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "namespace", ":", " ", "str", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "key", ":", " ", "The", " ", "key", " ", "to", " ", "get", " ", "within", " ", "this", " ", "namespace", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "key", ":", " ", "str", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "default", ":", " ", "The", " ", "value", " ", "to", " ", "use", " ", "if", " ", "this", " ", "key", " ", "is", " ", "absen", "t", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "message", ".", " ", "Us", "ing", " ", "the", " ", "special", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "openid", ".", "message", ".", "no", "\\u", "default", " ", "will", " ", "result", " ", "in", " ", "this", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "rais", "ing", " ", "a", " ", "Key", "Error", " ", "inst", "ead", " ", "of", " ", "return", "ing", " ", "the", " ", "default", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "rty", "pe", ":", " ", "str", " ", "or", " ", "the", " ", "type", " ", "of", " ", "default", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", "s", " ", "Key", "Error", ":", " ", "if", " ", "default", " ", "is", " ", "no", "\\u", "default", "\\", "10", ";", " ", " ", " ", " ", "@", "raise", "s", " ", "Unde", "fined", "Open", "ID", "Names", "pace", ":", " ", "if", " ", "the", " ", "message", " ", "has", " ", "not", " ", "ye", "t", "\\", "10", ";", " ", " ", " ", " ", "had", " ", "an", " ", "Open", "ID", " ", "namespace", " ", "set", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args", "\\u", "key_", "=_", "(_", "namespace_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "args_", "[_", "args", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "default_", "is_", "no", "\\u", "default_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "(_", "namespace_", ",_", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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_", "get", "Args_", "(_", "self_", ",_", "namespace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "the", " ", "argu", "ment", "s", " ", "tha", "t", " ", "are", " ", "defin", "ed", " ", "for", " ", "this", " ", "namespace", " ", "URI", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "return", "s", ":", " ", "mapping", " ", "from", " ", "namespace", "d", " ", "keys", " ", "to", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "@", "return", "type", ":", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "ns", "\\u", "key_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "(_", "pair", "\\u", "ns_", ",_", "ns", "\\u", "key_", ")_", ",_", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "self_", "._", "args_", "._", "iteritems_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "pair", "\\u", "ns_", "==_", "namespace_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "Args_", "(_", "self_", ",_", "namespace_", ",_", "updates_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "multiple", " ", "key", "/", "value", " ", "pair", "s", " ", "in", " ", "one", " ", "call", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "update", "s", ":", " ", "The", " ", "values", " ", "to", " ", "set", "\\", "10", ";", " ", " ", " ", " ", "@", "type", " ", "update", "s", ":", " ", "{", "unicode", ":", "unicode", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "updates_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Arg_", "(_", "namespace_", ",_", "k_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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_", "set", "Arg_", "(_", "self_", ",_", "namespace_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "a", " ", "single", " ", "argu", "ment", " ", "in", " ", "this", " ", "namespace", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "key_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "value_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "args_", "[_", "(_", "namespace_", ",_", "key_", ")_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "namespace_", "is_", "BAR", "E", "\\u", "NS_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "namespaces_", "._", "add_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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_", "del", "Arg_", "(_", "self_", ",_", "namespace_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "namespace_", "=_", "self_", "._", "\\u", "fix", "NS_", "(_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "self_", "._", "args_", "[_", "(_", "namespace_", ",_", "key_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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", " ", "%", "r", ">\"_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "module\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "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_", "self_", "._", "args_", "==_", "other_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "(_", "self_", "==_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Aliase", "d", "Arg_", "(_", "self_", ",_", "aliased", "\\u", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "aliased", "\\u", "key_", "==_", "'", "ns", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "Open", "ID", "Namespace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "aliased", "\\u", "key_", "._", "startswith_", "(_", "'", "ns", ".'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uri_", "=_", "self_", "._", "namespaces_", "._", "get", "Names", "pace", "URI_", "(_", "aliased", "\\u", "key_", "[_", "3_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "uri_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alias_", ",_", "key_", "=_", "aliased", "\\u", "key_", "._", "split_", "(_", "'.'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "need", " ", "more", " ", "than", " ", "x", " ", "values", " ", "to", " ", "unpack_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns_", "=_", "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 ", " _", "ns_", "=_", "self_", "._", "namespaces_", "._", "get", "Names", "pace", "URI_", "(_", "alias_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ns_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "aliased", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ns_", "=_", "self_", "._", "get", "Open", "ID", "Namespace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "get", "Arg_", "(_", "ns_", ",_", "key_", ",_", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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\nimport cPickle as pickle\nimport cudamat as cm\n\nimport sgd\nimport rnnet as rnnet\nimport dataLoader as dl\nimport pdb\n\ninFile = \"models/swbd_layers_5_2048_temporal_3_step_1e-5_mom_.95_anneal_1.3.bin\"\n\nnp.random.seed(33)\nimport random\nrandom.seed(33)\n\n# Load model if specified\nwith open(inFile,'r') as fid:\n opts = pickle.load(fid)\n loader = dl.DataLoader(opts.dataDir,opts.rawDim,opts.inputDim)\n\n nn = rnnet.NNet(opts.inputDim,opts.outputDim,opts.layerSize,opts.numLayers,\n opts.maxUttLen,temporalLayer=opts.temporalLayer)\n nn.initParams()\n SGD = sgd.SGD(nn,opts.maxUttLen,alpha=opts.step,momentum=opts.momentum)\n SGD.expcost = pickle.load(fid)\n SGD.it = 100\n nn.fromFile(fid)\n velocity = pickle.load(fid)\n for (w,b),(wv,bv) in zip(velocity,SGD.velocity):\n wv.copy_to_host()\n bv.copy_to_host()\n wv.numpy_array[:] = w[:]\n bv.numpy_array[:] = b[:]\n wv.copy_to_device()\n bv.copy_to_device()\n\n\n# Training\npdb.set_trace()\nfor i in np.random.permutation(opts.numFiles)+1:\n print \"File %d\"%i\n if i != 96:\n nk = 500\n if i == 384:\n nk = 139\n random.shuffle(np.arange(nk).tolist())\n else:\n data_dict,alis,keys,sizes = loader.loadDataFileDict(i)\n SGD.run(data_dict,alis,keys,sizes)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import cudamat as cm", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 20 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "Pickle_", "as_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cud", "amat", "_", "as_", "cm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sgd", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rn", "net_", "as_", "rn", "net_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "data", "Loader_", "as_", "dl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pdb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in", "File_", "=_", "\"", "model", "s", "/", "sw", "bd", "\\u", "layer", "s", "\\u", "5", "\\u", "204", "8", "\\u", "tempora", "l\\u", "3", "\\u", "step", "\\u", "1e-", "5", "\\u", "mom", "\\u.", "9", "5", "\\u", "anne", "al", "\\u", "1.3", ".", "bin", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "np_", "._", "random_", "._", "seed_", "(_", "33_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random_", "._", "seed_", "(_", "33_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "model", " ", "if", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "in", "File_", ",_", "'", "r", "'_", ")_", "as_", "fid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "=_", "pickle_", "._", "load_", "(_", "fid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loader_", "=_", "dl_", "._", "Data", "Loader_", "(_", "opts_", "._", "data", "Dir_", ",_", "opts_", "._", "raw", "Dim_", ",_", "opts_", "._", "input", "Dim_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nn_", "=_", "rn", "net_", "._", "NN", "et_", "(_", "opts_", "._", "input", "Dim_", ",_", "opts_", "._", "output", "Dim_", ",_", "opts_", "._", "layer", "Size_", ",_", "opts_", "._", "num", "Layers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", "._", "max", "Ut", "t", "Len_", ",_", "tempora", "l", "Layer_", "=_", "opts_", "._", "tempora", "l", "Layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nn_", "._", "init", "Params_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGD", "_", "=_", "sgd", "_", "._", "SGD", "_", "(_", "nn_", ",_", "opts_", "._", "max", "Ut", "t", "Len_", ",_", "alpha_", "=_", "opts_", "._", "step_", ",_", "momentum_", "=_", "opts_", "._", "momentum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGD", "_", "._", "exp", "cost_", "=_", "pickle_", "._", "load_", "(_", "fid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SGD", "_", "._", "it_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nn_", "._", "from", "File_", "(_", "fid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "velocity_", "=_", "pickle_", "._", "load_", "(_", "fid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "w_", ",_", "b_", ")_", ",_", "(_", "wv", "_", ",_", "bv_", ")_", "in_", "zip_", "(_", "velocity_", ",_", "SGD", "_", "._", "velocity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wv", "_", "._", "copy", "\\u", "to", "\\u", "host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bv_", "._", "copy", "\\u", "to", "\\u", "host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wv", "_", "._", "nump", "y", "\\u", "array_", "[_", ":_", "]_", "=_", "w_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bv_", "._", "nump", "y", "\\u", "array_", "[_", ":_", "]_", "=_", "b_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wv", "_", "._", "copy", "\\u", "to", "\\u", "device_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bv_", "._", "copy", "\\u", "to", "\\u", "device_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Train", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pdb_", "._", "set\\u", "trace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "np_", "._", "random_", "._", "permutation_", "(_", "opts_", "._", "num", "Files_", ")_", "+_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "File", " ", "%", "d", "\"_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "!=_", "96_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nk_", "=_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "==_", "384_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nk_", "=_", "139_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "random_", "._", "shuffle_", "(_", "np_", "._", "arange_", "(_", "nk_", ")_", "._", "tolist_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "dict_", ",_", "alis", "_", ",_", "keys_", ",_", "sizes_", "=_", "loader_", "._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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 ]
Unused local variable
cornell-brg/pymtl/pymtl/tools/simulation/sim_utils.py
[ { "content": "def _attr_name_to_object( model, name ):\n # Temporarily creates the names 'self' and 's' in the current\n # scope. SUPER HACKY\n self = s = model\n # If slice or list, get name components previous to indexing\n if '[?]' in name:\n name, extra = name.split('[?]', 1)\n # Try to return the Python object attached to the name. If the\n # object is not a SignalValue or a list, we can't add it to\n # the sensitivity list. Sometimes this is okay (eg. constants),\n # but sometimes this indicates an error in the user's code, so\n # display a warning.\n # In the case of a list, we need to reconstruct the name of each\n # item in the list so we can try to add it to the sensitivity\n # list. Return a tuple containing the list object, the list name\n # and the attribute string the appears after the list indexing.\n try:\n x = eval( name )\n if isinstance( x, SignalValue ): return x\n elif isinstance( x, list ): return ( x, name, extra )\n else: raise NameError\n except NameError:\n if model._debug:\n warnings.warn( \"Cannot add variable '{}' to sensitivity list.\"\n \"\".format( name ), Warning )\n return None", "metadata": "root._attr_name_to_object", "header": "['module', '___EOS___']", "index": 283 } ]
[ { "span": "self ", "start_line": 286, "start_column": 2, "end_line": 286, "end_column": 6 }, { "span": "s ", "start_line": 286, "start_column": 9, "end_line": 286, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "attr", "\\u", "name", "\\u", "to", "\\u", "object_", "(_", "model_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tempora", "ri", "ly", " ", "create", "s", " ", "the", " ", "names", " ", "'", "self", "'", " ", "and", " ", "'", "s", "'", " ", "in", " ", "the", " ", "current_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "scope", ".", " ", " ", "SUPER", " ", "HA", "CK", "Y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "=_", "s_", "=_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "slice", " ", "or", " ", "list", ",", " ", "get", " ", "name", " ", "component", "s", " ", "previ", "ous", " ", "to", " ", "indexing", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'[?]'_", "in_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", ",_", "extra_", "=_", "name_", "._", "split_", "(_", "'[?]'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "return", " ", "the", " ", "Pyth", "on", " ", "object", " ", "attache", "d", " ", "to", " ", "the", " ", "name", ".", " ", "If", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", " ", "is", " ", "not", " ", "a", " ", " ", "Signal", "Value", " ", "or", " ", "a", " ", "list", ",", " ", "we", " ", "can", "'", "t", " ", "add", " ", "it", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "sensitivity", " ", "list", ".", " ", " ", "Some", "times", " ", "this", " ", "is", " ", "oka", "y", " ", "(", "eg", ".", " ", "constant", "s", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "somet", "imes", " ", "this", " ", "indicat", "es", " ", "an", " ", "error", " ", "in", " ", "the", " ", "user", "'", "s", " ", "code", ",", " ", "so_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "display", " ", "a", " ", "warn", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "the", " ", "case", " ", "of", " ", "a", " ", "list", ",", " ", "we", " ", "need", " ", "to", " ", "reconstruct", " ", "the", " ", "name", " ", "of", " ", "each_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "item", " ", "in", " ", "the", " ", "list", " ", "so", " ", "we", " ", "can", " ", "try", " ", "to", " ", "add", " ", "it", " ", "to", " ", "the", " ", "sensitivity", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", ".", " ", "Return", " ", "a", " ", "tuple", " ", "contain", "ing", " ", "the", " ", "list", " ", "object", ",", " ", "the", " ", "list", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "the", " ", "attribute", " ", "string", " ", "the", " ", "appear", "s", " ", "after", " ", "the", " ", "list", " ", "indexing", "._", "\\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 ", " _", "x_", "=_", "eval_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "Signal", "Value_", ")_", ":_", "return_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "isinstance_", "(_", "x_", ",_", "list_", ")_", ":_", "return_", "(_", "x_", ",_", "name_", ",_", "extra_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Name", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model_", "._", "\\u", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "Cann", "ot", " ", "add", " ", "variab", "le", " ", "'{}'", " ", "to", " ", "sensitivity", " ", "list", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"_", "._", "format_", "(_", "name_", ")_", ",_", "Warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Testing equality to None
JT5D/Alfred-Popclip-Sublime/Sublime Text 2/JsFormat/libs/diff_match_patch/python2/diff_match_patch.py
[ { "content": " def diff_main(self, text1, text2, checklines=True, deadline=None):\n \"\"\"Find the differences between two texts. Simplifies the problem by\n stripping any common prefix or suffix off the texts before diffing.\n\n Args:\n text1: Old string to be diffed.\n text2: New string to be diffed.\n checklines: Optional speedup flag. If present and false, then don't run\n a line-level diff first to identify the changed areas.\n Defaults to true, which does a faster, slightly less optimal diff.\n deadline: Optional time when the diff should be complete by. Used\n internally for recursive calls. Users should set DiffTimeout instead.\n\n Returns:\n Array of changes.\n \"\"\"\n # Set a deadline by which time the diff must be complete.\n if deadline == None:\n # Unlike in most languages, Python counts time in seconds.\n if self.Diff_Timeout <= 0:\n deadline = sys.maxint\n else:\n deadline = time.time() + self.Diff_Timeout\n\n # Check for null inputs.\n if text1 == None or text2 == None:\n raise ValueError(\"Null inputs. (diff_main)\")\n\n # Check for equality (speedup).\n if text1 == text2:\n if text1:\n return [(self.DIFF_EQUAL, text1)]\n return []\n\n # Trim off common prefix (speedup).\n commonlength = self.diff_commonPrefix(text1, text2)\n commonprefix = text1[:commonlength]\n text1 = text1[commonlength:]\n text2 = text2[commonlength:]\n\n # Trim off common suffix (speedup).\n commonlength = self.diff_commonSuffix(text1, text2)\n if commonlength == 0:\n commonsuffix = ''\n else:\n commonsuffix = text1[-commonlength:]\n text1 = text1[:-commonlength]\n text2 = text2[:-commonlength]\n\n # Compute the diff on the middle block.\n diffs = self.diff_compute(text1, text2, checklines, deadline)\n\n # Restore the prefix and suffix.\n if commonprefix:\n diffs[:0] = [(self.DIFF_EQUAL, commonprefix)]\n if commonsuffix:\n diffs.append((self.DIFF_EQUAL, commonsuffix))\n self.diff_cleanupMerge(diffs)\n return diffs", "metadata": "root.diff_match_patch.diff_main", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 80 }, { "content": " def match_main(self, text, pattern, loc):\n \"\"\"Locate the best instance of 'pattern' in 'text' near 'loc'.\n\n Args:\n text: The text to search.\n pattern: The pattern to search for.\n loc: The location to search around.\n\n Returns:\n Best match index or -1.\n \"\"\"\n # Check for null inputs.\n if text == None or pattern == None:\n raise ValueError(\"Null inputs. (match_main)\")\n\n loc = max(0, min(loc, len(text)))\n if text == pattern:\n # Shortcut (potentially not guaranteed by the algorithm)\n return 0\n elif not text:\n # Nothing to match.\n return -1\n elif text[loc:loc + len(pattern)] == pattern:\n # Perfect match at the perfect spot! (Includes case of null pattern)\n return loc\n else:\n # Do a fuzzy compare.\n match = self.match_bitap(text, pattern, loc)\n return match", "metadata": "root.diff_match_patch.match_main", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1217 } ]
[ { "span": "deadline == None:", "start_line": 97, "start_column": 7, "end_line": 97, "end_column": 23 }, { "span": "text1 == None ", "start_line": 105, "start_column": 7, "end_line": 105, "end_column": 20 }, { "span": "text2 == None:", "start_line": 105, "start_column": 24, "end_line": 105, "end_column": 37 }, { "span": "text == None ", "start_line": 1229, "start_column": 7, "end_line": 1229, "end_column": 19 }, { "span": "pattern == None:", "start_line": 1229, "start_column": 23, "end_line": 1229, "end_column": 38 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "diff", "\\u", "main_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ",_", "check", "lines_", "=_", "True_", ",_", "deadline_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "the", " ", "difference", "s", " ", "bet", "ween", " ", "two", " ", "texts", ".", " ", " ", "Simplif", "ies", " ", "the", " ", "problem", " ", "by", "\\", "10", ";", " ", " ", "strip", "ping", " ", "any", " ", "common", " ", "prefix", " ", "or", " ", "suff", "ix", " ", "off", " ", "the", " ", "texts", " ", "bef", "ore", " ", "diff", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Old", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "New", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "check", "lines", ":", " ", "Optio", "nal", " ", "speed", "up", " ", "flag", ".", " ", " ", "If", " ", "presen", "t", " ", "and", " ", "fal", "se", ",", " ", "then", " ", "don", "'", "t", " ", "run", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "line", "-", "level", " ", "diff", " ", "first", " ", "to", " ", "identify", " ", "the", " ", "change", "d", " ", "area", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Default", "s", " ", "to", " ", "true", ",", " ", "whi", "ch", " ", "doe", "s", " ", "a", " ", "faste", "r", ",", " ", "slight", "ly", " ", "less", " ", "optim", "al", " ", "diff", ".", "\\", "10", ";", " ", " ", "deadl", "ine", ":", " ", "Optio", "nal", " ", "time", " ", "whe", "n", " ", "the", " ", "diff", " ", "shou", "ld", " ", "be", " ", "complete", " ", "by", ".", " ", " ", "Us", "ed", "\\", "10", ";", " ", " ", " ", " ", "internal", "ly", " ", "for", " ", "recurs", "ive", " ", "calls", ".", " ", " ", "User", "s", " ", "shou", "ld", " ", "set", " ", "Diff", "Time", "out", " ", "inst", "ead", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "change", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "a", " ", "deadl", "ine", " ", "by", " ", "whi", "ch", " ", "time", " ", "the", " ", "diff", " ", "must", " ", "be", " ", "complete", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "deadline_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Unli", "ke", " ", "in", " ", "most", " ", "language", "s", ",", " ", "Pyth", "on", " ", "count", "s", " ", "time", " ", "in", " ", "second", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "Diff", "\\u", "Timeout_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deadline_", "=_", "sys_", "._", "maxint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deadline_", "=_", "time_", "._", "time_", "(_", ")_", "+_", "self_", "._", "Diff", "\\u", "Timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "null", " ", "inputs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text1", "_", "==_", "None_", "or_", "text2_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Null", " ", "inputs", ".", " ", "(", "diff", "\\u", "main", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "equality", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text1", "_", "==_", "text2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text1", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "text1", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Trim", " ", "off", " ", "common", " ", "prefix", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common", "length_", "=_", "self_", "._", "diff", "\\u", "common", "Prefix_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "prefix_", "=_", "text1", "_", "[_", ":_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "text1", "_", "[_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text2_", "=_", "text2_", "[_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Trim", " ", "off", " ", "common", " ", "suff", "ix", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "common", "length_", "=_", "self_", "._", "diff", "\\u", "common", "Suffix_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common", "length_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "suffix_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "suffix_", "=_", "text1", "_", "[_", "-_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "text1", "_", "[_", ":_", "-_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text2_", "=_", "text2_", "[_", ":_", "-_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "the", " ", "diff", " ", "on", " ", "the", " ", "middle", " ", "block", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "diffs_", "=_", "self_", "._", "diff", "\\u", "compute_", "(_", "text1", "_", ",_", "text2_", ",_", "check", "lines_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Restor", "e", " ", "the", " ", "prefix", " ", "and", " ", "suff", "ix", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", ":_", "0_", "]_", "=_", "[_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "common", "prefix_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "common", "suffix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "common", "suffix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "diff", "\\u", "clean", "up", "Merge_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match", "\\u", "main_", "(_", "self_", ",_", "text_", ",_", "pattern_", ",_", "loc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Locat", "e", " ", "the", " ", "best", " ", "instance", " ", "of", " ", "'", "pattern", "'", " ", "in", " ", "'", "text", "'", " ", "near", " ", "'", "loc", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text", ":", " ", "The", " ", "text", " ", "to", " ", "search", ".", "\\", "10", ";", " ", " ", "pattern", ":", " ", "The", " ", "pattern", " ", "to", " ", "search", " ", "for", ".", "\\", "10", ";", " ", " ", "loc", ":", " ", "The", " ", "location", " ", "to", " ", "search", " ", "aro", "und", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Bes", "t", " ", "match", " ", "index", " ", "or", " ", "-1", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "null", " ", "inputs", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text_", "==_", "None_", "or_", "pattern_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Null", " ", "inputs", ".", " ", "(", "match", "\\u", "main", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loc_", "=_", "max_", "(_", "0_", ",_", "min_", "(_", "loc_", ",_", "len_", "(_", "text_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text_", "==_", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Short", "cut", " ", "(", "potenti", "ally", " ", "not", " ", "guaran", "tee", "d", " ", "by", " ", "the", " ", "algo", "rit", "hm", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "hing", " ", "to", " ", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "text_", "[_", "loc_", ":_", "loc_", "+_", "len_", "(_", "pattern_", ")_", "]_", "==_", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Perf", "ect", " ", "match", " ", "at", " ", "the", " ", "perfect", " ", "spot", "!", " ", " ", "(", "Includes", " ", "case", " ", "of", " ", "null", " ", "pattern", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "a", " ", "fuzz", "y", " ", "compare", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "self_", "._", "match", "\\u", "b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2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
'import *' may pollute namespace
los-cocos/cocos/cocos/audio/SDL/mixer.py
[ { "content": "#!/usr/bin/env python\n\n\"\"\"A simple multi-channel audio mixer.\n\nIt supports 8 channels of 16 bit stereo audio, plus a single channel\nof music, mixed by MidMod MOD, Timidity MIDI or SMPEG MP3 libraries.\n\nThe mixer can currently load Microsoft WAVE files and Creative Labs VOC\nfiles as audio samples, and can load MIDI files via Timidity and the\nfollowing music formats via MikMod: MOD, S3M, IT, XM. It can load Ogg\nVorbis streams as music if built with the Ogg Vorbis libraries, and finally\nit can load MP3 music using the SMPEG library.\n\nThe process of mixing MIDI files to wave output is very CPU intensive, so\nif playing regular WAVE files sounds great, but playing MIDI files sounds\nchoppy, try using 8-bit audio, mono audio, or lower frequencies.\n\n:note: The music stream does not resample to the required audio rate. You\n must call `Mix_OpenAudio` with the sampling rate of your music track.\n\"\"\"\n\n__docformat__ = 'restructuredtext'\n__version__ = '$Id: $'\n\nfrom ctypes import *\n\nimport cocos.compat\n\nfrom . import dll\nfrom . import version\nfrom . import array\nfrom . import rwops\n\n_dll = dll.SDL_DLL('SDL_mixer', 'Mix_Linked_Version', '1.2')\n\nMix_Linked_Version = _dll.function(\n 'Mix_Linked_Version',\n '''Get the version of the dynamically linked SDL_mixer library.\n ''',\n args=[],\n arg_types=[],\n return_type=POINTER(version.SDL_version),\n dereference_return=True,\n require_return=True)\n\n\n\n# opaque type\n_Mix_Music = c_void_p\n\nMix_OpenAudio = _dll.function(\n 'Mix_OpenAudio',\n '''Open the mixer with a certain audio format.\n\n :Parameters:\n `frequency` : int\n Samples per second. Typical values are 22050, 44100, 44800.\n `format` : int\n Audio format; one of AUDIO_U8, AUDIO_S8, AUDIO_U16LSB,\n AUDIO_S16LSB, AUDIO_U16MSB or AUDIO_S16MSB\n `channels` : int\n Either 1 for monophonic or 2 for stereo.\n `chunksize` : int\n Size of the audio buffer. Typical values are 4096, 8192.\n\n ''',\n args=['frequency', 'format', 'channels', 'chunksize'],\n arg_types=[c_int, c_ushort, c_int, c_int],\n return_type=c_int,\n error_return=-1)\n\nMix_AllocateChannels = _dll.function(\n 'Mix_AllocateChannels',\n '''Dynamically change the number of channels managed by the mixer.\n\n If decreasing the number of channels, the upper channels\n are stopped.\n\n :Parameters:\n - `numchans`: int\n\n :rtype: int\n :return: the new number of allocated channels.\n ''',\n args=['numchans'],\n arg_types=[c_int],\n return_type=c_int)\n\n_Mix_QuerySpec = _dll.private_function(\n 'Mix_QuerySpec',\n arg_types=[POINTER(c_int), POINTER(c_ushort), POINTER(c_int)],\n return_type=c_int)\n\n\n\nMix_LoadWAV_RW = _dll.function(\n 'Mix_LoadWAV_RW',\n '''Load a WAV, RIFF, AIFF, OGG or VOC file from a RWops source.\n\n\n\n :rtype: `Mix_Chunk`\n ''',\n args=['src', 'freesrc'],\n arg_types=[POINTER(rwops.SDL_RWops), c_int],\n return_type=POINTER(Mix_Chunk),\n dereference_return=True,\n require_return=True)\n\n\n\nMix_LoadMUS = _dll.function(\n 'Mix_LoadMUS',\n '''Load a WAV, MID, OGG, MP3 or MOD file.\n\n :Parameters:\n `file` : string\n Filename to load.\n\n :rtype: ``Mix_Music``\n ''',\n args=['file'],\n arg_types=[c_char_p],\n return_type=_Mix_Music,\n require_return=True)\n\nMix_LoadMUS_RW = _dll.function(\n 'Mix_LoadMUS_RW',\n '''Load a MID, OGG, MP3 or MOD file from a RWops source.\n\n :Parameters:\n `src` : `SDL_RWops`\n Readable RWops to load from.\n `freesrc` : `int`\n If non-zero, the source will be closed after loading.\n\n :rtype: ``Mix_Music``\n ''',\n args=['file'],\n arg_types=[c_char_p],\n return_type=_Mix_Music,\n require_return=True)\n\n_Mix_QuickLoad_WAV = _dll.private_function(\n 'Mix_QuickLoad_WAV',\n arg_types=[POINTER(c_ubyte)],\n return_type=POINTER(Mix_Chunk),\n dereference_return=True,\n require_return=True)\n\n\n\n_Mix_QuickLoad_RAW = _dll.private_function(\n 'Mix_QuickLoad_RAW',\n arg_types=[POINTER(c_ubyte), c_uint],\n return_type=POINTER(Mix_Chunk),\n dereference_return=True,\n require_return=True)\n\n\n\nMix_FreeChunk = _dll.function(\n 'Mix_FreeChunk',\n '''Free an audio chunk previously loaded.\n\n :Parameters:\n - `chunk`: `Mix_Chunk`\n\n ''',\n args=['chunk'],\n arg_types=[POINTER(Mix_Chunk)],\n return_type=None)\n\nMix_FreeMusic = _dll.function(\n 'Mix_FreeMusic',\n '''Free a music chunk previously loaded.\n\n :Parameters:\n - `music`: ``Mix_Music``\n\n ''',\n args=['music'],\n arg_types=[_Mix_Music],\n return_type=None)\n\nMix_GetMusicType = _dll.function(\n 'Mix_GetMusicType',\n '''Get the music format of a mixer music.\n\n Returns the format of the currently playing music if `music` is None.\n\n :Parameters:\n - `music`: ``Mix_Music``\n\n :rtype: int\n :return: one of `MUS_NONE`, `MUS_CMD`, `MUS_WAV`, `MUS_MOD`, `MUS_MID`,\n `MUS_OGG` or `MUS_MP3`\n ''',\n args=['music'],\n arg_types=[_Mix_Music],\n return_type=c_int)\n\n_Mix_FilterFunc = CFUNCTYPE(None, c_void_p, POINTER(c_ubyte), c_int)\n\n\n\n_Mix_SetPostMix = _dll.private_function(\n 'Mix_SetPostMix',\n arg_types=[_Mix_FilterFunc, c_void_p],\n return_type=None)\n\n_mix_postmix_ref = None\n\n\n\n_Mix_HookMusic = _dll.private_function(\n 'Mix_HookMusic',\n arg_types=[_Mix_FilterFunc, c_void_p],\n return_type=None)\n\n_hookmusic_ref = None\n\n\n\n_Mix_HookMusicFinishedFunc = CFUNCTYPE(None)\n\n_Mix_HookMusicFinished = _dll.private_function(\n 'Mix_HookMusicFinished',\n arg_types=[_Mix_HookMusicFinishedFunc],\n return_type=None)\n\n\n\n# Mix_GetMusicHookData not implemented (unnecessary)\n\n_Mix_ChannelFinishedFunc = CFUNCTYPE(None, c_int)\n\n_Mix_ChannelFinished = _dll.private_function(\n 'Mix_ChannelFinished',\n arg_types=[_Mix_ChannelFinishedFunc],\n return_type=None)\n\n# Keep the ctypes func around\n_channelfinished_ref = None\n\n\n\n_Mix_EffectFunc = CFUNCTYPE(None, c_int, POINTER(c_ubyte), c_int, c_void_p)\n\n\n\n_Mix_EffectDoneFunc = CFUNCTYPE(None, c_int, c_void_p)\n\n\n\n_Mix_RegisterEffect = _dll.private_function(\n 'Mix_RegisterEffect',\n arg_types=[c_int, _Mix_EffectFunc, _Mix_EffectDoneFunc, c_void_p],\n return_type=c_int,\n error_return=0)\n\n_effect_func_refs = []\n\n\n\n# Mix_UnregisterEffect cannot be implemented\n\nMix_UnregisterAllEffects = _dll.function(\n 'Mix_UnregisterAllEffects',\n '''Unregister all effects for a channel.\n\n You may not need to call this explicitly, unless you need to stop all\n effects from processing in the middle of a chunk's playback. Note that\n this will also shut off some internal effect processing, since\n `Mix_SetPanning` and others may use this API under the hood. This is\n called internally when a channel completes playback.\n\n Posteffects are never implicitly unregistered as they are for channels,\n but they may be explicitly unregistered through this function by\n specifying `MIX_CHANNEL_POST` for a channel.\n\n :Parameters:\n - `channel`: int\n\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=c_int,\n error_return=0)\n\nMix_SetPanning = _dll.function(\n 'Mix_SetPanning',\n '''Set the panning of a channel.\n\n The left and right channels are specified as integers between 0 and\n 255, quietest to loudest, respectively.\n\n Technically, this is just individual volume control for a sample with\n two (stereo) channels, so it can be used for more than just panning.\n If you want real panning, call it like this::\n\n Mix_SetPanning(channel, left, 255 - left)\n\n Setting (channel) to `MIX_CHANNEL_POST` registers this as a posteffect, and\n the panning will be done to the final mixed stream before passing it on\n to the audio device.\n\n This uses the `Mix_RegisterEffect` API internally, and returns without\n registering the effect function if the audio device is not configured\n for stereo output. Setting both (left) and (right) to 255 causes this\n effect to be unregistered, since that is the data's normal state.\n\n :Parameters:\n - `channel`: int\n - `left`: int\n - `right`: int\n\n ''',\n args=['channel', 'left', 'right'],\n arg_types=[c_int, c_ubyte, c_ubyte],\n return_type=c_int,\n error_return=0)\n\nMix_SetPosition = _dll.function(\n 'Mix_SetPosition',\n '''Set the position of a channel.\n\n `angle` is an integer from 0 to 360, that specifies the location of the\n sound in relation to the listener. `angle` will be reduced as neccesary\n (540 becomes 180 degrees, -100 becomes 260). Angle 0 is due north, and\n rotates clockwise as the value increases. For efficiency, the\n precision of this effect may be limited (angles 1 through 7 might all\n produce the same effect, 8 through 15 are equal, etc). `distance` is\n an integer between 0 and 255 that specifies the space between the sound\n and the listener. The larger the number, the further away the sound is.\n Using 255 does not guarantee that the channel will be culled from the\n mixing process or be completely silent. For efficiency, the precision\n of this effect may be limited (distance 0 through 5 might all produce\n the same effect, 6 through 10 are equal, etc). Setting `angle` and\n `distance` to 0 unregisters this effect, since the data would be\n unchanged.\n\n If you need more precise positional audio, consider using OpenAL for\n spatialized effects instead of SDL_mixer. This is only meant to be a\n basic effect for simple \"3D\" games.\n\n If the audio device is configured for mono output, then you won't get\n any effectiveness from the angle; however, distance attenuation on the\n channel will still occur. While this effect will function with stereo\n voices, it makes more sense to use voices with only one channel of\n sound, so when they are mixed through this effect, the positioning will\n sound correct. You can convert them to mono through SDL before giving\n them to the mixer in the first place if you like.\n\n Setting `channel` to `MIX_CHANNEL_POST` registers this as a posteffect,\n and the positioning will be done to the final mixed stream before\n passing it on to the audio device.\n\n This is a convenience wrapper over `Mix_SetDistance` and\n `Mix_SetPanning`.\n\n :Parameters:\n - `channel`: int\n - `angle`: int\n - `distance`: int\n\n ''',\n args=['channel', 'angle', 'distance'],\n arg_types=[c_int, c_short, c_ubyte],\n return_type=c_int,\n error_return=0)\n\nMix_SetDistance = _dll.function(\n 'Mix_SetDistance',\n '''Set the \"distance\" of a channel.\n\n `distance` is an integer from 0 to 255 that specifies the location of\n the sound in relation to the listener. Distance 0 is overlapping the\n listener, and 255 is as far away as possible A distance of 255 does not\n guarantee silence; in such a case, you might want to try changing the\n chunk's volume, or just cull the sample from the mixing process with\n `Mix_HaltChannel`.\n\n For efficiency, the precision of this effect may be limited (distances\n 1 through 7 might all produce the same effect, 8 through 15 are equal,\n etc). `distance` is an integer between 0 and 255 that specifies the\n space between the sound and the listener. The larger the number, the\n further away the sound is.\n\n Setting `distance` to 0 unregisters this effect, since the data would\n be unchanged.\n\n If you need more precise positional audio, consider using OpenAL for\n spatialized effects instead of SDL_mixer. This is only meant to be a\n basic effect for simple \"3D\" games.\n\n Setting `channel` to `MIX_CHANNEL_POST` registers this as a posteffect,\n and the distance attenuation will be done to the final mixed stream\n before passing it on to the audio device.\n\n This uses the `Mix_RegisterEffect` API internally.\n\n :Parameters:\n - `channel`: int\n - `distance`: distance\n\n ''',\n args=['channel', 'distance'],\n arg_types=[c_int, c_ubyte],\n return_type=c_int,\n error_return=0)\n\nMix_SetReverseStereo = _dll.function(\n 'Mix_SetReverseStereo',\n '''Causes a channel to reverse its stereo.\n\n This is handy if the user has his or her speakers hooked up backwards,\n or you would like to have a minor bit of psychedelia in your sound\n code. Calling this function with `flip` set to non-zero reverses the\n chunks's usual channels. If `flip` is zero, the effect is unregistered.\n\n This uses the `Mix_RegisterEffect` API internally, and thus is probably\n more CPU intensive than having the user just plug in his speakers\n correctly. `Mix_SetReverseStereo` returns without registering the\n effect function if the audio device is not configured for stereo\n output.\n\n If you specify `MIX_CHANNEL_POST` for `channel`, then this the effect\n is used on the final mixed stream before sending it on to the audio\n device (a posteffect).\n\n :Parameters:\n - `channel`: int\n - `flip`: int\n\n ''',\n args=['channel', 'flip'],\n arg_types=[c_int, c_int],\n return_type=c_int,\n error_return=0)\n\nMix_ReserveChannels = _dll.function(\n 'Mix_ReserveChannels',\n '''Reserve the first channels (0 to n-1) for the application.\n\n If reserved, a channel will not be allocated dynamically to a sample\n if requested with one of the ``Mix_Play*`` functions.\n\n :Parameters:\n - `num`: int\n\n :rtype: int\n :return: the number of reserved channels\n ''',\n args=['num'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_GroupChannel = _dll.function(\n 'Mix_GroupChannel',\n '''Assing a channel to a group.\n\n A tag can be assigned to several mixer channels, to form groups\n of channels. If `tag` is -1, the tag is removed (actually -1 is the\n tag used to represent the group of all the channels).\n\n :Parameters:\n - `channel`: int\n - `tag`: int\n\n ''',\n args=['channel', 'tag'],\n arg_types=[c_int, c_int],\n return_type=c_int,\n error_return=0)\n\nMix_GroupChannels = _dll.function(\n 'Mix_GroupChannels',\n '''Assign several consecutive channels to a group.\n\n A tag can be assigned to several mixer channels, to form groups\n of channels. If `tag` is -1, the tag is removed (actually -1 is the\n tag used to represent the group of all the channels).\n\n :Parameters:\n - `channel_from`: int\n - `channel_to`: int\n - `tag`: int\n\n ''',\n args=['channel_from', 'channel_to', 'tag'],\n arg_types=[c_int, c_int, c_int],\n return_type=c_int,\n error_return=0)\n\nMix_GroupAvailable = _dll.function(\n 'Mix_GroupAvailable',\n '''Find the first available channel in a group of channels.\n\n :Parameters:\n - `tag`: int\n\n :rtype: int\n :return: a channel, or -1 if none are available.\n ''',\n args=['tag'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_GroupCount = _dll.function(\n 'Mix_GroupCount',\n '''Get the number of channels in a group.\n\n If `tag` is -1, returns the total number of channels.\n\n :Parameters:\n - `tag`: int\n\n :rtype: int\n ''',\n args=['tag'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_GroupOldest = _dll.function(\n 'Mix_GroupOldest',\n '''Find the \"oldest\" sample playing in a group of channels.\n\n :Parameters:\n - `tag`: int\n\n :rtype: int\n ''',\n args=['tag'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_GroupNewer = _dll.function(\n 'Mix_GroupNewer',\n '''Find the \"most recent\" (i.e., last) sample playing in a group of\n channels.\n\n :Parameters:\n - `tag`: int\n\n :rtype: int\n ''',\n args=['tag'],\n arg_types=[c_int],\n return_type=c_int)\n\n\n\nMix_PlayChannelTimed = _dll.function(\n 'Mix_PlayChannelTimed',\n '''Play an audio chunk on a specific channel for a specified amount of\n time.\n\n :Parameters:\n `channel` : int\n If -1, play on the first free channel.\n `chunk` : `Mix_Chunk`\n Chunk to play\n `loops` : int\n If greater than zero, the number of times to play the sound;\n if -1, loop infinitely.\n `ticks` : int\n Maximum number of milliseconds to play sound for.\n\n :rtype: int\n :return: the channel that was used to play the sound.\n ''',\n args=['channel', 'chunk', 'loops', 'ticks'],\n arg_types=[c_int, POINTER(Mix_Chunk), c_int, c_int],\n return_type=c_int)\n\nMix_PlayMusic = _dll.function(\n 'Mix_PlayMusic',\n '''Play a music chunk.\n\n :Parameters:\n `music` : ``Mix_Music``\n Chunk to play\n `loops` : int\n If greater than zero, the number of times to play the sound;\n if -1, loop infinitely.\n ''',\n args=['music', 'loops'],\n arg_types=[_Mix_Music, c_int],\n return_type=c_int,\n error_return=-1)\n\nMix_FadeInMusic = _dll.function(\n 'Mix_FadeInMusic',\n '''Fade in music over a period of time.\n\n :Parameters:\n `music` : ``Mix_Music``\n Chunk to play\n `loops` : int\n If greater than zero, the number of times to play the sound;\n if -1, loop infinitely.\n `ms` : int\n Number of milliseconds to fade up over.\n ''',\n args=['music', 'loops', 'ms'],\n arg_types=[_Mix_Music, c_int, c_int],\n return_type=c_int,\n error_return=-1)\n\nMix_FadeInMusicPos = _dll.function(\n 'Mix_FadeInMusicPos',\n '''Fade in music at an offset over a period of time.\n\n :Parameters:\n `music` : ``Mix_Music``\n Chunk to play\n `loops` : int\n If greater than zero, the number of times to play the sound;\n if -1, loop infinitely.\n `ms` : int\n Number of milliseconds to fade up over.\n `position` : float\n Position within music to start at. Currently implemented\n only for MOD, OGG and MP3.\n\n :see: Mix_SetMusicPosition\n ''',\n args=['music', 'loops', 'ms', 'position'],\n arg_types=[_Mix_Music, c_int, c_int, c_double],\n return_type=c_int,\n error_return=-1)\n\n\n\nMix_FadeInChannelTimed = _dll.function(\n 'Mix_FadeInChannelTimed',\n '''Fade in a channel and play for a specified amount of time.\n\n :Parameters:\n `channel` : int\n If -1, play on the first free channel.\n `chunk` : `Mix_Chunk`\n Chunk to play\n `loops` : int\n If greater than zero, the number of times to play the sound;\n if -1, loop infinitely.\n `ms` : int\n Number of milliseconds to fade up over.\n `ticks` : int\n Maximum number of milliseconds to play sound for.\n ''',\n args=['channel', 'music', 'loops', 'ms', 'ticks'],\n arg_types=[c_int, _Mix_Music, c_int, c_int, c_int],\n return_type=c_int,\n error_return=-1)\n\nMix_Volume = _dll.function(\n 'Mix_Volume',\n '''Set the volume in the range of 0-128 of a specific channel.\n\n :Parameters:\n `channel` : int\n If -1, set the volume for all channels\n `volume` : int\n Volume to set, in the range 0-128, or -1 to just return the\n current volume.\n\n :rtype: int\n :return: the original volume.\n ''',\n args=['channel', 'volume'],\n arg_types=[c_int, c_int],\n return_type=c_int)\n\nMix_VolumeChunk = _dll.function(\n 'Mix_VolumeChunk',\n '''Set the volume in the range of 0-128 of a chunk.\n\n :Parameters:\n `chunk` : `Mix_Chunk`\n Chunk to set volume.\n `volume` : int\n Volume to set, in the range 0-128, or -1 to just return the\n current volume.\n\n :rtype: int\n :return: the original volume.\n ''',\n args=['chunk', 'volume'],\n arg_types=[POINTER(Mix_Chunk), c_int],\n return_type=c_int)\n\nMix_VolumeMusic = _dll.function(\n 'Mix_VolumeMusic',\n '''Set the volume in the range of 0-128 of the music.\n\n :Parameters:\n `volume` : int\n Volume to set, in the range 0-128, or -1 to just return the\n current volume.\n\n :rtype: int\n :return: the original volume.\n ''',\n args=['volume'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_HaltChannel = _dll.function(\n 'Mix_HaltChannel',\n '''Halt playing of a particular channel.\n\n :Parameters:\n - `channel`: int\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=None)\n\nMix_HaltGroup = _dll.function(\n 'Mix_HaltGroup',\n '''Halt playing of a particular group.\n\n :Parameters:\n - `tag`: int\n ''',\n args=['tag'],\n arg_types=[c_int],\n return_type=None)\n\nMix_HaltMusic = _dll.function(\n 'Mix_HaltMusic',\n '''Halt playing music.\n ''',\n args=[],\n arg_types=[],\n return_type=None)\n\nMix_ExpireChannel = _dll.function(\n 'Mix_ExpireChannel',\n '''Change the expiration delay for a particular channel.\n\n The sample will stop playing afte the `ticks` milliseconds have\n elapsed, or remove the expiration if `ticks` is -1.\n\n :Parameters:\n - `channel`: int\n - `ticks`: int\n\n :rtype: int\n :return: the number of channels affected.\n ''',\n args=['channel', 'ticks'],\n arg_types=[c_int, c_int],\n return_type=c_int)\n\nMix_FadeOutChannel = _dll.function(\n 'Mix_FadeOutChannel',\n '''Halt a channel, fading it out progressively until it's silent.\n\n The `ms` parameter indicates the number of milliseconds the fading\n will take.\n\n :Parameters:\n - `channel`: int\n - `ms`: int\n ''',\n args=['channel', 'ms'],\n arg_types=[c_int, c_int],\n return_type=None)\n\nMix_FadeOutGroup = _dll.function(\n 'Mix_FadeOutGroup',\n '''Halt a group, fading it out progressively until it's silent.\n\n The `ms` parameter indicates the number of milliseconds the fading\n will take.\n\n :Parameters:\n - `tag`: int\n - `ms`: int\n ''',\n args=['tag', 'ms'],\n arg_types=[c_int, c_int],\n return_type=None)\n\nMix_FadeOutMusic = _dll.function(\n 'Mix_FadeOutMusic',\n '''Halt playing music, fading it out progressively until it's silent.\n\n The `ms` parameter indicates the number of milliseconds the fading\n will take.\n\n :Parameters:\n - `ms`: int\n ''',\n args=['ms'],\n arg_types=[c_int],\n return_type=None)\n\nMix_FadingMusic = _dll.function(\n 'Mix_FadingMusic',\n '''Query the fading status of the music.\n\n :rtype: int\n :return: one of MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN.\n ''',\n args=[],\n arg_types=[],\n return_type=c_int)\n\nMix_FadingChannel = _dll.function(\n 'Mix_FadingChannel',\n '''Query the fading status of a channel.\n\n :Parameters:\n - `channel`: int\n\n :rtype: int\n :return: one of MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN.\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_Pause = _dll.function(\n 'Mix_Pause',\n '''Pause a particular channel.\n\n :Parameters:\n - `channel`: int\n\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=None)\n\nMix_Resume = _dll.function(\n 'Mix_Resume',\n '''Resume a particular channel.\n\n :Parameters:\n - `channel`: int\n\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=None)\n\nMix_Paused = _dll.function(\n 'Mix_Paused',\n '''Query if a channel is paused.\n\n :Parameters:\n - `channel`: int\n\n :rtype: int\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_PauseMusic = _dll.function(\n 'Mix_PauseMusic',\n '''Pause the music stream.\n ''',\n args=[],\n arg_types=[],\n return_type=None)\n\nMix_ResumeMusic = _dll.function(\n 'Mix_ResumeMusic',\n '''Resume the music stream.\n ''',\n args=[],\n arg_types=[],\n return_type=None)\n\nMix_RewindMusic = _dll.function(\n 'Mix_RewindMusic',\n '''Rewind the music stream.\n ''',\n args=[],\n arg_types=[],\n return_type=None)\n\nMix_PausedMusic = _dll.function(\n 'Mix_PausedMusic',\n '''Query if the music stream is paused.\n\n :rtype: int\n ''',\n args=[],\n arg_types=[],\n return_type=c_int)\n\nMix_SetMusicPosition = _dll.function(\n 'Mix_SetMusicPosition',\n '''Set the current position in the music stream.\n\n For MOD files the position represents the pattern order number;\n for OGG and MP3 files the position is in seconds. Currently no other\n music file formats support positioning.\n\n :Parameters:\n - `position`: float\n\n ''',\n args=['position'],\n arg_types=[c_double],\n return_type=c_int,\n error_return=-1)\n\nMix_Playing = _dll.function(\n 'Mix_Playing',\n '''Query the status of a specific channel.\n\n :Parameters:\n - `channel`: int\n\n :rtype: int\n :return: the number of queried channels that are playing.\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=c_int)\n\nMix_PlayingMusic = _dll.function(\n 'Mix_PlayingMusic',\n '''Query the status of the music stream.\n\n :rtype: int\n :return: 1 if music is playing, 0 otherwise.\n ''',\n args=[],\n arg_types=[],\n return_type=c_int)\n\nMix_SetMusicCMD = _dll.function(\n 'Mix_SetMusicCMD',\n '''Set the external music playback command.\n\n Any currently playing music will stop.\n\n :Parameters:\n - `command`: string\n\n ''',\n args=['command'],\n arg_types=[c_char_p],\n return_type=c_int,\n error_return=-1)\n\nMix_SetSynchroValue = _dll.function(\n 'Mix_SetSynchroValue',\n '''Set the synchro value for a MOD music stream.\n\n :Parameters:\n - `value`: int\n\n ''',\n args=['value'],\n arg_types=[c_int],\n return_type=c_int,\n error_return=-1)\n\nMix_GetSynchroValue = _dll.function(\n 'Mix_GetSynchroValue',\n '''Get the synchro value for a MOD music stream.\n\n :rtype: int\n ''',\n args=[],\n arg_types=[],\n return_type=c_int)\n\nMix_GetChunk = _dll.function(\n 'Mix_GetChunk',\n '''Get the chunk currently associated with a mixer channel.\n\n Returns None if the channel is invalid or if there's no chunk associated.\n\n :Parameters:\n - `channel`: int\n\n :rtype: `Mix_Chunk`\n ''',\n args=['channel'],\n arg_types=[c_int],\n return_type=POINTER(Mix_Chunk),\n dereference_return=True)\n\nMix_CloseAudio = _dll.function(\n 'Mix_CloseAudio',\n '''Close the mixer, halting all playing audio.\n\n ''',\n args=[],\n arg_types=[],\n return_type=None)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from ctypes import *", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "'", "import", " ", "*'_", "may", "_", "poll", "ute", "_", "namespace_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "A", " ", "simple", " ", "multi", "-", "channel", " ", "audio", " ", "mixer", ".", "\\", "10", ";", "\\", "10", ";", "It", " ", "support", "s", " ", "8", " ", "channel", "s", " ", "of", " ", "16", " ", "bit", " ", "stereo", " ", "audio", ",", " ", "plus", " ", "a", " ", "single", " ", "channel", "\\", "10", ";", "of", " ", "music", ",", " ", "mixed", " ", "by", " ", "Mid", "Mod", " ", "MOD", ",", " ", "Tim", "idi", "ty", " ", "MID", "I", " ", "or", " ", "SM", "PE", "G", " ", "MP", "3", " ", "librar", "ies", ".", "\\", "10", ";", "\\", "10", ";", "The", " ", "mixer", " ", "can", " ", "currentl", "y", " ", "load", " ", "Micro", "soft", " ", "WAVE", " ", "files", " ", "and", " ", "Creative", " ", "Lab", "s", " ", "VOC", "\\", "10", ";", "files", " ", "as", " ", "audio", " ", "samples", ",", " ", "and", " ", "can", " ", "load", " ", "MID", "I", " ", "files", " ", "via", " ", "Tim", "idi", "ty", " ", "and", " ", "the", "\\", "10", ";", "follow", "ing", " ", "music", " ", "formats", " ", "via", " ", "Mik", "Mod", ":", " ", "MOD", ",", " ", "S", "3", "M", ",", " ", "IT", ",", " ", "XM", ".", " ", " ", "It", " ", "can", " ", "load", " ", "Og", "g", "\\", "10", ";", "Vor", "bis", " ", "stream", "s", " ", "as", " ", "music", " ", "if", " ", "bui", "lt", " ", "with", " ", "the", " ", "Og", "g", " ", "Vor", "bis", " ", "librar", "ies", ",", " ", "and", " ", "final", "ly", "\\", "10", ";", "it", " ", "can", " ", "load", " ", "MP", "3", " ", "music", " ", "usi", "ng", " ", "the", " ", "SM", "PE", "G", " ", "librar", "y", ".", "\\", "10", ";", "\\", "10", ";", "The", " ", "process", " ", "of", " ", "mixing", " ", "MID", "I", " ", "files", " ", "to", " ", "wave", " ", "output", " ", "is", " ", "very", " ", "CPU", " ", "inten", "sive", ",", " ", "so", "\\", "10", ";", "if", " ", "play", "ing", " ", "regular", " ", "WAVE", " ", "files", " ", "sounds", " ", "great", ",", " ", "but", " ", "play", "ing", " ", "MID", "I", " ", "files", " ", "sounds", "\\", "10", ";", "chop", "py", ",", " ", "try", " ", "usi", "ng", " ", "8", "-", "bit", " ", "audio", ",", " ", "mono", " ", "audio", ",", " ", "or", " ", "lower", " ", "freque", "ncie", "s", ".", "\\", "10", ";", "\\", "10", ";", ":", "note", ":", " ", "The", " ", "music", " ", "stream", " ", "doe", "s", " ", "not", " ", "resample", " ", "to", " ", "the", " ", "require", "d", " ", "audio", " ", "rate", ".", " ", " ", "You", "\\", "10", ";", " ", " ", " ", " ", "must", " ", "call", " ", "`", "Mix", "\\u", "Open", "Audi", "o", "`", " ", "with", " ", "the", " ", "samp", "ling", " ", "rate", " ", "of", " ", "your", " ", "music", " ", "track", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "restructur", "edt", "ext", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'$", "Id", ":", " ", "$'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ctypes_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "coco", "s_", "._", "compat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "import_", "dll_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "rw", "ops_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "dll_", "=_", "dll_", "._", "SDL", "\\u", "DLL", "_", "(_", "'", "SDL", "\\u", "mixer", "'_", ",_", "'", "Mix", "\\u", "Linke", "d\\u", "Version", "'_", ",_", "'", "1.2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Linke", "d\\u", "Version_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Linke", "d\\u", "Version", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Get", " ", "the", " ", "version", " ", "of", " ", "the", " ", "dynami", "call", "y", " ", "linked", " ", "SDL", "\\u", "mixer", " ", "librar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "POINTER_", "(_", "version_", "._", "SDL", "\\u", "version_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dereferenc", "e\\u", "return_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "return_", "=_", "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_", "#", " ", "opaque", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Music", "_", "=_", "c\\u", "voi", "d\\u", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Open", "Audio_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Open", "Audi", "o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Open", " ", "the", " ", "mixer", " ", "with", " ", "a", " ", "cert", "ain", " ", "audio", " ", "format", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "freque", "nc", "y", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Sampl", "es", " ", "per", " ", "second", ".", " ", " ", "Typical", " ", "values", " ", "are", " ", "220", "50", ",", " ", "4410", "0", ",", " ", "448", "00", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "format", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Audi", "o", " ", "format", ";", " ", "one", " ", "of", " ", "AUDIO", "\\u", "U", "8", ",", " ", "AUDIO", "\\u", "S", "8", ",", " ", "AUDIO", "\\u", "U1", "6", "LS", "B", ",", "\\", "10", ";", " ", " ", " ", " ", "AUDIO", "\\u", "S1", "6", "LS", "B", ",", " ", "AUDIO", "\\u", "U1", "6", "MS", "B", " ", "or", " ", "AUDIO", "\\u", "S1", "6", "MS", "B", "\\", "10", ";", " ", " ", " ", " ", "`", "channel", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Ei", "ther", " ", "1", " ", "for", " ", "mono", "phon", "ic", " ", "or", " ", "2", " ", "for", " ", "stereo", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "chunks", "ize", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Size", " ", "of", " ", "the", " ", "audio", " ", "buffer", ".", " ", " ", "Typical", " ", "values", " ", "are", " ", "409", "6", ",", " ", "819", "2", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "freque", "nc", "y", "'_", ",_", "'", "format", "'_", ",_", "'", "channel", "s", "'_", ",_", "'", "chunks", "ize", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "ushort", "_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Allocate", "Channels_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Allocate", "Chan", "nels", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Dynamic", "ally", " ", "change", " ", "the", " ", "number", " ", "of", " ", "channel", "s", " ", "manage", "d", " ", "by", " ", "the", " ", "mixer", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "decre", "asin", "g", " ", "the", " ", "number", " ", "of", " ", "channel", "s", ",", " ", "the", " ", "upper", " ", "channel", "s", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "stopp", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "numc", "han", "s", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "new", " ", "number", " ", "of", " ", "allocated", " ", "channel", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "numc", "han", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Mix", "\\u", "Query", "Spec_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Query", "Spec", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "POINTER_", "(_", "c\\u", "int_", ")_", ",_", "POINTER_", "(_", "c\\u", "ushort", "_", ")_", ",_", "POINTER_", "(_", "c\\u", "int_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Mix", "\\u", "Load", "WA", "V", "\\u", "RW", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Load", "WA", "V", "\\u", "RW", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Load", " ", "a", " ", "WA", "V", ",", " ", "RI", "FF", ",", " ", "AI", "FF", ",", " ", "OG", "G", " ", "or", " ", "VOC", " ", "file", " ", "from", " ", "a", " ", "RW", "ops", " ", "source", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "`", "Mix", "\\u", "Chunk", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "src", "'_", ",_", "'", "frees", "rc", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "POINTER_", "(_", "rw", "ops_", "._", "SDL", "\\u", "RW", "ops_", ")_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dereferenc", "e\\u", "return_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "return_", "=_", "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\\uDEDENT\\u\\u\\u_", "Mix", "\\u", "Load", "MUS", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Load", "MUS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Load", " ", "a", " ", "WA", "V", ",", " ", "MID", ",", " ", "OG", "G", ",", " ", "MP", "3", " ", "or", " ", "MOD", " ", "file", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "file", "`", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "File", "name", " ", "to", " ", "load", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "file", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "\\u", "Mix", "\\u", "Music", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "return_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Load", "MUS", "\\u", "RW", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Load", "MUS", "\\u", "RW", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Load", " ", "a", " ", "MID", ",", " ", "OG", "G", ",", " ", "MP", "3", " ", "or", " ", "MOD", " ", "file", " ", "from", " ", "a", " ", "RW", "ops", " ", "source", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "src", "`", " ", ":", " ", "`", "SDL", "\\u", "RW", "ops", "`", "\\", "10", ";", " ", " ", " ", " ", "Read", "able", " ", "RW", "ops", " ", "to", " ", "load", " ", "from", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "frees", "rc", "`", " ", ":", " ", "`", "int", "`", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "non", "-", "zero", ",", " ", "the", " ", "source", " ", "will", " ", "be", " ", "close", "d", " ", "after", " ", "load", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "file", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "\\u", "Mix", "\\u", "Music", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "return_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Mix", "\\u", "Qui", "ck", "Load", "\\u", "WA", "V_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Qui", "ck", "Load", "\\u", "WA", "V", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "POINTER_", "(_", "c\\u", "ubyte_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dereferenc", "e\\u", "return_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "return_", "=_", "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\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Qui", "ck", "Load", "\\u", "RAW_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Qui", "ck", "Load", "\\u", "RA", "W", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "POINTER_", "(_", "c\\u", "ubyte_", ")_", ",_", "c\\u", "uint_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dereferenc", "e\\u", "return_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "require", "\\u", "return_", "=_", "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\\uDEDENT\\u\\u\\u_", "Mix", "\\u", "Free", "Chunk_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Free", "Chunk", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Free", " ", "an", " ", "audio", " ", "chunk", " ", "previ", "ously", " ", "load", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "chunk", "`", ":", " ", "`", "Mix", "\\u", "Chunk", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "chunk", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Free", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Free", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Free", " ", "a", " ", "music", " ", "chunk", " ", "previ", "ously", " ", "load", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "music", "`", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "music", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Music", "_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Get", "Music", "Type_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Get", "Music", "Type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Get", " ", "the", " ", "music", " ", "format", " ", "of", " ", "a", " ", "mixer", " ", "music", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "format", " ", "of", " ", "the", " ", "currentl", "y", " ", "play", "ing", " ", "music", " ", "if", " ", "`", "music", "`", " ", "is", " ", "Non", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "music", "`", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "one", " ", "of", " ", "`", "MUS", "\\u", "NON", "E", "`", ",", " ", "`", "MUS", "\\u", "CMD", "`", ",", " ", "`", "MUS", "\\u", "WA", "V", "`", ",", " ", "`", "MUS", "\\u", "MOD", "`", ",", " ", "`", "MUS", "\\u", "MID", "`", ",", "\\", "10", ";", " ", " ", " ", " ", "`", "MUS", "\\u", "OG", "G", "`", " ", "or", " ", "`", "MUS", "\\u", "MP", "3", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "music", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Music", "_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Mix", "\\u", "Filter", "Func_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "c\\u", "voi", "d\\u", "p_", ",_", "POINTER_", "(_", "c\\u", "ubyte_", ")_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Set", "Post", "Mix", "_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Post", "Mix", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Filter", "Func_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "mix", "\\u", "post", "mix", "\\u", "ref_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Hook", "Music", "_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Hook", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Filter", "Func_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "hook", "music", "\\u", "ref_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Hook", "Music", "Finish", "ed", "Func_", "=_", "CFUNCTYPE_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Mix", "\\u", "Hook", "Music", "Finished_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Hook", "Music", "Finish", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Hook", "Music", "Finish", "ed", "Func_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mix", "\\u", "Get", "Music", "Hook", "Data", " ", "not", " ", "implemented", " ", "(", "unne", "cess", "ary", ")_", "\\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", "Mix", "\\u", "Chan", "nel", "Finish", "ed", "Func_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Mix", "\\u", "Chan", "nel", "Finished_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Chan", "nel", "Finish", "ed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Chan", "nel", "Finish", "ed", "Func_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Keep", " ", "the", " ", "ctype", "s", " ", "func", " ", "around_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "channel", "finish", "ed", "\\u", "ref_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Effe", "ct", "Func_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "c\\u", "int_", ",_", "POINTER_", "(_", "c\\u", "ubyte_", ")_", ",_", "c\\u", "int_", ",_", "c\\u", "voi", "d\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Effe", "ct", "Don", "e", "Func_", "=_", "CFUNCTYPE_", "(_", "None_", ",_", "c\\u", "int_", ",_", "c\\u", "voi", "d\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "Mix", "\\u", "Register", "Effect_", "=_", "\\u", "dll_", "._", "private", "\\u", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Register", "Effe", "ct", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "\\u", "Mix", "\\u", "Effe", "ct", "Func_", ",_", "\\u", "Mix", "\\u", "Effe", "ct", "Don", "e", "Func_", ",_", "c\\u", "voi", "d\\u", "p_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "effect", "\\u", "func", "\\u", "refs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mix", "\\u", "Unregister", "Effe", "ct", " ", "cann", "ot", " ", "be", " ", "implemented", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Mix", "\\u", "Unregister", "All", "Effe", "cts_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Unregister", "All", "Effe", "ct", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Unregister", " ", "all", " ", "effect", "s", " ", "for", " ", "a", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "You", " ", "may", " ", "not", " ", "need", " ", "to", " ", "call", " ", "this", " ", "explicit", "ly", ",", " ", "unl", "ess", " ", "you", " ", "need", " ", "to", " ", "stop", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "effect", "s", " ", "from", " ", "process", "ing", " ", "in", " ", "the", " ", "middle", " ", "of", " ", "a", " ", "chunk", "'", "s", " ", "playback", ".", " ", "Not", "e", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "will", " ", "als", "o", " ", "shut", " ", "off", " ", "some", " ", "internal", " ", "effect", " ", "process", "ing", ",", " ", "sinc", "e", "\\", "10", ";", " ", " ", " ", " ", "`", "Mix", "\\u", "Set", "Pan", "ning", "`", " ", "and", " ", "other", "s", " ", "may", " ", "use", " ", "this", " ", "API", " ", "under", " ", "the", " ", "hood", ".", " ", "Thi", "s", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "call", "ed", " ", "internal", "ly", " ", "whe", "n", " ", "a", " ", "channel", " ", "complete", "s", " ", "playback", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Post", "effect", "s", " ", "are", " ", "neve", "r", " ", "implicit", "ly", " ", "unregister", "ed", " ", "as", " ", "the", "y", " ", "are", " ", "for", " ", "channel", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "the", "y", " ", "may", " ", "be", " ", "explicit", "ly", " ", "unregister", "ed", " ", "through", " ", "this", " ", "function", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "speci", "fy", "ing", " ", "`", "MIX", "\\u", "CHAN", "NEL", "\\u", "POST", "`", " ", "for", " ", "a", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Pan", "ning_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Pan", "ning", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "pan", "ning", " ", "of", " ", "a", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "left", " ", "and", " ", "right", " ", "channel", "s", " ", "are", " ", "specified", " ", "as", " ", "integ", "ers", " ", "bet", "ween", " ", "0", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "255", ",", " ", "quie", "test", " ", "to", " ", "loud", "est", ",", " ", "respec", "tiv", "el", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Techni", "call", "y", ",", " ", "this", " ", "is", " ", "just", " ", "individual", " ", "volume", " ", "control", " ", "for", " ", "a", " ", "sample", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "two", " ", "(", "stereo", ")", " ", "channel", "s", ",", " ", "so", " ", "it", " ", "can", " ", "be", " ", "used", " ", "for", " ", "more", " ", "than", " ", "just", " ", "pan", "ning", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "want", " ", "real", " ", "pan", "ning", ",", " ", "call", " ", "it", " ", "like", " ", "this", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Mix", "\\u", "Set", "Pan", "ning", "(", "channel", ",", " ", "left", ",", " ", "255", " ", "-", " ", "left", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sett", "ing", " ", "(", "channel", ")", " ", "to", " ", "`", "MIX", "\\u", "CHAN", "NEL", "\\u", "POST", "`", " ", "register", "s", " ", "this", " ", "as", " ", "a", " ", "poste", "ffe", "ct", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "pan", "ning", " ", "will", " ", "be", " ", "don", "e", " ", "to", " ", "the", " ", "final", " ", "mixed", " ", "stream", " ", "bef", "ore", " ", "passi", "ng", " ", "it", " ", "on", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "audio", " ", "device", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "use", "s", " ", "the", " ", "`", "Mix", "\\u", "Register", "Effe", "ct", "`", " ", "API", " ", "internal", "ly", ",", " ", "and", " ", "return", "s", " ", "with", "out", "\\", "10", ";", " ", " ", " ", " ", "register", "ing", " ", "the", " ", "effect", " ", "function", " ", "if", " ", "the", " ", "audio", " ", "device", " ", "is", " ", "not", " ", "configur", "ed", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "stereo", " ", "output", ".", " ", "Sett", "ing", " ", "bot", "h", " ", "(", "left", ")", " ", "and", " ", "(", "right", ")", " ", "to", " ", "255", " ", "caus", "es", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "effect", " ", "to", " ", "be", " ", "unregister", "ed", ",", " ", "sinc", "e", " ", "tha", "t", " ", "is", " ", "the", " ", "data", "'", "s", " ", "normal", " ", "state", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "left", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "right", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "left", "'_", ",_", "'", "right", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "ubyte_", ",_", "c\\u", "ubyte_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Position_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Position", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "position", " ", "of", " ", "a", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "angle", "`", " ", "is", " ", "an", " ", "integ", "er", " ", "from", " ", "0", " ", "to", " ", "360", ",", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", " ", "location", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "sound", " ", "in", " ", "relation", " ", "to", " ", "the", " ", "listen", "er", ".", " ", "`", "angle", "`", " ", "will", " ", "be", " ", "reduce", "d", " ", "as", " ", "nec", "ces", "ary", "\\", "10", ";", " ", " ", " ", " ", "(", "540", " ", "bec", "ome", "s", " ", "180", " ", "degr", "ees", ",", " ", "-1", "00", " ", "bec", "ome", "s", " ", "260", ").", " ", " ", "Ang", "le", " ", "0", " ", "is", " ", "due", " ", "north", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "rota", "tes", " ", "clockwise", " ", "as", " ", "the", " ", "value", " ", "increase", "s", ".", " ", " ", "For", " ", "efficien", "cy", ",", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "preci", "sion", " ", "of", " ", "this", " ", "effect", " ", "may", " ", "be", " ", "limited", " ", "(", "angle", "s", " ", "1", " ", "through", " ", "7", " ", "mig", "ht", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "produce", " ", "the", " ", "same", " ", "effect", ",", " ", "8", " ", "through", " ", "15", " ", "are", " ", "equal", ",", " ", "etc", ").", " ", " ", "`", "distance", "`", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "integ", "er", " ", "bet", "ween", " ", "0", " ", "and", " ", "255", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", " ", "space", " ", "bet", "ween", " ", "the", " ", "sound", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "the", " ", "listen", "er", ".", " ", "The", " ", "large", "r", " ", "the", " ", "number", ",", " ", "the", " ", "fur", "ther", " ", "awa", "y", " ", "the", " ", "sound", " ", "is", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "ing", " ", "255", " ", "doe", "s", " ", "not", " ", "guaran", "tee", " ", "tha", "t", " ", "the", " ", "channel", " ", "will", " ", "be", " ", "cul", "led", " ", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "mixing", " ", "process", " ", "or", " ", "be", " ", "complete", "ly", " ", "sile", "nt", ".", " ", "For", " ", "efficien", "cy", ",", " ", "the", " ", "preci", "sion", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "this", " ", "effect", " ", "may", " ", "be", " ", "limited", " ", "(", "distance", " ", "0", " ", "through", " ", "5", " ", "mig", "ht", " ", "all", " ", "produce", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "same", " ", "effect", ",", " ", "6", " ", "through", " ", "10", " ", "are", " ", "equal", ",", " ", "etc", ").", " ", "Sett", "ing", " ", "`", "angle", "`", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "`", "distance", "`", " ", "to", " ", "0", " ", "unregister", "s", " ", "this", " ", "effect", ",", " ", "sinc", "e", " ", "the", " ", "data", " ", "wou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "unchanged", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "need", " ", "more", " ", "precise", " ", "positional", " ", "audio", ",", " ", "consider", " ", "usi", "ng", " ", "Open", "AL", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "spat", "iali", "zed", " ", "effect", "s", " ", "inst", "ead", " ", "of", " ", "SDL", "\\u", "mixer", ".", " ", "Thi", "s", " ", "is", " ", "only", " ", "mean", "t", " ", "to", " ", "be", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "basic", " ", "effect", " ", "for", " ", "simple", " ", "\"", "3", "D", "\"", " ", "games", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "audio", " ", "device", " ", "is", " ", "configur", "ed", " ", "for", " ", "mono", " ", "output", ",", " ", "then", " ", "you", " ", "won", "'", "t", " ", "get", "\\", "10", ";", " ", " ", " ", " ", "any", " ", "effective", "ness", " ", "from", " ", "the", " ", "angle", ";", " ", "how", "ever", ",", " ", "distance", " ", "atten", "uation", " ", "on", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "channel", " ", "will", " ", "still", " ", "occur", ".", " ", "Whi", "le", " ", "this", " ", "effect", " ", "will", " ", "function", " ", "with", " ", "stereo", "\\", "10", ";", " ", " ", " ", " ", "voice", "s", ",", " ", "it", " ", "make", "s", " ", "more", " ", "sense", " ", "to", " ", "use", " ", "voice", "s", " ", "with", " ", "only", " ", "one", " ", "channel", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "sound", ",", " ", "so", " ", "whe", "n", " ", "the", "y", " ", "are", " ", "mixed", " ", "through", " ", "this", " ", "effect", ",", " ", "the", " ", "position", "ing", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "sound", " ", "correct", ".", " ", "You", " ", "can", " ", "convert", " ", "them", " ", "to", " ", "mono", " ", "through", " ", "SDL", " ", "bef", "ore", " ", "gi", "ving", "\\", "10", ";", " ", " ", " ", " ", "them", " ", "to", " ", "the", " ", "mixer", " ", "in", " ", "the", " ", "first", " ", "place", " ", "if", " ", "you", " ", "like", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sett", "ing", " ", "`", "channel", "`", " ", "to", " ", "`", "MIX", "\\u", "CHAN", "NEL", "\\u", "POST", "`", " ", "register", "s", " ", "this", " ", "as", " ", "a", " ", "poste", "ffe", "ct", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "the", " ", "position", "ing", " ", "will", " ", "be", " ", "don", "e", " ", "to", " ", "the", " ", "final", " ", "mixed", " ", "stream", " ", "bef", "ore", "\\", "10", ";", " ", " ", " ", " ", "passi", "ng", " ", "it", " ", "on", " ", "to", " ", "the", " ", "audio", " ", "device", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "a", " ", "convenien", "ce", " ", "wrapp", "er", " ", "over", " ", "`", "Mix", "\\u", "Set", "Distan", "ce", "`", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "`", "Mix", "\\u", "Set", "Pan", "ning", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "angle", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "distance", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "angle", "'_", ",_", "'", "distance", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "short_", ",_", "c\\u", "ubyte_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Distance_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Distan", "ce", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "\"", "distance", "\"", " ", "of", " ", "a", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "distance", "`", " ", "is", " ", "an", " ", "integ", "er", " ", "from", " ", "0", " ", "to", " ", "255", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", " ", "location", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "sound", " ", "in", " ", "relation", " ", "to", " ", "the", " ", "listen", "er", ".", " ", " ", "Distan", "ce", " ", "0", " ", "is", " ", "overlapping", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "listen", "er", ",", " ", "and", " ", "255", " ", "is", " ", "as", " ", "far", " ", "awa", "y", " ", "as", " ", "possib", "le", " ", "A", " ", "distance", " ", "of", " ", "255", " ", "doe", "s", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "guaran", "tee", " ", "silence", ";", " ", "in", " ", "suc", "h", " ", "a", " ", "case", ",", " ", "you", " ", "mig", "ht", " ", "want", " ", "to", " ", "try", " ", "chang", "ing", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "chunk", "'", "s", " ", "volume", ",", " ", "or", " ", "just", " ", "cul", "l", " ", "the", " ", "sample", " ", "from", " ", "the", " ", "mixing", " ", "process", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "`", "Mix", "\\u", "Hal", "t", "Chan", "nel", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "efficien", "cy", ",", " ", "the", " ", "preci", "sion", " ", "of", " ", "this", " ", "effect", " ", "may", " ", "be", " ", "limited", " ", "(", "distance", "s", "\\", "10", ";", " ", " ", " ", " ", "1", " ", "through", " ", "7", " ", "mig", "ht", " ", "all", " ", "produce", " ", "the", " ", "same", " ", "effect", ",", " ", "8", " ", "through", " ", "15", " ", "are", " ", "equal", ",", "\\", "10", ";", " ", " ", " ", " ", "etc", ").", " ", " ", "`", "distance", "`", " ", "is", " ", "an", " ", "integ", "er", " ", "bet", "ween", " ", "0", " ", "and", " ", "255", " ", "tha", "t", " ", "speci", "fie", "s", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "space", " ", "bet", "ween", " ", "the", " ", "sound", " ", "and", " ", "the", " ", "listen", "er", ".", " ", "The", " ", "large", "r", " ", "the", " ", "number", ",", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "fur", "ther", " ", "awa", "y", " ", "the", " ", "sound", " ", "is", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sett", "ing", " ", "`", "distance", "`", " ", "to", " ", "0", " ", "unregister", "s", " ", "this", " ", "effect", ",", " ", "sinc", "e", " ", "the", " ", "data", " ", "wou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "unchanged", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "need", " ", "more", " ", "precise", " ", "positional", " ", "audio", ",", " ", "consider", " ", "usi", "ng", " ", "Open", "AL", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "spat", "iali", "zed", " ", "effect", "s", " ", "inst", "ead", " ", "of", " ", "SDL", "\\u", "mixer", ".", " ", "Thi", "s", " ", "is", " ", "only", " ", "mean", "t", " ", "to", " ", "be", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "basic", " ", "effect", " ", "for", " ", "simple", " ", "\"", "3", "D", "\"", " ", "games", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sett", "ing", " ", "`", "channel", "`", " ", "to", " ", "`", "MIX", "\\u", "CHAN", "NEL", "\\u", "POST", "`", " ", "register", "s", " ", "this", " ", "as", " ", "a", " ", "poste", "ffe", "ct", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "the", " ", "distance", " ", "atten", "uation", " ", "will", " ", "be", " ", "don", "e", " ", "to", " ", "the", " ", "final", " ", "mixed", " ", "stream", "\\", "10", ";", " ", " ", " ", " ", "bef", "ore", " ", "passi", "ng", " ", "it", " ", "on", " ", "to", " ", "the", " ", "audio", " ", "device", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "use", "s", " ", "the", " ", "`", "Mix", "\\u", "Register", "Effe", "ct", "`", " ", "API", " ", "internal", "ly", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "distance", "`", ":", " ", "distance", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "distance", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "ubyte_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Revers", "e", "Ster", "eo_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Revers", "e", "Ster", "eo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Cause", "s", " ", "a", " ", "channel", " ", "to", " ", "reverse", " ", "its", " ", "stereo", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "hand", "y", " ", "if", " ", "the", " ", "user", " ", "has", " ", "his", " ", "or", " ", "her", " ", "speakers", " ", "hooke", "d", " ", "up", " ", "back", "ward", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "you", " ", "wou", "ld", " ", "like", " ", "to", " ", "have", " ", "a", " ", "mino", "r", " ", "bit", " ", "of", " ", "psych", "ede", "lia", " ", "in", " ", "your", " ", "sound", "\\", "10", ";", " ", " ", " ", " ", "code", ".", " ", " ", "Call", "ing", " ", "this", " ", "function", " ", "with", " ", "`", "flip", "`", " ", "set", " ", "to", " ", "non", "-", "zero", " ", "reverse", "s", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "chunks", "'", "s", " ", "usual", " ", "channel", "s", ".", " ", "If", " ", "`", "flip", "`", " ", "is", " ", "zero", ",", " ", "the", " ", "effect", " ", "is", " ", "unregister", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "use", "s", " ", "the", " ", "`", "Mix", "\\u", "Register", "Effe", "ct", "`", " ", "API", " ", "internal", "ly", ",", " ", "and", " ", "thu", "s", " ", "is", " ", "probab", "ly", "\\", "10", ";", " ", " ", " ", " ", "more", " ", "CPU", " ", "inten", "sive", " ", "than", " ", "hav", "ing", " ", "the", " ", "user", " ", "just", " ", "plug", " ", "in", " ", "his", " ", "speakers", "\\", "10", ";", " ", " ", " ", " ", "correct", "ly", ".", " ", " ", "`", "Mix", "\\u", "Set", "Revers", "e", "Ster", "eo", "`", " ", "return", "s", " ", "with", "out", " ", "register", "ing", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "effect", " ", "function", " ", "if", " ", "the", " ", "audio", " ", "device", " ", "is", " ", "not", " ", "configur", "ed", " ", "for", " ", "stereo", "\\", "10", ";", " ", " ", " ", " ", "output", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "speci", "fy", " ", "`", "MIX", "\\u", "CHAN", "NEL", "\\u", "POST", "`", " ", "for", " ", "`", "channel", "`", ",", " ", "then", " ", "this", " ", "the", " ", "effect", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "used", " ", "on", " ", "the", " ", "final", " ", "mixed", " ", "stream", " ", "bef", "ore", " ", "sendin", "g", " ", "it", " ", "on", " ", "to", " ", "the", " ", "audio", "\\", "10", ";", " ", " ", " ", " ", "device", " ", "(", "a", " ", "poste", "ffe", "ct", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "flip", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "flip", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Reserve", "Channels_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Reserve", "Chan", "nels", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Reserve", " ", "the", " ", "first", " ", "channel", "s", " ", "(", "0", " ", "to", " ", "n", "-1", ")", " ", "for", " ", "the", " ", "applica", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "reserve", "d", ",", " ", "a", " ", "channel", " ", "will", " ", "not", " ", "be", " ", "allocated", " ", "dynami", "call", "y", " ", "to", " ", "a", " ", "sample", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "request", "ed", " ", "with", " ", "one", " ", "of", " ", "the", " ", "``", "Mix", "\\u", "Play", "*", "``", " ", "function", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "num", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "number", " ", "of", " ", "reserve", "d", " ", "channel", "s", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "num", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Group", "Channel_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Group", "Chan", "nel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Assi", "ng", " ", "a", " ", "channel", " ", "to", " ", "a", " ", "group", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "tag", " ", "can", " ", "be", " ", "assign", "ed", " ", "to", " ", "sever", "al", " ", "mixer", " ", "channel", "s", ",", " ", "to", " ", "form", " ", "group", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "channel", "s", ".", " ", " ", "If", " ", "`", "tag", "`", " ", "is", " ", "-1", ",", " ", "the", " ", "tag", " ", "is", " ", "remove", "d", " ", "(", "actual", "ly", " ", "-1", " ", "is", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "tag", " ", "used", " ", "to", " ", "represent", " ", "the", " ", "group", " ", "of", " ", "all", " ", "the", " ", "channel", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Group", "Channels_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Group", "Chan", "nels", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Assign", " ", "sever", "al", " ", "consec", "uti", "ve", " ", "channel", "s", " ", "to", " ", "a", " ", "group", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "tag", " ", "can", " ", "be", " ", "assign", "ed", " ", "to", " ", "sever", "al", " ", "mixer", " ", "channel", "s", ",", " ", "to", " ", "form", " ", "group", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "channel", "s", ".", " ", " ", "If", " ", "`", "tag", "`", " ", "is", " ", "-1", ",", " ", "the", " ", "tag", " ", "is", " ", "remove", "d", " ", "(", "actual", "ly", " ", "-1", " ", "is", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "tag", " ", "used", " ", "to", " ", "represent", " ", "the", " ", "group", " ", "of", " ", "all", " ", "the", " ", "channel", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "\\u", "from", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "channel", "\\u", "to", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "\\u", "from", "'_", ",_", "'", "channel", "\\u", "to", "'_", ",_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Group", "Available_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Group", "Avail", "able", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Fin", "d", " ", "the", " ", "first", " ", "avail", "able", " ", "channel", " ", "in", " ", "a", " ", "group", " ", "of", " ", "channel", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "a", " ", "channel", ",", " ", "or", " ", "-1", " ", "if", " ", "none", " ", "are", " ", "avail", "able", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Group", "Count_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Group", "Count", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Get", " ", "the", " ", "number", " ", "of", " ", "channel", "s", " ", "in", " ", "a", " ", "group", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "`", "tag", "`", " ", "is", " ", "-1", ",", " ", "return", "s", " ", "the", " ", "total", " ", "number", " ", "of", " ", "channel", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Group", "Old", "est_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Group", "Old", "est", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Fin", "d", " ", "the", " ", "\"", "oldest", "\"", " ", "sample", " ", "play", "ing", " ", "in", " ", "a", " ", "group", " ", "of", " ", "channel", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Group", "New", "er_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Group", "New", "er", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Fin", "d", " ", "the", " ", "\"", "most", " ", "recent", "\"", " ", "(", "i", ".", "e", ".,", " ", "last", ")", " ", "sample", " ", "play", "ing", " ", "in", " ", "a", " ", "group", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "channel", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Mix", "\\u", "Play", "Chan", "nel", "Time", "d_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Play", "Chan", "nel", "Time", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Play", " ", "an", " ", "audio", " ", "chunk", " ", "on", " ", "a", " ", "specific", " ", "channel", " ", "for", " ", "a", " ", "specified", " ", "amo", "unt", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "time", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "channel", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "-1", ",", " ", "play", " ", "on", " ", "the", " ", "first", " ", "free", " ", "channel", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "chunk", "`", " ", ":", " ", "`", "Mix", "\\u", "Chunk", "`", "\\", "10", ";", " ", " ", " ", " ", "Chunk", " ", "to", " ", "play", "\\", "10", ";", " ", " ", " ", " ", "`", "loop", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "great", "er", " ", "than", " ", "zero", ",", " ", "the", " ", "number", " ", "of", " ", "times", " ", "to", " ", "play", " ", "the", " ", "sound", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "-1", ",", " ", "loop", " ", "infini", "tel", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "tick", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Maxim", "um", " ", "number", " ", "of", " ", "milliseconds", " ", "to", " ", "play", " ", "sound", " ", "for", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "channel", " ", "tha", "t", " ", "was", " ", "used", " ", "to", " ", "play", " ", "the", " ", "sound", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "chunk", "'_", ",_", "'", "loop", "s", "'_", ",_", "'", "tick", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Play", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Play", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Play", " ", "a", " ", "music", " ", "chunk", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "music", "`", " ", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", " ", " ", " ", " ", "Chunk", " ", "to", " ", "play", "\\", "10", ";", " ", " ", " ", " ", "`", "loop", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "great", "er", " ", "than", " ", "zero", ",", " ", "the", " ", "number", " ", "of", " ", "times", " ", "to", " ", "play", " ", "the", " ", "sound", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "-1", ",", " ", "loop", " ", "infini", "tel", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "music", "'_", ",_", "'", "loop", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Music", "_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "e", "In", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "e", "In", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Fad", "e", " ", "in", " ", "music", " ", "over", " ", "a", " ", "period", " ", "of", " ", "time", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "music", "`", " ", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", " ", " ", " ", " ", "Chunk", " ", "to", " ", "play", "\\", "10", ";", " ", " ", " ", " ", "`", "loop", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "great", "er", " ", "than", " ", "zero", ",", " ", "the", " ", "number", " ", "of", " ", "times", " ", "to", " ", "play", " ", "the", " ", "sound", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "-1", ",", " ", "loop", " ", "infini", "tel", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "ms", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "milliseconds", " ", "to", " ", "fade", " ", "up", " ", "over", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "music", "'_", ",_", "'", "loop", "s", "'_", ",_", "'", "ms", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Music", "_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "e", "In", "Music", "Pos_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "e", "In", "Music", "Pos", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Fad", "e", " ", "in", " ", "music", " ", "at", " ", "an", " ", "offset", " ", "over", " ", "a", " ", "period", " ", "of", " ", "time", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "music", "`", " ", ":", " ", "``", "Mix", "\\u", "Music", "``", "\\", "10", ";", " ", " ", " ", " ", "Chunk", " ", "to", " ", "play", "\\", "10", ";", " ", " ", " ", " ", "`", "loop", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "great", "er", " ", "than", " ", "zero", ",", " ", "the", " ", "number", " ", "of", " ", "times", " ", "to", " ", "play", " ", "the", " ", "sound", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "-1", ",", " ", "loop", " ", "infini", "tel", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "ms", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "milliseconds", " ", "to", " ", "fade", " ", "up", " ", "over", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "position", "`", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Position", " ", "within", " ", "music", " ", "to", " ", "start", " ", "at", ".", " ", " ", "Curr", "ent", "ly", " ", "implemented", "\\", "10", ";", " ", " ", " ", " ", "only", " ", "for", " ", "MOD", ",", " ", "OG", "G", " ", "and", " ", "MP", "3", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "see", ":", " ", "Mix", "\\u", "Set", "Music", "Position", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "music", "'_", ",_", "'", "loop", "s", "'_", ",_", "'", "ms", "'_", ",_", "'", "position", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "\\u", "Mix", "\\u", "Music", "_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", ",_", "c\\u", "double_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Mix", "\\u", "Fad", "e", "In", "Chan", "nel", "Time", "d_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "e", "In", "Chan", "nel", "Time", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Fad", "e", " ", "in", " ", "a", " ", "channel", " ", "and", " ", "play", " ", "for", " ", "a", " ", "specified", " ", "amo", "unt", " ", "of", " ", "time", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "channel", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "-1", ",", " ", "play", " ", "on", " ", "the", " ", "first", " ", "free", " ", "channel", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "chunk", "`", " ", ":", " ", "`", "Mix", "\\u", "Chunk", "`", "\\", "10", ";", " ", " ", " ", " ", "Chunk", " ", "to", " ", "play", "\\", "10", ";", " ", " ", " ", " ", "`", "loop", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "great", "er", " ", "than", " ", "zero", ",", " ", "the", " ", "number", " ", "of", " ", "times", " ", "to", " ", "play", " ", "the", " ", "sound", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "-1", ",", " ", "loop", " ", "infini", "tel", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "ms", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "milliseconds", " ", "to", " ", "fade", " ", "up", " ", "over", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "tick", "s", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Maxim", "um", " ", "number", " ", "of", " ", "milliseconds", " ", "to", " ", "play", " ", "sound", " ", "for", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "music", "'_", ",_", "'", "loop", "s", "'_", ",_", "'", "ms", "'_", ",_", "'", "tick", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "\\u", "Mix", "\\u", "Music", "_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Volume_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Volume", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "volume", " ", "in", " ", "the", " ", "range", " ", "of", " ", "0", "-1", "2", "8", " ", "of", " ", "a", " ", "specific", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "channel", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "-1", ",", " ", "set", " ", "the", " ", "volume", " ", "for", " ", "all", " ", "channel", "s", "\\", "10", ";", " ", " ", " ", " ", "`", "volume", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Volume", " ", "to", " ", "set", ",", " ", "in", " ", "the", " ", "range", " ", "0", "-1", "2", "8", ",", " ", "or", " ", "-1", " ", "to", " ", "just", " ", "return", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "current", " ", "volume", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "original", " ", "volume", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "volume", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Volume", "Chunk_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Volume", "Chunk", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "volume", " ", "in", " ", "the", " ", "range", " ", "of", " ", "0", "-1", "2", "8", " ", "of", " ", "a", " ", "chunk", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "chunk", "`", " ", ":", " ", "`", "Mix", "\\u", "Chunk", "`", "\\", "10", ";", " ", " ", " ", " ", "Chunk", " ", "to", " ", "set", " ", "volume", ".", "\\", "10", ";", " ", " ", " ", " ", "`", "volume", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Volume", " ", "to", " ", "set", ",", " ", "in", " ", "the", " ", "range", " ", "0", "-1", "2", "8", ",", " ", "or", " ", "-1", " ", "to", " ", "just", " ", "return", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "current", " ", "volume", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "original", " ", "volume", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "chunk", "'_", ",_", "'", "volume", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Volume", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Volume", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "volume", " ", "in", " ", "the", " ", "range", " ", "of", " ", "0", "-1", "2", "8", " ", "of", " ", "the", " ", "music", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "`", "volume", "`", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Volume", " ", "to", " ", "set", ",", " ", "in", " ", "the", " ", "range", " ", "0", "-1", "2", "8", ",", " ", "or", " ", "-1", " ", "to", " ", "just", " ", "return", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "current", " ", "volume", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "original", " ", "volume", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "volume", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Hal", "t", "Channel_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Hal", "t", "Chan", "nel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Hal", "t", " ", "play", "ing", " ", "of", " ", "a", " ", "partic", "ular", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Hal", "t", "Group_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Hal", "t", "Group", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Hal", "t", " ", "play", "ing", " ", "of", " ", "a", " ", "partic", "ular", " ", "group", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "tag", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Hal", "t", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Hal", "t", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Hal", "t", " ", "play", "ing", " ", "music", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Expire", "Channel_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Expire", "Chan", "nel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Change", " ", "the", " ", "expir", "ation", " ", "dela", "y", " ", "for", " ", "a", " ", "partic", "ular", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "sample", " ", "will", " ", "stop", " ", "play", "ing", " ", "af", "te", " ", "the", " ", "`", "tick", "s", "`", " ", "milliseconds", " ", "have", "\\", "10", ";", " ", " ", " ", " ", "ela", "pse", "d", ",", " ", "or", " ", "remove", " ", "the", " ", "expir", "ation", " ", "if", " ", "`", "tick", "s", "`", " ", "is", " ", "-1", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "tick", "s", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "number", " ", "of", " ", "channel", "s", " ", "affect", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "tick", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "e", "Out", "Channel_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "e", "Out", "Chan", "nel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Hal", "t", " ", "a", " ", "channel", ",", " ", "fad", "ing", " ", "it", " ", "out", " ", "progressi", "vel", "y", " ", "unti", "l", " ", "it", "'", "s", " ", "sile", "nt", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "`", "ms", "`", " ", "parameter", " ", "indicat", "es", " ", "the", " ", "number", " ", "of", " ", "milliseconds", " ", "the", " ", "fad", "ing", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "take", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "ms", "`", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", ",_", "'", "ms", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "e", "Out", "Group_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "e", "Out", "Group", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Hal", "t", " ", "a", " ", "group", ",", " ", "fad", "ing", " ", "it", " ", "out", " ", "progressi", "vel", "y", " ", "unti", "l", " ", "it", "'", "s", " ", "sile", "nt", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "`", "ms", "`", " ", "parameter", " ", "indicat", "es", " ", "the", " ", "number", " ", "of", " ", "milliseconds", " ", "the", " ", "fad", "ing", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "take", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "tag", "`", ":", " ", "int", "\\", "10", ";", " ", "-", " ", "`", "ms", "`", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "tag", "'_", ",_", "'", "ms", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", ",_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "e", "Out", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "e", "Out", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Hal", "t", " ", "play", "ing", " ", "music", ",", " ", "fad", "ing", " ", "it", " ", "out", " ", "progressi", "vel", "y", " ", "unti", "l", " ", "it", "'", "s", " ", "sile", "nt", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "`", "ms", "`", " ", "parameter", " ", "indicat", "es", " ", "the", " ", "number", " ", "of", " ", "milliseconds", " ", "the", " ", "fad", "ing", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "take", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "ms", "`", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "ms", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "ing", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "ing", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Query", " ", "the", " ", "fad", "ing", " ", "status", " ", "of", " ", "the", " ", "music", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "one", " ", "of", " ", "MIX", "\\u", "NO", "\\u", "FA", "DING", ",", " ", "MIX", "\\u", "FA", "DING", "\\u", "OUT", ",", " ", "MIX", "\\u", "FA", "DING", "\\u", "IN", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Fad", "ing", "Channel_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Fad", "ing", "Chan", "nel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Query", " ", "the", " ", "fad", "ing", " ", "status", " ", "of", " ", "a", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "one", " ", "of", " ", "MIX", "\\u", "NO", "\\u", "FA", "DING", ",", " ", "MIX", "\\u", "FA", "DING", "\\u", "OUT", ",", " ", "MIX", "\\u", "FA", "DING", "\\u", "IN", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Pause", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Pause", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Pause", " ", "a", " ", "partic", "ular", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Resu", "me_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Resu", "me", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Resu", "me", " ", "a", " ", "partic", "ular", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Pause", "d_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Pause", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Query", " ", "if", " ", "a", " ", "channel", " ", "is", " ", "paus", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Pause", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Pause", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Pause", " ", "the", " ", "music", " ", "stream", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Resu", "me", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Resu", "me", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Resu", "me", " ", "the", " ", "music", " ", "stream", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Re", "wind", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Re", "wind", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Re", "wind", " ", "the", " ", "music", " ", "stream", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Pause", "d", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Pause", "d", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Query", " ", "if", " ", "the", " ", "music", " ", "stream", " ", "is", " ", "paus", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Music", "Position_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Music", "Position", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "current", " ", "position", " ", "in", " ", "the", " ", "music", " ", "stream", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "MOD", " ", "files", " ", "the", " ", "position", " ", "represent", "s", " ", "the", " ", "pattern", " ", "order", " ", "number", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "OG", "G", " ", "and", " ", "MP", "3", " ", "files", " ", "the", " ", "position", " ", "is", " ", "in", " ", "second", "s", ".", " ", " ", "Curr", "ent", "ly", " ", "no", " ", "other", "\\", "10", ";", " ", " ", " ", " ", "music", " ", "file", " ", "formats", " ", "support", " ", "position", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "position", "`", ":", " ", "float", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "position", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "double_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Play", "ing_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Play", "ing", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Query", " ", "the", " ", "status", " ", "of", " ", "a", " ", "specific", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "number", " ", "of", " ", "queried", " ", "channel", "s", " ", "tha", "t", " ", "are", " ", "play", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Play", "ing", "Music", "_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Play", "ing", "Music", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Query", " ", "the", " ", "status", " ", "of", " ", "the", " ", "music", " ", "stream", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "1", " ", "if", " ", "music", " ", "is", " ", "play", "ing", ",", " ", "0", " ", "other", "wis", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Music", "CMD_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Music", "CMD", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "external", " ", "music", " ", "playback", " ", "command", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Any", " ", "currentl", "y", " ", "play", "ing", " ", "music", " ", "will", " ", "stop", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "command", "`", ":", " ", "string", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "command", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "char", "\\u", "p_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Set", "Synchro", "Value_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Set", "Synchro", "Value", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Set", " ", "the", " ", "sync", "hro", " ", "value", " ", "for", " ", "a", " ", "MOD", " ", "music", " ", "stream", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "value", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "error", "\\u", "return_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Get", "Synchro", "Value_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Get", "Synchro", "Value", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Get", " ", "the", " ", "sync", "hro", " ", "value", " ", "for", " ", "a", " ", "MOD", " ", "music", " ", "stream", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "c\\u", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Get", "Chunk_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Get", "Chunk", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Get", " ", "the", " ", "chunk", " ", "currentl", "y", " ", "associate", "d", " ", "with", " ", "a", " ", "mixer", " ", "channel", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Non", "e", " ", "if", " ", "the", " ", "channel", " ", "is", " ", "invalid", " ", "or", " ", "if", " ", "there", "'", "s", " ", "no", " ", "chunk", " ", "associate", "d", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", "-", " ", "`", "channel", "`", ":", " ", "int", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "`", "Mix", "\\u", "Chunk", "`", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "'", "channel", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "c\\u", "int_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "POINTER_", "(_", "Mix", "\\u", "Chunk_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dereferenc", "e\\u", "return_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Mix", "\\u", "Clos", "e", "Audio_", "=_", "\\u", "dll_", "._", "function_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mix", "\\u", "Clos", "e", "Audi", "o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "Clos", "e", " ", "the", " ", "mixer", ",", " ", "halt", "ing", " ", "all", " ", "play", "ing", " ", "audio", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arg", "\\u", "types_", "=_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "type_", "=_", "None_", ")_" ]
[ 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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 ]
Unused local variable
lmorchard/badg.us/badgus/badger_api/tests/test_views.py
[ { "content": " def test_already_awarded(self):\n \"\"\"Can award badges from API\"\"\"\n description = \"Is a hoopy frood.\"\n invite_email = 'someguy@example.com'\n award_user = self._get_user(username=\"awardee1\",\n email=\"awardee1@example.com\")\n\n award = self.badge.award_to(email=award_user.email)\n deferred_award = self.badge.award_to(email=invite_email)\n\n # Construct the request data...\n data = dict(\n description = description,\n emails = [\n invite_email,\n award_user.email,\n ],\n )\n\n # POST to the awards URL\n resp = self.client.post(self.awards_url, json.dumps(data),\n content_type='application/json',\n HTTP_AUTHORIZATION=self.basic_auth)\n \n eq_('application/json', resp['Content-Type'])\n data = json.loads(resp.content)\n\n print \"DATA %s\" % data\n\n ok_('errors' in data)\n ok_(award_user.email in data['errors'])\n eq_('ALREADYAWARDED', data['errors'][award_user.email])\n ok_(invite_email in data['errors'])\n eq_('ALREADYAWARDED', data['errors'][invite_email])", "metadata": "root.BadgerApiViewsTests.test_already_awarded", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 152 } ]
[ { "span": "award ", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 13 }, { "span": "deferred_award ", "start_line": 160, "start_column": 8, "end_line": 160, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "alr", "ead", "y", "\\u", "award", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Can", " ", "award", " ", "badge", "s", " ", "from", " ", "API", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\"", "Is", " ", "a", " ", "hoo", "py", " ", "fro", "od", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "invite", "\\u", "email_", "=_", "'", "some", "guy", "@", "example", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "award", "\\u", "user_", "=_", "self_", "._", "\\u", "get", "\\u", "user_", "(_", "username_", "=_", "\"", "award", "ee", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "\"", "award", "ee", "1", "@", "example", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "award", "_", "=_", "self_", "._", "badge", "_", "._", "award", "\\u", "to_", "(_", "email_", "=_", "award", "\\u", "user_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "red", "\\u", "award", "_", "=_", "self_", "._", "badge", "_", "._", "award", "\\u", "to_", "(_", "email_", "=_", "invite", "\\u", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "the", " ", "request", " ", "data", "..._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "emails_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "invite", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "award", "\\u", "user_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POST", " ", "to", " ", "the", " ", "awards", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "json_", "._", "dumps_", "(_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "self_", "._", "basic", "\\u", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "'", "applica", "tion", "/", "json", "'_", ",_", "resp_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "DATA", " ", "%", "s", "\"_", "%_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ok\\u_", "(_", "'", "error", "s", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "award", "\\u", "user_", "._", "email_", "in_", "data_", "[_", "'", "error", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "ALREADY", "AWA", "RD", "ED", "'_", ",_", "data_", "[_", "'", "error", "s", "'_", "]_", "[_", "award", "\\u", "user_", "._", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "invite", "\\u", "email_", "in_", "data_", "[_", "'", "error", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "ALREADY", "AWA", "RD", "ED", "'_", ",_", "data_", "[_", "'", "error", "s", "'_", "]_", "[_", "invite", "\\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 ]
Unused local variable
yuhaozhang/nnjm-global/code/train_nnjm.py
[ { "content": " def getBatchData(self):\n src_lang = self.src_lang\n tgt_lang = self.tgt_lang\n tgt_vocab_size = self.tgt_vocab_size\n ngram_size = self.ngram_size\n\n is_shuffle = self.is_shuffle\n chunk_size = self.chunk_size\n src_window = self.src_window\n opt = self.opt\n\n (data_x, data_y) = io_read_ngram.get_joint_ngrams(self.src_f, self.tgt_f, self.align_f, \\\n tgt_vocab_size, ngram_size, src_window, opt, num_read_lines=chunk_size)\n return (data_x, data_y)", "metadata": "root.TrainNNJMModel.getBatchData", "header": "['class', 'TrainNNJMModel', '(', 'TrainModel', ')', ':', '___EOS___']", "index": 94 }, { "content": " def loadBatchData(self, isInitialLoad=False):\n src_lang = self.src_lang\n tgt_lang = self.tgt_lang\n tgt_vocab_size = self.tgt_vocab_size\n ngram_size = self.ngram_size\n\n chunk_size = self.chunk_size\n src_window = self.src_window\n opt = self.opt\n\n (self.data_x, self.data_y) = io_read_ngram.get_joint_ngrams(self.src_f, self.tgt_f, self.align_f, \\\n tgt_vocab_size, ngram_size, src_window, opt, num_read_lines=chunk_size)\n\n if isInitialLoad == False:\n assert(type(self.model) == model_nnlm.ModelNNLM)\n return self.model.updateTrainModelInput(self.data_x, self.data_y)", "metadata": "root.TrainNNJMModel.loadBatchData", "header": "['class', 'TrainNNJMModel', '(', 'TrainModel', ')', ':', '___EOS___']", "index": 122 }, { "content": " def displayFirstNExamples(self, n):\n if self.src_window < 0:\n return\n src_vocab, src_vocab_size = io_vocab.load_vocab(self.src_vocab_file)\n tgt_vocab, tgt_vocab_size = io_vocab.load_vocab(self.tgt_vocab_file)\n src_inverse_vocab = io_vocab.inverse_vocab(src_vocab)\n tgt_inverse_vocab = io_vocab.inverse_vocab(tgt_vocab)\n assert(n <= self.chunk_size)\n for i in xrange(n):\n example_x = self.data_x[i]\n example_y = self.data_y[i]\n sent_idx = example_x[-1]\n src_window_vector = example_x[:self.src_window*2 + 1]\n tgt_gram_vector = example_x[self.src_window*2 + 1:]\n src_window_words = io_vocab.getWordsFromIndeces(src_window_vector, src_inverse_vocab, self.tgt_vocab_size)\n tgt_gram_words = io_vocab.getWordsFromIndeces(tgt_gram_vector, tgt_inverse_vocab, 0)\n\n output = \"\"\n count = 0\n for w in src_window_words:\n count += 1\n if count == self.src_window + 1:\n output += \"[\" + w + \"] \"\n else:\n output += w + \" \"\n output += \"|| \"\n output += \" \".join(tgt_gram_words) + \" \"\n output += \"===> \" + tgt_inverse_vocab[example_y]\n print output", "metadata": "root.TrainNNJMModel.displayFirstNExamples", "header": "['class', 'TrainNNJMModel', '(', 'TrainModel', ')', ':', '___EOS___']", "index": 139 } ]
[ { "span": "src_lang ", "start_line": 95, "start_column": 8, "end_line": 95, "end_column": 16 }, { "span": "tgt_lang ", "start_line": 96, "start_column": 8, "end_line": 96, "end_column": 16 }, { "span": "is_shuffle ", "start_line": 100, "start_column": 8, "end_line": 100, "end_column": 18 }, { "span": "src_lang ", "start_line": 123, "start_column": 8, "end_line": 123, "end_column": 16 }, { "span": "tgt_lang ", "start_line": 124, "start_column": 8, "end_line": 124, "end_column": 16 }, { "span": "sent_idx ", "start_line": 150, "start_column": 12, "end_line": 150, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Train", "NN", "JM", "Model_", "(_", "Train", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Bat", "ch", "Data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src", "\\u", "lang_", "=_", "self_", "._", "src", "\\u", "lang_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "lang_", "=_", "self_", "._", "tgt", "\\u", "lang_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "vocab", "\\u", "size_", "=_", "self_", "._", "tgt", "\\u", "vocab", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ngram", "\\u", "size_", "=_", "self_", "._", "ngram", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "shuffle_", "=_", "self_", "._", "is", "\\u", "shuffle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chunk", "\\u", "size_", "=_", "self_", "._", "chunk", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src", "\\u", "window_", "=_", "self_", "._", "src", "\\u", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt_", "=_", "self_", "._", "opt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "data\\u", "x_", ",_", "data\\u", "y_", ")_", "=_", "io", "\\u", "read", "\\u", "ngram_", "._", "get", "\\u", "joint", "\\u", "ngrams_", "(_", "self_", "._", "src", "\\u", "f_", ",_", "self_", "._", "tgt", "\\u", "f_", ",_", "self_", "._", "align", "\\u", "f_", ",_", "tgt", "\\u", "vocab", "\\u", "size_", ",_", "ngram", "\\u", "size_", ",_", "src", "\\u", "window_", ",_", "opt_", ",_", "num", "\\u", "read", "\\u", "lines_", "=_", "chunk", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "data\\u", "x_", ",_", "data\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Train", "NN", "JM", "Model_", "(_", "Train", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "Bat", "ch", "Data_", "(_", "self_", ",_", "is", "Initial", "Load_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "src", "\\u", "lang_", "=_", "self_", "._", "src", "\\u", "lang_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "lang_", "=_", "self_", "._", "tgt", "\\u", "lang_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "vocab", "\\u", "size_", "=_", "self_", "._", "tgt", "\\u", "vocab", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ngram", "\\u", "size_", "=_", "self_", "._", "ngram", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "chunk", "\\u", "size_", "=_", "self_", "._", "chunk", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src", "\\u", "window_", "=_", "self_", "._", "src", "\\u", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt_", "=_", "self_", "._", "opt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "data\\u", "x_", ",_", "self_", "._", "data\\u", "y_", ")_", "=_", "io", "\\u", "read", "\\u", "ngram_", "._", "get", "\\u", "joint", "\\u", "ngrams_", "(_", "self_", "._", "src", "\\u", "f_", ",_", "self_", "._", "tgt", "\\u", "f_", ",_", "self_", "._", "align", "\\u", "f_", ",_", "tgt", "\\u", "vocab", "\\u", "size_", ",_", "ngram", "\\u", "size_", ",_", "src", "\\u", "window_", ",_", "opt_", ",_", "num", "\\u", "read", "\\u", "lines_", "=_", "chunk", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "Initial", "Load_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "type_", "(_", "self_", "._", "model_", ")_", "==_", "model", "\\u", "nn", "lm_", "._", "Model", "NN", "LM", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "model_", "._", "update", "Train", "Model", "Input_", "(_", "self_", "._", "data\\u", "x_", ",_", "self_", "._", "data\\u", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Train", "NN", "JM", "Model_", "(_", "Train", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "display", "Fi", "rst", "NE", "xa", "mple", "s_", "(_", "self_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "src", "\\u", "window_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "src", "\\u", "vocab_", ",_", "src", "\\u", "vocab", "\\u", "size_", "=_", "io", "\\u", "vocab_", "._", "load", "\\u", "vocab_", "(_", "self_", "._", "src", "\\u", "vocab", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "vocab_", ",_", "tgt", "\\u", "vocab", "\\u", "size_", "=_", "io", "\\u", "vocab_", "._", "load", "\\u", "vocab_", "(_", "self_", "._", "tgt", "\\u", "vocab", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src", "\\u", "inv", "erse", "\\u", "vocab_", "=_", "io", "\\u", "vocab_", "._", "inv", "erse", "\\u", "vocab_", "(_", "src", "\\u", "vocab_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "inv", "erse", "\\u", "vocab_", "=_", "io", "\\u", "vocab_", "._", "inv", "erse", "\\u", "vocab_", "(_", "tgt", "\\u", "vocab_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "n_", "<=_", "self_", "._", "chunk", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "example", "\\u", "x_", "=_", "self_", "._", "data\\u", "x_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "example", "\\u", "y_", "=_", "self_", "._", "data\\u", "y_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sent", "\\u", "idx_", "=_", "example", "\\u", "x_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src", "\\u", "window", "\\u", "vector_", "=_", "example", "\\u", "x_", "[_", ":_", "self_", "._", "src", "\\u", "window_", "*_", "2_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "gram", "\\u", "vector_", "=_", "example", "\\u", "x_", "[_", "self_", "._", "src", "\\u", "window_", "*_", "2_", "+_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src", "\\u", "window", "\\u", "words_", "=_", "io", "\\u", "vocab_", "._", "get", "Word", "s", "Fro", "m", "Inde", "ces_", "(_", "src", "\\u", "window", "\\u", "vector_", ",_", "src", "\\u", "inv", "erse", "\\u", "vocab_", ",_", "self_", "._", "tgt", "\\u", "vocab", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tgt", "\\u", "gram", "\\u", "words_", "=_", "io", "\\u", "vocab_", "._", "get", "Word", "s", "Fro", "m", "Inde", "ces_", "(_", "tgt", "\\u", "gram", "\\u", "vector_", ",_", "tgt", "\\u", "inv", "erse", "\\u", "vocab_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "w_", "in_", "src", "\\u", "window", "\\u", "words_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "count_", "==_", "self_", "._", "src", "\\u", "window_", "+_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "output_", "+=_", "\"[\"_", "+_", "w_", "+_", "\"]", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "output_", "+=_", "w_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "output_", "+=_", "\"|", "|", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "+=_", "\"", " ", "\"_", "._", "join_", "(_", "tgt", "\\u", "gram", "\\u", "words_", ")_", "+_", "\"", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "+=_", "\"==", "=>", " ", "\"_", "+_", "tgt", "\\u", "inv", "erse", "\\u", "vocab_", "[_", "example", "\\u", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/controller/drivers/XenDriver.py
[ { "content": "from vt_manager.controller.drivers.VTDriver import VTDriver\nfrom vt_manager.models.XenServer import XenServer\nfrom vt_manager.models.XenVM import XenVM\nfrom vt_manager.models.VTServer import VTServer\nfrom vt_manager.utils.HttpUtils import HttpUtils\nimport threading\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class XenDriver(VTDriver):\n\n\n#\tdef __init__(self):\n#\t\tself.ServerClass = eval('XenServer') \n#\t\tself.VMclass = eval('XenVM') \n\n\n\n\n\t\n\t\n", "metadata": "root.XenDriver", "header": "['module', '___EOS___']", "index": 7 }, { "content": " @staticmethod\n def getInstance():\n\t\treturn XenDriver()", "metadata": "root.XenDriver.getInstance", "header": "['class', 'XenDriver', '(', 'VTDriver', ')', ':', '___NEWLINE___', '___NL___', '___NL___', '#\\tdef __init__(self):', '___NL___', \"#\\t\\tself.ServerClass = eval('XenServer') \", '___NL___', \"#\\t\\tself.VMclass = eval('XenVM')\", '___NL___', '___EOS___']", "index": 15 }, { "content": " def deleteVM(self, vm):\n\t\ttry:\n\t\t\tvm.Server.get().deleteVM(vm)\n\t\texcept:\n\t\t\traise\t", "metadata": "root.XenDriver.deleteVM", "header": "['class', 'XenDriver', '(', 'VTDriver', ')', ':', '___NEWLINE___', '___NL___', '___NL___', '#\\tdef __init__(self):', '___NL___', \"#\\t\\tself.ServerClass = eval('XenServer') \", '___NL___', \"#\\t\\tself.VMclass = eval('XenVM')\", '___NL___', '___EOS___']", "index": 19 }, { "content": " def getServerAndCreateVM(self,action):\n try: \n Server = XenServer.objects.get(uuid = action.server.uuid )\n VMmodel = Server.createVM(*XenDriver.xenVMtoModel(action.server.virtual_machines[0],threading.currentThread().callBackURL, save = True))\n return Server, VMmodel\n except Exception as e:\n raise e", "metadata": "root.XenDriver.getServerAndCreateVM", "header": "['class', 'XenDriver', '(', 'VTDriver', ')', ':', '___NEWLINE___', '___NL___', '___NL___', '#\\tdef __init__(self):', '___NL___', \"#\\t\\tself.ServerClass = eval('XenServer') \", '___NL___', \"#\\t\\tself.VMclass = eval('XenVM')\", '___NL___', '___EOS___']", "index": 25 }, { "content": " @staticmethod\n def createOrUpdateServerFromPOST(request, instance):\n\t\t#return XenServer.constructor(server.getName(),server.getOSType(),server.getOSDistribution(),server.getOSVersion(),server.getAgentURL(),save=True)\n\t\tserver = XenServer.objects.get(uuid = instance.getUUID())\n\t\tif server:\n\t\t\treturn server.updateServer(HttpUtils.getFieldInPost(request,VTServer, \"name\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"operatingSystemType\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"operatingSystemDistribution\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"operatingSystemVersion\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"numberOfCPUs\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"CPUFrequency\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"memory\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"discSpaceGB\"),\n\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"agentURL\"),\n\t\t\t\tsave=True)\n\t\telse:\n\t\t\treturn XenServer.constructor(HttpUtils.getFieldInPost(request,VTServer, \"name\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"operatingSystemType\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"operatingSystemDistribution\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"operatingSystemVersion\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"numberOfCPUs\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"CPUFrequency\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"memory\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"discSpaceGB\"),\n\t\t\t\t\t\t\tHttpUtils.getFieldInPost(request,VTServer, \"agentURL\"),\n\t\t\t\t\t\t\tsave=True)", "metadata": "root.XenDriver.createOrUpdateServerFromPOST", "header": "['class', 'XenDriver', '(', 'VTDriver', ')', ':', '___NEWLINE___', '___NL___', '___NL___', '#\\tdef __init__(self):', '___NL___', \"#\\t\\tself.ServerClass = eval('XenServer') \", '___NL___', \"#\\t\\tself.VMclass = eval('XenVM')\", '___NL___', '___EOS___']", "index": 33 }, { "content": " def crudServerFromInstance(self,instance):\n\t\tserver = XenServer.objects.filter(uuid = instance.getUUID())\n\t\tif len(server)==1:\n\t\t\tserver = server[0]\n\t\t\treturn server.updateServer(instance.getName(),\n\t\t\t\t\t\tinstance.getOSType(),\n\t\t\t\t\t\tinstance.getOSDistribution(),\n\t\t\t\t\t\tinstance.getOSVersion(),\n\t\t\t\t\t\tinstance.getNumberOfCPUs(),\n\t\t\t\t\t\tinstance.getCPUFrequency(),\n\t\t\t\t\t\tinstance.getMemory(),\n\t\t\t\t\t\tinstance.getDiscSpaceGB(),\n\t\t\t\t\t\tinstance.getAgentURL(),\n\t\t\t\t\t\tinstance.getAgentPassword(),\n\t\t\t\t\t\tsave = True)\n\t\telif len(server)==0:\n\t\t\treturn XenServer.constructor(instance.getName(),\n\t\t\t\t\t\t\t\tinstance.getOSType(),\n\t\t\t\t\t\t\t\tinstance.getOSDistribution(),\n\t\t\t\t\t\t\t\tinstance.getOSVersion(),\n\t\t\t\t\t\t\t\tinstance.getNumberOfCPUs(),\n\t\t\t\t\t\t\t\tinstance.getCPUFrequency(),\n\t\t\t\t\t\t\t\tinstance.getMemory(),\n\t\t\t\t\t\t\t\tinstance.getDiscSpaceGB(),\n\t\t\t\t\t\t\t\tinstance.getAgentURL(),\n\t\t\t\t\t\t\t\tinstance.getAgentPassword(),\n\t\t\t\t\t\t\t\tsave=True)\n\t\telse:\n\t\t\traise Exception(\"Trying to create a server failed\")", "metadata": "root.XenDriver.crudServerFromInstance", "header": "['class', 'XenDriver', '(', 'VTDriver', ')', ':', '___NEWLINE___', '___NL___', '___NL___', '#\\tdef __init__(self):', '___NL___', \"#\\t\\tself.ServerClass = eval('XenServer') \", '___NL___', \"#\\t\\tself.VMclass = eval('XenVM')\", '___NL___', '___EOS___']", "index": 60 }, { "content": " @staticmethod\n def xenVMtoModel(VMxmlClass, callBackURL, save):\n name = VMxmlClass.name\n uuid = VMxmlClass.uuid\n projectId = VMxmlClass.project_id\n projectName = VMxmlClass.project_name\n sliceId = VMxmlClass.slice_id\n sliceName = VMxmlClass.slice_name\n osType = VMxmlClass.operating_system_type\n osVersion = VMxmlClass.operating_system_version\n osDist = VMxmlClass.operating_system_distribution\n memory = VMxmlClass.xen_configuration.memory_mb\n\t\t# XXX\n callBackUrl = callBackURL\n hdSetupType = VMxmlClass.xen_configuration.hd_setup_type\n hdOriginPath = VMxmlClass.xen_configuration.hd_origin_path\n virtSetupType = VMxmlClass.xen_configuration.virtualization_setup_type\n return name,uuid,projectId,projectName,sliceId,sliceName,osType,osVersion,osDist,memory,None,None,callBackUrl,hdSetupType,hdOriginPath,virtSetupType,save", "metadata": "root.XenDriver.xenVMtoModel", "header": "['class', 'XenDriver', '(', 'VTDriver', ')', ':', '___NEWLINE___', '___NL___', '___NL___', '#\\tdef __init__(self):', '___NL___', \"#\\t\\tself.ServerClass = eval('XenServer') \", '___NL___', \"#\\t\\tself.VMclass = eval('XenVM')\", '___NL___', '___EOS___']", "index": 90 } ]
[ { "span": "from vt_manager.models.XenVM import XenVM", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 41 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "controller_", "._", "drivers_", "._", "VT", "Driver_", "import_", "VT", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "Xen", "Server_", "import_", "Xen", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "Xen", "VM_", "import_", "Xen", "VM_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "models_", "._", "VT", "Server_", "import_", "VT", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "utils_", "._", "Http", "Utils_", "import_", "Http", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\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_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", "_", "\\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_", "get", "Instance_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "Xen", "Driver_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", "_", "\\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_", "delete", "VM_", "(_", "self_", ",_", "vm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "vm_", "._", "Server_", "._", "get_", "(_", ")_", "._", "delete", "VM_", "(_", "vm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Server", "And", "Creat", "e", "VM_", "(_", "self_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Server_", "=_", "Xen", "Server_", "._", "objects_", "._", "get_", "(_", "uuid_", "=_", "action_", "._", "server_", "._", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VM", "model_", "=_", "Server_", "._", "create", "VM_", "(_", "*_", "Xen", "Driver_", "._", "xen", "VM", "to", "Model_", "(_", "action_", "._", "server_", "._", "virtual", "\\u", "machines_", "[_", "0_", "]_", ",_", "threading_", "._", "current", "Thread_", "(_", ")_", "._", "call", "Back", "URL_", ",_", "save_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Server_", ",_", "VM", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create", "Or", "Update", "Server", "Fro", "m", "POST_", "(_", "request_", ",_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "Xen", "Server", ".", "construct", "or", "(", "server", ".", "get", "Name", "()", ",", "server", ".", "get", "OST", "ype", "()", ",", "server", ".", "get", "OS", "Distribut", "ion", "()", ",", "server", ".", "get", "OS", "Version", "()", ",", "server", ".", "get", "Agent", "URL", "()", ",", "save", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "server_", "=_", "Xen", "Server_", "._", "objects_", "._", "get_", "(_", "uuid_", "=_", "instance_", "._", "get", "UUID_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "server_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "server_", "._", "update", "Server_", "(_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "name", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "operati", "ng", "System", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "operati", "ng", "System", "Distribut", "ion", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "operati", "ng", "System", "Version", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "number", "Of", "CPU", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "CPU", "Freq", "uenc", "y", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "memory", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "disc", "Spac", "e", "GB", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "agent", "URL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save_", "=_", "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\t", "\t\t_", "return_", "Xen", "Server_", "._", "constructor_", "(_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "name", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "operati", "ng", "System", "Type", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "operati", "ng", "System", "Distribut", "ion", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "operati", "ng", "System", "Version", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "number", "Of", "CPU", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "CPU", "Freq", "uenc", "y", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "memory", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "disc", "Spac", "e", "GB", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Http", "Utils_", "._", "get", "Field", "In", "Post_", "(_", "request_", ",_", "VT", "Server_", ",_", "\"", "agent", "URL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "crud", "Server", "Fro", "m", "Instance_", "(_", "self_", ",_", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "server_", "=_", "Xen", "Server_", "._", "objects_", "._", "filter_", "(_", "uuid_", "=_", "instance_", "._", "get", "UUID_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "server_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "server_", "=_", "server_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "server_", "._", "update", "Server_", "(_", "instance_", "._", "get", "Name_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "OST", "ype_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "OS", "Distribution_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "OS", "Version_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Number", "Of", "CPU", "s_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "CPU", "Frequency_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Memory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Disc", "Spac", "e", "GB", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Agent", "URL_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Agent", "Password_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "server_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "Xen", "Server_", "._", "constructor_", "(_", "instance_", "._", "get", "Name_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "OST", "ype_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "OS", "Distribution_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "OS", "Version_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Number", "Of", "CPU", "s_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "CPU", "Frequency_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Memory_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Disc", "Spac", "e", "GB", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Agent", "URL_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "instance_", "._", "get", "Agent", "Password_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "save_", "=_", "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\t", "\t\t_", "raise_", "Exception_", "(_", "\"", "Tr", "ying", " ", "to", " ", "create", " ", "a", " ", "server", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Xen", "Driver_", "(_", "VT", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "def", " ", "\\u\\u", "init", "\\u\\u", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "Server", "Class", " ", "=", " ", "eval", "('", "Xen", "Server", "')", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "self", ".", "VM", "class", " ", "=", " ", "eval", "('", "Xen", "VM", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "xen", "VM", "to", "Model_", "(_", "VM", "xml", "Class_", ",_", "call", "Back", "URL_", ",_", "save_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "VM", "xml", "Class_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid_", "=_", "VM", "xml", "Class_", "._", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project", "Id_", "=_", "VM", "xml", "Class_", "._", "project", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project", "Name_", "=_", "VM", "xml", "Class_", "._", "project", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slice", "Id_", "=_", "VM", "xml", "Class_", "._", "slice", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slice", "Name_", "=_", "VM", "xml", "Class_", "._", "slice", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "Type_", "=_", "VM", "xml", "Class_", "._", "operati", "ng", "\\u", "system", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "Version_", "=_", "VM", "xml", "Class_", "._", "operati", "ng", "\\u", "system", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "Dist_", "=_", "VM", "xml", "Class_", "._", "operati", "ng", "\\u", "system", "\\u", "distribution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "memory_", "=_", "VM", "xml", "Class_", "._", "xen", "\\u", "configuration_", "._", "memory", "\\u", "mb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X_", "\\u\\u\\uNL\\u\\u\\u_", "call", "Back", "Url_", "=_", "call", "Back", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hd", "Set", "up", "Type_", "=_", "VM", "xml", "Class_", "._", "xen", "\\u", "configuration_", "._", "hd", "\\u", "setup", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hd", "Orig", "in", "Path_", "=_", "VM", "xml", "Class_", "._", "xen", "\\u", "configuration_", "._", "hd", "\\u", "orig", "in", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "virt", "Set", "up", "Type_", "=_", "VM", "xml", "Class_", "._", "xen", "\\u", "configuration_", "._", "virtual", "izatio", "n", "\\u", "setup", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "name_", ",_", "uuid_", ",_", "project", "Id_", ",_", "project", "Name_", ",_", "slice", "Id_", ",_", "slice", "Name_", ",_", "os", "Type_", ",_", "os", "Version_", ",_", "os", "Dist_", ",_", "memory_", ",_", "None_", ",_", "None_", ",_", "call", "Back", "Url_", ",_", "hd", "Set", "up", "Type_", ",_", "hd", "Orig", "in", "Path_", ",_", "virt", "Set", "up", "Type_", ",_", "save_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
jpscaletti/Voodoo/tests/test_output.py
[ { "content": "def test_output_force(capsys, dst):\n render(dst)\n out, err = capsys.readouterr()\n render(dst, quiet=False, force=True)\n out, err = capsys.readouterr()\n print(out)\n\n assert re.search(r'conflict[^\\s]+ config\\.py', out)\n assert re.search(r'force[^\\s]+ config\\.py', out)\n assert re.search(r'identical[^\\s]+ setup\\.py', out)\n assert re.search(r'identical[^\\s]+ doc/images/nslogo\\.gif', out)", "metadata": "root.test_output_force", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def test_output_skip(capsys, dst):\n render(dst)\n out, err = capsys.readouterr()\n render(dst, quiet=False, skip=True)\n out, err = capsys.readouterr()\n print(out)\n\n assert re.search(r'conflict[^\\s]+ config\\.py', out)\n assert re.search(r'skip[^\\s]+ config\\.py', out)\n assert re.search(r'identical[^\\s]+ setup\\.py', out)\n assert re.search(r'identical[^\\s]+ doc/images/nslogo\\.gif', out)", "metadata": "root.test_output_skip", "header": "['module', '___EOS___']", "index": 38 } ]
[ { "span": "out,", "start_line": 27, "start_column": 4, "end_line": 27, "end_column": 7 }, { "span": "err ", "start_line": 27, "start_column": 9, "end_line": 27, "end_column": 12 }, { "span": "out,", "start_line": 40, "start_column": 4, "end_line": 40, "end_column": 7 }, { "span": "err ", "start_line": 40, "start_column": 9, "end_line": 40, "end_column": 12 } ]
[ { "span": "out,", "start_line": 29, "start_column": 4, "end_line": 29, "end_column": 7 }, { "span": "err ", "start_line": 29, "start_column": 9, "end_line": 29, "end_column": 12 }, { "span": "out,", "start_line": 42, "start_column": 4, "end_line": 42, "end_column": 7 }, { "span": "err ", "start_line": 42, "start_column": 9, "end_line": 42, "end_column": 12 } ]
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", "output", "\\u", "force_", "(_", "capsys_", ",_", "dst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "render_", "(_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "capsys_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render_", "(_", "dst_", ",_", "quiet_", "=_", "False_", ",_", "force_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "capsys_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "confl", "ict", "[", "^", "\\\\", "s", "]+", " ", " ", "config", "\\\\.", "py", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "force", "[", "^", "\\\\", "s", "]+", " ", " ", "config", "\\\\.", "py", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "identi", "cal", "[", "^", "\\\\", "s", "]+", " ", " ", "setup", "\\\\.", "py", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "identi", "cal", "[", "^", "\\\\", "s", "]+", " ", " ", "doc", "/", "images", "/", "nsl", "ogo", "\\\\.", "gif", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "output", "\\u", "skip_", "(_", "capsys_", ",_", "dst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "render_", "(_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "capsys_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render_", "(_", "dst_", ",_", "quiet_", "=_", "False_", ",_", "skip_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "capsys_", "._", "readouterr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "confl", "ict", "[", "^", "\\\\", "s", "]+", " ", " ", "config", "\\\\.", "py", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "skip", "[", "^", "\\\\", "s", "]+", " ", " ", "config", "\\\\.", "py", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "identi", "cal", "[", "^", "\\\\", "s", "]+", " ", " ", "setup", "\\\\.", "py", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re_", "._", "search_", "(_", "r", "'", "identi", "cal", "[", "^", "\\\\", "s", "]+", " ", " ", "doc", "/", "images", "/", "nsl", "ogo", "\\\\.", "gif", "'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 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 ]
Use of the return value of a procedure
CGATOxford/cgat/obsolete/run_nubiscan.py
[ { "content": "\"\"\"\n\n:Author: Andreas Heger\n:Release: $Id: run_nubiscan.py 2861 2010-02-23 17:36:32Z andreas $\n:Date: |today|\n:Tags: Python\n\nPurpose\n-------\n\n.. todo::\n \n describe purpose of the script.\n\nUsage\n-----\n\nType::\n\n python <script_name>.py --help\n\nfor command line help.\n\nCommand line options\n--------------------\n\n\"\"\"\n\nimport os\nimport sys\nimport re\nimport optparse\nimport numpy\nimport CGAT.Experiment as E\nimport CGAT.Nubiscan as Nubiscan\nimport CGAT.FastaIterator as FastaIterator\nimport CGAT.Stats as Stats\nimport CGAT.Genomics as Genomics\nimport CGAT.Masker as Masker\n\n# from MEME\nRXRVDR = numpy.matrix(((0.02, 0.16, 0.82, 0.66, 0.00, 0.00),\n (0.10, 0.00, 0.12, 0.34, 1.00, 0.32),\n (0.02, 0.84, 0.04, 0.00, 0.00, 0.00),\n (0.86, 0.00, 0.02, 0.00, 0.00, 0.68),\n (0, 0, 0, 0, 0, 0),\n ))\n\n# from Bioprospector - first half site\nRXRVDR1 = numpy.matrix(((0.09, 0.22, 0.76, 0.70, 0.00, 0.00),\n (0.15, 0.00, 0.17, 0.30, 1.00, 0.36),\n (0.00, 0.77, 0.00, 0.00, 0.00, 0.00),\n (0.76, 0.00, 0.07, 0.00, 0.00, 0.64),\n (0, 0, 0, 0, 0, 0),\n ))\n\n\n# from Bioprospector - second half site\nRXRVDR2 = numpy.matrix(((0.02, 0.02, 0.88, 0.27, 0.05, 0.03),\n (0.05, 0.15, 0.07, 0.73, 0.92, 0.42),\n (0.00, 0.83, 0.04, 0.00, 0.00, 0.00),\n (0.93, 0.00, 0.01, 0.00, 0.04, 0.55),\n (0, 0, 0, 0, 0, 0),\n ))\n\n# from Bioprospector - combined half-sites\nRXVDR = (RXRVDR1 + RXRVDR2) / 2.0\n\nNR = numpy.matrix(((0.72, 0, 0.09, 0.27, 0, 0.90),\n (0, 0, 0, 0, 0.90, 0.09),\n (0.27, 0.90, 0.54, 0.09, 0.09, 0),\n (0, 0.09, 0.36, 0.63, 0, 0),\n (0, 0, 0, 0, 0, 0),\n ))\n\n\n\n\n\n\nif __name__ == \"__main__\":\n sys.exit(main(sys.argv))\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main(argv=None):\n \"\"\"script main.\n\n parses command line options in sys.argv, unless *argv* is given.\n \"\"\"\n\n if not argv:\n argv = sys.argv\n\n # setup command line parser\n parser = E.OptionParser(\n version=\"%prog version: $Id: run_nubiscan.py 2861 2010-02-23 17:36:32Z andreas $\", usage=globals()[\"__doc__\"])\n\n parser.add_option(\"-i\", \"--iterations\", dest=\"iterations\", type=\"int\",\n help=\"number of iterations for sampling [default=%default].\")\n\n parser.add_option(\"-q\", \"--qvalue\", dest=\"qvalue_threshold\", type=\"float\",\n help=\"qvalue threshold [default=%default].\")\n\n parser.add_option(\"--without-combine\", dest=\"combine\", action=\"store_false\",\n help=\"combine overlapping motifs [default=%default].\")\n\n parser.add_option(\"-f\", \"--fdr-control\", dest=\"fdr_control\", type=\"choice\",\n choices=(\"per-sequence\", \"all\", \"xall\"),\n help=\"qvalue threshold [default=%default].\")\n\n parser.add_option(\"-m\", \"--motif\", dest=\"motif\", type=\"choice\",\n choices=(\"rxrvdr\", \"rxrvdr1\", \"rxrvdr2\", \"nr\"),\n help=\"qvalue threshold [default=%default].\")\n\n parser.add_option(\"-a\", \"--arrangements\", dest=\"arrangements\", type=\"string\",\n help=\"',' separated list of repeat arrangements [default=%default]\")\n\n parser.add_option(\"-x\", \"--mask\", dest=\"mask\", type=\"choice\",\n choices=(\"dust\", \"repeatmasker\"),\n help =\"mask sequences before scanning [default=%default]\")\n\n parser.add_option(\"--output-stats\", dest=\"output_stats\", action=\"store_true\",\n help=\"output stats [default=%default].\")\n\n parser.add_option(\"--add-sequence\", dest=\"add_sequence\", action=\"store_true\",\n help=\"add sequence information [default=%default].\")\n\n parser.set_defaults(\n iterations=100,\n qvalue_threshold=0.05,\n motif=\"rxrvdr\",\n fdr_control=\"all\",\n combine=True,\n arrangements=None,\n mask=None,\n output_stats=False,\n add_sequence=False,\n )\n\n # add common options (-h/--help, ...) and parse command line\n (options, args) = E.Start(parser, argv=argv, add_output_options=True)\n\n # do sth\n ninput, nskipped, noutput = 0, 0, 0\n\n if options.arrangements is None:\n options.arrangements = [\n \"DR%s\" % x for x in range(0, 15)] + [\"ER%s\" % x for x in range(0, 15)]\n else:\n options.arrangements = options.arrangements.split(\",\")\n\n options.stdout.write(\"%s\" % \"\\t\".join(Nubiscan.NubiscanMatch._fields))\n if options.add_sequence:\n options.stdout.write(\"\\tsequence\")\n options.stdout.write(\"\\n\")\n\n if options.motif == 'nr':\n sense_matrix = NR\n elif options.motif == \"rxrvdr\":\n sense_matrix = RXRVDR\n elif options.motif == \"rxrvdr1\":\n sense_matrix = RXRVDR1\n elif options.motif == \"rxrvdr2\":\n sense_matrix = RXRVDR2\n else:\n raise ValueError(\"unknown matrix %s\" % options.motif)\n\n if options.fdr_control == \"all\":\n\n seqs = list(FastaIterator.iterate(options.stdin))\n\n if options.mask:\n masked_seqs = maskSequences(\n [x.sequence for x in seqs], options.mask)\n else:\n masked_seqs = [x.sequence for x in seqs]\n\n ninput = len(seqs)\n map_id2title = dict(\n enumerate([re.sub(\"\\s.*\", \"\", x.title) for x in seqs]))\n matcher = Nubiscan.MatcherRandomisationSequences(sense_matrix,\n samples=options.iterations)\n\n results = matcher.run(masked_seqs,\n options.arrangements,\n qvalue_threshold=options.qvalue_threshold)\n\n if options.combine:\n results = Nubiscan.combineMotifs(results)\n\n for r in results:\n\n if r.alternatives:\n alternatives = \",\".join(\n [x.arrangement for x in r.alternatives])\n else:\n alternatives = \"\"\n\n options.stdout.write(\"\\t\".join((\n map_id2title[r.id],\n \"%i\" % r.start,\n \"%i\" % r.end,\n r.strand,\n r.arrangement,\n \"%6.4f\" % r.score,\n \"%6.4f\" % r.zscore,\n \"%6.4e\" % r.pvalue,\n \"%6.4e\" % r.qvalue,\n alternatives)))\n\n if options.add_sequence:\n s = masked_seqs[int(r.id)][r.start:r.end]\n if r.strand == \"-\":\n s = Genomics.complement(s)\n s = s[:6].upper() + s[6:-6].lower() + s[-6:].upper()\n options.stdout.write(\"\\t%s\" % s)\n\n options.stdout.write(\"\\n\")\n noutput += 1\n\n # output stats\n if options.output_stats:\n outfile = E.openOutputFile(\"fdr\")\n outfile.write(\"bin\\thist\\tnobserved\\n\")\n for bin, hist, nobs in zip(matcher.bin_edges, matcher.hist, matcher.nobservations):\n outfile.write(\"%f\\t%f\\t%f\\n\" % (bin, hist, nobs))\n outfile.close()\n\n elif options.fdr_control == \"xall\":\n\n matcher = Nubiscan.MatcherRandomisationSequence(sense_matrix,\n samples=options.iterations)\n\n # collect all results\n matches = []\n for seq in FastaIterator.iterate(options.stdin):\n ninput += 1\n mm = matcher.run(seq.sequence,\n options.arrangements,\n qvalue_threshold=None)\n for m in mm:\n matches.append(m._replace(sequence=seq.title))\n\n # estimate qvalues for all matches across all sequences\n pvalues = [x.pvalue for x in matches]\n fdr = Stats.doFDR(pvalues)\n qvalues = fdr.mQValues\n results = []\n for m, qvalue in zip(matches, qvalues):\n if qvalue > options.qvalue_threshold:\n continue\n results.append(m._replace(qvalue=qvalue))\n\n if options.combine:\n results = Nubiscan.combineMotifs(results)\n\n # output\n for r in results:\n options.stdout.write(\"\\t\".join((\n r.id,\n \"%i\" % r.start,\n \"%i\" % r.end,\n r.strand,\n r.arrangement,\n \"%6.4f\" % r.score,\n \"%6.4f\" % r.zscore,\n \"%6.4e\" % r.pvalue,\n \"%6.4e\" % r.qvalue)) + \"\\n\")\n\n noutput += 1\n\n elif options.fdr_control == \"per-sequence\":\n matcher = Nubiscan.MatcherRandomisationSequence(sense_matrix,\n samples=options.iterations)\n\n for seq in FastaIterator.iterate(options.stdin):\n ninput += 1\n result = matcher.run(seq.sequence,\n options.arrangements,\n qvalue_threshold=options.qvalue_threshold)\n\n if options.combine:\n result = Nubiscan.combineMotifs(result)\n\n t = re.sub(\" .*\", \"\", seq.title)\n for r in result:\n options.stdout.write(\"\\t\".join((\n t,\n \"%i\" % r.start,\n \"%i\" % r.end,\n r.strand,\n r.arrangement,\n \"%6.4f\" % r.score,\n \"%6.4f\" % r.zscore,\n \"%f\" % r.pvalue,\n \"%f\" % r.qvalue)) + \"\\n\")\n\n noutput += 1\n\n E.info(\"ninput=%i, noutput=%i, nskipped=%i\" % (ninput, noutput, nskipped))\n\n # write footer and output benchmark information.\n E.Stop()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 92 } ]
[ { "span": "main(sys.argv))", "start_line": 314, "start_column": 13, "end_line": 314, "end_column": 27 } ]
[ { "span": "def main(argv=None):", "start_line": 92, "start_column": 0, "end_line": 92, "end_column": 20 } ]
1
false
[ "[CLS]_", "Use_", "of_", "the_", "return_", "value_", "of_", "a_", "procedure_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "\\", "10", ";", ":", "Author", ":", " ", "Andre", "as", " ", "He", "ger", "\\", "10", ";", ":", "Release", ":", " ", "$", "Id", ":", " ", "run", "\\u", "nu", "bis", "can", ".", "py", " ", "286", "1", " ", "2010", "-0", "2", "-", "23", " ", "1", "7", ":", "3", "6", ":", "32", "Z", " ", "andr", "eas", " ", "$", "\\", "10", ";", ":", "Date", ":", " ", "|", "toda", "y", "|", "\\", "10", ";", ":", "Ta", "gs", ":", " ", "Pyth", "on", "\\", "10", ";", "\\", "10", ";", "Pur", "pose", "\\", "10", ";", "-------", "\\", "10", ";", "\\", "10", ";", "..", " ", "todo", "::", "\\", "10", ";", " ", " ", " ", "\\", "10", ";", " ", " ", " ", "descri", "be", " ", "purpose", " ", "of", " ", "the", " ", "script", ".", "\\", "10", ";", "\\", "10", ";", "Us", "age", "\\", "10", ";", "-----", "\\", "10", ";", "\\", "10", ";", "Type", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "python", " ", "<", "script", "\\u", "name", ">.", "py", " ", "--", "help", "\\", "10", ";", "\\", "10", ";", "for", " ", "command", " ", "line", " ", "help", ".", "\\", "10", ";", "\\", "10", ";", "Command", " ", "line", " ", "options", "\\", "10", ";", "--------------", "------", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "optparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Experiment_", "as_", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Nu", "bis", "can_", "as_", "Nu", "bis", "can_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Fast", "a", "Iterator_", "as_", "Fast", "a", "Iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Stats_", "as_", "Stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Geno", "mic", "s_", "as_", "Geno", "mic", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Mask", "er_", "as_", "Mask", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "MEM", "E_", "\\u\\u\\uNL\\u\\u\\u_", "RX", "RV", "DR", "_", "=_", "numpy_", "._", "matrix_", "(_", "(_", "(_", "0.02_", ",_", "0.16", "_", ",_", "0.82", "_", ",_", "0.66", "_", ",_", "0.00_", ",_", "0.00_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.10", "_", ",_", "0.00_", ",_", "0.12_", ",_", "0.34", "_", ",_", "1.00_", ",_", "0.32", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.02_", ",_", "0.84", "_", ",_", "0.04_", ",_", "0.00_", ",_", "0.00_", ",_", "0.00_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.86", "_", ",_", "0.00_", ",_", "0.02_", ",_", "0.00_", ",_", "0.00_", ",_", "0.68", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "Bio", "prospe", "ctor", " ", "-", " ", "first", " ", "half", " ", "site_", "\\u\\u\\uNL\\u\\u\\u_", "RX", "RV", "DR", "1_", "=_", "numpy_", "._", "matrix_", "(_", "(_", "(_", "0.09", "_", ",_", "0.22", "_", ",_", "0.76", "_", ",_", "0.70", "_", ",_", "0.00_", ",_", "0.00_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.15_", ",_", "0.00_", ",_", "0.17", "_", ",_", "0.30", "_", ",_", "1.00_", ",_", "0.36", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.00_", ",_", "0.77", "_", ",_", "0.00_", ",_", "0.00_", ",_", "0.00_", ",_", "0.00_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.76", "_", ",_", "0.00_", ",_", "0.07_", ",_", "0.00_", ",_", "0.00_", ",_", "0.64", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "Bio", "prospe", "ctor", " ", "-", " ", "second", " ", "half", " ", "site_", "\\u\\u\\uNL\\u\\u\\u_", "RX", "RV", "DR", "2_", "=_", "numpy_", "._", "matrix_", "(_", "(_", "(_", "0.02_", ",_", "0.02_", ",_", "0.88", "_", ",_", "0.27", "_", ",_", "0.05_", ",_", "0.03_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.05_", ",_", "0.15_", ",_", "0.07_", ",_", "0.73", "_", ",_", "0.92", "_", ",_", "0.42", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.00_", ",_", "0.83", "_", ",_", "0.04_", ",_", "0.00_", ",_", "0.00_", ",_", "0.00_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.93", "_", ",_", "0.00_", ",_", "0.01_", ",_", "0.00_", ",_", "0.04_", ",_", "0.55", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "Bio", "prospe", "ctor", " ", "-", " ", "combin", "ed", " ", "half", "-", "sites_", "\\u\\u\\uNL\\u\\u\\u_", "RX", "VD", "R_", "=_", "(_", "RX", "RV", "DR", "1_", "+_", "RX", "RV", "DR", "2_", ")_", "/_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NR", "_", "=_", "numpy_", "._", "matrix_", "(_", "(_", "(_", "0.72", "_", ",_", "0_", ",_", "0.09", "_", ",_", "0.27", "_", ",_", "0_", ",_", "0.90", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0.90", "_", ",_", "0.09", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.27", "_", ",_", "0.90", "_", ",_", "0.54", "_", ",_", "0.09", "_", ",_", "0.09", "_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "0.09", "_", ",_", "0.36", "_", ",_", "0.63", "_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", "main_", "(_", "sys_", "._", "argv_", ")_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", "argv_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "script", " ", "main", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "parse", "s", " ", "command", " ", "line", " ", "options", " ", "in", " ", "sys", ".", "argv", ",", " ", "unl", "ess", " ", "*", "argv", "*", " ", "is", " ", "give", "n", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "argv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argv_", "=_", "sys_", "._", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "setup", " ", "command", " ", "line", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "=_", "E_", "._", "Optio", "n", "Parser_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "\"%", "prog", " ", "version", ":", " ", "$", "Id", ":", " ", "run", "\\u", "nu", "bis", "can", ".", "py", " ", "286", "1", " ", "2010", "-0", "2", "-", "23", " ", "1", "7", ":", "3", "6", ":", "32", "Z", " ", "andr", "eas", " ", "$\"_", ",_", "usage_", "=_", "globals_", "(_", ")_", "[_", "\"\\u\\u", "doc", "\\u\\u\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "i", "\"_", ",_", "\"--", "iterati", "ons", "\"_", ",_", "dest_", "=_", "\"", "iterati", "ons", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "number", " ", "of", " ", "iterati", "ons", " ", "for", " ", "samp", "ling", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "q", "\"_", ",_", "\"--", "qva", "lue", "\"_", ",_", "dest_", "=_", "\"", "qva", "lue", "\\u", "threshol", "d", "\"_", ",_", "type_", "=_", "\"", "float", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "qva", "lue", " ", "threshol", "d", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "with", "out", "-", "combin", "e", "\"_", ",_", "dest_", "=_", "\"", "combin", "e", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "fal", "se", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "combin", "e", " ", "overlapping", " ", "motifs", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "f", "\"_", ",_", "\"--", "fd", "r", "-", "control", "\"_", ",_", "dest_", "=_", "\"", "fd", "r", "\\u", "control", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "(_", "\"", "per", "-", "sequence", "\"_", ",_", "\"", "all", "\"_", ",_", "\"", "xa", "ll", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "qva", "lue", " ", "threshol", "d", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "m", "\"_", ",_", "\"--", "motif", "\"_", ",_", "dest_", "=_", "\"", "motif", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "(_", "\"", "rx", "rv", "dr", "\"_", ",_", "\"", "rx", "rv", "dr", "1", "\"_", ",_", "\"", "rx", "rv", "dr", "2", "\"_", ",_", "\"", "nr", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "qva", "lue", " ", "threshol", "d", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "a", "\"_", ",_", "\"--", "arrange", "ment", "s", "\"_", ",_", "dest_", "=_", "\"", "arrange", "ment", "s", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"',", "'", " ", "separate", "d", " ", "list", " ", "of", " ", "repeat", " ", "arrange", "ment", "s", " ", "[", "default", "=", "%", "default", "]\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "x", "\"_", ",_", "\"--", "mask", "\"_", ",_", "dest_", "=_", "\"", "mask", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "(_", "\"", "dust", "\"_", ",_", "\"", "repeat", "mask", "er", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "mask", " ", "sequence", "s", " ", "bef", "ore", " ", "scanning", " ", "[", "default", "=", "%", "default", "]\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "output", "-", "stats", "\"_", ",_", "dest_", "=_", "\"", "output", "\\u", "stats", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "output", " ", "stats", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "add", "-", "sequence", "\"_", ",_", "dest_", "=_", "\"", "add", "\\u", "sequence", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "add", " ", "sequence", " ", "informati", "on", " ", "[", "default", "=", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "set\\u", "defaults_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "iterations_", "=_", "100_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "qva", "lue", "\\u", "threshold_", "=_", "0.05_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "motif_", "=_", "\"", "rx", "rv", "dr", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fd", "r", "\\u", "control_", "=_", "\"", "all", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "combine_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "arrange", "ments_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mask_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "stats_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "sequence_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "common", " ", "options", " ", "(-", "h", "/--", "help", ",", " ", "...)", " ", "and", " ", "parse", " ", "command", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "E_", "._", "Start_", "(_", "parser_", ",_", "argv_", "=_", "argv_", ",_", "add", "\\u", "output", "\\u", "options_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "do", " ", "sth", "_", "\\u\\u\\uNL\\u\\u\\u_", "nin", "put_", ",_", "ns", "kip", "ped_", ",_", "noutput", "_", "=_", "0_", ",_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "arrange", "ments_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "arrange", "ments_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "DR", "%", "s", "\"_", "%_", "x_", "for_", "x_", "in_", "range_", "(_", "0_", ",_", "15_", ")_", "]_", "+_", "[_", "\"", "ER", "%", "s", "\"_", "%_", "x_", "for_", "x_", "in_", "range_", "(_", "0_", ",_", "15_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "arrange", "ments_", "=_", "options_", "._", "arrange", "ments_", "._", "split_", "(_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"%", "s", "\"_", "%_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "Nu", "bis", "can_", "._", "Nu", "bis", "can", "Match_", "._", "\\u", "fields_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "add", "\\u", "sequence_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "tse", "quenc", "e", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "motif_", "==_", "'", "nr", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sense", "\\u", "matrix_", "=_", "NR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "motif_", "==_", "\"", "rx", "rv", "dr", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sense", "\\u", "matrix_", "=_", "RX", "RV", "DR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "motif_", "==_", "\"", "rx", "rv", "dr", "1", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sense", "\\u", "matrix_", "=_", "RX", "RV", "DR", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "motif_", "==_", "\"", "rx", "rv", "dr", "2", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sense", "\\u", "matrix_", "=_", "RX", "RV", "DR", "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 ", " _", "raise_", "Value", "Error_", "(_", "\"", "unknown", " ", "matrix", " ", "%", "s", "\"_", "%_", "options_", "._", "motif_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "fd", "r", "\\u", "control_", "==_", "\"", "all", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "seqs_", "=_", "list_", "(_", "Fast", "a", "Iterator_", "._", "iterate_", "(_", "options_", "._", "stdin_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "mask_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mask", "ed", "\\u", "seqs_", "=_", "mask", "Sequences", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "._", "sequence_", "for_", "x_", "in_", "seqs_", "]_", ",_", "options_", "._", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mask", "ed", "\\u", "seqs_", "=_", "[_", "x_", "._", "sequence_", "for_", "x_", "in_", "seqs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nin", "put_", "=_", "len_", "(_", "seqs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "map", "\\u", "id2", "title_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "enumerate_", "(_", "[_", "re_", "._", "sub_", "(_", "\"\\\\", "s", ".*\"_", ",_", "\"\"_", ",_", "x_", "._", "title_", ")_", "for_", "x_", "in_", "seqs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matcher_", "=_", "Nu", "bis", "can_", "._", "Match", "er", "Random", "isat", "ion", "Sequences", "_", "(_", "sense", "\\u", "matrix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "samples_", "=_", "options_", "._", "iterations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "matcher_", "._", "run_", "(_", "mask", "ed", "\\u", "seqs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "arrange", "ments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "qva", "lue", "\\u", "threshold_", "=_", "options_", "._", "qva", "lue", "\\u", "threshold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "Nu", "bis", "can_", "._", "combin", "e", "Moti", "fs_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "r_", "._", "alternatives", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alternatives", "_", "=_", "\",\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "._", "arrange", "ment_", "for_", "x_", "in_", "r_", "._", "alternatives", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alternatives", "_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "map", "\\u", "id2", "title_", "[_", "r_", "._", "id_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "i", "\"_", "%_", "r_", "._", "start_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "i", "\"_", "%_", "r_", "._", "end_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "strand_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "arrange", "ment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "f", "\"_", "%_", "r_", "._", "score_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "f", "\"_", "%_", "r_", "._", "zsc", "ore_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "e", "\"_", "%_", "r_", "._", "pvalue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "e", "\"_", "%_", "r_", "._", "qva", "lue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alternatives", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "add", "\\u", "sequence_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "mask", "ed", "\\u", "seqs_", "[_", "int_", "(_", "r_", "._", "id_", ")_", "]_", "[_", "r_", "._", "start_", ":_", "r_", "._", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", "._", "strand_", "==_", "\"-\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "=_", "Geno", "mic", "s_", "._", "complement_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "s_", "[_", ":_", "6_", "]_", "._", "upper_", "(_", ")_", "+_", "s_", "[_", "6_", ":_", "-_", "6_", "]_", "._", "lower_", "(_", ")_", "+_", "s_", "[_", "-_", "6_", ":_", "]_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "t", "%", "s", "\"_", "%_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "noutput", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", " ", "stats_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "output", "\\u", "stats_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outfile_", "=_", "E_", "._", "open", "Output", "File_", "(_", "\"", "fd", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "._", "write_", "(_", "\"", "bin", "\\\\", "this", "t", "\\\\", "tno", "bse", "rve", "d", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bin_", ",_", "hist_", ",_", "nob", "s_", "in_", "zip_", "(_", "matcher_", "._", "bin", "\\u", "edges_", ",_", "matcher_", "._", "hist_", ",_", "matcher_", "._", "nob", "serv", "ations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outfile_", "._", "write_", "(_", "\"%", "f", "\\\\", "t", "%", "f", "\\\\", "t", "%", "f", "\\\\", "n", "\"_", "%_", "(_", "bin_", ",_", "hist_", ",_", "nob", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outfile_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "fd", "r", "\\u", "control_", "==_", "\"", "xa", "ll", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matcher_", "=_", "Nu", "bis", "can_", "._", "Match", "er", "Random", "isat", "ion", "Sequence_", "(_", "sense", "\\u", "matrix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "samples_", "=_", "options_", "._", "iterations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "collect", " ", "all", " ", "results_", "\\u\\u\\uNL\\u\\u\\u_", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "seq_", "in_", "Fast", "a", "Iterator_", "._", "iterate_", "(_", "options_", "._", "stdin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nin", "put_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mm_", "=_", "matcher_", "._", "run_", "(_", "seq_", "._", "sequence_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "arrange", "ments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "qva", "lue", "\\u", "threshold_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "mm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matches_", "._", "append_", "(_", "m_", "._", "\\u", "replace_", "(_", "sequence_", "=_", "seq_", "._", "title_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "estimate", " ", "qva", "lue", "s", " ", "for", " ", "all", " ", "matche", "s", " ", "acro", "ss", " ", "all", " ", "sequences_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pvalue", "s_", "=_", "[_", "x_", "._", "pvalue_", "for_", "x_", "in_", "matches_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd", "r_", "=_", "Stats_", "._", "do", "FD", "R_", "(_", "pvalue", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qva", "lue", "s_", "=_", "fd", "r_", "._", "m", "QV", "alues", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", ",_", "qva", "lue_", "in_", "zip_", "(_", "matches_", ",_", "qva", "lue", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "qva", "lue_", ">_", "options_", "._", "qva", "lue", "\\u", "threshold_", ":_", "\\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_", "results_", "._", "append_", "(_", "m_", "._", "\\u", "replace_", "(_", "qva", "lue_", "=_", "qva", "lue_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "Nu", "bis", "can_", "._", "combin", "e", "Moti", "fs_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "r_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "i", "\"_", "%_", "r_", "._", "start_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "i", "\"_", "%_", "r_", "._", "end_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "strand_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "arrange", "ment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "f", "\"_", "%_", "r_", "._", "score_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "f", "\"_", "%_", "r_", "._", "zsc", "ore_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "e", "\"_", "%_", "r_", "._", "pvalue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "e", "\"_", "%_", "r_", "._", "qva", "lue_", ")_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "noutput", "_", "+=_", "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_", "elif_", "options_", "._", "fd", "r", "\\u", "control_", "==_", "\"", "per", "-", "sequence", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matcher_", "=_", "Nu", "bis", "can_", "._", "Match", "er", "Random", "isat", "ion", "Sequence_", "(_", "sense", "\\u", "matrix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "samples_", "=_", "options_", "._", "iterations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "seq_", "in_", "Fast", "a", "Iterator_", "._", "iterate_", "(_", "options_", "._", "stdin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nin", "put_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "matcher_", "._", "run_", "(_", "seq_", "._", "sequence_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "arrange", "ments_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "qva", "lue", "\\u", "threshold_", "=_", "options_", "._", "qva", "lue", "\\u", "threshold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "combine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "Nu", "bis", "can_", "._", "combin", "e", "Moti", "fs_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "re_", "._", "sub_", "(_", "\"", " ", ".*\"_", ",_", "\"\"_", ",_", "seq_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "t_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "i", "\"_", "%_", "r_", "._", "start_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "i", "\"_", "%_", "r_", "._", "end_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "strand_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "._", "arrange", "ment_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "f", "\"_", "%_", "r_", "._", "score_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "6.4", "f", "\"_", "%_", "r_", "._", "zsc", "ore_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "f", "\"_", "%_", "r_", "._", "pvalue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "f", "\"_", "%_", "r_", "._", "qva", "lue_", ")_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "noutput", "_", "+=_", "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_", "E_", "._", "info_", "(_", "\"", "nin", "put", "=", "%", "i", ",", " ", "noutput", "=", "%", "i", ",", " ", "ns", "kip", "ped", "=", "%", "i", "\"_", "%_", "(_", "nin", "put_", ",_", "noutput", "_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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 ]
Except block handles 'BaseException'
rtucker-mozilla/mozilla_inventory/dhcp/views.py
[ { "content": "from django.core.exceptions import ValidationError\nfrom django.core.paginator import Paginator, InvalidPage, EmptyPage\n\nfrom django.db.models import Q\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.shortcuts import render_to_response, redirect, get_object_or_404\nfrom django.template import RequestContext\nfrom django.template.loader import render_to_string\ntry:\n import json\nexcept:\n from django.utils import simplejson as json\nimport _mysql_exceptions\n\nimport models\nimport forms\nfrom truth.models import KeyValue as TruthKeyValue, Truth\nfrom systems.models import NetworkAdapter\n#import adapters.dhcp\nfrom middleware.restrict_to_remote import allow_anyone\n\nfrom DHCP import DHCP\nfrom django.test.client import RequestFactory\nfrom django.template.defaulttags import URLNode\nfrom django.conf import settings\nfrom jinja2.filters import contextfilter\nfrom django.utils import translation\nfrom libs.jinja import jinja_render_to_response\nfrom api_v2.keyvalue_handler import KeyValueHandler\n\nfactory = RequestFactory()\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def new(request):\n error_message = ''\n if request.method == 'POST':\n form = forms.AddDHCPScopeForm(request.POST)\n if form.is_valid():\n truth_exists = False\n try:\n tmp = Truth.objects.get(name=form.cleaned_data['scope_name'])\n truth_exists = True\n except:\n pass\n if truth_exists is False: \n t = Truth(name=form.cleaned_data['scope_name'], description=form.cleaned_data['scope_description'])\n t.save()\n k = TruthKeyValue(truth=t,key='is_dhcp_scope',value='True')\n k.save()\n return redirect('/dhcp/edit/%s' % t.name)\n else:\n error_message = 'DHCP Scope Exists'\n else:\n form = forms.AddDHCPScopeForm()\n\n return jinja_render_to_response('dhcp/new.html', {\n \"form\": form ,\n \"error_message\":error_message\n })", "metadata": "root.new", "header": "['module', '___EOS___']", "index": 46 }, { "content": "def override_file(request, dhcp_scope):\n if request.method == 'POST':\n form = forms.DHCPScopeOverrideForm(request.POST)\n if form.is_valid():\n do = models.DHCPOverride.objects.get(dhcp_scope=dhcp_scope)\n do.override_text = form.cleaned_data['override_text']\n do.save()\n #s = form.save()\n #return redirect('/dhcp/show/')\n else:\n try:\n do = models.DHCPOverride.objects.get(dhcp_scope=dhcp_scope)\n except:\n do = models.DHCPOverride(dhcp_scope=dhcp_scope)\n do.save()\n\n form = forms.DHCPScopeOverrideForm(initial={'dhcp_scope':dhcp_scope, 'override_text':do.override_text})\n\n return jinja_render_to_response('dhcp/override.html', {\n \"form\": form,\n 'dhcp_scope':dhcp_scope\n },\n RequestContext(request))", "metadata": "root.override_file", "header": "['module', '___EOS___']", "index": 72 }, { "content": "def edit(request, dhcp_scope):\n h = KeyValueHandler()\n trequest = factory.get('/api/keyvalue/?keystore=%s' % dhcp_scope, follow=True)\n instance = h.read(trequest)\n initial = {}\n initial['scope_name'] = dhcp_scope\n ##A bunch of try/catch blocks to create key/value pairs if one does not exist\n try:\n initial['scope_start'] = instance['dhcp.scope.start']\n except:\n trequest = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.scope.start', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['scope_start'] = ''\n try:\n initial['scope_end'] = instance['dhcp.scope.end']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.scope.end', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['scope_end'] = ''\n try:\n initial['scope_netmask'] = instance['dhcp.scope.netmask']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.scope.netmask', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['scope_netmask'] = ''\n try:\n initial['pool_start'] = instance['dhcp.pool.start']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.pool.start', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['pool_start'] = ''\n try:\n initial['pool_end'] = instance['dhcp.pool.end']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.pool.end', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['pool_end'] = ''\n try:\n initial['ntp_server1'] = instance['dhcp.option.ntp_server.0']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.option.ntp_server.0', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['ntp_server1'] = ''\n try:\n initial['ntp_server2'] = instance['dhcp.option.ntp_server.1']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.option.ntp_server.1', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['ntp_server2'] = ''\n try:\n initial['router'] = instance['dhcp.option.router.0']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.option.router.0', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['router'] = ''\n try:\n initial['domain_name'] = instance['dhcp.option.domain_name.0']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.option.domain_name.0', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['domain_name'] = ''\n try:\n initial['dns_server1'] = instance['dhcp.dns_server.0']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.dns_server.0', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['dns_server1'] = ''\n try:\n initial['dns_server2'] = instance['dhcp.dns_server.1']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.dns_server.1', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['dns_server2'] = ''\n try:\n initial['allow_booting'] = instance['dhcp.pool.allow_booting.0']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.pool.allow_booting.0', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['allow_booting'] = ''\n try:\n initial['allow_bootp'] = instance['dhcp.pool.allow_bootp.0']\n except:\n treqeust = factory.post('/en-US/api/keyvalue/%s/' % dhcp_scope, {'key':'dhcp.pool.allow_bootp.0', 'value':'', 'truth_name':dhcp_scope}, follow=True)\n h.create(trequest)\n initial['allow_bootp'] = ''\n\n if request.method == 'POST':\n form = forms.EditDHCPScopeForm(request.POST)\n if form.is_valid():\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.scope.start', 'value':form.cleaned_data['scope_start']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.scope.end', 'value':form.cleaned_data['scope_end']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.scope.netmask', 'value':form.cleaned_data['scope_netmask']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.pool.start', 'value':form.cleaned_data['pool_start']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.pool.end', 'value':form.cleaned_data['pool_end']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.option.ntp_server.0', 'value':form.cleaned_data['ntp_server1']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.option.ntp_server.1', 'value':form.cleaned_data['ntp_server2']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.dns_server.0', 'value':form.cleaned_data['dns_server1']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.dns_server.1', 'value':form.cleaned_data['dns_server2']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.option.domain_name.0', 'value':form.cleaned_data['domain_name']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.option.router.0', 'value':form.cleaned_data['router']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.pool.allow_booting.0', 'value':form.cleaned_data['allow_booting']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n trequest = factory.post('/en-US/api/v2/keyvalue/%s/' % dhcp_scope, {'truth_id': dhcp_scope, 'key':'dhcp.pool.allow_bootp.0', 'value':form.cleaned_data['allow_bootp']}, follow=True)\n h.update(trequest, dhcp_scope)\n\n else:\n form = forms.EditDHCPScopeForm(initial=initial)\n\n return jinja_render_to_response('dhcp/edit.html', {\n \"form\": form,\n 'dhcp_scope': dhcp_scope\n })", "metadata": "root.edit", "header": "['module', '___EOS___']", "index": 128 }, { "content": "def delete(request, dhcp_scope):\n try:\n scope = Truth.objects.get(name=dhcp_scope)\n TruthKeyValue.objects.filter(truth=scope).delete()\n scope.delete()\n return redirect('/dhcp/show/')\n except: \n return redirect('/dhcp/show/')", "metadata": "root.delete", "header": "['module', '___EOS___']", "index": 263 } ]
[ { "span": "except:", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 7 }, { "span": "except:", "start_line": 55, "start_column": 12, "end_line": 55, "end_column": 19 }, { "span": "except:", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 15 }, { "span": "except:", "start_line": 137, "start_column": 4, "end_line": 137, "end_column": 11 }, { "span": "except:", "start_line": 143, "start_column": 4, "end_line": 143, "end_column": 11 }, { "span": "except:", "start_line": 149, "start_column": 4, "end_line": 149, "end_column": 11 }, { "span": "except:", "start_line": 155, "start_column": 4, "end_line": 155, "end_column": 11 }, { "span": "except:", "start_line": 161, "start_column": 4, "end_line": 161, "end_column": 11 }, { "span": "except:", "start_line": 167, "start_column": 4, "end_line": 167, "end_column": 11 }, { "span": "except:", "start_line": 173, "start_column": 4, "end_line": 173, "end_column": 11 }, { "span": "except:", "start_line": 179, "start_column": 4, "end_line": 179, "end_column": 11 }, { "span": "except:", "start_line": 185, "start_column": 4, "end_line": 185, "end_column": 11 }, { "span": "except:", "start_line": 191, "start_column": 4, "end_line": 191, "end_column": 11 }, { "span": "except:", "start_line": 197, "start_column": 4, "end_line": 197, "end_column": 11 }, { "span": "except:", "start_line": 203, "start_column": 4, "end_line": 203, "end_column": 11 }, { "span": "except:", "start_line": 209, "start_column": 4, "end_line": 209, "end_column": 11 }, { "span": "except: ", "start_line": 269, "start_column": 4, "end_line": 269, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "exceptions_", "import_", "Validat", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "paginator_", "import_", "Paginator_", ",_", "Inva", "lid", "Page_", ",_", "Emp", "ty", "Page_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "import_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", ",_", "Http", "Respons", "e", "Redirect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", ",_", "redirect_", ",_", "get", "\\u", "object\\u", "or", "\\u", "404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "loader_", "import_", "render", "\\u", "to", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "utils_", "import_", "simplejson_", "as_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "\\u", "mysql", "\\u", "exceptions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "forms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "truth_", "._", "models_", "import_", "Key", "Value_", "as_", "Tru", "th", "Key", "Value_", ",_", "Tru", "th_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "systems_", "._", "models_", "import_", "Network", "Adapter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "import", " ", "adapter", "s", ".", "dhcp_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "middleware_", "._", "restrict", "\\u", "to", "\\u", "remote_", "import_", "allow", "\\u", "any", "one_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "DHC", "P_", "import_", "DHC", "P_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "client_", "import_", "Request", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "default", "tags_", "import_", "URL", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jinja2_", "._", "filters_", "import_", "context", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "translation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "libs_", "._", "jin", "ja_", "import_", "jin", "ja", "\\u", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api", "\\u", "v2_", "._", "keyval", "ue", "\\u", "handler_", "import_", "Key", "Value", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "Request", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "new_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "message_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "forms_", "._", "Add", "DHC", "PS", "cope", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "truth", "\\u", "exists_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "Tru", "th_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "scope", "\\u", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "truth", "\\u", "exists_", "=_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "truth", "\\u", "exists_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "Tru", "th_", "(_", "name_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "scope", "\\u", "name", "'_", "]_", ",_", "description_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "scope", "\\u", "description", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "Tru", "th", "Key", "Value_", "(_", "truth_", "=_", "t_", ",_", "key_", "=_", "'", "is", "\\u", "dhcp", "\\u", "scope", "'_", ",_", "value_", "=_", "'", "Tru", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "'/", "dhcp", "/", "edit", "/", "%", "s", "'_", "%_", "t_", "._", "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 ", " _", "error", "\\u", "message_", "=_", "'", "DHC", "P", " ", "Sco", "pe", " ", "Exist", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "forms_", "._", "Add", "DHC", "PS", "cope", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "jin", "ja", "\\u", "render", "\\u", "to", "\\u", "response_", "(_", "'", "dhcp", "/", "new", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "form", "\"_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "error", "\\u", "message", "\"_", ":_", "error", "\\u", "message_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "override", "\\u", "file_", "(_", "request_", ",_", "dhcp", "\\u", "scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "forms_", "._", "DHC", "PS", "cope", "Override", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "do_", "=_", "models_", "._", "DHC", "PO", "ver", "ride", "_", "._", "objects_", "._", "get_", "(_", "dhcp", "\\u", "scope_", "=_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "do_", "._", "override", "\\u", "text_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "override", "\\u", "text", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "do_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "s", " ", "=", " ", "form", ".", "save", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "redirec", "t", "('", "/", "dhcp", "/", "show", "/'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "do_", "=_", "models_", "._", "DHC", "PO", "ver", "ride", "_", "._", "objects_", "._", "get_", "(_", "dhcp", "\\u", "scope_", "=_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "do_", "=_", "models_", "._", "DHC", "PO", "ver", "ride", "_", "(_", "dhcp", "\\u", "scope_", "=_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "do_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "forms_", "._", "DHC", "PS", "cope", "Override", "Form_", "(_", "initial_", "=_", "{_", "'", "dhcp", "\\u", "scope", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "override", "\\u", "text", "'_", ":_", "do_", "._", "override", "\\u", "text_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "jin", "ja", "\\u", "render", "\\u", "to", "\\u", "response_", "(_", "'", "dhcp", "/", "override", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "form", "\"_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "scope", "'_", ":_", "dhcp", "\\u", "scope_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "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_", "def_", "edit_", "(_", "request_", ",_", "dhcp", "\\u", "scope_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "Key", "Value", "Handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "get_", "(_", "'/", "api", "/", "keyval", "ue", "/?", "keystore", "=", "%", "s", "'_", "%_", "dhcp", "\\u", "scope_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "=_", "h_", "._", "read_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "scope", "\\u", "name", "'_", "]_", "=_", "dhcp", "\\u", "scope_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", "A", " ", "bunch", " ", "of", " ", "try", "/", "catch", " ", "blocks", " ", "to", " ", "create", " ", "key", "/", "value", " ", "pair", "s", " ", "if", " ", "one", " ", "doe", "s", " ", "not", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "[_", "'", "scope", "\\u", "start", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "scope", ".", "start", "'_", "]_", "\\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 ", " _", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "scope", ".", "start", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "scope", "\\u", "start", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "scope", "\\u", "end", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "scope", ".", "end", "'_", "]_", "\\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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "scope", ".", "end", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "scope", "\\u", "end", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "scope", "\\u", "net", "mask", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "scope", ".", "net", "mask", "'_", "]_", "\\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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "scope", ".", "net", "mask", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "scope", "\\u", "net", "mask", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "pool", "\\u", "start", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "pool", ".", "start", "'_", "]_", "\\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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "start", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "pool", "\\u", "start", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "pool", "\\u", "end", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "pool", ".", "end", "'_", "]_", "\\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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "end", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "pool", "\\u", "end", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "ntp", "\\u", "server", "1", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "option", ".", "ntp", "\\u", "server", ".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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "ntp", "\\u", "server", ".0", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "ntp", "\\u", "server", "1", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "[_", "'", "ntp", "\\u", "server", "2", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "option", ".", "ntp", "\\u", "server", ".1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "ntp", "\\u", "server", ".1", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "ntp", "\\u", "server", "2", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "router", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "option", ".", "router", ".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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "router", ".0", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "router", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "domain", "\\u", "name", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "option", ".", "domain", "\\u", "name", ".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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "domain", "\\u", "name", ".0", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "domain", "\\u", "name", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "dns", "\\u", "server", "1", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "dns", "\\u", "server", ".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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "dns", "\\u", "server", ".0", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "dns", "\\u", "server", "1", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "[_", "'", "dns", "\\u", "server", "2", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "dns", "\\u", "server", ".1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "dns", "\\u", "server", ".1", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "dns", "\\u", "server", "2", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "allow", "\\u", "boot", "ing", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "pool", ".", "allow", "\\u", "boot", "ing", ".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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "allow", "\\u", "boot", "ing", ".0", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "allow", "\\u", "boot", "ing", "'_", "]_", "=_", "''_", "\\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 ", " _", "initial_", "[_", "'", "allow", "\\u", "boot", "p", "'_", "]_", "=_", "instance_", "[_", "'", "dhcp", ".", "pool", ".", "allow", "\\u", "boot", "p", ".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 ", " _", "tre", "qe", "ust", "_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "allow", "\\u", "boot", "p", ".0", "'_", ",_", "'", "value", "'_", ":_", "''_", ",_", "'", "truth", "\\u", "name", "'_", ":_", "dhcp", "\\u", "scope_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "create_", "(_", "tre", "quest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "initial_", "[_", "'", "allow", "\\u", "boot", "p", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "'", "POST", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "forms_", "._", "Edit", "DHC", "PS", "cope", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "scope", ".", "start", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "scope", "\\u", "start", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "scope", ".", "end", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "scope", "\\u", "end", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "scope", ".", "net", "mask", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "scope", "\\u", "net", "mask", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "start", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "pool", "\\u", "start", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "end", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "pool", "\\u", "end", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "ntp", "\\u", "server", ".0", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "ntp", "\\u", "server", "1", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "ntp", "\\u", "server", ".1", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "ntp", "\\u", "server", "2", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "dns", "\\u", "server", ".0", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "dns", "\\u", "server", "1", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "dns", "\\u", "server", ".1", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "dns", "\\u", "server", "2", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "domain", "\\u", "name", ".0", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "domain", "\\u", "name", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "option", ".", "router", ".0", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "router", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "allow", "\\u", "boot", "ing", ".0", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "allow", "\\u", "boot", "ing", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tre", "quest_", "=_", "factory_", "._", "post_", "(_", "'/", "en", "-", "US", "/", "api", "/", "v2", "/", "keyval", "ue", "/", "%", "s", "/'_", "%_", "dhcp", "\\u", "scope_", ",_", "{_", "'", "truth", "\\u", "id", "'_", ":_", "dhcp", "\\u", "scope_", ",_", "'", "key", "'_", ":_", "'", "dhcp", ".", "pool", ".", "allow", "\\u", "boot", "p", ".0", "'_", ",_", "'", "value", "'_", ":_", "form_", "._", "clean", "ed", "\\u", "data_", "[_", "'", "allow", "\\u", "boot", "p", "'_", "]_", "}_", ",_", "follow_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "update_", "(_", "tre", "quest_", ",_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "=_", "forms_", "._", "Edit", "DHC", "PS", "cope", "Form_", "(_", "initial_", "=_", "initial_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "jin", "ja", "\\u", "render", "\\u", "to", "\\u", "response_", "(_", "'", "dhcp", "/", "edit", ".", "html", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "form", "\"_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dhcp", "\\u", "scope", "'_", ":_", "dhcp", "\\u", "scope_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "request_", ",_", "dhcp", "\\u", "scope_", ")_", ":_", "\\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 ", " _", "scope_", "=_", "Tru", "th_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "dhcp", "\\u", "scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Tru", "th", "Key", "Value_", "._", "objects_", "._", "filter_", "(_", "truth_", "=_", "scope_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scope_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "'/", "dhcp", "/", "show", "/'_", ")_", "\\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_", "redirect_", "(_", "'/", "dhcp", "/", "show", "/'_", ")_" ]
[ 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, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unnecessary pass
dorneanu/appvulnms/src/core/framework.py
[ { "content": " @abstractmethod\n def __init__(self, params):\n self.info = 'Module'\n self.parameters = {}\n pass", "metadata": "root.BaseModule.__init__", "header": "['class', 'BaseModule', '(', ')', ':', '___EOS___']", "index": 174 } ]
[ { "span": "pass", "start_line": 178, "start_column": 8, "end_line": 178, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Base", "Module_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "abstractmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "info_", "=_", "'", "Modul", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parameters_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2 ]
Unused import
zzzeek/sqlalchemy/test/orm/test_load_on_fks.py
[ { "content": "from sqlalchemy import *\nfrom sqlalchemy.orm import *\n\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.testing import eq_, AssertsExecutionResults, assert_raises\nfrom sqlalchemy import testing\nfrom sqlalchemy.testing import fixtures\nfrom sqlalchemy.orm.attributes import instance_state\nfrom sqlalchemy.orm.exc import FlushError\nfrom sqlalchemy.testing.schema import Table, Column\n\nengine = testing.db\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class FlushOnPendingTest(AssertsExecutionResults, fixtures.TestBase):\n\n\n\n", "metadata": "root.FlushOnPendingTest", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def setUp(self):\n global Parent, Child, Base\n Base= declarative_base()\n\n class Parent(Base):\n __tablename__ = 'parent'\n\n id= Column(Integer, primary_key=True, test_needs_autoincrement=True)\n name = Column(String(50), nullable=False)\n children = relationship(\"Child\", load_on_pending=True)\n\n class Child(Base):\n __tablename__ = 'child'\n id= Column(Integer, primary_key=True, test_needs_autoincrement=True)\n parent_id = Column(Integer, ForeignKey('parent.id'))\n\n Base.metadata.create_all(engine)", "metadata": "root.FlushOnPendingTest.setUp", "header": "['class', 'FlushOnPendingTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 15 }, { "content": " def tearDown(self):\n Base.metadata.drop_all(engine)", "metadata": "root.FlushOnPendingTest.tearDown", "header": "['class', 'FlushOnPendingTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 33 }, { "content": " def test_annoying_autoflush_one(self):\n sess = Session(engine)\n\n p1 = Parent()\n sess.add(p1)\n p1.children = []", "metadata": "root.FlushOnPendingTest.test_annoying_autoflush_one", "header": "['class', 'FlushOnPendingTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 36 }, { "content": " def test_annoying_autoflush_two(self):\n sess = Session(engine)\n\n p1 = Parent()\n sess.add(p1)\n assert p1.children == []", "metadata": "root.FlushOnPendingTest.test_annoying_autoflush_two", "header": "['class', 'FlushOnPendingTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 43 }, { "content": " def test_dont_load_if_no_keys(self):\n sess = Session(engine)\n\n p1 = Parent()\n sess.add(p1)\n\n def go():\n assert p1.children == []\n self.assert_sql_count(testing.db, go, 0)", "metadata": "root.FlushOnPendingTest.test_dont_load_if_no_keys", "header": "['class', 'FlushOnPendingTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 50 }, { "content": "class LoadOnFKsTest(AssertsExecutionResults, fixtures.TestBase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.LoadOnFKsTest", "header": "['module', '___EOS___']", "index": 60 }, { "content": " def setUp(self):\n global Parent, Child, Base\n Base= declarative_base()\n\n class Parent(Base):\n __tablename__ = 'parent'\n __table_args__ = {'mysql_engine':'InnoDB'}\n\n id= Column(Integer, primary_key=True, test_needs_autoincrement=True)\n\n class Child(Base):\n __tablename__ = 'child'\n __table_args__ = {'mysql_engine':'InnoDB'}\n\n id= Column(Integer, primary_key=True, test_needs_autoincrement=True)\n parent_id = Column(Integer, ForeignKey('parent.id'))\n\n parent = relationship(Parent, backref=backref(\"children\"))\n\n Base.metadata.create_all(engine)\n\n global sess, p1, p2, c1, c2\n sess = Session(bind=engine)\n\n p1 = Parent()\n p2 = Parent()\n c1, c2 = Child(), Child()\n c1.parent = p1\n sess.add_all([p1, p2])\n assert c1 in sess\n\n sess.commit()", "metadata": "root.LoadOnFKsTest.setUp", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 62 }, { "content": " def tearDown(self):\n sess.rollback()\n Base.metadata.drop_all(engine)", "metadata": "root.LoadOnFKsTest.tearDown", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 95 }, { "content": " def test_load_on_pending_disallows_backref_event(self):\n Child.parent.property.load_on_pending = True\n sess.autoflush = False\n c3 = Child()\n sess.add(c3)\n c3.parent_id = p1.id\n c3.parent = p1\n\n # a side effect of load-on-pending with no autoflush.\n # a change to the backref event handler to check\n # collection membership before assuming \"old == new so return\"\n # would fix this - but this is wasteful and autoflush\n # should be turned on.\n assert c3 not in p1.children", "metadata": "root.LoadOnFKsTest.test_load_on_pending_disallows_backref_event", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 99 }, { "content": " def test_enable_rel_loading_disallows_backref_event(self):\n sess.autoflush = False\n c3 = Child()\n sess.enable_relationship_loading(c3)\n c3.parent_id = p1.id\n c3.parent = p1\n\n # c3.parent is already acting like a \"load\" here,\n # so backref events don't work\n assert c3 not in p1.children", "metadata": "root.LoadOnFKsTest.test_enable_rel_loading_disallows_backref_event", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 114 }, { "content": " def test_load_on_persistent_allows_backref_event(self):\n Child.parent.property.load_on_pending = True\n c3 = Child()\n sess.add(c3)\n c3.parent_id = p1.id\n c3.parent = p1\n\n assert c3 in p1.children", "metadata": "root.LoadOnFKsTest.test_load_on_persistent_allows_backref_event", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 125 }, { "content": " def test_enable_rel_loading_on_persistent_disallows_backref_event(self):\n c3 = Child()\n sess.enable_relationship_loading(c3)\n c3.parent_id = p1.id\n c3.parent = p1\n\n # c3.parent is already acting like a \"load\" here,\n # so backref events don't work\n assert c3 not in p1.children", "metadata": "root.LoadOnFKsTest.test_enable_rel_loading_on_persistent_disallows_backref_event", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 134 }, { "content": " def test_no_load_on_pending_allows_backref_event(self):\n # users who stick with the program and don't use\n # 'load_on_pending' get expected behavior\n\n sess.autoflush = False\n c3 = Child()\n sess.add(c3)\n c3.parent_id = p1.id\n\n c3.parent = p1\n\n assert c3 in p1.children", "metadata": "root.LoadOnFKsTest.test_no_load_on_pending_allows_backref_event", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 144 }, { "content": " def test_autoflush_on_pending(self):\n c3 = Child()\n sess.add(c3)\n c3.parent_id = p1.id\n\n # pendings don't autoflush\n assert c3.parent is None", "metadata": "root.LoadOnFKsTest.test_autoflush_on_pending", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 157 }, { "content": " def test_autoflush_on_pending(self):\n Child.parent.property.load_on_pending = True\n c3 = Child()\n sess.add(c3)\n c3.parent_id = p1.id\n\n # ...unless the flag is on\n assert c3.parent is p1", "metadata": "root.LoadOnFKsTest.test_autoflush_on_pending", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 165 }, { "content": " def test_collection_load_from_pending_populated(self):\n Parent.children.property.load_on_pending = True\n p2 = Parent(id=p1.id)\n sess.add(p2)\n # load should emit since PK is populated\n def go():\n assert p2.children\n self.assert_sql_count(testing.db, go, 1)", "metadata": "root.LoadOnFKsTest.test_collection_load_from_pending_populated", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 174 }, { "content": " def test_collection_load_from_pending_no_sql(self):\n Parent.children.property.load_on_pending = True\n p2 = Parent(id=None)\n sess.add(p2)\n # load should not emit since \"None\" is the bound\n # param list\n def go():\n assert not p2.children\n self.assert_sql_count(testing.db, go, 0)", "metadata": "root.LoadOnFKsTest.test_collection_load_from_pending_no_sql", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_load_on_pending_with_set(self):\n Child.parent.property.load_on_pending = True\n\n p1.children\n\n c3 = Child()\n sess.add(c3)\n\n c3.parent_id = p1.id\n\n def go():\n c3.parent = p1\n self.assert_sql_count(testing.db, go, 0)", "metadata": "root.LoadOnFKsTest.test_load_on_pending_with_set", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 193 }, { "content": " def test_backref_doesnt_double(self):\n Child.parent.property.load_on_pending = True\n sess.autoflush = False\n p1.children\n c3 = Child()\n sess.add(c3)\n c3.parent = p1\n c3.parent = p1\n c3.parent = p1\n c3.parent = p1\n assert len(p1.children)== 2", "metadata": "root.LoadOnFKsTest.test_backref_doesnt_double", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 207 }, { "content": " def test_m2o_lazy_loader_on_persistent(self):\n \"\"\"Compare the behaviors from the lazyloader using\n the \"committed\" state in all cases, vs. the lazyloader\n using the \"current\" state in all cases except during flush.\n\n \"\"\"\n\n for loadfk in (True, False):\n for loadrel in (True, False):\n for autoflush in (True, False):\n for manualflush in (True, False):\n for fake_autoexpire in (True, False):\n sess.autoflush = autoflush\n\n if loadfk:\n c1.parent_id\n if loadrel:\n c1.parent\n\n c1.parent_id = p2.id\n\n if manualflush:\n sess.flush()\n\n # fake_autoexpire refers to the eventual\n # auto-expire of 'parent' when c1.parent_id\n # is altered.\n if fake_autoexpire:\n sess.expire(c1, ['parent'])\n\n # old 0.6 behavior\n #if manualflush and (not loadrel or fake_autoexpire):\n # # a flush occurs, we get p2\n # assert c1.parent is p2\n #elif not loadrel and not loadfk:\n # # problematically - we get None since committed state\n # # is empty when c1.parent_id was mutated, since we want\n # # to save on selects. this is\n # # why the patch goes in in 0.6 - this is mostly a bug.\n # assert c1.parent is None\n #else:\n # # if things were loaded, autoflush doesn't even\n # # happen.\n # assert c1.parent is p1\n\n # new behavior\n if loadrel and not fake_autoexpire:\n assert c1.parent is p1\n else:\n assert c1.parent is p2\n\n sess.rollback()", "metadata": "root.LoadOnFKsTest.test_m2o_lazy_loader_on_persistent", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 219 }, { "content": " def test_m2o_lazy_loader_on_pending(self):\n for loadonpending in (False, True):\n for autoflush in (False, True):\n for manualflush in (False, True):\n Child.parent.property.load_on_pending = loadonpending\n sess.autoflush = autoflush\n c2 = Child()\n sess.add(c2)\n c2.parent_id = p2.id\n\n if manualflush:\n sess.flush()\n\n if loadonpending or manualflush:\n assert c2.parent is p2\n else:\n assert c2.parent is None\n\n sess.rollback()", "metadata": "root.LoadOnFKsTest.test_m2o_lazy_loader_on_pending", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 272 }, { "content": " def test_m2o_lazy_loader_on_transient(self):\n for loadonpending in (False, True):\n for attach in (False, True):\n for autoflush in (False, True):\n for manualflush in (False, True):\n for enable_relationship_rel in (False, True):\n Child.parent.property.load_on_pending = loadonpending\n sess.autoflush = autoflush\n c2 = Child()\n\n if attach:\n state = instance_state(c2)\n state.session_id = sess.hash_key\n\n if enable_relationship_rel:\n sess.enable_relationship_loading(c2)\n\n c2.parent_id = p2.id\n\n if manualflush:\n sess.flush()\n\n if (loadonpending and attach) or enable_relationship_rel:\n assert c2.parent is p2\n else:\n assert c2.parent is None\n\n sess.rollback()", "metadata": "root.LoadOnFKsTest.test_m2o_lazy_loader_on_transient", "header": "['class', 'LoadOnFKsTest', '(', 'AssertsExecutionResults', ',', 'fixtures', '.', 'TestBase', ')', ':', '___EOS___']", "index": 292 } ]
[ { "span": "from sqlalchemy.testing import eq_, AssertsExecutionResults, assert_raises", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 74 }, { "span": "from sqlalchemy.orm.exc import FlushError", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 41 }, { "span": "from sqlalchemy.testing.schema import Table, Column", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "orm_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sqlalchemy_", "._", "ext_", "._", "declarative", "_", "import_", "declarative", "\\u", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "import_", "eq\\u_", ",_", "Assert", "s", "Execut", "ion", "Results_", ",_", "assert", "\\u", "raises_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "testing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "import_", "fixtures_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "orm_", "._", "attributes_", "import_", "instance", "\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "orm_", "._", "exc_", "import_", "Flu", "sh", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "._", "schema_", "import_", "Table_", ",_", "Column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "engine_", "=_", "testing_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Flu", "sh", "On", "Pend", "ing", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Flu", "sh", "On", "Pend", "ing", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\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 ", " _", "global_", "Parent_", ",_", "Child_", ",_", "Base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base_", "=_", "declarative", "\\u", "base_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Parent_", "(_", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "tablename\\u\\u_", "=_", "'", "parent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "Column_", "(_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "test\\u", "need", "s", "\\u", "autoincrement_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "Column_", "(_", "String_", "(_", "50_", ")_", ",_", "nullable_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "children_", "=_", "relationship_", "(_", "\"", "Chil", "d", "\"_", ",_", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Child_", "(_", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "tablename\\u\\u_", "=_", "'", "child", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "Column_", "(_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "test\\u", "need", "s", "\\u", "autoincrement_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent", "\\u", "id_", "=_", "Column_", "(_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "parent", ".", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Base_", "._", "metadata_", "._", "create", "\\u", "all_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "sh", "On", "Pend", "ing", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\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 ", " _", "Base_", "._", "metadata_", "._", "drop", "\\u", "all_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "sh", "On", "Pend", "ing", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "anno", "ying", "\\u", "autof", "lus", "h", "\\u", "one_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "=_", "Session_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "=_", "Parent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "._", "children_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "sh", "On", "Pend", "ing", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "anno", "ying", "\\u", "autof", "lus", "h", "\\u", "two_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "=_", "Session_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "=_", "Parent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "p1_", "._", "children_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Flu", "sh", "On", "Pend", "ing", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "don", "t", "\\u", "load", "\\u", "if", "\\u", "no", "\\u", "keys_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "=_", "Session_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "=_", "Parent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "p1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "go_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "p1_", "._", "children_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "sql", "\\u", "count_", "(_", "testing_", "._", "db_", ",_", "go_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\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 ", " _", "global_", "Parent_", ",_", "Child_", ",_", "Base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base_", "=_", "declarative", "\\u", "base_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Parent_", "(_", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "tablename\\u\\u_", "=_", "'", "parent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "table", "\\u", "args\\u\\u_", "=_", "{_", "'", "mysql", "\\u", "eng", "ine", "'_", ":_", "'", "Inno", "DB", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "Column_", "(_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "test\\u", "need", "s", "\\u", "autoincrement_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Child_", "(_", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "tablename\\u\\u_", "=_", "'", "child", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "table", "\\u", "args\\u\\u_", "=_", "{_", "'", "mysql", "\\u", "eng", "ine", "'_", ":_", "'", "Inno", "DB", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "Column_", "(_", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "test\\u", "need", "s", "\\u", "autoincrement_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent", "\\u", "id_", "=_", "Column_", "(_", "Integer_", ",_", "Fore", "ign", "Key_", "(_", "'", "parent", ".", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "relationship_", "(_", "Parent_", ",_", "backref_", "=_", "backref_", "(_", "\"", "child", "ren", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Base_", "._", "metadata_", "._", "create", "\\u", "all_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "global_", "sess_", ",_", "p1_", ",_", "p2_", ",_", "c1_", ",_", "c2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "=_", "Session_", "(_", "bind_", "=_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "=_", "Parent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Parent_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", ",_", "c2_", "=_", "Child_", "(_", ")_", ",_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add", "\\u", "all_", "(_", "[_", "p1_", ",_", "p2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c1_", "in_", "sess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sess_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\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 ", " _", "sess_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Base_", "._", "metadata_", "._", "drop", "\\u", "all_", "(_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "on", "\\u", "pend", "ing", "\\u", "disallow", "s", "\\u", "back", "ref", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "autof", "lus", "h_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "side", " ", "effect", " ", "of", " ", "load", "-", "on", "-", "pend", "ing", " ", "with", " ", "no", " ", "autof", "lus", "h", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "change", " ", "to", " ", "the", " ", "back", "ref", " ", "event", " ", "handler", " ", "to", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "collection", " ", "member", "ship", " ", "bef", "ore", " ", "ass", "umi", "ng", " ", "\"", "old", " ", "==", " ", "new", " ", "so", " ", "return", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wou", "ld", " ", "fix", " ", "this", " ", "-", " ", "but", " ", "this", " ", "is", " ", "wast", "efu", "l", " ", "and", " ", "autof", "lus", "h_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "shou", "ld", " ", "be", " ", "turn", "ed", " ", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "not_", "in_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "enable", "\\u", "rel", "\\u", "load", "ing", "\\u", "disallow", "s", "\\u", "back", "ref", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "._", "autof", "lus", "h_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "enable", "\\u", "relation", "ship", "\\u", "loading_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "c3", ".", "parent", " ", "is", " ", "alr", "ead", "y", " ", "actin", "g", " ", "like", " ", "a", " ", "\"", "load", "\"", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "back", "ref", " ", "events", " ", "don", "'", "t", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "not_", "in_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "on", "\\u", "persiste", "nt", "\\u", "allow", "s", "\\u", "back", "ref", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "in_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "enable", "\\u", "rel", "\\u", "load", "ing", "\\u", "on", "\\u", "persiste", "nt", "\\u", "disallow", "s", "\\u", "back", "ref", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "enable", "\\u", "relation", "ship", "\\u", "loading_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "c3", ".", "parent", " ", "is", " ", "alr", "ead", "y", " ", "actin", "g", " ", "like", " ", "a", " ", "\"", "load", "\"", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "back", "ref", " ", "events", " ", "don", "'", "t", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "not_", "in_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "load", "\\u", "on", "\\u", "pend", "ing", "\\u", "allow", "s", "\\u", "back", "ref", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "users", " ", "who", " ", "stick", " ", "with", " ", "the", " ", "program", " ", "and", " ", "don", "'", "t", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "load", "\\u", "on", "\\u", "pend", "ing", "'", " ", "get", " ", "expected", " ", "behavior_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "._", "autof", "lus", "h_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "in_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "autof", "lus", "h", "\\u", "on", "\\u", "pending_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pend", "ings", " ", "don", "'", "t", " ", "autof", "lus", "h_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "._", "parent_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "autof", "lus", "h", "\\u", "on", "\\u", "pending_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "unl", "ess", " ", "the", " ", "flag", " ", "is", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "c3_", "._", "parent_", "is_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "collection", "\\u", "load", "\\u", "from", "\\u", "pend", "ing", "\\u", "populate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Parent_", "._", "children_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Parent_", "(_", "id_", "=_", "p1_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "load", " ", "shou", "ld", " ", "emit", " ", "sinc", "e", " ", "PK", " ", "is", " ", "populate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "go_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "p2_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "sql", "\\u", "count_", "(_", "testing_", "._", "db_", ",_", "go_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "collection", "\\u", "load", "\\u", "from", "\\u", "pend", "ing", "\\u", "no", "\\u", "sql_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Parent_", "._", "children_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Parent_", "(_", "id_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "p2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "load", " ", "shou", "ld", " ", "not", " ", "emit", " ", "sinc", "e", " ", "\"", "Non", "e", "\"", " ", "is", " ", "the", " ", "bound_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "param", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "go_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "not_", "p2_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "sql", "\\u", "count_", "(_", "testing_", "._", "db_", ",_", "go_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "on", "\\u", "pend", "ing", "\\u", "with", "\\u", "set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c3_", "._", "parent", "\\u", "id_", "=_", "p1_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "go_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "sql", "\\u", "count_", "(_", "testing_", "._", "db_", ",_", "go_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "back", "ref", "\\u", "doesnt", "\\u", "double_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "autof", "lus", "h_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1_", "._", "children_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "parent_", "=_", "p1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "p1_", "._", "children_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "m2", "o", "\\u", "lazy", "\\u", "load", "er", "\\u", "on", "\\u", "persistent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compare", " ", "the", " ", "behavior", "s", " ", "from", " ", "the", " ", "lazy", "load", "er", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "\"", "committ", "ed", "\"", " ", "state", " ", "in", " ", "all", " ", "case", "s", ",", " ", "vs", ".", " ", "the", " ", "lazy", "load", "er", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "the", " ", "\"", "current", "\"", " ", "state", " ", "in", " ", "all", " ", "case", "s", " ", "except", " ", "dur", "ing", " ", "flush", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "load", "fk_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "load", "rel_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "autof", "lus", "h_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "manu", "alf", "lus", "h_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "fake", "\\u", "autoe", "xp", "ire_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sess_", "._", "autof", "lus", "h_", "=_", "autof", "lus", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "load", "fk_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "c1_", "._", "parent", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "load", "rel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "c1_", "._", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c1_", "._", "parent", "\\u", "id_", "=_", "p2_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "manu", "alf", "lus", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sess_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fake", "\\u", "autoe", "xp", "ire", " ", "refer", "s", " ", "to", " ", "the", " ", "eventual", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "auto", "-", "expir", "e", " ", "of", " ", "'", "parent", "'", " ", "whe", "n", " ", "c1", ".", "parent", "\\u", "id_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "alter", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fake", "\\u", "autoe", "xp", "ire_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sess_", "._", "expire_", "(_", "c1_", ",_", "[_", "'", "parent", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "old", " ", "0.", "6", " ", "behavior_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "manu", "alf", "lus", "h", " ", "and", " ", "(", "not", " ", "load", "rel", " ", "or", " ", "fake", "\\u", "autoe", "xp", "ire", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "a", " ", "flush", " ", "occur", "s", ",", " ", "we", " ", "get", " ", "p2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "assert", " ", "c1", ".", "parent", " ", "is", " ", "p2_", "\\u\\u\\uNL\\u\\u\\u_", "#", "eli", "f", " ", "not", " ", "load", "rel", " ", "and", " ", "not", " ", "load", "fk", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "problem", "atic", "ally", " ", "-", " ", "we", " ", "get", " ", "Non", "e", " ", "sinc", "e", " ", "committ", "ed", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "is", " ", "empty", " ", "whe", "n", " ", "c1", ".", "parent", "\\u", "id", " ", "was", " ", "mutate", "d", ",", " ", "sinc", "e", " ", "we", " ", "want_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "to", " ", "save", " ", "on", " ", "select", "s", ".", " ", " ", "this", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "wh", "y", " ", "the", " ", "patch", " ", "go", "es", " ", "in", " ", "in", " ", "0.", "6", " ", "-", " ", "this", " ", "is", " ", "most", "ly", " ", "a", " ", "bug", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "assert", " ", "c1", ".", "parent", " ", "is", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "if", " ", "thing", "s", " ", "wer", "e", " ", "load", "ed", ",", " ", "autof", "lus", "h", " ", "doe", "sn", "'", "t", " ", "even_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "happ", "en", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "assert", " ", "c1", ".", "parent", " ", "is", " ", "p1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", " ", "behavior_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "load", "rel_", "and_", "not_", "fake", "\\u", "autoe", "xp", "ire_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assert_", "c1_", "._", "parent_", "is_", "p1_", "\\u\\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_", "c1_", "._", "parent_", "is_", "p2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sess_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "m2", "o", "\\u", "lazy", "\\u", "load", "er", "\\u", "on", "\\u", "pending_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "load", "onp", "ending_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "autof", "lus", "h_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "manu", "alf", "lus", "h_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "load", "onp", "ending_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "autof", "lus", "h_", "=_", "autof", "lus", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "add_", "(_", "c2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "._", "parent", "\\u", "id_", "=_", "p2_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "manu", "alf", "lus", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sess_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "load", "onp", "ending_", "or_", "manu", "alf", "lus", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assert_", "c2_", "._", "parent_", "is_", "p2_", "\\u\\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_", "c2_", "._", "parent_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sess_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Load", "On", "FK", "s", "Test_", "(_", "Assert", "s", "Execut", "ion", "Results_", ",_", "fixtures_", "._", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "m2", "o", "\\u", "lazy", "\\u", "load", "er", "\\u", "on", "\\u", "transient", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "load", "onp", "ending_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "attach_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "autof", "lus", "h_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "manu", "alf", "lus", "h_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "enable", "\\u", "relation", "ship", "\\u", "rel_", "in_", "(_", "False_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "Child_", "._", "parent_", "._", "property_", "._", "load", "\\u", "on", "\\u", "pending_", "=_", "load", "onp", "ending_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "autof", "lus", "h_", "=_", "autof", "lus", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "Child_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "attach_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "state_", "=_", "instance", "\\u", "state_", "(_", "c2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "session", "\\u", "id_", "=_", "sess_", "._", "hash", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "enable", "\\u", "relation", "ship", "\\u", "rel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sess_", "._", "enable", "\\u", "relation", "ship", "\\u", "loading_", "(_", "c2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c2_", "._", "parent", "\\u", "id_", "=_", "p2_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "manu", "alf", "lus", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sess_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "load", "onp", "ending_", "and_", "attach_", ")_", "or_", "enable", "\\u", "relation", "ship", "\\u", "rel_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assert_", "c2_", "._", "parent_", "is_", "p2_", "\\u\\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_", "c2_", "._", "parent_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sess_", "._", "rollback_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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
fp7-ofelia/ocf/vt_manager/src/python/vt_manager/communication/sfa/rspecs/elements/versions/sfav1Lease.py
[ { "content": "from vt_manager.communication.sfa.util.sfalogging import logger\nfrom vt_manager.communication.sfa.util.xml import XpathFilter\nfrom vt_manager.communication.sfa.util.xrn import Xrn\n\nfrom vt_manager.communication.sfa.rspecs.elements.element import Element\nfrom vt_manager.communication.sfa.rspecs.elements.node import Node\nfrom vt_manager.communication.sfa.rspecs.elements.sliver import Sliver\nfrom vt_manager.communication.sfa.rspecs.elements.location import Location\nfrom vt_manager.communication.sfa.rspecs.elements.hardware_type import HardwareType\nfrom vt_manager.communication.sfa.rspecs.elements.disk_image import DiskImage\nfrom vt_manager.communication.sfa.rspecs.elements.interface import Interface\nfrom vt_manager.communication.sfa.rspecs.elements.bwlimit import BWlimit\nfrom vt_manager.communication.sfa.rspecs.elements.pltag import PLTag\nfrom vt_manager.communication.sfa.rspecs.elements.versions.sfav1Sliver import SFAv1Sliver\nfrom vt_manager.communication.sfa.rspecs.elements.versions.sfav1PLTag import SFAv1PLTag\nfrom vt_manager.communication.sfa.rspecs.elements.versions.pgv2Services import PGv2Services\nfrom vt_manager.communication.sfa.rspecs.elements.lease import Lease\n\nfrom sfa.planetlab.plxrn import xrn_to_hostname\n\n\n\n\n\n\n# leases = [] \n# for lease_elem in lease_elems:\n# lease = Lease(lease_elem.attrib, lease_elem)\n# if lease.get('lease_id'):\n# lease['lease_id'] = lease_elem.attrib['lease_id']\n# lease['component_id'] = lease_elem.attrib['component_id']\n# lease['slice_id'] = lease_elem.attrib['slice_id']\n# lease['start_time'] = lease_elem.attrib['start_time']\n# lease['duration'] = lease_elem.attrib['duration']\n\n# leases.append(lease)\n# return leases \n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SFAv1Lease:\n\n\n\n\n# lease_elems = [] \n# for lease in leases:\n# lease_fields = ['lease_id', 'component_id', 'slice_id', 'start_time', 'duration']\n# lease_elem = network_elem.add_instance('lease', lease, lease_fields)\n# lease_elems.append(lease_elem)\n\n\n", "metadata": "root.SFAv1Lease", "header": "['module', '___EOS___']", "index": 20 }, { "content": " @staticmethod\n def add_leases(xml, leases):\n \n network_elems = xml.xpath('//network')\n if len(network_elems) > 0:\n network_elem = network_elems[0]\n elif len(leases) > 0:\n network_urn = Xrn(leases[0]['component_id']).get_authority_urn().split(':')[0]\n network_elem = xml.add_element('network', name = network_urn)\n else:\n network_elem = xml\n \n # group the leases by slice and timeslots\n grouped_leases = []\n\n while leases:\n slice_id = leases[0]['slice_id']\n start_time = leases[0]['start_time']\n duration = leases[0]['duration']\n group = []\n\n for lease in leases:\n if slice_id == lease['slice_id'] and start_time == lease['start_time'] and duration == lease['duration']:\n group.append(lease)\n\n grouped_leases.append(group)\n\n for lease1 in group:\n leases.remove(lease1)\n\n lease_elems = []\n for lease in grouped_leases:\n #lease_fields = ['lease_id', 'component_id', 'slice_id', 'start_time', 'duration']\n lease_fields = ['slice_id', 'start_time', 'duration']\n lease_elem = network_elem.add_instance('lease', lease[0], lease_fields)\n lease_elems.append(lease_elem)\n\n # add nodes of this lease\n for node in lease:\n lease_elem.add_instance('node', node, ['component_id'])", "metadata": "root.SFAv1Lease.add_leases", "header": "['class', 'SFAv1Lease', ':', '___EOS___']", "index": 22 }, { "content": " @staticmethod\n def get_leases(xml, filter={}):\n xpath = '//lease%s | //default:lease%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))\n lease_elems = xml.xpath(xpath)\n return SFAv1Lease.get_lease_objs(lease_elems)", "metadata": "root.SFAv1Lease.get_leases", "header": "['class', 'SFAv1Lease', ':', '___EOS___']", "index": 72 }, { "content": " @staticmethod\n def get_lease_objs(lease_elems):\n leases = []\n for lease_elem in lease_elems:\n #get nodes\n node_elems = lease_elem.xpath('./default:node | ./node')\n for node_elem in node_elems:\n lease = Lease(lease_elem.attrib, lease_elem)\n lease['slice_id'] = lease_elem.attrib['slice_id']\n lease['start_time'] = lease_elem.attrib['start_time']\n lease['duration'] = lease_elem.attrib['duration']\n lease['component_id'] = node_elem.attrib['component_id']\n leases.append(lease)\n\n return leases", "metadata": "root.SFAv1Lease.get_lease_objs", "header": "['class', 'SFAv1Lease', ':', '___EOS___']", "index": 78 } ]
[ { "span": "from vt_manager.communication.sfa.util.sfalogging import logger", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 63 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.element import Element", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 72 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.node import Node", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 66 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.sliver import Sliver", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 70 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.location import Location", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 74 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.hardware_type import HardwareType", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 83 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.disk_image import DiskImage", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 77 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.interface import Interface", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 76 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.bwlimit import BWlimit", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 72 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.pltag import PLTag", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 68 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.versions.sfav1Sliver import SFAv1Sliver", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 89 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.versions.sfav1PLTag import SFAv1PLTag", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 87 }, { "span": "from vt_manager.communication.sfa.rspecs.elements.versions.pgv2Services import PGv2Services", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 91 }, { "span": "from sfa.planetlab.plxrn import xrn_to_hostname", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "util_", "._", "sfa", "logging_", "import_", "logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "util_", "._", "xml_", "import_", "Xp", "ath", "Filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "util_", "._", "xr", "n_", "import_", "Xr", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "element_", "import_", "Element_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "node_", "import_", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "sli", "ver_", "import_", "Sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "location_", "import_", "Location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "hard", "ware", "\\u", "type_", "import_", "Hard", "ware", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "disk", "\\u", "image_", "import_", "Disk", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "interface_", "import_", "Interface_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "bw", "limit_", "import_", "BW", "limit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "plt", "ag_", "import_", "PL", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "sfa", "v1", "Sli", "ver_", "import_", "SF", "Av", "1", "Sli", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "sfa", "v1", "PL", "Tag_", "import_", "SF", "Av", "1", "PL", "Tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "versions_", "._", "pg", "v2", "Services_", "import_", "PG", "v2", "Services_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vt", "\\u", "manager_", "._", "communication", "_", "._", "sfa", "_", "._", "rsp", "ecs_", "._", "elements_", "._", "lease_", "import_", "Leas", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sfa", "_", "._", "planet", "lab_", "._", "pl", "xr", "n_", "import_", "xr", "n", "\\u", "to", "\\u", "hostname_", "\\u\\u\\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_", "#", " ", " ", " ", " ", "lease", "s", " ", "=", " ", "[]", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "lease", "\\u", "elem", " ", "in", " ", "lease", "\\u", "elem", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", " ", "=", " ", "Leas", "e", "(", "lease", "\\u", "elem", ".", "attrib", ",", " ", "lease", "\\u", "elem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "lease", ".", "get", "('", "lease", "\\u", "id", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "lease", "['", "lease", "\\u", "id", "']", " ", "=", " ", "lease", "\\u", "elem", ".", "attrib", "['", "lease", "\\u", "id", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "['", "component", "\\u", "id", "']", " ", "=", " ", "lease", "\\u", "elem", ".", "attrib", "['", "component", "\\u", "id", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "['", "slice", "\\u", "id", "']", " ", "=", " ", "lease", "\\u", "elem", ".", "attrib", "['", "slice", "\\u", "id", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "['", "start", "\\u", "time", "']", " ", "=", " ", "lease", "\\u", "elem", ".", "attrib", "['", "start", "\\u", "time", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "['", "duration", "']", " ", "=", " ", "lease", "\\u", "elem", ".", "attrib", "['", "duration", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "s", ".", "append", "(", "lease", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "lease", "s_", "\\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_", "SF", "Av", "1", "Leas", "e_", ":_", "\\u\\u\\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_", "#", " ", " ", " ", " ", "lease", "\\u", "elem", "s", " ", "=", " ", "[]", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "lease", " ", "in", " ", "lease", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "\\u", "fields", " ", "=", " ", "['", "lease", "\\u", "id", "',", " ", "'", "component", "\\u", "id", "',", " ", "'", "slice", "\\u", "id", "',", " ", "'", "start", "\\u", "time", "',", " ", "'", "duration", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "\\u", "elem", " ", "=", " ", "network", "\\u", "elem", ".", "add", "\\u", "instance", "('", "lease", "',", " ", "lease", ",", " ", "lease", "\\u", "fields", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "lease", "\\u", "elem", "s", ".", "append", "(", "lease", "\\u", "elem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "SF", "Av", "1", "Leas", "e_", ":_", "\\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", "lease", "s_", "(_", "xml_", ",_", "lease", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "(_", "lease", "s_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "network", "\\u", "urn_", "=_", "Xr", "n_", "(_", "lease", "s_", "[_", "0_", "]_", "[_", "'", "component", "\\u", "id", "'_", "]_", ")_", "._", "get", "\\u", "authori", "ty", "\\u", "urn_", "(_", ")_", "._", "split_", "(_", "':'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "network", "\\u", "elem_", "=_", "xml_", "._", "add", "\\u", "element_", "(_", "'", "network", "'_", ",_", "name_", "=_", "network", "\\u", "urn_", ")_", "\\u\\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_", "#", " ", "group", " ", "the", " ", "lease", "s", " ", "by", " ", "slice", " ", "and", " ", "timesl", "ots_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "groupe", "d\\u", "lease", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "lease", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slice", "\\u", "id_", "=_", "lease", "s_", "[_", "0_", "]_", "[_", "'", "slice", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "lease", "s_", "[_", "0_", "]_", "[_", "'", "start", "\\u", "time", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration_", "=_", "lease", "s_", "[_", "0_", "]_", "[_", "'", "duration", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "lease_", "in_", "lease", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "slice", "\\u", "id_", "==_", "lease_", "[_", "'", "slice", "\\u", "id", "'_", "]_", "and_", "start", "\\u", "time_", "==_", "lease_", "[_", "'", "start", "\\u", "time", "'_", "]_", "and_", "duration_", "==_", "lease_", "[_", "'", "duration", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "group_", "._", "append_", "(_", "lease_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "groupe", "d\\u", "lease", "s_", "._", "append_", "(_", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "lease", "1_", "in_", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lease", "s_", "._", "remove_", "(_", "lease", "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_", "lease", "\\u", "elems_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "lease_", "in_", "groupe", "d\\u", "lease", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "lease", "\\u", "fields", " ", "=", " ", "['", "lease", "\\u", "id", "',", " ", "'", "component", "\\u", "id", "',", " ", "'", "slice", "\\u", "id", "',", " ", "'", "start", "\\u", "time", "',", " ", "'", "duration", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lease", "\\u", "fields_", "=_", "[_", "'", "slice", "\\u", "id", "'_", ",_", "'", "start", "\\u", "time", "'_", ",_", "'", "duration", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease", "\\u", "elem_", "=_", "network", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "lease", "'_", ",_", "lease_", "[_", "0_", "]_", ",_", "lease", "\\u", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease", "\\u", "elems_", "._", "append_", "(_", "lease", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "nodes", " ", "of", " ", "this", " ", "lease_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", "in_", "lease_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lease", "\\u", "elem_", "._", "add", "\\u", "instance_", "(_", "'", "node", "'_", ",_", "node_", ",_", "[_", "'", "component", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SF", "Av", "1", "Leas", "e_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "lease", "s_", "(_", "xml_", ",_", "filter_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xpath_", "=_", "'//", "lease", "%", "s", " ", "|", " ", "//", "default", ":", "lease", "%", "s", "'_", "%_", "(_", "Xp", "ath", "Filter_", "._", "xpath_", "(_", "filter_", ")_", ",_", "Xp", "ath", "Filter_", "._", "xpath_", "(_", "filter_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease", "\\u", "elems_", "=_", "xml_", "._", "xpath_", "(_", "xpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "SF", "Av", "1", "Leas", "e_", "._", "get", "\\u", "lease", "\\u", "objs_", "(_", "lease", "\\u", "elems_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SF", "Av", "1", "Leas", "e_", ":_", "\\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", "lease", "\\u", "objs_", "(_", "lease", "\\u", "elems_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lease", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "lease", "\\u", "elem_", "in_", "lease", "\\u", "elems_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "get", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node", "\\u", "elems_", "=_", "lease", "\\u", "elem_", "._", "xpath_", "(_", "'./", "default", ":", "node", " ", "|", " ", "./", "node", "'_", ")_", "\\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 ", " _", "lease_", "=_", "Leas", "e_", "(_", "lease", "\\u", "elem_", "._", "attrib_", ",_", "lease", "\\u", "elem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease_", "[_", "'", "slice", "\\u", "id", "'_", "]_", "=_", "lease", "\\u", "elem_", "._", "attrib_", "[_", "'", "slice", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease_", "[_", "'", "start", "\\u", "time", "'_", "]_", "=_", "lease", "\\u", "elem_", "._", "attrib_", "[_", "'", "start", "\\u", "time", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease_", "[_", "'", "duration", "'_", "]_", "=_", "lease", "\\u", "elem_", "._", "attrib_", "[_", "'", "duration", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease_", "[_", "'", "component", "\\u", "id", "'_", "]_", "=_", "node", "\\u", "elem_", "._", "attrib_", "[_", "'", "component", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lease", "s_", "._", "append_", "(_", "lease_", ")_", "\\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_", "lease", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 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, 2, 0, 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, 2, 0, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
azoft-dev-team/imagrium/env/Lib/xml/sax/drivers2/drv_javasax.py
[ { "content": " def getValue(self, name):\n value = self._attrs.getValue(_makeJavaNsTuple(name))\n if value == None:\n raise KeyError(name)\n return value", "metadata": "root.AttributesImpl.getValue", "header": "['class', 'AttributesImpl', ':', '___EOS___']", "index": 264 }, { "content": " def getValue(self, name):\n jname = _makeJavaNsTuple(name)\n value = self._attrs.getValue(jname[0], jname[1])\n if value == None:\n raise KeyError(name)\n return value", "metadata": "root.AttributesNSImpl.getValue", "header": "['class', 'AttributesNSImpl', '(', 'AttributesImpl', ')', ':', '___EOS___']", "index": 336 } ]
[ { "span": "value == None:", "start_line": 266, "start_column": 11, "end_line": 266, "end_column": 24 }, { "span": "value == None:", "start_line": 339, "start_column": 11, "end_line": 339, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Attribute", "s", "Impl_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Value_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "self_", "._", "\\u", "attrs_", "._", "get", "Value_", "(_", "\\u", "make", "Ja", "va", "Ns", "Tuple_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attribute", "s", "NS", "Impl_", "(_", "Attribute", "s", "Impl_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Value_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jn", "ame_", "=_", "\\u", "make", "Ja", "va", "Ns", "Tuple_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "\\u", "attrs_", "._", "get", "Value_", "(_", "jn", "ame_", "[_", "0_", "]_", ",_", "jn", "ame_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
dokterbob/satchmo/satchmo/apps/payment/views/payship.py
[ { "content": "####################################################################\n# Second step in the order process: Capture the billing method and shipping type\n#####################################################################\n\nfrom django import http\nfrom django.conf import settings\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom livesettings import config_value\nfrom satchmo_store.contact.models import Contact\nfrom payment.config import gateway_live\nfrom payment.forms import CreditPayShipForm, SimplePayShipForm\nfrom product.utils import find_best_auto_discount\nfrom satchmo_store.shop.models import Cart\nfrom satchmo_store.shop.models import Order, OrderPayment\nfrom satchmo_utils.dynamic import lookup_url, lookup_template\n\nimport logging\n\nlog = logging.getLogger('payship')\nselection = _(\"Please Select\")\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def pay_ship_info_verify(request, payment_module):\n \"\"\"Verify customer and cart.\n Returns:\n True, contact, cart on success\n False, destination of failure\n \"\"\"\n # Verify that the customer exists.\n try:\n contact = Contact.objects.from_request(request, create=False)\n except Contact.DoesNotExist:\n log.debug('No contact, returning to step 1 of checkout')\n url = lookup_url(payment_module, 'satchmo_checkout-step1')\n return (False, http.HttpResponseRedirect(url))\n\n # Verify that we still have items in the cart.\n tempCart = Cart.objects.from_request(request)\n if tempCart.numItems == 0:\n template = lookup_template(payment_module, 'shop/checkout/empty_cart.html')\n return (False, render_to_response(template,\n context_instance=RequestContext(request)))\n\n return (True, contact, tempCart)", "metadata": "root.pay_ship_info_verify", "header": "['module', '___EOS___']", "index": 24 }, { "content": "def credit_pay_ship_process_form(request, contact, working_cart, payment_module, allow_skip=True, *args, **kwargs):\n \"\"\"Handle the form information.\n Returns:\n (True, destination) on success\n (False, form) on failure\n \"\"\"\n \n def _get_form(request, payment_module, *args, **kwargs):\n processor = payment_module.MODULE.load_module('processor')\n log.debug('processor=%s', processor)\n if hasattr(processor, 'FORM'):\n log.debug('getting form from module')\n formclass = processor.FORM\n else:\n log.debug('using default form')\n formclass = CreditPayShipForm\n \n form = formclass(request, payment_module, *args, **kwargs)\n return form\n\n if request.method == \"POST\":\n new_data = request.POST.copy()\n \n form = _get_form(request, payment_module, new_data, *args, **kwargs)\n if form.is_valid():\n data = form.cleaned_data\n form.save(request, working_cart, contact, payment_module, data=data)\n url = lookup_url(payment_module, 'satchmo_checkout-step3')\n return (True, http.HttpResponseRedirect(url))\n else:\n log.debug('Form errors: %s', form.errors)\n else:\n order_data = {}\n try:\n order = Order.objects.from_request(request)\n if order.shipping_model:\n order_data['shipping'] = order.shipping_model\n if order.credit_card:\n cc = order.credit_card\n val = cc.decryptedCC\n if val:\n order_data['credit_number'] = val\n val = cc.ccv\n if val:\n order_data['ccv'] = val\n val = cc.expire_month\n if val:\n order_data['month_expires'] = val\n val = cc.expire_year\n if val:\n order_data['year_expires'] = val\n val = cc.credit_type\n if val:\n order_data['credit_type'] = val\n \n kwargs['initial'] = order_data\n ordershippable = order.is_shippable\n except Order.DoesNotExist:\n pass\n \n form = _get_form(request, payment_module, *args, **kwargs)\n if not form.is_needed():\n log.debug('Skipping pay ship because form is not needed, nothing to pay')\n form.save(request, working_cart, contact, None, \n data={'shipping' : form.shipping_dict.keys()[0]})\n\n url = lookup_url(payment_module, 'satchmo_checkout-step3')\n return (True, http.HttpResponseRedirect(url))\n \n return (False, form)", "metadata": "root.credit_pay_ship_process_form", "header": "['module', '___EOS___']", "index": 47 }, { "content": "def simple_pay_ship_process_form(request, contact, working_cart, payment_module, allow_skip=True):\n if request.method == \"POST\":\n new_data = request.POST.copy()\n form = SimplePayShipForm(request, payment_module, new_data)\n if form.is_valid():\n form.save(request, working_cart, contact, payment_module)\n url = lookup_url(payment_module, 'satchmo_checkout-step3')\n return (True, http.HttpResponseRedirect(url))\n else:\n return (False, form)\n else:\n order_data = None\n try:\n order = Order.objects.from_request(request)\n if order.shipping_model:\n order_data = {}\n order_data['shipping'] = order.shipping_model\n ordershippable = order.is_shippable\n except Order.DoesNotExist:\n pass\n\n form = SimplePayShipForm(request, payment_module, order_data)\n if allow_skip:\n skipping = False\n skipstep = form.shipping_hidden or not ordershippable or (len(form.shipping_dict) == 1)\n if skipstep: \n log.debug('Skipping pay ship, nothing to select for shipping')\n # no shipping choice = skip this step\n form.save(request, working_cart, contact, payment_module, \n data={'shipping' : form.fields['shipping'].initial})\n skipping = True\n elif not form.is_needed():\n log.debug('Skipping pay ship because form is not needed, nothing to pay')\n form.save(request, working_cart, contact, None, \n data={'shipping' : form.shipping_dict.keys()[0]})\n skipping = True\n \n if skipping:\n url = lookup_url(payment_module, 'satchmo_checkout-step3')\n return (True, http.HttpResponseRedirect(url))\n \n return (False, form)", "metadata": "root.simple_pay_ship_process_form", "header": "['module', '___EOS___']", "index": 118 }, { "content": "def pay_ship_render_form(request, form, template, payment_module, cart):\n template = lookup_template(payment_module, template)\n \n ctx = RequestContext(request, {\n 'form': form,\n 'PAYMENT_LIVE': gateway_live(payment_module),\n })\n return render_to_response(template, context_instance=ctx)", "metadata": "root.pay_ship_render_form", "header": "['module', '___EOS___']", "index": 161 }, { "content": "def base_pay_ship_info(request, payment_module, form_handler, template):\n results = pay_ship_info_verify(request, payment_module)\n if not results[0]:\n return results[1]\n\n contact = results[1]\n working_cart = results[2]\n\n results = form_handler(request, contact, working_cart, payment_module)\n if results[0]:\n return results[1]\n\n form = results[1]\n return pay_ship_render_form(request, form, template, payment_module, working_cart)", "metadata": "root.base_pay_ship_info", "header": "['module', '___EOS___']", "index": 170 }, { "content": "def credit_pay_ship_info(request, payment_module, template='shop/checkout/pay_ship.html'):\n \"\"\"A pay_ship view which uses a credit card.\"\"\"\n return base_pay_ship_info(request, payment_module, credit_pay_ship_process_form, template)", "metadata": "root.credit_pay_ship_info", "header": "['module', '___EOS___']", "index": 185 }, { "content": "def simple_pay_ship_info(request, payment_module, template):\n \"\"\"A pay_ship view which doesn't require a credit card.\"\"\"\n return base_pay_ship_info(request, payment_module, simple_pay_ship_process_form, template)", "metadata": "root.simple_pay_ship_info", "header": "['module', '___EOS___']", "index": 189 } ]
[ { "span": "from django.conf import settings", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 32 }, { "span": "from livesettings import config_value", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 37 }, { "span": "from product.utils import find_best_auto_discount", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 49 }, { "span": "from satchmo_store.shop.models import Order, OrderPayment", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 57 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Second", " ", "step", " ", "in", " ", "the", " ", "order", " ", "process", ":", " ", "Captur", "e", " ", "the", " ", "bill", "ing", " ", "method", " ", "and", " ", "shipping", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "import_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render", "\\u", "to", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", "\\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_", "from_", "lives", "ettings_", "import_", "config", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sat", "chm", "o", "\\u", "store_", "._", "contact_", "._", "models_", "import_", "Contact_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "payment_", "._", "config_", "import_", "gateway", "\\u", "live_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "payment_", "._", "forms_", "import_", "Credit", "Pay", "Ship", "Form_", ",_", "Simple", "Pay", "Ship", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "product_", "._", "utils_", "import_", "find", "\\u", "best", "\\u", "auto", "\\u", "discount_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sat", "chm", "o", "\\u", "store_", "._", "shop", "_", "._", "models_", "import_", "Cart", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sat", "chm", "o", "\\u", "store_", "._", "shop", "_", "._", "models_", "import_", "Order_", ",_", "Order", "Payment", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sat", "chm", "o", "\\u", "utils_", "._", "dynamic_", "import_", "look", "up", "\\u", "url_", ",_", "look", "up", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "pay", "ship", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selection_", "=_", "\\u_", "(_", "\"", "Ple", "ase", " ", "Select", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "pay", "\\u", "ship", "\\u", "info", "\\u", "verify_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Verify", " ", "customer", " ", "and", " ", "cart", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", ",", " ", "contact", ",", " ", "cart", " ", "on", " ", "success", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", ",", " ", "destinat", "ion", " ", "of", " ", "fail", "ure", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Verify", " ", "tha", "t", " ", "the", " ", "customer", " ", "exist", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contact_", "=_", "Contact_", "._", "objects_", "._", "from", "\\u", "request_", "(_", "request_", ",_", "create_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Contact_", "._", "Do", "es", "Not", "Exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "No", " ", "contact", ",", " ", "return", "ing", " ", "to", " ", "step", " ", "1", " ", "of", " ", "check", "out", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "look", "up", "\\u", "url_", "(_", "pay", "ment", "\\u", "module_", ",_", "'", "sat", "chm", "o", "\\u", "check", "out", "-", "step", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "False_", ",_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Verify", " ", "tha", "t", " ", "we", " ", "still", " ", "have", " ", "items", " ", "in", " ", "the", " ", "cart", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "temp", "Cart", "_", "=_", "Cart", "_", "._", "objects_", "._", "from", "\\u", "request_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "temp", "Cart", "_", "._", "num", "Items_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template_", "=_", "look", "up", "\\u", "template_", "(_", "pay", "ment", "\\u", "module_", ",_", "'", "shop", "/", "check", "out", "/", "empty", "\\u", "cart", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "False_", ",_", "render", "\\u", "to", "\\u", "response_", "(_", "template_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "context", "\\u", "instance_", "=_", "Request", "Context_", "(_", "request_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "True_", ",_", "contact_", ",_", "temp", "Cart", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "credit", "\\u", "pay", "\\u", "ship", "\\u", "process", "\\u", "form_", "(_", "request_", ",_", "contact_", ",_", "working", "\\u", "cart_", ",_", "pay", "ment", "\\u", "module_", ",_", "allow", "\\u", "skip_", "=_", "True_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", " ", "the", " ", "form", " ", "informati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "(", "Tru", "e", ",", " ", "destinat", "ion", ")", " ", "on", " ", "success", "\\", "10", ";", " ", " ", " ", " ", "(", "Fal", "se", ",", " ", "form", ")", " ", "on", " ", "fail", "ure", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "form_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "processor_", "=_", "pay", "ment", "\\u", "module_", "._", "MODULE_", "._", "load", "\\u", "module_", "(_", "'", "process", "or", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "process", "or", "=", "%", "s", "'_", ",_", "processor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "processor_", ",_", "'", "FORM", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "getti", "ng", " ", "form", " ", "from", " ", "module", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "class_", "=_", "processor_", "._", "FORM", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "usi", "ng", " ", "default", " ", "form", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form", "class_", "=_", "Credit", "Pay", "Ship", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "form", "class_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "method_", "==_", "\"", "POST", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "data_", "=_", "request_", "._", "POST_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "\\u", "get", "\\u", "form_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "new", "\\u", "data_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "form_", "._", "clean", "ed", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "save_", "(_", "request_", ",_", "working", "\\u", "cart_", ",_", "contact_", ",_", "pay", "ment", "\\u", "module_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "look", "up", "\\u", "url_", "(_", "pay", "ment", "\\u", "module_", ",_", "'", "sat", "chm", "o", "\\u", "check", "out", "-", "step", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "True_", ",_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Form", " ", "error", "s", ":", " ", "%", "s", "'_", ",_", "form_", "._", "errors_", ")_", "\\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 ", " _", "order", "\\u", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order_", "=_", "Order_", "._", "objects_", "._", "from", "\\u", "request_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "order_", "._", "shipping", "\\u", "model_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "data_", "[_", "'", "shipping", "'_", "]_", "=_", "order_", "._", "shipping", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "order_", "._", "credit", "\\u", "card_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cc_", "=_", "order_", "._", "credit", "\\u", "card_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "cc_", "._", "decrypted", "CC_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "order", "\\u", "data_", "[_", "'", "credit", "\\u", "number", "'_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "val_", "=_", "cc_", "._", "cc", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "order", "\\u", "data_", "[_", "'", "cc", "v", "'_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "val_", "=_", "cc_", "._", "expir", "e\\u", "month_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "order", "\\u", "data_", "[_", "'", "month", "\\u", "expir", "es", "'_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "val_", "=_", "cc_", "._", "expir", "e\\u", "year_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "order", "\\u", "data_", "[_", "'", "year", "\\u", "expir", "es", "'_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "val_", "=_", "cc_", "._", "credit", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "order", "\\u", "data_", "[_", "'", "credit", "\\u", "type", "'_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "initial", "'_", "]_", "=_", "order", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order", "ship", "pab", "le_", "=_", "order_", "._", "is", "\\u", "ship", "pab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Order_", "._", "Do", "es", "Not", "Exist_", ":_", "\\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_", "form_", "=_", "\\u", "get", "\\u", "form_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "form_", "._", "is", "\\u", "needed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Ski", "ppi", "ng", " ", "pay", " ", "ship", " ", "bec", "aus", "e", " ", "form", " ", "is", " ", "not", " ", "need", "ed", ",", " ", "not", "hing", " ", "to", " ", "pay", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "save_", "(_", "request_", ",_", "working", "\\u", "cart_", ",_", "contact_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "shipping", "'_", ":_", "form_", "._", "shipping", "\\u", "dict_", "._", "keys_", "(_", ")_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "look", "up", "\\u", "url_", "(_", "pay", "ment", "\\u", "module_", ",_", "'", "sat", "chm", "o", "\\u", "check", "out", "-", "step", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "True_", ",_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "False_", ",_", "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_", "def_", "simple", "\\u", "pay", "\\u", "ship", "\\u", "process", "\\u", "form_", "(_", "request_", ",_", "contact_", ",_", "working", "\\u", "cart_", ",_", "pay", "ment", "\\u", "module_", ",_", "allow", "\\u", "skip_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "method_", "==_", "\"", "POST", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "data_", "=_", "request_", "._", "POST_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Simple", "Pay", "Ship", "Form_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "new", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "form_", "._", "save_", "(_", "request_", ",_", "working", "\\u", "cart_", ",_", "contact_", ",_", "pay", "ment", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "look", "up", "\\u", "url_", "(_", "pay", "ment", "\\u", "module_", ",_", "'", "sat", "chm", "o", "\\u", "check", "out", "-", "step", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "True_", ",_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "False_", ",_", "form_", ")_", "\\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 ", " _", "order", "\\u", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order_", "=_", "Order_", "._", "objects_", "._", "from", "\\u", "request_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "order_", "._", "shipping", "\\u", "model_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "order", "\\u", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "order", "\\u", "data_", "[_", "'", "shipping", "'_", "]_", "=_", "order_", "._", "shipping", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "order", "ship", "pab", "le_", "=_", "order_", "._", "is", "\\u", "ship", "pab", "le_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Order_", "._", "Do", "es", "Not", "Exist_", ":_", "\\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_", "form_", "=_", "Simple", "Pay", "Ship", "Form_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "order", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "allow", "\\u", "skip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skip", "ping_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skips", "tep_", "=_", "form_", "._", "shipping", "\\u", "hidden_", "or_", "not_", "order", "ship", "pab", "le_", "or_", "(_", "len_", "(_", "form_", "._", "shipping", "\\u", "dict_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "skips", "tep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Ski", "ppi", "ng", " ", "pay", " ", "ship", ",", " ", "not", "hing", " ", "to", " ", "select", " ", "for", " ", "shipping", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "shipping", " ", "choice", " ", "=", " ", "skip", " ", "this", " ", "step_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "._", "save_", "(_", "request_", ",_", "working", "\\u", "cart_", ",_", "contact_", ",_", "pay", "ment", "\\u", "module_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "shipping", "'_", ":_", "form_", "._", "fields_", "[_", "'", "shipping", "'_", "]_", "._", "initial_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skip", "ping_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "form_", "._", "is", "\\u", "needed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Ski", "ppi", "ng", " ", "pay", " ", "ship", " ", "bec", "aus", "e", " ", "form", " ", "is", " ", "not", " ", "need", "ed", ",", " ", "not", "hing", " ", "to", " ", "pay", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "save_", "(_", "request_", ",_", "working", "\\u", "cart_", ",_", "contact_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "shipping", "'_", ":_", "form_", "._", "shipping", "\\u", "dict_", "._", "keys_", "(_", ")_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skip", "ping_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "skip", "ping_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "look", "up", "\\u", "url_", "(_", "pay", "ment", "\\u", "module_", ",_", "'", "sat", "chm", "o", "\\u", "check", "out", "-", "step", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "True_", ",_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "False_", ",_", "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_", "def_", "pay", "\\u", "ship", "\\u", "render", "\\u", "form_", "(_", "request_", ",_", "form_", ",_", "template_", ",_", "pay", "ment", "\\u", "module_", ",_", "cart_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template_", "=_", "look", "up", "\\u", "template_", "(_", "pay", "ment", "\\u", "module_", ",_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "=_", "Request", "Context_", "(_", "request_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "form_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PAY", "MENT", "\\u", "LIVE", "'_", ":_", "gateway", "\\u", "live_", "(_", "pay", "ment", "\\u", "module_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render", "\\u", "to", "\\u", "response_", "(_", "template_", ",_", "context", "\\u", "instance_", "=_", "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_", "def_", "base", "\\u", "pay", "\\u", "ship", "\\u", "info_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "form", "\\u", "handler_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "=_", "pay", "\\u", "ship", "\\u", "info", "\\u", "verify_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "results_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "results_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "contact_", "=_", "results_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "working", "\\u", "cart_", "=_", "results_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "form", "\\u", "handler_", "(_", "request_", ",_", "contact_", ",_", "working", "\\u", "cart_", ",_", "pay", "ment", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "results_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "results_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "results_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pay", "\\u", "ship", "\\u", "render", "\\u", "form_", "(_", "request_", ",_", "form_", ",_", "template_", ",_", "pay", "ment", "\\u", "module_", ",_", "working", "\\u", "cart_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "credit", "\\u", "pay", "\\u", "ship", "\\u", "info_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "template_", "=_", "'", "shop", "/", "check", "out", "/", "pay", "\\u", "ship", ".", "html", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "pay", "\\u", "ship", " ", "view", " ", "whi", "ch", " ", "use", "s", " ", "a", " ", "credit", " ", "card", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "base", "\\u", "pay", "\\u", "ship", "\\u", "info_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "credit", "\\u", "pay", "\\u", "ship", "\\u", "process", "\\u", "form_", ",_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "simple", "\\u", "pay", "\\u", "ship", "\\u", "info_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "pay", "\\u", "ship", " ", "view", " ", "whi", "ch", " ", "doe", "sn", "'", "t", " ", "require", " ", "a", " ", "credit", " ", "card", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "base", "\\u", "pay", "\\u", "ship", "\\u", "info_", "(_", "request_", ",_", "pay", "ment", "\\u", "module_", ",_", "simple", "\\u", "pay", "\\u", "ship", "\\u", "process", "\\u", "form_", ",_", "template_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
F-Secure/see/doc/conf.py
[ { "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# Sandboxed Execution Environment documentation build configuration file, created by\n# sphinx-quickstart on Fri Sep 25 15:07:57 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\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n 'sphinx.ext.autodoc',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'Sandboxed Execution Environment'\ncopyright = '2015, F-Secure Corporation'\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#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_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\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'SandboxedExecutionEnvironmentdoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n ('index', 'SandboxedExecutionEnvironment.tex', 'Sandboxed Execution Environment Documentation',\n 'F-Secure Corporation', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n ('index', 'sandboxedexecutionenvironment', 'Sandboxed Execution Environment Documentation',\n ['F-Secure Corporation'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n ('index', 'SandboxedExecutionEnvironment', 'Sandboxed Execution Environment Documentation',\n 'F-Secure Corporation', 'SandboxedExecutionEnvironment', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 10 }, { "span": "import os", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 9 } ]
[]
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_", "#", " ", "Sandbox", "ed", " ", "Execut", "ion", " ", "Environ", "ment", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Fri", " ", "Se", "p", " ", "25", " ", "15", ":", "0", "7", ":", "5", "7", " ", "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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "'", "Sandbox", "ed", " ", "Execut", "ion", " ", "Environ", "ment", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "'", "201", "5", ",", " ", "F", "-", "Secur", "e", " ", "Cor", "porat", "ion", "'_", "\\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_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "'\\u", "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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "robots", ".", "txt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "hta", "ccess", ")", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "se", " ", "files", " ", "are", " ", "copied_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", "ly", " ", "to", " ", "the", " ", "root", " ", "of", " ", "the", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "extra", "\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "Sandbox", "ed", "Execut", "ion", "Environ", "ment", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "points", "ize", "':", " ", "'", "10", "pt", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "preamble", "':", " ", "''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Sandbox", "ed", "Execut", "ion", "Environ", "ment", ".", "tex", "'_", ",_", "'", "Sandbox", "ed", " ", "Execut", "ion", " ", "Environ", "ment", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "F", "-", "Secur", "e", " ", "Cor", "porat", "ion", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "sand", "box", "ede", "xec", "uti", "one", "nvir", "on", "ment", "'_", ",_", "'", "Sandbox", "ed", " ", "Execut", "ion", " ", "Environ", "ment", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "F", "-", "Secur", "e", " ", "Cor", "porat", "ion", "'_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "Sandbox", "ed", "Execut", "ion", "Environ", "ment", "'_", ",_", "'", "Sandbox", "ed", " ", "Execut", "ion", " ", "Environ", "ment", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "F", "-", "Secur", "e", " ", "Cor", "porat", "ion", "'_", ",_", "'", "Sandbox", "ed", "Execut", "ion", "Environ", "ment", "'_", ",_", "'", "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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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 ]
Unused import
mozilla/inventory/vendor-local/src/django-extensions/build/lib/django_extensions/tests/__init__.py
[ { "content": "from django.db import models\nfrom django_extensions.tests.test_dumpscript import DumpScriptTests\nfrom django_extensions.tests.utils import UTILS_TRUNCATE_LETTERS_TESTS\nfrom django_extensions.tests.utils import UTILS_UUID_TESTS\nfrom django_extensions.tests.json_field import JsonFieldTest\nfrom django_extensions.tests.uuid_field import UUIDFieldTest\ntry:\n from django_extensions.tests.encrypted_fields import EncryptedFieldsTestCase\n from django_extensions.tests.models import Secret\nexcept ImportError:\n pass\n\n__test__ = {\n 'UTILS_TRUNCATE_LETTERS_TESTS': UTILS_TRUNCATE_LETTERS_TESTS,\n 'UTILS_UUID_TESTS': UTILS_UUID_TESTS,\n}\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.db import models", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 28 }, { "span": "from django_extensions.tests.test_dumpscript import DumpScriptTests", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 67 }, { "span": "from django_extensions.tests.json_field import JsonFieldTest", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 60 }, { "span": "from django_extensions.tests.uuid_field import UUIDFieldTest", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 60 }, { "span": "from django_extensions.tests.encrypted_fields import EncryptedFieldsTestCase", "start_line": 7, "start_column": 4, "end_line": 7, "end_column": 80 }, { "span": "from django_extensions.tests.models import Secret", "start_line": 8, "start_column": 4, "end_line": 8, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "test\\u", "dump", "script_", "import_", "Dump", "Script", "Tests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "utils_", "import_", "UTIL", "S", "\\u", "TRUN", "CATE", "\\u", "LETTER", "S", "\\u", "TESTS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "utils_", "import_", "UTIL", "S", "\\u", "UU", "ID", "\\u", "TESTS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "json", "\\u", "field_", "import_", "Js", "on", "Field", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "uuid", "\\u", "field_", "import_", "UU", "IDF", "iel", "d", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "encrypt", "ed", "\\u", "fields_", "import_", "Encrypt", "ed", "Field", "s", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django", "\\u", "extensions_", "._", "tests_", "._", "models_", "import_", "Secret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "test\\u", "\\u_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "UTIL", "S", "\\u", "TRUN", "CATE", "\\u", "LETTER", "S", "\\u", "TESTS", "'_", ":_", "UTIL", "S", "\\u", "TRUN", "CATE", "\\u", "LETTER", "S", "\\u", "TESTS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "UTIL", "S", "\\u", "UU", "ID", "\\u", "TESTS", "'_", ":_", "UTIL", "S", "\\u", "UU", "ID", "\\u", "TESTS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
networkx/networkx/networkx/generators/stochastic.py
[ { "content": "# Copyright (C) 2010-2013 by\n# Aric Hagberg <hagberg@lanl.gov>\n# Dan Schult <dschult@colgate.edu>\n# Pieter Swart <swart@lanl.gov>\n# All rights reserved.\n# BSD license.\n\"\"\"Functions for generating stochastic graphs from a given weighted directed\ngraph.\n\n\"\"\"\nfrom __future__ import division\n\nfrom functools import partial\n\nfrom networkx.classes import DiGraph\nfrom networkx.classes import MultiDiGraph\nfrom networkx.utils import not_implemented_for\n\n__author__ = \"Aric Hagberg <aric.hagberg@gmail.com>\"\n__all__ = ['stochastic_graph']\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@not_implemented_for('undirected')\ndef stochastic_graph(G, copy=True, weight='weight'):\n \"\"\"Returns a right-stochastic representation of directed graph `G`.\n\n A right-stochastic graph is a weighted digraph in which for each\n node, the sum of the weights of all the out-edges of that node is\n 1. If the graph is already weighted (for example, via a 'weight'\n edge attribute), the reweighting takes that into account.\n\n Parameters\n ----------\n G : directed graph\n A :class:`~networkx.DiGraph` or :class:`~networkx.MultiDiGraph`.\n\n copy : boolean, optional\n If this is True, then this function returns a new graph with\n the stochastic reweighting. Otherwise, the original graph is\n modified in-place (and also returned, for convenience).\n\n weight : edge attribute key (optional, default='weight')\n Edge attribute key used for reading the existing weight and\n setting the new weight. If no attribute with this key is found\n for an edge, then the edge weight is assumed to be 1. If an edge\n has a weight, it must be a a positive number.\n\n \"\"\"\n if copy:\n G = MultiDiGraph(G) if G.is_multigraph() else DiGraph(G)\n # There is a tradeoff here: the dictionary of node degrees may\n # require a lot of memory, whereas making a call to `G.out_degree`\n # inside the loop may be costly in computation time.\n degree = dict(G.out_degree(weight=weight))\n for u, v, d in G.edges(data=True):\n if degree[u] == 0:\n d[weight] = 0\n else:\n d[weight] = d.get(weight, 1) / degree[u]\n return G", "metadata": "root.stochastic_graph", "header": "['module', '___EOS___']", "index": 22 } ]
[ { "span": "from functools import partial", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", " ", " ", " ", "Copy", "right", " ", "(", "C", ")", " ", "2010", "-", "2013", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Ari", "c", " ", "Ha", "gb", "erg", " ", "<", "ha", "gb", "erg", "@", "lan", "l", ".", "gov", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Dan", " ", "Sch", "ult", " ", "<", "dsc", "hu", "lt", "@", "col", "gate", ".", "edu", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Pie", "ter", " ", "Swa", "rt", " ", "<", "swa", "rt", "@", "lan", "l", ".", "gov", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "BS", "D", " ", "license", "._", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Function", "s", " ", "for", " ", "generat", "ing", " ", "stochastic", " ", "graph", "s", " ", "from", " ", "a", " ", "give", "n", " ", "weight", "ed", " ", "direct", "ed", "\\", "10", ";", "graph", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "networkx_", "._", "classes_", "import_", "Di", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "networkx_", "._", "classes_", "import_", "Multi", "Di", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "networkx_", "._", "utils_", "import_", "not", "\\u", "implemented", "\\u", "for_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "\"", "Ari", "c", " ", "Ha", "gb", "erg", " ", "<", "ari", "c", ".", "ha", "gb", "erg", "@", "gma", "il", ".", "com", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "stochastic", "\\u", "graph", "'_", "]_", "\\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_", "@_", "not", "\\u", "implemented", "\\u", "for_", "(_", "'", "undi", "rect", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "stochastic", "\\u", "graph_", "(_", "G_", ",_", "copy_", "=_", "True_", ",_", "weight_", "=_", "'", "weight", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "a", " ", "right", "-", "stochastic", " ", "represent", "ation", " ", "of", " ", "direct", "ed", " ", "graph", " ", "`", "G", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "right", "-", "stochastic", " ", "graph", " ", "is", " ", "a", " ", "weight", "ed", " ", "digraph", " ", "in", " ", "whi", "ch", " ", "for", " ", "each", "\\", "10", ";", " ", " ", " ", " ", "node", ",", " ", "the", " ", "sum", " ", "of", " ", "the", " ", "weight", "s", " ", "of", " ", "all", " ", "the", " ", "out", "-", "edge", "s", " ", "of", " ", "tha", "t", " ", "node", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "1", ".", " ", "If", " ", "the", " ", "graph", " ", "is", " ", "alr", "ead", "y", " ", "weight", "ed", " ", "(", "for", " ", "example", ",", " ", "via", " ", "a", " ", "'", "weight", "'", "\\", "10", ";", " ", " ", " ", " ", "edge", " ", "attribute", "),", " ", "the", " ", "rew", "eight", "ing", " ", "take", "s", " ", "tha", "t", " ", "int", "o", " ", "account", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "G", " ", ":", " ", "direct", "ed", " ", "graph", "\\", "10", ";", " ", " ", " ", " ", "A", " ", ":", "class", ":`", "~", "networkx", ".", "Di", "Graph", "`", " ", "or", " ", ":", "class", ":`", "~", "networkx", ".", "Multi", "Di", "Graph", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "copy", " ", ":", " ", "boolean", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "this", " ", "is", " ", "Tru", "e", ",", " ", "then", " ", "this", " ", "function", " ", "return", "s", " ", "a", " ", "new", " ", "graph", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "stochastic", " ", "rew", "eight", "ing", ".", " ", "Ot", "her", "wis", "e", ",", " ", "the", " ", "original", " ", "graph", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "modifi", "ed", " ", "in", "-", "place", " ", "(", "and", " ", "als", "o", " ", "return", "ed", ",", " ", "for", " ", "convenien", "ce", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "weight", " ", ":", " ", "edge", " ", "attribute", " ", "key", " ", "(", "option", "al", ",", " ", "default", "='", "weight", "')", "\\", "10", ";", " ", " ", " ", " ", "Ed", "ge", " ", "attribute", " ", "key", " ", "used", " ", "for", " ", "readi", "ng", " ", "the", " ", "exist", "ing", " ", "weight", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "setti", "ng", " ", "the", " ", "new", " ", "weight", ".", " ", " ", "If", " ", "no", " ", "attribute", " ", "with", " ", "this", " ", "key", " ", "is", " ", "found", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "an", " ", "edge", ",", " ", "then", " ", "the", " ", "edge", " ", "weight", " ", "is", " ", "assume", "d", " ", "to", " ", "be", " ", "1", ".", " ", "If", " ", "an", " ", "edge", "\\", "10", ";", " ", " ", " ", " ", "has", " ", "a", " ", "weight", ",", " ", "it", " ", "must", " ", "be", " ", "a", " ", "a", " ", "posit", "ive", " ", "number", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "copy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "G_", "=_", "Multi", "Di", "Graph_", "(_", "G_", ")_", "if_", "G_", "._", "is", "\\u", "multi", "graph_", "(_", ")_", "else_", "Di", "Graph_", "(_", "G_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "There", " ", "is", " ", "a", " ", "trade", "off", " ", "here", ":", " ", "the", " ", "dictionar", "y", " ", "of", " ", "node", " ", "degr", "ees", " ", "may", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "require", " ", "a", " ", "lot", " ", "of", " ", "memory", ",", " ", "where", "as", " ", "mak", "ing", " ", "a", " ", "call", " ", "to", " ", "`", "G", ".", "out", "\\u", "degr", "ee", "`_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "insi", "de", " ", "the", " ", "loop", " ", "may", " ", "be", " ", "cost", "ly", " ", "in", " ", "computation", " ", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "degree_", "=_", "dict_", "(_", "G_", "._", "out", "\\u", "degree_", "(_", "weight_", "=_", "weight_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "u_", ",_", "v_", ",_", "d_", "in_", "G_", "._", "edges_", "(_", "data_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "degree_", "[_", "u_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "[_", "weight_", "]_", "=_", "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 ", " _", "d_", "[_", "weight_", "]_", "=_", "d_", "._", "get_", "(_", "weight_", ",_", "1_", ")_", "/_", "degree_", "[_", "u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "G_" ]
[ 4, 4, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
SUSE/azurectl/test/unit/defaults_test.py
[ { "content": "\nfrom mock import patch\n\nfrom test_helper import *\nimport mock\n\nfrom azurectl.azurectl_exceptions import *\nfrom azurectl.defaults import Defaults\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestDefaults:\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestDefaults", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def __set_account_type_docopts(self):\n self.account_type_docopts = {\n '--locally-redundant': False,\n '--zone-redundant': False,\n '--geo-redundant': False,\n '--read-access-geo-redundant': False\n }", "metadata": "root.TestDefaults.__set_account_type_docopts", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 11 }, { "content": " def __host_caching_docopts(self, selection=None):\n docopts = {\n '--no-cache': False,\n '--read-only-cache': False,\n '--read-write-cache': False\n }\n if selection:\n docopts[selection] = True\n return docopts", "metadata": "root.TestDefaults.__host_caching_docopts", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 19 }, { "content": " def test_get_azure_domain(self):\n assert Defaults.get_azure_domain('West US') == 'cloudapp.net'", "metadata": "root.TestDefaults.test_get_azure_domain", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 29 }, { "content": " @raises(AzureDomainLookupError)\n def test_get_azure_domain_raises(self):\n Defaults.get_azure_domain('region-does-not-exist')", "metadata": "root.TestDefaults.test_get_azure_domain_raises", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 32 }, { "content": " def test_set_attribute(self):\n class X:\n def __init__(self):\n self.name = 'value'\n instance = X()\n Defaults.set_attribute(instance, 'name', 'foo')\n assert instance.name == 'foo'", "metadata": "root.TestDefaults.test_set_attribute", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 36 }, { "content": " def test_get_attribute(self):\n class X:\n def __init__(self):\n self.name = 'value'\n instance = X()\n Defaults.get_attribute(instance, 'name')\n assert instance.name == 'value'", "metadata": "root.TestDefaults.test_get_attribute", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 44 }, { "content": " def test_account_type_for_docopts(self):\n self.__set_account_type_docopts()\n self.account_type_docopts['--locally-redundant'] = True\n result = Defaults.account_type_for_docopts(self.account_type_docopts)\n assert result == 'Standard_LRS'\n\n self.__set_account_type_docopts()\n self.account_type_docopts['--zone-redundant'] = True\n result = Defaults.account_type_for_docopts(self.account_type_docopts)\n assert result == 'Standard_ZRS'\n\n self.__set_account_type_docopts()\n self.account_type_docopts['--geo-redundant'] = True\n result = Defaults.account_type_for_docopts(self.account_type_docopts)\n assert result == 'Standard_GRS'\n\n self.__set_account_type_docopts()\n self.account_type_docopts['--read-access-geo-redundant'] = True\n result = Defaults.account_type_for_docopts(self.account_type_docopts)\n assert result == 'Standard_RAGRS'", "metadata": "root.TestDefaults.test_account_type_for_docopts", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 52 }, { "content": " def test_default_account_type_for_docopts(self):\n self.__set_account_type_docopts()\n result = Defaults.account_type_for_docopts(self.account_type_docopts)\n assert result == 'Standard_GRS'", "metadata": "root.TestDefaults.test_default_account_type_for_docopts", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 73 }, { "content": " def test_docopt_for_account_type(self):\n result = Defaults.docopt_for_account_type('Standard_LRS')\n assert result == '--locally-redundant'\n\n result = Defaults.docopt_for_account_type('Standard_ZRS')\n assert result == '--zone-redundant'\n\n result = Defaults.docopt_for_account_type('Standard_GRS')\n assert result == '--geo-redundant'\n\n result = Defaults.docopt_for_account_type('Standard_RAGRS')\n assert result == '--read-access-geo-redundant'", "metadata": "root.TestDefaults.test_docopt_for_account_type", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 78 }, { "content": " def test_host_caching_for_docopts(self):\n # No cache\n host_caching_docopts = self.__host_caching_docopts('--no-cache')\n assert Defaults.host_caching_for_docopts(host_caching_docopts) == 'None'\n # read-only cache\n host_caching_docopts = self.__host_caching_docopts('--read-only-cache')\n assert Defaults.host_caching_for_docopts(host_caching_docopts) == \\\n 'ReadOnly'\n\n # read-write cache\n host_caching_docopts = self.__host_caching_docopts('--read-write-cache')\n assert Defaults.host_caching_for_docopts(host_caching_docopts) == \\\n 'ReadWrite'", "metadata": "root.TestDefaults.test_host_caching_for_docopts", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 91 }, { "content": " def test_default_host_caching_for_docopts(self):\n host_caching_docopts = self.__host_caching_docopts()\n assert Defaults.host_caching_for_docopts(host_caching_docopts) == \\\n 'ReadOnly'", "metadata": "root.TestDefaults.test_default_host_caching_for_docopts", "header": "['class', 'TestDefaults', ':', '___EOS___']", "index": 105 } ]
[ { "span": "from mock import patch", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 22 }, { "span": "import mock", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mock_", "import_", "patch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "test\\u", "helper_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "azu", "rect", "l_", "._", "azu", "rect", "l\\u", "exceptions_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "azu", "rect", "l_", "._", "defaults_", "import_", "Defaults_", "\\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", "Defaults_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "set\\u", "account", "\\u", "type", "\\u", "doc", "opts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "local", "ly", "-", "redundant", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "zone", "-", "redundant", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "geo", "-", "redundant", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "read", "-", "access", "-", "geo", "-", "redundant", "'_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "host", "\\u", "caching", "\\u", "doc", "opts_", "(_", "self_", ",_", "selection_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc", "opts_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "no", "-", "cache", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "read", "-", "only", "-", "cache", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "read", "-", "write", "-", "cache", "'_", ":_", "False_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "selection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc", "opts_", "[_", "selection_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "doc", "opts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "azu", "re", "\\u", "domain_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "Defaults_", "._", "get", "\\u", "azu", "re", "\\u", "domain_", "(_", "'", "West", " ", "US", "'_", ")_", "==_", "'", "cloud", "app", ".", "net", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Az", "ure", "Doma", "in", "Look", "up", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "azu", "re", "\\u", "domain", "\\u", "raises_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Defaults_", "._", "get", "\\u", "azu", "re", "\\u", "domain_", "(_", "'", "region", "-", "doe", "s", "-", "not", "-", "exist", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "set\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "X_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "'", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance_", "=_", "X_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Defaults_", "._", "set\\u", "attribute_", "(_", "instance_", ",_", "'", "name", "'_", ",_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "instance_", "._", "name_", "==_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "X_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "'", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "instance_", "=_", "X_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Defaults_", "._", "get", "\\u", "attribute_", "(_", "instance_", ",_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "instance_", "._", "name_", "==_", "'", "value", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "set\\u", "account", "\\u", "type", "\\u", "doc", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", "[_", "'--", "local", "ly", "-", "redundant", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'", "Standard", "\\u", "LR", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "set\\u", "account", "\\u", "type", "\\u", "doc", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", "[_", "'--", "zone", "-", "redundant", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'", "Standard", "\\u", "ZR", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "set\\u", "account", "\\u", "type", "\\u", "doc", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", "[_", "'--", "geo", "-", "redundant", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'", "Standard", "\\u", "GR", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "set\\u", "account", "\\u", "type", "\\u", "doc", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", "[_", "'--", "read", "-", "access", "-", "geo", "-", "redundant", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'", "Standard", "\\u", "RA", "GR", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "default", "\\u", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "set\\u", "account", "\\u", "type", "\\u", "doc", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "account", "\\u", "type", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", "._", "account", "\\u", "type", "\\u", "doc", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'", "Standard", "\\u", "GR", "S", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "doc", "opt", "\\u", "for", "\\u", "account", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "Defaults_", "._", "doc", "opt", "\\u", "for", "\\u", "account", "\\u", "type_", "(_", "'", "Standard", "\\u", "LR", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'--", "local", "ly", "-", "redundant", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "doc", "opt", "\\u", "for", "\\u", "account", "\\u", "type_", "(_", "'", "Standard", "\\u", "ZR", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'--", "zone", "-", "redundant", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "doc", "opt", "\\u", "for", "\\u", "account", "\\u", "type_", "(_", "'", "Standard", "\\u", "GR", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'--", "geo", "-", "redundant", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "Defaults_", "._", "doc", "opt", "\\u", "for", "\\u", "account", "\\u", "type_", "(_", "'", "Standard", "\\u", "RA", "GR", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "'--", "read", "-", "access", "-", "geo", "-", "redundant", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "host", "\\u", "caching", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "caching", "\\u", "doc", "opts_", "=_", "self_", "._", "\\u\\u", "host", "\\u", "caching", "\\u", "doc", "opts_", "(_", "'--", "no", "-", "cache", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "Defaults_", "._", "host", "\\u", "caching", "\\u", "for", "\\u", "doc", "opts_", "(_", "host", "\\u", "caching", "\\u", "doc", "opts_", ")_", "==_", "'", "Non", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "read", "-", "only", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "\\u", "doc", "opts_", "=_", "self_", "._", "\\u\\u", "host", "\\u", "caching", "\\u", "doc", "opts_", "(_", "'--", "read", "-", "only", "-", "cache", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "Defaults_", "._", "host", "\\u", "caching", "\\u", "for", "\\u", "doc", "opts_", "(_", "host", "\\u", "caching", "\\u", "doc", "opts_", ")_", "==_", "'", "Read", "On", "ly", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", "-", "write", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "\\u", "doc", "opts_", "=_", "self_", "._", "\\u\\u", "host", "\\u", "caching", "\\u", "doc", "opts_", "(_", "'--", "read", "-", "write", "-", "cache", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "Defaults_", "._", "host", "\\u", "caching", "\\u", "for", "\\u", "doc", "opts_", "(_", "host", "\\u", "caching", "\\u", "doc", "opts_", ")_", "==_", "'", "Read", "Write", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Defaults_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "default", "\\u", "host", "\\u", "caching", "\\u", "for", "\\u", "doc", "opts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "caching", "\\u", "doc", "opts_", "=_", "self_", "._", "\\u\\u", "host", "\\u", "caching", "\\u", "doc", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "Defaults_", "._", "host", "\\u", "caching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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
Narcolapser/python-o365/O365/message.py
[ { "content": "\tdef markAsRead(self):\n\t\t'''marks analogous message as read in the cloud.'''\n\t\tread = '{\"IsRead\":true}'\n\t\theaders = {'Content-type': 'application/json', 'Accept': 'application/json'}\n\t\ttry:\n\t\t\tresponse = requests.patch(self.update_url.format(self.json['Id']),read,headers=headers,auth=self.auth)\n\t\texcept:\n\t\t\treturn False\n\t\treturn True", "metadata": "root.Message.markAsRead", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 118 }, { "content": "\tdef getSenderName(self):\n\t\t'''try to get the name of the sender.'''\n\t\ttry:\n\t\t\treturn self.json['Sender']['EmailAddress']['Name']\n\t\texcept:\n\t\t\treturn ''", "metadata": "root.Message.getSenderName", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 137 }, { "content": "\tdef setBody(self,val):\n\t\t'''Sets the body content of the email.'''\n\t\tcont = False\n\n\t\twhile not cont:\n\t\t\ttry:\n\t\t\t\tself.json['Body']['Content'] = val\n\t\t\t\tself.json['Body']['ContentType'] = 'Text'\n\t\t\t\tcont = True\n\t\t\texcept:\n\t\t\t\tself.json['Body'] = {}", "metadata": "root.Message.setBody", "header": "['class', 'Message', '(', 'object', ')', ':', '___EOS___']", "index": 222 } ]
[ { "span": "except:", "start_line": 124, "start_column": 2, "end_line": 124, "end_column": 9 }, { "span": "except:", "start_line": 141, "start_column": 2, "end_line": 141, "end_column": 9 }, { "span": "except:", "start_line": 231, "start_column": 3, "end_line": 231, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mark", "As", "Read_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "'''", "mark", "s", " ", "analog", "ous", " ", "message", " ", "as", " ", "read", " ", "in", " ", "the", " ", "cloud", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "read_", "=_", "'{", "\"", "Is", "Read", "\":", "true", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "{_", "'", "Conten", "t", "-", "type", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", ",_", "'", "Accept", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "response_", "=_", "requests_", "._", "patch_", "(_", "self_", "._", "update", "\\u", "url_", "._", "format_", "(_", "self_", "._", "json_", "[_", "'", "Id", "'_", "]_", ")_", ",_", "read_", ",_", "headers_", "=_", "headers_", ",_", "auth_", "=_", "self_", "._", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Sen", "der", "Name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "'''", "try", " ", "to", " ", "get", " ", "the", " ", "name", " ", "of", " ", "the", " ", "sender", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "json_", "[_", "'", "Sen", "der", "'_", "]_", "[_", "'", "Ema", "il", "Address", "'_", "]_", "[_", "'", "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\t", "\t\t_", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Message_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Body_", "(_", "self_", ",_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "'''", "Set", "s", " ", "the", " ", "body", " ", "content", " ", "of", " ", "the", " ", "email", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cont_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "not_", "cont_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "json_", "[_", "'", "Bod", "y", "'_", "]_", "[_", "'", "Conten", "t", "'_", "]_", "=_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "json_", "[_", "'", "Bod", "y", "'_", "]_", "[_", "'", "Conten", "t", "Type", "'_", "]_", "=_", "'", "Text", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cont_", "=_", "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\t", "\t\t\t_", "self_", "._", "json_", "[_", "'", "Bod", "y", "'_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\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, 2, 2, 2 ]
Unused import
kislyuk/watchtower/watchtower/__init__.py
[ { "content": "from __future__ import absolute_import, division, print_function, unicode_literals\nfrom operator import itemgetter\nimport os, sys, json, logging, time, threading, warnings, collections\n\ntry:\n import Queue\nexcept ImportError:\n import queue as Queue\n\n# from eight import str, bytes, int\n\nimport boto3\nfrom botocore.exceptions import ClientError\n\nhandler_base_class = logging.Handler\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _idempotent_create(_callable, *args, **kwargs):\n try:\n _callable(*args, **kwargs)\n except ClientError as e:\n if e.response.get(\"Error\", {}).get(\"Code\") != \"ResourceAlreadyExistsException\":\n raise", "metadata": "root._idempotent_create", "header": "['module', '___EOS___']", "index": 16 }, { "content": "class PyCWLWarning(UserWarning):\n pass", "metadata": "root.PyCWLWarning", "header": "['module', '___EOS___']", "index": 23 }, { "content": "class CloudWatchLogHandler(handler_base_class):\n \"\"\"\n Create a new CloudWatch log handler object. This is the main entry point to the functionality of the module. See\n http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html for more information.\n\n :param log_group: Name of the CloudWatch log group to write logs to. By default, the name of this module is used.\n :type log_group: String\n :param stream_name:\n Name of the CloudWatch log stream to write logs to. By default, the name of the logger that processed the\n message is used.\n :type stream_name: String\n :param use_queues:\n If **True**, logs will be queued on a per-stream basis and sent in batches. To manage the queues, a queue\n handler thread will be spawned.\n :type queue: Boolean\n :param send_interval:\n Maximum time (in seconds, or a timedelta) to hold messages in queue before sending a batch.\n :type send_interval: Integer\n :param max_batch_size:\n Maximum size (in bytes) of the queue before sending a batch. From CloudWatch Logs documentation: **The maximum\n batch size is 1,048,576 bytes, and this size is calculated as the sum of all event messages in UTF-8, plus 26\n bytes for each log event.**\n :type max_batch_size: Integer\n :param max_batch_count:\n Maximum number of messages in the queue before sending a batch. From CloudWatch Logs documentation: **The\n maximum number of log events in a batch is 10,000.**\n :type max_batch_count: Integer\n :param boto3_session:\n Session object to create boto3 `logs` clients. Accepts AWS credential, profile_name, and region_name from its\n constructor.\n :type boto3_session: boto3.session.Session\n \"\"\"\n END = 1\n\n\n\n\n", "metadata": "root.CloudWatchLogHandler", "header": "['module', '___EOS___']", "index": 26 }, { "content": " def __init__(self, log_group=__name__, stream_name=None, use_queues=True, send_interval=60,\n max_batch_size=1024*1024, max_batch_count=10000, boto3_session=None, *args, **kwargs):\n handler_base_class.__init__(self, *args, **kwargs)\n self.log_group = log_group\n self.stream_name = stream_name\n self.use_queues = use_queues\n self.send_interval = send_interval\n self.max_batch_size = max_batch_size\n self.max_batch_count = max_batch_count\n self.queues, self.sequence_tokens = {}, {}\n self.threads = []\n self.shutting_down = False\n self.cwl_client = (boto3_session or boto3).client(\"logs\")\n _idempotent_create(self.cwl_client.create_log_group, logGroupName=self.log_group)", "metadata": "root.CloudWatchLogHandler.__init__", "header": "['class', 'CloudWatchLogHandler', '(', 'handler_base_class', ')', ':', '___EOS___']", "index": 60 }, { "content": " def _submit_batch(self, batch, stream_name):\n if len(batch) < 1:\n return\n sorted_batch = sorted(batch, key=itemgetter('timestamp'), reverse=False)\n kwargs = dict(logGroupName=self.log_group, logStreamName=stream_name,\n logEvents=sorted_batch)\n if self.sequence_tokens[stream_name] is not None:\n kwargs[\"sequenceToken\"] = self.sequence_tokens[stream_name]\n\n try:\n response = self.cwl_client.put_log_events(**kwargs)\n except ClientError as e:\n if e.response.get(\"Error\", {}).get(\"Code\") in (\"DataAlreadyAcceptedException\",\n \"InvalidSequenceTokenException\"):\n kwargs[\"sequenceToken\"] = e.response[\"Error\"][\"Message\"].rsplit(\" \", 1)[-1]\n response = self.cwl_client.put_log_events(**kwargs)\n else:\n raise\n\n if \"rejectedLogEventsInfo\" in response:\n # TODO: make this configurable/non-fatal\n raise Exception(\"Failed to deliver logs: {}\".format(response))", "metadata": "root.CloudWatchLogHandler._submit_batch", "header": "['class', 'CloudWatchLogHandler', '(', 'handler_base_class', ')', ':', '___EOS___']", "index": 75 }, { "content": " def emit(self, message):\n stream_name = self.stream_name\n if stream_name is None:\n stream_name = message.name\n if stream_name not in self.sequence_tokens:\n _idempotent_create(self.cwl_client.create_log_stream,\n logGroupName=self.log_group, logStreamName=stream_name)\n self.sequence_tokens[stream_name] = None\n\n msg = dict(timestamp=int(message.created * 1000), message=self.format(message))\n if isinstance(msg[\"message\"], collections.Mapping):\n msg[\"message\"] = json.dumps(msg[\"message\"])\n if self.use_queues:\n if stream_name not in self.queues:\n self.queues[stream_name] = Queue.Queue()\n thread = threading.Thread(target=self.batch_sender,\n args=(self.queues[stream_name], stream_name, self.send_interval,\n self.max_batch_size, self.max_batch_count))\n self.threads.append(thread)\n thread.daemon = True\n thread.start()\n if self.shutting_down:\n warnings.warn(\"Received message after logging system shutdown\", PyCWLWarning)\n else:\n self.queues[stream_name].put(msg)\n else:\n self._submit_batch([msg], stream_name)", "metadata": "root.CloudWatchLogHandler.emit", "header": "['class', 'CloudWatchLogHandler', '(', 'handler_base_class', ')', ':', '___EOS___']", "index": 98 }, { "content": " def batch_sender(self, my_queue, stream_name, send_interval, max_batch_size, max_batch_count):\n #thread_local = threading.local()\n msg = None\n def size(msg):\n return len(msg[\"message\"]) + 26\n\n # See https://boto3.readthedocs.org/en/latest/reference/services/logs.html#logs.Client.put_log_events\n while msg != self.END:\n cur_batch = [] if msg is None else [msg]\n cur_batch_size = sum(size(msg) for msg in cur_batch)\n cur_batch_msg_count = len(cur_batch)\n cur_batch_deadline = time.time() + send_interval\n while True:\n try:\n msg = my_queue.get(block=True, timeout=max(0, cur_batch_deadline-time.time()))\n except Queue.Empty:\n # If the queue is empty, we don't want to reprocess the previous message\n msg = None\n if msg is None \\\n or msg == self.END \\\n or cur_batch_size + size(msg) > max_batch_size \\\n or cur_batch_msg_count >= max_batch_count \\\n or time.time() >= cur_batch_deadline:\n self._submit_batch(cur_batch, stream_name)\n if msg is not None:\n # We don't want to call task_done if the queue was empty and we didn't receive anything new\n my_queue.task_done()\n break\n elif msg:\n cur_batch_size += size(msg)\n cur_batch_msg_count += 1\n cur_batch.append(msg)\n my_queue.task_done()", "metadata": "root.CloudWatchLogHandler.batch_sender", "header": "['class', 'CloudWatchLogHandler', '(', 'handler_base_class', ')', ':', '___EOS___']", "index": 126 }, { "content": " def flush(self):\n self.shutting_down = True\n for q in self.queues.values():\n q.put(self.END)\n for q in self.queues.values():\n q.join()", "metadata": "root.CloudWatchLogHandler.flush", "header": "['class', 'CloudWatchLogHandler', '(', 'handler_base_class', ')', ':', '___EOS___']", "index": 160 } ]
[ { "span": "import os, sys, json, logging, time, threading, warnings, collections", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 69 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", ",_", "division_", ",_", "print", "\\u", "function_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "operator_", "import_", "itemgetter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", ",_", "sys_", ",_", "json_", ",_", "logging_", ",_", "time_", ",_", "threading_", ",_", "warnings_", ",_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Queue_", "\\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_", "queue_", "as_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "eight", " ", "import", " ", "str", ",", " ", "bytes", ",", " ", "int_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "boto3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "._", "exceptions_", "import_", "Client", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "handler", "\\u", "base", "\\u", "class_", "=_", "logging_", "._", "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\\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_", "\\u", "idempotent", "\\u", "create_", "(_", "\\u", "callable_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "callable_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Client", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "response_", "._", "get_", "(_", "\"", "Error", "\"_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "\"", "Code", "\"_", ")_", "!=_", "\"", "Reso", "urc", "e", "Al", "read", "y", "Exist", "s", "Except", "ion", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Py", "CW", "LW", "arn", "ing_", "(_", "User", "Warning_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cloud", "Watch", "Log", "Handler_", "(_", "handler", "\\u", "base", "\\u", "class_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "new", " ", "Cloud", "Watch", " ", "log", " ", "handler", " ", "object", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "main", " ", "entry", " ", "point", " ", "to", " ", "the", " ", "functional", "it", "y", " ", "of", " ", "the", " ", "module", ".", " ", "See", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "docs", ".", "aws", ".", "amaz", "on", ".", "com", "/", "Ama", "zon", "Cloud", "Watch", "/", "late", "st", "/", "Dev", "elope", "r", "Guide", "/", "What", "Is", "Cloud", "Watch", "Log", "s", ".", "html", " ", "for", " ", "more", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "log", "\\u", "group", ":", " ", "Name", " ", "of", " ", "the", " ", "Cloud", "Watch", " ", "log", " ", "group", " ", "to", " ", "write", " ", "logs", " ", "to", ".", " ", "By", " ", "default", ",", " ", "the", " ", "name", " ", "of", " ", "this", " ", "module", " ", "is", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "log", "\\u", "group", ":", " ", "String", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "stream", "\\u", "name", ":", "\\", "10", ";", " ", " ", " ", " ", "Name", " ", "of", " ", "the", " ", "Cloud", "Watch", " ", "log", " ", "stream", " ", "to", " ", "write", " ", "logs", " ", "to", ".", " ", "By", " ", "default", ",", " ", "the", " ", "name", " ", "of", " ", "the", " ", "logg", "er", " ", "tha", "t", " ", "process", "ed", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "message", " ", "is", " ", "used", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "stream", "\\u", "name", ":", " ", "String", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "use", "\\u", "queue", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "**", "Tru", "e", "**", ",", " ", "logs", " ", "will", " ", "be", " ", "queue", "d", " ", "on", " ", "a", " ", "per", "-", "stream", " ", "basi", "s", " ", "and", " ", "sent", " ", "in", " ", "batche", "s", ".", " ", "To", " ", "manage", " ", "the", " ", "queue", "s", ",", " ", "a", " ", "queue", "\\", "10", ";", " ", " ", " ", " ", "handler", " ", "thread", " ", "will", " ", "be", " ", "spawne", "d", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "queue", ":", " ", "Boo", "lean", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "send", "\\u", "interval", ":", "\\", "10", ";", " ", " ", " ", " ", "Maxim", "um", " ", "time", " ", "(", "in", " ", "second", "s", ",", " ", "or", " ", "a", " ", "timedelta", ")", " ", "to", " ", "hold", " ", "message", "s", " ", "in", " ", "queue", " ", "bef", "ore", " ", "sendin", "g", " ", "a", " ", "batch", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "send", "\\u", "interval", ":", " ", "Integer", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "max", "\\u", "batch", "\\u", "size", ":", "\\", "10", ";", " ", " ", " ", " ", "Maxim", "um", " ", "size", " ", "(", "in", " ", "bytes", ")", " ", "of", " ", "the", " ", "queue", " ", "bef", "ore", " ", "sendin", "g", " ", "a", " ", "batch", ".", " ", "Fro", "m", " ", "Cloud", "Watch", " ", "Log", "s", " ", "documentation", ":", " ", "**", "The", " ", "maxim", "um", "\\", "10", ";", " ", " ", " ", " ", "batch", " ", "size", " ", "is", " ", "1", ",", "048", ",", "576", " ", "bytes", ",", " ", "and", " ", "this", " ", "size", " ", "is", " ", "calculated", " ", "as", " ", "the", " ", "sum", " ", "of", " ", "all", " ", "event", " ", "message", "s", " ", "in", " ", "UT", "F", "-", "8", ",", " ", "plus", " ", "2", "6", "\\", "10", ";", " ", " ", " ", " ", "bytes", " ", "for", " ", "each", " ", "log", " ", "event", ".*", "*", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "max", "\\u", "batch", "\\u", "size", ":", " ", "Integer", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "max", "\\u", "batch", "\\u", "count", ":", "\\", "10", ";", " ", " ", " ", " ", "Maxim", "um", " ", "number", " ", "of", " ", "message", "s", " ", "in", " ", "the", " ", "queue", " ", "bef", "ore", " ", "sendin", "g", " ", "a", " ", "batch", ".", " ", "Fro", "m", " ", "Cloud", "Watch", " ", "Log", "s", " ", "documentation", ":", " ", "**", "The", "\\", "10", ";", " ", " ", " ", " ", "maxim", "um", " ", "number", " ", "of", " ", "log", " ", "events", " ", "in", " ", "a", " ", "batch", " ", "is", " ", "10", ",", "000", ".*", "*", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "max", "\\u", "batch", "\\u", "count", ":", " ", "Integer", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "boto", "3", "\\u", "session", ":", "\\", "10", ";", " ", " ", " ", " ", "Sess", "ion", " ", "object", " ", "to", " ", "create", " ", "boto", "3", " ", "`", "logs", "`", " ", "clients", ".", " ", "Accept", "s", " ", "AW", "S", " ", "cred", "ential", ",", " ", "profile", "\\u", "name", ",", " ", "and", " ", "region", "\\u", "name", " ", "from", " ", "its", "\\", "10", ";", " ", " ", " ", " ", "construct", "or", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "boto", "3", "\\u", "session", ":", " ", "boto", "3", ".", "session", ".", "Sess", "ion", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "END_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Cloud", "Watch", "Log", "Handler_", "(_", "handler", "\\u", "base", "\\u", "class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "log", "\\u", "group_", "=_", "\\u\\u", "name\\u\\u_", ",_", "stream", "\\u", "name_", "=_", "None_", ",_", "use", "\\u", "queues_", "=_", "True_", ",_", "send", "\\u", "interval_", "=_", "60_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "batch", "\\u", "size_", "=_", "1024_", "*_", "1024_", ",_", "max", "\\u", "batch", "\\u", "count_", "=_", "10000_", ",_", "boto", "3", "\\u", "session_", "=_", "None_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler", "\\u", "base", "\\u", "class_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "\\u", "group_", "=_", "log", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stream", "\\u", "name_", "=_", "stream", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "use", "\\u", "queues_", "=_", "use", "\\u", "queues_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "send", "\\u", "interval_", "=_", "send", "\\u", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "batch", "\\u", "size_", "=_", "max", "\\u", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "\\u", "batch", "\\u", "count_", "=_", "max", "\\u", "batch", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "queues_", ",_", "self_", "._", "sequence", "\\u", "tokens_", "=_", "{_", "}_", ",_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "threads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shutt", "ing", "\\u", "down_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cw", "l\\u", "client_", "=_", "(_", "boto", "3", "\\u", "session_", "or_", "boto3_", ")_", "._", "client_", "(_", "\"", "logs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "idempotent", "\\u", "create_", "(_", "self_", "._", "cw", "l\\u", "client_", "._", "create", "\\u", "log", "\\u", "group_", ",_", "log", "Group", "Name_", "=_", "self_", "._", "log", "\\u", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cloud", "Watch", "Log", "Handler_", "(_", "handler", "\\u", "base", "\\u", "class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "submit", "\\u", "batch_", "(_", "self_", ",_", "batch_", ",_", "stream", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "batch_", ")_", "<_", "1_", ":_", "\\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_", "sorte", "d\\u", "batch_", "=_", "sorted_", "(_", "batch_", ",_", "key_", "=_", "itemgetter_", "(_", "'", "timestamp", "'_", ")_", ",_", "reverse_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "=_", "dict_", "(_", "log", "Group", "Name_", "=_", "self_", "._", "log", "\\u", "group_", ",_", "log", "Stream", "Name_", "=_", "stream", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "Events_", "=_", "sorte", "d\\u", "batch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "sequence", "\\u", "tokens_", "[_", "stream", "\\u", "name_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "\"", "sequence", "Token", "\"_", "]_", "=_", "self_", "._", "sequence", "\\u", "tokens_", "[_", "stream", "\\u", "name_", "]_", "\\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 ", " _", "response_", "=_", "self_", "._", "cw", "l\\u", "client_", "._", "put", "\\u", "log", "\\u", "events_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Client", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "response_", "._", "get_", "(_", "\"", "Error", "\"_", ",_", "{_", "}_", ")_", "._", "get_", "(_", "\"", "Code", "\"_", ")_", "in_", "(_", "\"", "Data", "Al", "read", "y", "Accept", "ed", "Except", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Inva", "lid", "Sequ", "ence", "Token", "Except", "ion", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "\"", "sequence", "Token", "\"_", "]_", "=_", "e_", "._", "response_", "[_", "\"", "Error", "\"_", "]_", "[_", "\"", "Messag", "e", "\"_", "]_", "._", "rsplit_", "(_", "\"", " ", "\"_", ",_", "1_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "cw", "l\\u", "client_", "._", "put", "\\u", "log", "\\u", "events_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "reject", "ed", "Log", "Event", "s", "Info", "\"_", "in_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "make", " ", "this", " ", "configurable", "/", "non", "-", "fatal_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Fail", "ed", " ", "to", " ", "deliver", " ", "logs", ":", " ", "{}\"_", "._", "format_", "(_", "response_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cloud", "Watch", "Log", "Handler_", "(_", "handler", "\\u", "base", "\\u", "class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit_", "(_", "self_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "name_", "=_", "self_", "._", "stream", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "stream", "\\u", "name_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "name_", "=_", "message_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "stream", "\\u", "name_", "not_", "in_", "self_", "._", "sequence", "\\u", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "idempotent", "\\u", "create_", "(_", "self_", "._", "cw", "l\\u", "client_", "._", "create", "\\u", "log", "\\u", "stream_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "Group", "Name_", "=_", "self_", "._", "log", "\\u", "group_", ",_", "log", "Stream", "Name_", "=_", "stream", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sequence", "\\u", "tokens_", "[_", "stream", "\\u", "name_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "dict_", "(_", "timestamp_", "=_", "int_", "(_", "message_", "._", "created_", "*_", "1000_", ")_", ",_", "message_", "=_", "self_", "._", "format_", "(_", "message_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "msg_", "[_", "\"", "message", "\"_", "]_", ",_", "collections_", "._", "Mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "[_", "\"", "message", "\"_", "]_", "=_", "json_", "._", "dumps_", "(_", "msg_", "[_", "\"", "message", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "use", "\\u", "queues_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "stream", "\\u", "name_", "not_", "in_", "self_", "._", "queues_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "queues_", "[_", "stream", "\\u", "name_", "]_", "=_", "Queue_", "._", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "batch", "\\u", "sender_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "(_", "self_", "._", "queues_", "[_", "stream", "\\u", "name_", "]_", ",_", "stream", "\\u", "name_", ",_", "self_", "._", "send", "\\u", "interval_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "max", "\\u", "batch", "\\u", "size_", ",_", "self_", "._", "max", "\\u", "batch", "\\u", "count_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "threads_", "._", "append_", "(_", "thread_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "daemon_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "shutt", "ing", "\\u", "down_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "Receive", "d", " ", "message", " ", "after", " ", "logg", "ing", " ", "system", " ", "shut", "down", "\"_", ",_", "Py", "CW", "LW", "arn", "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 ", " _", "self_", "._", "queues_", "[_", "stream", "\\u", "name_", "]_", "._", "put_", "(_", "msg_", ")_", "\\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", "submit", "\\u", "batch_", "(_", "[_", "msg_", "]_", ",_", "stream", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cloud", "Watch", "Log", "Handler_", "(_", "handler", "\\u", "base", "\\u", "class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "batch", "\\u", "sender_", "(_", "self_", ",_", "my", "\\u", "queue_", ",_", "stream", "\\u", "name_", ",_", "send", "\\u", "interval_", ",_", "max", "\\u", "batch", "\\u", "size_", ",_", "max", "\\u", "batch", "\\u", "count_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "thread", "\\u", "local", " ", "=", " ", "thread", "ing", ".", "local", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "size_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "msg_", "[_", "\"", "message", "\"_", "]_", ")_", "+_", "26_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "https", "://", "boto", "3", ".", "read", "the", "docs", ".", "org", "/", "en", "/", "late", "st", "/", "reference", "/", "service", "s", "/", "logs", ".", "html", "#", "logs", ".", "Client", ".", "put", "\\u", "log", "\\u", "events_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "msg_", "!=_", "self_", "._", "END_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur", "\\u", "batch_", "=_", "[_", "]_", "if_", "msg_", "is_", "None_", "else_", "[_", "msg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "\\u", "batch", "\\u", "size_", "=_", "sum_", "(_", "size_", "(_", "msg_", ")_", "for_", "msg_", "in_", "cur", "\\u", "batch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "\\u", "batch", "\\u", "msg", "\\u", "count_", "=_", "len_", "(_", "cur", "\\u", "batch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "\\u", "batch", "\\u", "deadline_", "=_", "time_", "._", "time_", "(_", ")_", "+_", "send", "\\u", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "msg_", "=_", "my", "\\u", "queue_", "._", "get_", "(_", "block_", "=_", "True_", ",_", "timeout_", "=_", "max_", "(_", "0_", ",_", "cur", "\\u", "batch", "\\u", "deadline_", "-_", "time_", "._", "time_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Queue_", "._", "Empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "queue", " ", "is", " ", "empty", ",", " ", "we", " ", "don", "'", "t", " ", "want", " ", "to", " ", "repro", "cess", " ", "the", " ", "previ", "ous", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "msg_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "msg_", "is_", "None_", "or_", "msg_", "==_", "self_", "._", "END_", "or_", "cur", "\\u", "batch", "\\u", "size_", "+_", "size_", "(_", "msg_", ")_", ">_", "max", "\\u", "batch", "\\u", "size_", "or_", "cur", "\\u", "batch", "\\u", "msg", "\\u", "count_", ">=_", "max", "\\u", "batch", "\\u", "count_", "or_", "time_", "._", "time_", "(_", ")_", ">=_", "cur", "\\u", "batch", "\\u", "deadline_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "submit", "\\u", "batch_", "(_", "cur", "\\u", "batch_", ",_", "stream", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "msg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "want", " ", "to", " ", "call", " ", "task", "\\u", "don", "e", " ", "if", " ", "the", " ", "queue", " ", "was", " ", "empty", " ", "and", " ", "we", " ", "did", "n", "'", "t", " ", "receive", " ", "anyt", "hing", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "my", "\\u", "queue_", "._", "task", "\\u", "done_", "(_", ")_", "\\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_", "elif_", "msg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cur", "\\u", "batch", "\\u", "size_", "+=_", "size_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "\\u", "batch", "\\u", "msg", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "\\u", "batch_", "._", "append_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "\\u", "queue_", "._", "task", "\\u", "done_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cloud", "Watch", "Log", "Handler_", "(_", "handler", "\\u", "base", "\\u", "class_", ")_", ":_", "\\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_", "flush_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "shutt", "ing", "\\u", "down_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "q_", "in_", "self_", "._", "queues_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLIN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 2, 2, 2, 2 ]
Unreachable code
globocom/database-as-a-service/dbaas/workflow/steps/mysql/deploy/create_secondary_ip.py
[ { "content": " def do(self, workflow_dict):\n try:\n if 'hosts' not in workflow_dict:\n return False\n\n if len(workflow_dict['hosts']) == 1:\n return True\n\n cs_credentials = get_credentials_for(\n environment=workflow_dict['environment'],\n credential_type=CredentialType.CLOUDSTACK)\n\n LOG.info(\"Get credential fot network api...\")\n networkapi_credentials = get_credentials_for(\n environment=workflow_dict['environment'],\n credential_type=CredentialType.NETWORKAPI)\n\n cs_provider = CloudStackProvider(credentials=cs_credentials,\n networkapi_credentials=networkapi_credentials)\n if not cs_provider:\n raise Exception(\"Could not create CloudStackProvider object\")\n return False\n\n workflow_dict['databaseinfraattr'] = []\n\n networkapi_equipment_id = cs_provider.register_networkapi_equipment(\n equipment_name=workflow_dict['names']['infra'])\n if not networkapi_equipment_id:\n raise Exception(\"Could not register networkapi equipment\")\n return False\n\n workflow_dict['networkapi_equipment_id'] = networkapi_equipment_id\n\n for host in workflow_dict['hosts']:\n LOG.info(\"Creating Secondary ips...\")\n\n host_attr = HostAttr.objects.get(host=host)\n\n reserved_ip = cs_provider.reserve_ip(\n project_id=cs_credentials.project,\n vm_id=host_attr.vm_id)\n\n if not reserved_ip:\n return False\n\n total = DatabaseInfraAttr.objects.filter(\n databaseinfra=workflow_dict['databaseinfra']).count()\n\n databaseinfraattr = DatabaseInfraAttr()\n\n databaseinfraattr.ip = reserved_ip['secondary_ip']\n\n if total == 0:\n databaseinfraattr.is_write = True\n\n LOG.info(\"Updating databaseinfra endpoint...\")\n\n databaseinfra = workflow_dict['databaseinfra']\n databaseinfra.endpoint = databaseinfraattr.ip + \\\n \":%i\" % 3306\n databaseinfra.save()\n\n workflow_dict['databaseinfra'] = databaseinfra\n\n ip_desc = 'Write IP'\n\n else:\n databaseinfraattr.is_write = False\n ip_desc = 'Read IP'\n\n networkapi_ip_id = cs_provider.register_networkapi_ip(equipment_id=networkapi_equipment_id,\n ip=reserved_ip[\n 'secondary_ip'],\n ip_desc=ip_desc)\n\n databaseinfraattr.cs_ip_id = reserved_ip['cs_ip_id']\n databaseinfraattr.networkapi_equipment_id = networkapi_equipment_id\n databaseinfraattr.networkapi_ip_id = networkapi_ip_id\n databaseinfraattr.databaseinfra = workflow_dict[\n 'databaseinfra']\n databaseinfraattr.save()\n\n workflow_dict['databaseinfraattr'].append(databaseinfraattr)\n\n return True\n except Exception:\n traceback = full_stack()\n\n workflow_dict['exceptions']['error_codes'].append(DBAAS_0010)\n workflow_dict['exceptions']['traceback'].append(traceback)\n\n return False", "metadata": "root.CreateSecondaryIp.do", "header": "['class', 'CreateSecondaryIp', '(', 'BaseStep', ')', ':', '___EOS___']", "index": 19 } ]
[ { "span": "return False", "start_line": 40, "start_column": 16, "end_line": 40, "end_column": 28 }, { "span": "return False", "start_line": 48, "start_column": 16, "end_line": 48, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Creat", "e", "Second", "ary", "Ip_", "(_", "Base", "Step_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do_", "(_", "self_", ",_", "workf", "low", "\\u", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "host", "s", "'_", "not_", "in_", "workf", "low", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "workf", "low", "\\u", "dict_", "[_", "'", "host", "s", "'_", "]_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cs", "\\u", "credentials_", "=_", "get", "\\u", "cred", "ential", "s", "\\u", "for_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "environment_", "=_", "workf", "low", "\\u", "dict_", "[_", "'", "environ", "ment", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cred", "ential", "\\u", "type_", "=_", "Cred", "ential", "Type_", "._", "CLOUD", "STACK", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOG_", "._", "info_", "(_", "\"", "Get", " ", "cred", "ential", " ", "fot", " ", "network", " ", "api", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "network", "api", "\\u", "credentials_", "=_", "get", "\\u", "cred", "ential", "s", "\\u", "for_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "environment_", "=_", "workf", "low", "\\u", "dict_", "[_", "'", "environ", "ment", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cred", "ential", "\\u", "type_", "=_", "Cred", "ential", "Type_", "._", "NET", "WORK", "API_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cs", "\\u", "provider_", "=_", "Cloud", "Stack", "Provider_", "(_", "credentials_", "=_", "cs", "\\u", "credentials_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "network", "api", "\\u", "credentials_", "=_", "network", "api", "\\u", "credentials_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "cs", "\\u", "provider_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Cou", "ld", " ", "not", " ", "create", " ", "Cloud", "Stack", "Provider", " ", "object", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "workf", "low", "\\u", "dict_", "[_", "'", "databa", "sei", "nfra", "attr", "'_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "network", "api", "\\u", "equipment", "\\u", "id_", "=_", "cs", "\\u", "provider_", "._", "register", "\\u", "network", "api", "\\u", "equipment", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "equipment", "\\u", "name_", "=_", "workf", "low", "\\u", "dict_", "[_", "'", "names", "'_", "]_", "[_", "'", "infra", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "network", "api", "\\u", "equipment", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Cou", "ld", " ", "not", " ", "register", " ", "network", "api", " ", "equipment", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "workf", "low", "\\u", "dict_", "[_", "'", "network", "api", "\\u", "equipment", "\\u", "id", "'_", "]_", "=_", "network", "api", "\\u", "equipment", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "host_", "in_", "workf", "low", "\\u", "dict_", "[_", "'", "host", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "LOG_", "._", "info_", "(_", "\"", "Creat", "ing", " ", "Second", "ary", " ", "ips", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "attr_", "=_", "Host", "Attr_", "._", "objects_", "._", "get_", "(_", "host_", "=_", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reserve", "d\\u", "ip_", "=_", "cs", "\\u", "provider_", "._", "reserve", "\\u", "ip_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "id_", "=_", "cs", "\\u", "credentials_", "._", "project_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vm", "\\u", "id_", "=_", "host", "\\u", "attr_", "._", "vm", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "reserve", "d\\u", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total_", "=_", "Databa", "se", "Infra", "Attr_", "._", "objects_", "._", "filter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "databa", "sei", "nfra", "_", "=_", "workf", "low", "\\u", "dict_", "[_", "'", "databa", "sei", "nfra", "'_", "]_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "=_", "Databa", "se", "Infra", "Attr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "._", "ip_", "=_", "reserve", "d\\u", "ip_", "[_", "'", "second", "ary", "\\u", "ip", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "total_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "databa", "sei", "nfra", "attr_", "._", "is", "\\u", "write_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOG_", "._", "info_", "(_", "\"", "Up", "dati", "ng", " ", "databa", "sei", "nfra", " ", "endpoint", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "databa", "sei", "nfra", "_", "=_", "workf", "low", "\\u", "dict_", "[_", "'", "databa", "sei", "nfra", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databa", "sei", "nfra", "_", "._", "endpoint_", "=_", "databa", "sei", "nfra", "attr_", "._", "ip_", "+_", "\":", "%", "i", "\"_", "%_", "3306", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databa", "sei", "nfra", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workf", "low", "\\u", "dict_", "[_", "'", "databa", "sei", "nfra", "'_", "]_", "=_", "databa", "sei", "nfra", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "desc_", "=_", "'", "Write", " ", "IP", "'_", "\\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 ", " ", "_", "databa", "sei", "nfra", "attr_", "._", "is", "\\u", "write_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "\\u", "desc_", "=_", "'", "Read", " ", "IP", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "network", "api", "\\u", "ip", "\\u", "id_", "=_", "cs", "\\u", "provider_", "._", "register", "\\u", "network", "api", "\\u", "ip_", "(_", "equipment", "\\u", "id_", "=_", "network", "api", "\\u", "equipment", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip_", "=_", "reserve", "d\\u", "ip_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "second", "ary", "\\u", "ip", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "desc_", "=_", "ip", "\\u", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "._", "cs", "\\u", "ip", "\\u", "id_", "=_", "reserve", "d\\u", "ip_", "[_", "'", "cs", "\\u", "ip", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "._", "network", "api", "\\u", "equipment", "\\u", "id_", "=_", "network", "api", "\\u", "equipment", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "._", "network", "api", "\\u", "ip", "\\u", "id_", "=_", "network", "api", "\\u", "ip", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "._", "databa", "sei", "nfra", "_", "=_", "workf", "low", "\\u", "dict_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "databa", "sei", "nfra", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "databa", "sei", "nfra", "attr_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workf", "low", "\\u", "dict_", "[_", "'", "databa", "sei", "nfra", "attr", "'_", "]_", "._", "append_", "(_", "databa", "sei", "nfra", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "traceback_", "=_", "full", "\\u", "stack_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "workf", "low", "\\u", "dict_", "[_", "'", "exception", "s", "'_", "]_", "[_", "'", "error", "\\u", "codes", "'_", "]_", "._", "append_", "(_", "DBA", "AS", "\\u", "0010", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "workf", "low", "\\u", "dict_", "[_", "'", "exception", "s", "'_", "]_", "[_", "'", "traceback", "'_", "]_", "._", "append_", "(_", "traceback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
ioam/param/tests/testobjectselector.py
[ { "content": " def test_initialization_out_of_bounds(self):\n try:\n class Q(param.Parameterized):\n q = param.ObjectSelector(5,objects=[4])\n except ValueError:\n pass\n else:\n raise AssertionError(\"ObjectSelector created outside range.\")", "metadata": "root.TestObjectSelectorParameters.test_initialization_out_of_bounds", "header": "['class', 'TestObjectSelectorParameters', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 73 }, { "content": " def test_initialization_no_bounds(self):\n try:\n class Q(param.Parameterized):\n q = param.ObjectSelector(5,objects=10)\n except TypeError:\n pass\n else:\n raise AssertionError(\"ObjectSelector created without range.\")", "metadata": "root.TestObjectSelectorParameters.test_initialization_no_bounds", "header": "['class', 'TestObjectSelectorParameters', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 83 } ]
[ { "span": "Q(", "start_line": 75, "start_column": 18, "end_line": 75, "end_column": 19 }, { "span": "Q(", "start_line": 85, "start_column": 18, "end_line": 85, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Object", "Select", "or", "Parameters_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "initialization", "\\u", "out", "\\u", "of", "\\u", "bounds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Q_", "(_", "param_", "._", "Parameteri", "zed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "param_", "._", "Object", "Selector_", "(_", "5_", ",_", "objects_", "=_", "[_", "4_", "]_", ")_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Assert", "ion", "Error_", "(_", "\"", "Object", "Select", "or", " ", "created", " ", "outsi", "de", " ", "range", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Object", "Select", "or", "Parameters_", "(_", "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", "initialization", "\\u", "no", "\\u", "bounds_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "Q_", "(_", "param_", "._", "Parameteri", "zed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "param_", "._", "Object", "Selector_", "(_", "5_", ",_", "objects_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Assert", "ion", "Error_", "(_", "\"", "Object", "Select", "or", " ", "created", " ", "with", "out", " ", "range", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused local variable
ricmoo/pycoind/tests/test-script.py
[ { "content": " def test_hashnone(self):\n # Block: bitcoin@\n # Txn: \n\n txn_bytes = ''.decode('hex')\n pk_script = ''.decode('hex')\n input_index = 3\n\n #self.check_transaction(txn_bytes, pk_script, input_index)", "metadata": "root.TestScriptTransactions.test_hashnone", "header": "['class', 'TestScriptTransactions', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 53 }, { "content": " def test_hashnone_anyonecanpay(self):\n # Block: bitcoin@\n # Txn: \n\n txn_bytes = ''.decode('hex')\n pk_script = ''.decode('hex')\n input_index = 3\n\n #self.check_transaction(txn_bytes, pk_script, input_index)", "metadata": "root.TestScriptTransactions.test_hashnone_anyonecanpay", "header": "['class', 'TestScriptTransactions', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 63 }, { "content": " def test_hashsingle_anyonecanpay(self):\n # Block: bitcoin@\n # Txn: \n\n txn_bytes = ''.decode('hex')\n pk_script = ''.decode('hex')\n input_index = 3\n\n #self.check_transaction(txn_bytes, pk_script, input_index)", "metadata": "root.TestScriptTransactions.test_hashsingle_anyonecanpay", "header": "['class', 'TestScriptTransactions', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 83 }, { "content": " def test_stack_ops(self):\n xTop = 19\n (x, x0, x1, x2, x3, x4, x5, x6) = (41, 43, 47, 53, 59, 61, 67, 71)\n tests = [\n ('OP_IFDUP', [0], [0],),\n ('OP_IFDUP', [1], [1, 1],),\n\n ('OP_DEPTH', [], [0]),\n ('OP_DEPTH', [1,1], [1,1,2]),\n\n ('OP_DROP', [x], []),\n ('OP_DROP', [], None),\n\n ('OP_DUP', [x], [x, x]),\n ('OP_DUP', [x1, x], [x1, x, x]),\n ('OP_DUP', [], None),\n\n ('OP_NIP', [x1,x2], [x2]),\n ('OP_NIP', [x,x2,x3], [x,x3]),\n ('OP_NIP', [x1], None),\n ('OP_NIP', [], None),\n\n ('OP_OVER', [x1,x2], [x1,x2,x1]),\n ('OP_OVER', [x1], None),\n ('OP_OVER', [], None),\n\n ('OP_PICK', [x5, x4, x3, x2, x1, x0, 5], [x5, x4, x3, x2, x1, x0, x5]),\n ('OP_PICK', [x5, x4, x3, x2, x1, x0, 2], [x5, x4, x3, x2, x1, x0, x2]),\n # @TODO: pick error cases\n\n ('OP_ROLL', [x5, x4, x3, x2, x1, x0, 5], [x4, x3, x2, x1, x0, x5]),\n ('OP_ROLL', [x5, x4, x3, x2, x1, x0, 2], [x5, x4, x3, x1, x0, x2]),\n # @TODO: roll error cases (not enough arguments to start, len < n)\n\n ('OP_ROT', [x1, x2, x3], [x2, x3, x1]),\n ('OP_ROT', [x, x1, x2, x3], [x, x2, x3, x1]),\n # @TODO: rot error cases (ditto)\n\n ('OP_SWAP', [x1, x2], [x2, x1]),\n ('OP_SWAP', [x, x1, x2], [x, x2, x1]),\n ('OP_SWAP', [x1], None),\n ('OP_SWAP', [], None),\n\n ('OP_TUCK', [x1, x2], [x2, x1, x2]),\n ('OP_TUCK', [x, x1, x2], [x, x2, x1, x2]),\n # @TODO: tuck error cases\n\n ('OP_2DROP', [x1, x2], []),\n ('OP_2DROP', [x, x1, x2], [x]),\n ('OP_2DROP', [x1], None),\n ('OP_2DROP', [], None),\n\n ('OP_2DUP', [x1, x2], [x1, x2, x1, x2]),\n ('OP_2DUP', [x, x1, x2], [x, x1, x2, x1, x2]),\n ('OP_2DUP', [x1], None),\n ('OP_2DUP', [], None),\n\n ('OP_3DUP', [x1, x2, x3], [x1, x2, x3, x1, x2, x3]),\n ('OP_3DUP', [x, x1, x2, x3], [x, x1, x2, x3, x1, x2, x3]),\n ('OP_3DUP', [x1, x2], None),\n ('OP_3DUP', [x1], None),\n ('OP_3DUP', [], None),\n\n ('OP_2OVER', [x1, x2, x3, x4], [x1, x2, x3, x4, x1, x2]),\n ('OP_2OVER', [x, x1, x2, x3, x4], [x, x1, x2, x3, x4, x1, x2]),\n # @TODO: 2over error cases\n\n ('OP_2ROT', [x1, x2, x3, x4, x5, x6], [x3, x4, x5, x6, x1, x2]),\n ('OP_2ROT', [x, x1, x2, x3, x4, x5, x6], [x, x3, x4, x5, x6, x1, x2]),\n # @TODO: 2rot error cases\n\n ('OP_2SWAP', [x1, x2, x3, x4], [x3, x4, x1, x2]),\n ('OP_2SWAP', [x, x1, x2, x3, x4], [x, x3, x4, x1, x2]),\n # @TODO: 2swap error cases\n ]\n\n for opname, inputs, outputs in tests:\n # length(x1) + x1 [+ length(x1) + x2 ...] + opcode\n script = \"\".join(self.bv(i) for i in inputs) + chr(pycoind.script.opcodes.get_opcode(opname))\n self.check_script(script, outputs)", "metadata": "root.TestScriptTransactions.test_stack_ops", "header": "['class', 'TestScriptTransactions', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 139 } ]
[ { "span": "txn_bytes ", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 17 }, { "span": "pk_script ", "start_line": 58, "start_column": 8, "end_line": 58, "end_column": 17 }, { "span": "input_index ", "start_line": 59, "start_column": 8, "end_line": 59, "end_column": 19 }, { "span": "txn_bytes ", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 17 }, { "span": "pk_script ", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 17 }, { "span": "input_index ", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 19 }, { "span": "txn_bytes ", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 17 }, { "span": "pk_script ", "start_line": 88, "start_column": 8, "end_line": 88, "end_column": 17 }, { "span": "input_index ", "start_line": 89, "start_column": 8, "end_line": 89, "end_column": 19 }, { "span": "xTop ", "start_line": 140, "start_column": 8, "end_line": 140, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Script", "Transactions", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hash", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Block", ":", " ", "bitcoin", "@_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tx", "n", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tx", "n", "\\u", "bytes_", "=_", "''_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pk", "\\u", "script_", "=_", "''_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "index_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "check", "\\u", "transaction", "(", "tx", "n", "\\u", "bytes", ",", " ", "pk", "\\u", "script", ",", " ", "input", "\\u", "index", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Script", "Transactions", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hash", "none", "\\u", "any", "one", "can", "pay_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Block", ":", " ", "bitcoin", "@_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tx", "n", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tx", "n", "\\u", "bytes_", "=_", "''_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pk", "\\u", "script_", "=_", "''_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "index_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "check", "\\u", "transaction", "(", "tx", "n", "\\u", "bytes", ",", " ", "pk", "\\u", "script", ",", " ", "input", "\\u", "index", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Script", "Transactions", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hash", "single", "\\u", "any", "one", "can", "pay_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Block", ":", " ", "bitcoin", "@_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tx", "n", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tx", "n", "\\u", "bytes_", "=_", "''_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pk", "\\u", "script_", "=_", "''_", "._", "decode_", "(_", "'", "hex", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "index_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "check", "\\u", "transaction", "(", "tx", "n", "\\u", "bytes", ",", " ", "pk", "\\u", "script", ",", " ", "input", "\\u", "index", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Script", "Transactions", "_", "(_", "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", "stack", "\\u", "ops_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "Top_", "=_", "19_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "x_", ",_", "x0_", ",_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", ",_", "x5", "_", ",_", "x6", "_", ")_", "=_", "(_", "41_", ",_", "43_", ",_", "47_", ",_", "53_", ",_", "59_", ",_", "61_", ",_", "67_", ",_", "71_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "IF", "DU", "P", "'_", ",_", "[_", "0_", "]_", ",_", "[_", "0_", "]_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "IF", "DU", "P", "'_", ",_", "[_", "1_", "]_", ",_", "[_", "1_", ",_", "1_", "]_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DEPTH", "'_", ",_", "[_", "]_", ",_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DEPTH", "'_", ",_", "[_", "1_", ",_", "1_", "]_", ",_", "[_", "1_", ",_", "1_", ",_", "2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DROP", "'_", ",_", "[_", "x_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DROP", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DU", "P", "'_", ",_", "[_", "x_", "]_", ",_", "[_", "x_", ",_", "x_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DU", "P", "'_", ",_", "[_", "x1_", ",_", "x_", "]_", ",_", "[_", "x1_", ",_", "x_", ",_", "x_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "DU", "P", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "NI", "P", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "NI", "P", "'_", ",_", "[_", "x_", ",_", "x2_", ",_", "x3_", "]_", ",_", "[_", "x_", ",_", "x3_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "NI", "P", "'_", ",_", "[_", "x1_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "NI", "P", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "OVER", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "OVER", "'_", ",_", "[_", "x1_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "OVER", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "PIC", "K", "'_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "5_", "]_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "x5", "_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "PIC", "K", "'_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "2_", "]_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "pick", " ", "error", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "ROLL", "'_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "5_", "]_", ",_", "[_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "x5", "_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "ROLL", "'_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x2_", ",_", "x1_", ",_", "x0_", ",_", "2_", "]_", ",_", "[_", "x5", "_", ",_", "x4_", ",_", "x3_", ",_", "x1_", ",_", "x0_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "roll", " ", "error", " ", "case", "s", " ", "(", "not", " ", "eno", "ugh", " ", "argu", "ment", "s", " ", "to", " ", "start", ",", " ", "len", " ", "<", " ", "n", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "ROT", "'_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", "]_", ",_", "[_", "x2_", ",_", "x3_", ",_", "x1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "ROT", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", "]_", ",_", "[_", "x_", ",_", "x2_", ",_", "x3_", ",_", "x1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "rot", " ", "error", " ", "case", "s", " ", "(", "dit", "to", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "SWA", "P", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x2_", ",_", "x1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "SWA", "P", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x_", ",_", "x2_", ",_", "x1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "SWA", "P", "'_", ",_", "[_", "x1_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "SWA", "P", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "TU", "CK", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x2_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "TU", "CK", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x_", ",_", "x2_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "tu", "ck", " ", "error", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DROP", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DROP", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DROP", "'_", ",_", "[_", "x1_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DROP", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DU", "P", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DU", "P", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", "]_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DU", "P", "'_", ",_", "[_", "x1_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "DU", "P", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "3", "DU", "P", "'_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", "]_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x1_", ",_", "x2_", ",_", "x3_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "3", "DU", "P", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", "]_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x1_", ",_", "x2_", ",_", "x3_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "3", "DU", "P", "'_", ",_", "[_", "x1_", ",_", "x2_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "3", "DU", "P", "'_", ",_", "[_", "x1_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "3", "DU", "P", "'_", ",_", "[_", "]_", ",_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "OVER", "'_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", "]_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "OVER", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", "]_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "2o", "ver", " ", "error", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "ROT", "'_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", ",_", "x5", "_", ",_", "x6", "_", "]_", ",_", "[_", "x3_", ",_", "x4_", ",_", "x5", "_", ",_", "x6", "_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "ROT", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", ",_", "x5", "_", ",_", "x6", "_", "]_", ",_", "[_", "x_", ",_", "x3_", ",_", "x4_", ",_", "x5", "_", ",_", "x6", "_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "2r", "ot", " ", "error", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "SWA", "P", "'_", ",_", "[_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", "]_", ",_", "[_", "x3_", ",_", "x4_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "OP", "\\u", "2", "SWA", "P", "'_", ",_", "[_", "x_", ",_", "x1_", ",_", "x2_", ",_", "x3_", ",_", "x4_", "]_", ",_", "[_", "x_", ",_", "x3_", ",_", "x4_", ",_", "x1_", ",_", "x2_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "TOD", "O", ":", " ", "2s", "wap", " ", "error", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "opname", "_", ",_", "inputs_", ",_", "outputs_", "in_", "tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "length", "(", "x1", ")", " ", "+", " ", "x1", " ", "[+", " ", "length", "(", "x1", ")", " ", "+", " ", "x2", " ", "...]", " ", "+", " ", "opcode_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script_", "=_", "\"\"_", "._", "join_", "(_", "self_", "._", "bv_", "(_", "i_", ")_", "for_", "i_", "in_", "inputs_", ")_", "+_", "chr_", "(_", "pyco", "ind_", "._", "script_", "._", "opcodes_", "._", "get", "\\u", "opcode_", "(_", "opname", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "check", "\\u", "script_", "(_", "script_", ",_", "outputs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 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, 4, 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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 ]
Unused import
xraypy/xraylarch/plugins/epics/xrfcontrol.py
[ { "content": "#!/usr/bin/env python\n\"\"\"\nEpics XRF Display App\n\"\"\"\n\nimport sys\nimport os\n\nimport time\nimport copy\nfrom functools import partial\n\nimport wx\nimport wx.lib.mixins.inspection\nimport wx.lib.scrolledpanel as scrolled\ntry:\n from wx._core import PyDeadObjectError\nexcept:\n PyDeadObjectError = Exception\n\nimport wx.lib.colourselect as csel\nimport numpy as np\nimport matplotlib\n\nHAS_PLOT = False\ntry:\n from wxmplot import PlotPanel\n HAS_PLOT = True\nexcept ImportError:\n HAS_PLOT = False\n\nHAS_DV = False\ntry:\n import wx.dataview as dv\n HAS_DV = True\nexcept:\n pass\n\nfrom wxutils import (SimpleText, EditableListBox, Font, FloatCtrl,\n pack, Popup, Button, get_icon, Check, MenuItem,\n Choice, FileOpen, FileSave, fix_filename, HLine,\n GridPanel, CEN, LEFT, RIGHT)\n\n\nimport larch\nfrom larch_plugins.wx import (PeriodicTablePanel, XRFDisplayFrame,\n FILE_WILDCARDS, CalibrationFrame)\n\nROI_WILDCARD = 'Data files (*.dat)|*.dat|ROI files (*.roi)|*.roi|All files (*.*)|*.*'\nlarch.use_plugin_path('epics')\ntry:\n from larch_plugins.epics import Epics_MultiXMAP, Epics_Xspress3\n from scandb import ScanDB\nexcept:\n pass\n\n\n\n\n\n\nif __name__ == \"__main__\":\n # e = EpicsXRFApp(prefix='QX4:', det_type='ME-4',\n # amp_type='xspress3', nmca=4)\n\n EpicsXRFApp().MainLoop()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class DetectorSelectDialog(wx.Dialog):\n \"\"\"Connect to an Epics MCA detector\n Can be either XIA xMAP or Quantum XSPress3\n \"\"\"\n msg = '''Select XIA xMAP or Quantum XSPress3 MultiElement MCA detector'''\n det_types = ('ME-4', 'other')\n def_prefix = '13QX4:' # SDD1:'\n def_nelem = 4\n", "metadata": "root.DetectorSelectDialog", "header": "['module', '___EOS___']", "index": 57 }, { "content": " def __init__(self, parent=None, prefix=None, det_type='ME-4',\n is_xsp3=False, nmca=4,\n title='Select Epics MCA Detector'):\n if prefix is None: prefix = self.def_prefix\n if det_type not in self.det_types:\n det_type = self.det_types[0]\n\n wx.Dialog.__init__(self, parent, wx.ID_ANY, title=title)\n\n self.SetBackgroundColour((240, 240, 230))\n self.SetFont(Font(9))\n if parent is not None:\n self.SetFont(parent.GetFont())\n\n self.is_xsp3 = Check(self, size=(120, -1), default=False)\n\n self.dettype = Choice(self,size=(120, -1), choices=self.det_types)\n self.dettype.SetStringSelection(det_type)\n\n self.prefix = wx.TextCtrl(self, -1, prefix, size=(120, -1))\n self.nelem = FloatCtrl(self, value=nmca, precision=0, minval=1,\n size=(120, -1))\n\n btnsizer = wx.StdDialogButtonSizer()\n\n if wx.Platform != \"__WXMSW__\":\n btn = wx.ContextHelpButton(self)\n btnsizer.AddButton(btn)\n\n btn = wx.Button(self, wx.ID_OK)\n btn.SetHelpText(\"Use this detector\")\n btn.SetDefault()\n btnsizer.AddButton(btn)\n\n btn = wx.Button(self, wx.ID_CANCEL)\n btnsizer.AddButton(btn)\n btnsizer.Realize()\n\n hline = wx.StaticLine(self, size=(225, 3), style=wx.LI_HORIZONTAL)\n sty = LEFT|wx.ALIGN_CENTER_VERTICAL\n sizer = wx.GridBagSizer(5, 2)\n def txt(label):\n return SimpleText(self, label, size=(120, -1), style=LEFT)\n\n sizer.Add(txt(' Detector Type'), (0, 0), (1, 1), sty, 2)\n sizer.Add(txt(' Uses Xspress3?'), (1, 0), (1, 1), sty, 2)\n sizer.Add(txt(' Epics Prefix'), (2, 0), (1, 1), sty, 2)\n sizer.Add(txt(' # Elements'), (3, 0), (1, 1), sty, 2)\n sizer.Add(self.dettype, (0, 1), (1, 1), sty, 2)\n sizer.Add(self.is_xsp3, (1, 1), (1, 1), sty, 2)\n sizer.Add(self.prefix, (2, 1), (1, 1), sty, 2)\n sizer.Add(self.nelem, (3, 1), (1, 1), sty, 2)\n\n sizer.Add(hline, (4, 0), (1, 2), sty, 2)\n sizer.Add(btnsizer, (5, 0), (1, 2), sty, 2)\n self.SetSizer(sizer)\n sizer.Fit(self)", "metadata": "root.DetectorSelectDialog.__init__", "header": "['class', 'DetectorSelectDialog', '(', 'wx', '.', 'Dialog', ')', ':', '___EOS___']", "index": 66 }, { "content": "class EpicsXRFDisplayFrame(XRFDisplayFrame):\n _about = \"\"\"Epics XRF Spectra Display\n Matt Newville <newville @ cars.uchicago.edu>\n \"\"\"\n me4_layout = ((0, 0), (1, 0), (1, 1), (0, 1))\n main_title = 'Epics XRF Control'\n\n\n\n\n\n\n\n\n\n\n\n\n\n # def update_mca(self, counts, **kws):\n # self.det.needs_refresh = False\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.EpicsXRFDisplayFrame", "header": "['module', '___EOS___']", "index": 125 }, { "content": " def __init__(self, parent=None, _larch=None, prefix=None,\n det_type='ME-4', is_xsp3=False,\n nmca=4, size=(725, 580), scandb_conn=None,\n title='Epics XRF Display',\n output_title='XRF', **kws):\n\n self.det_type = det_type\n self.is_xsp3 = is_xsp3\n self.nmca = nmca\n self.det_fore = 1\n self.det_back = 0\n self.scandb = None\n if scandb_conn is not None:\n self.ConnectScanDB(**scandb_conn)\n\n self.onConnectEpics(event=None, prefix=prefix)\n\n XRFDisplayFrame.__init__(self, parent=parent, _larch=_larch,\n title=title, size=size, **kws)", "metadata": "root.EpicsXRFDisplayFrame.__init__", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 131 }, { "content": " def onConnectEpics(self, event=None, prefix=None, **kws):\n if prefix is None:\n res = self.prompt_for_detector(prefix=prefix,\n is_xsp3=self.is_xsp3,\n nmca=self.nmca)\n self.prefix, self.det_type, self.is_xsp3, self.nmca = res\n else:\n self.prefix = prefix\n self.det_fore = 1\n self.det_back = 0\n self.clear_mcas()\n self.connect_to_detector(prefix=self.prefix, is_xsp3=self.is_xsp3,\n det_type=self.det_type, nmca=self.nmca)", "metadata": "root.EpicsXRFDisplayFrame.onConnectEpics", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 151 }, { "content": " def ConnectScanDB(self, **kws):\n self.scandb = ScanDB(**kws)\n # print \"Scandb \", self.scandb\n if self.scandb is not None:\n basedir = self.scandb.get_info('user_folder')\n fileroot = self.scandb.get_info('server_fileroot')\n basedir = str(basedir)\n fileroot = str(fileroot)\n if basedir.startswith(fileroot):\n basedir = basedir[len(fileroot):]\n fullpath = os.path.join(fileroot, basedir)\n fullpath = fullpath.replace('\\\\', '/').replace('//', '/')\n curdir = os.getcwd()\n try:\n os.chdir(fullpath)\n except:\n os.chdir(curdir)\n self.scandb.connect_pvs()", "metadata": "root.EpicsXRFDisplayFrame.ConnectScanDB", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 165 }, { "content": " def onSaveMCAFile(self, event=None, **kws):\n tmp = '''\n # print 'SaveMCA File'\n deffile = ''\n if hasattr(self.mca, 'sourcefile'):\n deffile = \"%s%s\" % (deffile, getattr(self.mca, 'sourcefile'))\n if hasattr(self.mca, 'areaname'):\n deffile = \"%s%s\" % (deffile, getattr(self.mca, 'areaname'))\n if deffile == '':\n deffile ='test'\n if not deffile.endswith('.mca'):\n deffile = deffile + '.mca'\n '''\n\n deffile = 'save.mca' # fix_filename(str(deffile))\n outfile = FileSave(self, \"Save MCA File\",\n default_file=deffile,\n wildcard=FILE_WILDCARDS)\n\n environ = []\n if self.scandb is not None:\n c, table = self.scandb.get_table('pvs')\n pvrows = self.scandb.query(table).all()\n for row in pvrows:\n addr = str(row.name)\n desc = str(row.notes)\n val = self.scandb.pvs[addr].get(as_string=True)\n environ.append((addr, val, desc))\n\n if outfile is not None:\n self.det.save_mcafile(outfile, environ=environ)", "metadata": "root.EpicsXRFDisplayFrame.onSaveMCAFile", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 184 }, { "content": " def onSaveColumnFile(self, event=None, **kws):\n print( ' EPICS-XRFDisplay onSaveColumnFile not yet implemented ')\n pass", "metadata": "root.EpicsXRFDisplayFrame.onSaveColumnFile", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 216 }, { "content": " def prompt_for_detector(self, prefix=None, is_xsp3=False, nmca=4):\n dlg = DetectorSelectDialog(prefix=prefix, is_xsp3=is_xsp3, nmca=nmca)\n dlg.Raise()\n if dlg.ShowModal() == wx.ID_OK:\n dpref = dlg.prefix.GetValue()\n atype = dlg.is_xsp3.IsChecked()\n dtype = dlg.dettype.GetStringSelection()\n nmca = dlg.nelem.GetValue()\n dlg.Destroy()\n return dpref, dtype, atype, nmca", "metadata": "root.EpicsXRFDisplayFrame.prompt_for_detector", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 220 }, { "content": " def connect_to_detector(self, prefix=None, is_xsp3=False,\n det_type=None, nmca=4):\n self.det = None\n if is_xsp3:\n self.det = Epics_Xspress3(prefix=prefix, nmca=nmca)\n self.det.connect()\n time.sleep(0.5)\n self.det.get_mca(mca=1)\n self.needs_newplot=True\n else:\n self.det = Epics_MultiXMAP(prefix=prefix, nmca=nmca)", "metadata": "root.EpicsXRFDisplayFrame.connect_to_detector", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 231 }, { "content": " def show_mca(self, init=False):\n self.needs_newplot = False\n if self.mca is None or self.needs_newplot:\n self.mca = self.det.get_mca(mca=self.det_fore)\n\n self.plotmca(self.mca, set_title=False, init=init)\n title = \"Foreground: MCA{:d}\".format(self.det_fore)\n if self.det_back > 0:\n if self.mca2 is None:\n self.mca2 = self.det.get_mca(mca=self.det_back)\n\n c2 = self.det.get_array(mca=self.det_back)\n e2 = self.det.get_energy(mca=self.det_back)\n title = \"{:s} Background: MCA{:d}\".format(title, self.det_back)\n try:\n self.oplot(e2, c2)\n except ValueError:\n pass\n\n roiname = self.get_roiname()\n\n if roiname in self.wids['roilist'].GetStrings():\n i = self.wids['roilist'].GetStrings().index(roiname)\n self.wids['roilist'].EnsureVisible(i)\n self.onROI(label=roiname)\n\n self.SetTitle(\"%s: %s\" % (self.main_title, title))\n self.needs_newplot = False", "metadata": "root.EpicsXRFDisplayFrame.show_mca", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 243 }, { "content": " def onSaveROIs(self, event=None, **kws):\n dlg = wx.FileDialog(self, message=\"Save ROI File\",\n defaultDir=os.getcwd(),\n wildcard=ROI_WILDCARD,\n style = wx.FD_SAVE|wx.FD_CHANGE_DIR)\n\n if dlg.ShowModal() == wx.ID_OK:\n roifile = dlg.GetPath()\n\n self.det.save_rois(roifile)", "metadata": "root.EpicsXRFDisplayFrame.onSaveROIs", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 272 }, { "content": " def onRestoreROIs(self, event=None, **kws):\n dlg = wx.FileDialog(self, message=\"Read ROI File\",\n defaultDir=os.getcwd(),\n wildcard=ROI_WILDCARD,\n style = wx.FD_OPEN|wx.FD_CHANGE_DIR)\n\n if dlg.ShowModal() == wx.ID_OK:\n roifile = dlg.GetPath()\n self.det.restore_rois(roifile)\n self.set_roilist(mca=self.mca)\n self.show_mca()\n self.onSelectDet(event=None, index=0)", "metadata": "root.EpicsXRFDisplayFrame.onRestoreROIs", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 283 }, { "content": " def createCustomMenus(self):\n menu = wx.Menu()\n MenuItem(self, menu, \"Connect to Detector\\tCtrl+D\",\n \"Connect to MCA or XSPress3 Detector\",\n self.onConnectEpics)\n menu.AppendSeparator()\n self._menus.insert(1, (menu, 'Detector'))", "metadata": "root.EpicsXRFDisplayFrame.createCustomMenus", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 296 }, { "content": " def createMainPanel(self):\n epicspanel = self.createEpicsPanel()\n ctrlpanel = self.createControlPanel()\n plotpanel = self.panel = self.createPlotPanel()\n self.panel.SetName('plotpanel')\n tx, ty = self.wids['ptable'].GetBestSize()\n cx, cy = ctrlpanel.GetBestSize()\n px, py = plotpanel.GetBestSize()\n\n self.SetSize((950, 625))\n self.SetMinSize((450, 350))\n\n style = wx.ALIGN_LEFT|wx.EXPAND|wx.ALL\n\n bsizer = wx.BoxSizer(wx.HORIZONTAL)\n bsizer.Add(ctrlpanel, 0, style, 1)\n bsizer.Add(plotpanel, 1, style, 1)\n hline = wx.StaticLine(self, size=(425, 2), style=wx.LI_HORIZONTAL|style)\n\n sizer = wx.BoxSizer(wx.VERTICAL)\n sizer.Add(epicspanel, 0, style, 1)\n sizer.Add(hline, 0, style, 1)\n sizer.Add(bsizer, 1, style, 1)\n pack(self, sizer)\n\n self.set_roilist(mca=None)", "metadata": "root.EpicsXRFDisplayFrame.createMainPanel", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 304 }, { "content": " def createEpicsPanel(self):\n pane = wx.Panel(self, name='epics panel')\n psizer = wx.GridBagSizer(4, 12) # wx.BoxSizer(wx.HORIZONTAL)\n\n btnpanel = wx.Panel(pane, name='buttons')\n\n nmca = self.nmca\n NPERROW = 6\n self.SetFont(Font(9))\n if self.det_type.lower().startswith('me-4') and nmca<5:\n btnsizer = wx.GridBagSizer(2, 2)\n else:\n btnsizer = wx.GridBagSizer(int((nmca+NPERROW-2)/(1.0*NPERROW)), NPERROW)\n\n style = wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL\n rstyle = wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL\n bkg_choices = ['None']\n\n psizer.Add(SimpleText(pane, ' MCAs: '), (0, 0), (1, 1), style, 1)\n for i in range(1, 1+nmca):\n bkg_choices.append(\"%i\" % i)\n b = Button(btnpanel, '%i' % i, size=(30, 25),\n action=partial(self.onSelectDet, index=i))\n self.wids['det%i' % i] = b\n loc = divmod(i-1, NPERROW)\n if self.det_type.lower().startswith('me-4') and nmca<NPERROW-1:\n loc = self.me4_layout[i-1]\n btnsizer.Add(b, loc, (1, 1), style, 1)\n pack(btnpanel, btnsizer)\n nrows = 1 + loc[0]\n\n if self.det_type.lower().startswith('me-4') and nmca<5:\n nrows = 2\n\n psizer.Add(btnpanel, (0, 1), (nrows, 1), style, 1)\n\n self.wids['det_status'] = SimpleText(pane, ' ', size=(120, -1), style=style)\n self.wids['deadtime'] = SimpleText(pane, ' ', size=(120, -1), style=style)\n\n self.wids['bkg_det'] = Choice(pane, size=(75, -1), choices=bkg_choices,\n action=self.onSelectDet)\n\n self.wids['dwelltime'] = FloatCtrl(pane, value=0.0, precision=1, minval=0,\n size=(80, -1), act_on_losefocus=True,\n action=self.onSetDwelltime)\n self.wids['elapsed'] = SimpleText(pane, ' ', size=(80, -1), style=style)\n\n b1 = Button(pane, 'Start', size=(90, 25), action=self.onStart)\n b2 = Button(pane, 'Stop', size=(90, 25), action=self.onStop)\n b3 = Button(pane, 'Erase', size=(90, 25), action=self.onErase)\n b4 = Button(pane, 'Continuous', size=(90, 25), action=partial(self.onStart,\n dtime=0))\n\n bkg_lab = SimpleText(pane, 'Background MCA:', size=(150, -1))\n pre_lab = SimpleText(pane, 'Preset Time (s):', size=(125, -1))\n ela_lab = SimpleText(pane, 'Elapsed Time (s):', size=(125, -1))\n sta_lab = SimpleText(pane, 'Status :', size=(100, -1))\n dea_lab = SimpleText(pane, '% Deadtime:', size=(100, -1))\n\n\n psizer.Add(bkg_lab, (0, 2), (1, 1), style, 1)\n psizer.Add(self.wids['bkg_det'], (1, 2), (1, 1), style, 1)\n psizer.Add(pre_lab, (0, 3), (1, 1), style, 1)\n psizer.Add(ela_lab, (1, 3), (1, 1), style, 1)\n psizer.Add(self.wids['dwelltime'], (0, 4), (1, 1), style, 1)\n psizer.Add(self.wids['elapsed'], (1, 4), (1, 1), style, 1)\n\n psizer.Add(b1, (0, 5), (1, 1), style, 1)\n psizer.Add(b4, (0, 6), (1, 1), style, 1)\n psizer.Add(b2, (1, 5), (1, 1), style, 1)\n psizer.Add(b3, (1, 6), (1, 1), style, 1)\n\n psizer.Add(sta_lab, (0, 7), (1, 1), style, 1)\n psizer.Add(self.wids['det_status'], (0, 8), (1, 1), style, 1)\n psizer.Add(dea_lab, (1, 7), (1, 1), style, 1)\n psizer.Add(self.wids['deadtime'], (1, 8), (1, 1), style, 1)\n pack(pane, psizer)\n # pane.SetMinSize((500, 53))\n self.det.connect_displays(status=self.wids['det_status'],\n elapsed=self.wids['elapsed'],\n deadtime=self.wids['deadtime'])\n\n wx.CallAfter(self.onSelectDet, index=1, init=True)\n self.timer_counter = 0\n self.mca_timer = wx.Timer(self)\n self.Bind(wx.EVT_TIMER, self.UpdateData, self.mca_timer)\n self.mca_timer.Start(100)\n return pane", "metadata": "root.EpicsXRFDisplayFrame.createEpicsPanel", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 331 }, { "content": " def UpdateData(self, event=None, force=False):\n self.timer_counter += 1\n if self.mca is None or self.needs_newplot:\n self.show_mca()\n # self.elapsed_real = self.det.elapsed_real\n self.mca.real_time = self.det.elapsed_real\n\n if force or self.det.needs_refresh:\n self.det.needs_refresh = False\n if self.det_back > 0:\n if self.mca2 is None:\n self.mca2 = self.det.get_mca(mca=self.det_back)\n\n counts = self.det.get_array(mca=self.det_back)\n energy = self.det.get_energy(mca=self.det_back)\n try:\n self.update_mca(counts, energy=energy, is_mca2=True, draw=False)\n except ValueError:\n pass\n\n if self.mca is None:\n self.mca = self.det.get_mca(mca=self.det_fore)\n\n counts = self.det.get_array(mca=self.det_fore)*1.0\n energy = self.det.get_energy(mca=self.det_fore)\n if max(counts) < 1.0:\n counts = 1e-4*np.ones(len(counts))\n counts[0] = 2.0\n self.update_mca(counts, energy=energy)", "metadata": "root.EpicsXRFDisplayFrame.UpdateData", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 423 }, { "content": " def ShowROIStatus(self, left, right, name='', panel=0):\n if left > right:\n return\n sum = self.ydata[left:right].sum()\n dt = self.mca.real_time\n roi_ave = self.roi_aves[panel]\n roi_ave.update(sum)\n cps = roi_ave.get_cps()\n nmsg, cmsg, rmsg = '', '', ''\n if len(name) > 0:\n nmsg = \" %s\" % name\n cmsg = \" Counts={:10,.0f}\".format(sum)\n if cps is not None and cps > 0:\n rmsg = \" CPS={:10,.1f}\".format(cps)\n self.write_message(\"%s%s%s\" % (nmsg, cmsg, rmsg), panel=panel)", "metadata": "root.EpicsXRFDisplayFrame.ShowROIStatus", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 453 }, { "content": " def onSelectDet(self, event=None, index=0, init=False, **kws):\n if index > 0:\n self.det_fore = index\n self.det_back = self.wids['bkg_det'].GetSelection()\n if self.det_fore == self.det_back:\n self.det_back = 0\n\n for i in range(1, self.nmca+1):\n dname = 'det%i' % i\n bcol = (220, 220, 220)\n fcol = (0, 0, 0)\n if i == self.det_fore:\n bcol = (60, 50, 245)\n fcol = (240, 230, 100)\n if i == self.det_back:\n bcol = (80, 200, 20)\n self.wids[dname].SetBackgroundColour(bcol)\n self.wids[dname].SetForegroundColour(fcol)\n self.clear_mcas()\n self.show_mca(init=init)\n self.Refresh()", "metadata": "root.EpicsXRFDisplayFrame.onSelectDet", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 469 }, { "content": " def swap_mcas(self, event=None):\n if self.mca2 is None:\n return\n self.mca, self.mca2 = self.mca2, self.mca\n fore, back = self.det_fore, self.det_back\n self.wids['bkg_det'].SetSelection(fore)\n self.onSelectDet(index=back)", "metadata": "root.EpicsXRFDisplayFrame.swap_mcas", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 491 }, { "content": " def onSetDwelltime(self, event=None, **kws):\n if 'dwelltime' in self.wids:\n self.det.set_dwelltime(dtime=self.wids['dwelltime'].GetValue())", "metadata": "root.EpicsXRFDisplayFrame.onSetDwelltime", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 499 }, { "content": " def clear_mcas(self):\n self.mca = self.mca2 = None\n self.x2data = self.y2data = None\n self.needs_newplot = True", "metadata": "root.EpicsXRFDisplayFrame.clear_mcas", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 503 }, { "content": " def onStart(self, event=None, dtime=None, **kws):\n if dtime is not None:\n self.wids['dwelltime'].SetValue(\"%.1f\" % dtime)\n self.det.set_dwelltime(dtime=dtime)\n else:\n self.det.set_dwelltime(dtime=self.wids['dwelltime'].GetValue())\n [rave.clear() for rave in self.roi_aves]\n self.det.start()", "metadata": "root.EpicsXRFDisplayFrame.onStart", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 508 }, { "content": " def onStop(self, event=None, **kws):\n self.det.stop()\n self.det.needs_refresh = True\n time.sleep(0.125)\n self.UpdateData(event=None, force=True)", "metadata": "root.EpicsXRFDisplayFrame.onStop", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 517 }, { "content": " def onErase(self, event=None, **kws):\n self.needs_newplot = True\n self.det.erase()", "metadata": "root.EpicsXRFDisplayFrame.onErase", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 523 }, { "content": " def onDelROI(self, event=None):\n roiname = self.get_roiname()\n errmsg = None\n if self.roilist_sel is None:\n errmsg = 'No ROI selected to delete.'\n if errmsg is not None:\n return Popup(self, errmsg, 'Cannot Delete ROI')\n self.det.del_roi(roiname)\n XRFDisplayFrame.onDelROI(self)", "metadata": "root.EpicsXRFDisplayFrame.onDelROI", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 527 }, { "content": " def onNewROI(self, event=None):\n roiname = self.get_roiname()\n errmsg = None\n if self.xmarker_left is None or self.xmarker_right is None:\n errmsg = 'Must select right and left markers to define ROI'\n elif roiname in self.wids['roilist'].GetStrings():\n errmsg = '%s is already in ROI list - use a unique name.' % roiname\n if errmsg is not None:\n return Popup(self, errmsg, 'Cannot Define ROI')\n\n confirmed = XRFDisplayFrame.onNewROI(self)\n if confirmed:\n self.det.add_roi(roiname, lo=self.xmarker_left,\n hi=self.xmarker_right)", "metadata": "root.EpicsXRFDisplayFrame.onNewROI", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 537 }, { "content": " def onRenameROI(self, event=None):\n roiname = self.get_roiname()\n errmsg = None\n if roiname in self.wids['roilist'].GetStrings():\n errmsg = '%s is already in ROI list - use a unique name.' % roiname\n elif self.roilist_sel is None:\n errmsg = 'No ROI selected to rename.'\n if errmsg is not None:\n return Popup(self, errmsg, 'Cannot Rename ROI')\n\n if self.roilist_sel < len(self.det.mcas[0].rois):\n self.det.rename_roi(self.roilist_sel, roiname)\n names = self.wids['roilist'].GetStrings()\n names[self.roilist_sel] = roiname\n self.wids['roilist'].Clear()\n for sname in names:\n self.wids['roilist'].Append(sname)\n self.wids['roilist'].SetSelection(self.roilist_sel)", "metadata": "root.EpicsXRFDisplayFrame.onRenameROI", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 552 }, { "content": " def onCalibrateEnergy(self, event=None, **kws):\n try:\n self.win_calib.Raise()\n except:\n self.win_calib = CalibrationFrame(self, mca=self.mca,\n larch=self.larch,\n callback=self.onSetCalib)", "metadata": "root.EpicsXRFDisplayFrame.onCalibrateEnergy", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 571 }, { "content": " def onSetCalib(self, offset, slope, mca=None):\n print('XRFControl Set Energy Calibratione' , offset, slope, mca)", "metadata": "root.EpicsXRFDisplayFrame.onSetCalib", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 579 }, { "content": " def onClose(self, event=None):\n self.onStop()\n XRFDisplayFrame.onClose(self)", "metadata": "root.EpicsXRFDisplayFrame.onClose", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 582 }, { "content": " def onExit(self, event=None):\n self.onStop()\n XRFDisplayFrame.onExit(self)", "metadata": "root.EpicsXRFDisplayFrame.onExit", "header": "['class', 'EpicsXRFDisplayFrame', '(', 'XRFDisplayFrame', ')', ':', '___EOS___']", "index": 586 }, { "content": "class EpicsXRFApp(wx.App, wx.lib.mixins.inspection.InspectionMixin):\n", "metadata": "root.EpicsXRFApp", "header": "['module', '___EOS___']", "index": 590 }, { "content": " def __init__(self, **kws):\n self.kws = kws\n wx.App.__init__(self)", "metadata": "root.EpicsXRFApp.__init__", "header": "['class', 'EpicsXRFApp', '(', 'wx', '.', 'App', ',', 'wx', '.', 'lib', '.', 'mixins', '.', 'inspection', '.', 'InspectionMixin', ')', ':', '___EOS___']", "index": 591 }, { "content": " def OnInit(self):\n self.Init()\n frame = EpicsXRFDisplayFrame(**self.kws) #\n frame.Show()\n self.SetTopWindow(frame)\n return True", "metadata": "root.EpicsXRFApp.OnInit", "header": "['class', 'EpicsXRFApp', '(', 'wx', '.', 'App', ',', 'wx', '.', 'lib', '.', 'mixins', '.', 'inspection', '.', 'InspectionMixin', ')', ':', '___EOS___']", "index": 595 } ]
[ { "span": "import sys", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 10 }, { "span": "import copy", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 11 }, { "span": "import wx.lib.scrolledpanel as scrolled", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 39 }, { "span": "from wx._core import PyDeadObjectError", "start_line": 16, "start_column": 4, "end_line": 16, "end_column": 42 }, { "span": "import wx.lib.colourselect as csel", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 35 }, { "span": "import matplotlib", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 17 }, { "span": "from wxmplot import PlotPanel", "start_line": 26, "start_column": 4, "end_line": 26, "end_column": 33 }, { "span": "import wx.dataview as dv", "start_line": 33, "start_column": 4, "end_line": 33, "end_column": 28 }, { "span": "from wxutils import (SimpleText, EditableListBox, Font, FloatCtrl,\n pack, Popup, Button, get_icon, Check, MenuItem,\n Choice, FileOpen, FileSave, fix_filename, HLine,\n GridPanel, CEN, LEFT, RIGHT)", "start_line": 38, "start_column": 0, "end_line": 41, "end_column": 49 }, { "span": "from larch_plugins.wx import (PeriodicTablePanel, XRFDisplayFrame,\n FILE_WILDCARDS, CalibrationFrame)", "start_line": 45, "start_column": 0, "end_line": 46, "end_column": 63 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Epi", "cs", " ", "XR", "F", " ", "Display", " ", "App", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "wx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "wx_", "._", "lib_", "._", "mixins_", "._", "inspection", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "wx_", "._", "lib_", "._", "scrolled", "panel_", "as_", "scrolled", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "wx_", "._", "\\u", "core_", "import_", "Py", "Dead", "Object", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Py", "Dead", "Object", "Error_", "=_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "wx_", "._", "lib_", "._", "colour", "select_", "as_", "cse", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "HAS", "\\u", "PLOT", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "wx", "mplo", "t_", "import_", "Plot", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HAS", "\\u", "PLOT", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "HAS", "\\u", "PLOT", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "HAS", "\\u", "DV", "_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "wx_", "._", "datav", "iew_", "as_", "dv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HAS", "\\u", "DV", "_", "=_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "wx", "utils_", "import_", "(_", "Simple", "Text_", ",_", "Editable", "List", "Box_", ",_", "Font_", ",_", "Float", "Ctrl_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pack_", ",_", "Popup_", ",_", "Button_", ",_", "get", "\\u", "icon_", ",_", "Check_", ",_", "Menu", "Item_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Choice_", ",_", "File", "Open_", ",_", "File", "Save_", ",_", "fix", "\\u", "filename_", ",_", "HL", "ine_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Grid", "Panel_", ",_", "CEN", "_", ",_", "LEFT_", ",_", "RIGHT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "lar", "ch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lar", "ch", "\\u", "plugins_", "._", "wx_", "import_", "(_", "Period", "ic", "Table", "Panel_", ",_", "XR", "FD", "isp", "lay", "Frame_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "FILE", "\\u", "WIL", "DC", "ARD", "S_", ",_", "Calibrat", "ion", "Frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ROI", "\\u", "WIL", "DC", "ARD", "_", "=_", "'", "Data", " ", "files", " ", "(*", ".", "dat", ")|", "*.", "dat", "|", "ROI", " ", "files", " ", "(*", ".", "roi", ")|", "*.", "roi", "|", "All", " ", "files", " ", "(*", ".*)", "|", "*.", "*'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lar", "ch_", "._", "use", "\\u", "plugin", "\\u", "path_", "(_", "'", "epic", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "lar", "ch", "\\u", "plugins_", "._", "epic", "s_", "import_", "Epi", "cs", "\\u", "Multi", "XM", "AP_", ",_", "Epi", "cs", "\\u", "Xs", "press", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scan", "db_", "import_", "Sca", "n", "DB_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "e", " ", "=", " ", "Epi", "cs", "XR", "FA", "pp", "(", "prefix", "='", "QX", "4", ":'", ",", " ", "det", "\\u", "type", "='", "ME", "-", "4", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "amp", "\\u", "type", "='", "xsp", "ress", "3", "',", " ", "nm", "ca", "=", "4", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Epi", "cs", "XR", "FA", "pp_", "(_", ")_", "._", "Main", "Loop_", "(_", ")_", "\\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_", "Detect", "or", "Select", "Dialog_", "(_", "wx_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Connect", " ", "to", " ", "an", " ", "Epi", "cs", " ", "MC", "A", " ", "detect", "or", "\\", "10", ";", " ", " ", " ", " ", "Can", " ", "be", " ", "eit", "her", " ", "XI", "A", " ", "x", "MAP", " ", " ", "or", " ", "Quant", "um", " ", "XS", "Press", "3", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "'''", "Select", " ", "XI", "A", " ", "x", "MAP", " ", "or", " ", "Quant", "um", " ", "XS", "Press", "3", " ", "Multi", "Element", " ", "MC", "A", " ", "detect", "or", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "det", "\\u", "types_", "=_", "(_", "'", "ME", "-", "4", "'_", ",_", "'", "other", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def", "\\u", "prefix_", "=_", "'", "13", "QX", "4", ":'_", "#", " ", "SD", "D1", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def", "\\u", "nele", "m_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Detect", "or", "Select", "Dialog_", "(_", "wx_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", "=_", "None_", ",_", "prefix_", "=_", "None_", ",_", "det", "\\u", "type_", "=_", "'", "ME", "-", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "xsp", "3_", "=_", "False_", ",_", "nm", "ca_", "=_", "4_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "'", "Select", " ", "Epi", "cs", " ", "MC", "A", " ", "Detect", "or", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prefix_", "is_", "None_", ":_", "prefix_", "=_", "self_", "._", "def", "\\u", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "det", "\\u", "type_", "not_", "in_", "self_", "._", "det", "\\u", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "det", "\\u", "type_", "=_", "self_", "._", "det", "\\u", "types_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wx_", "._", "Dialog_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", ",_", "wx_", "._", "ID", "\\u", "ANY_", ",_", "title_", "=_", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Set", "Back", "ground", "Colour_", "(_", "(_", "240_", ",_", "240_", ",_", "230_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "Font_", "(_", "Font_", "(_", "9_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "parent_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Set", "Font_", "(_", "parent_", "._", "Get", "Font_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "is", "\\u", "xsp", "3_", "=_", "Check_", "(_", "self_", ",_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ",_", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "det", "type_", "=_", "Choice_", "(_", "self_", ",_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ",_", "choices_", "=_", "self_", "._", "det", "\\u", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det", "type_", "._", "Set", "String", "Selection_", "(_", "det", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "prefix_", "=_", "wx_", "._", "Text", "Ctrl_", "(_", "self_", ",_", "-_", "1_", ",_", "prefix_", ",_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nele", "m_", "=_", "Float", "Ctrl_", "(_", "self_", ",_", "value_", "=_", "nm", "ca_", ",_", "precision_", "=_", "0_", ",_", "minval_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "btn", "sizer_", "=_", "wx_", "._", "Std", "Dialog", "Butt", "on", "Sizer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "wx_", "._", "Platform_", "!=_", "\"\\u\\u", "WX", "MS", "W", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "btn_", "=_", "wx_", "._", "Context", "Help", "Button_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "btn", "sizer_", "._", "Add", "Button_", "(_", "btn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "btn_", "=_", "wx_", "._", "Button_", "(_", "self_", ",_", "wx_", "._", "ID", "\\u", "OK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "btn_", "._", "Set", "Help", "Text_", "(_", "\"", "Us", "e", " ", "this", " ", "detect", "or", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "btn_", "._", "Set", "Default_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "btn", "sizer_", "._", "Add", "Button_", "(_", "btn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "btn_", "=_", "wx_", "._", "Button_", "(_", "self_", ",_", "wx_", "._", "ID", "\\u", "CANCEL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "btn", "sizer_", "._", "Add", "Button_", "(_", "btn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "btn", "sizer_", "._", "Real", "ize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hline", "_", "=_", "wx_", "._", "Static", "Line_", "(_", "self_", ",_", "size_", "=_", "(_", "225_", ",_", "3_", ")_", ",_", "style_", "=_", "wx_", "._", "LI", "\\u", "HORIZONTAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sty", "_", "=_", "LEFT_", "|_", "wx_", "._", "ALIGN", "\\u", "CENTER", "\\u", "VERTICAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "=_", "wx_", "._", "Grid", "Bag", "Sizer_", "(_", "5_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "txt_", "(_", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Simple", "Text_", "(_", "self_", ",_", "label_", ",_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ",_", "style_", "=_", "LEFT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "txt_", "(_", "'", " ", " ", "Detect", "or", " ", "Type", "'_", ")_", ",_", "(_", "0_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "txt_", "(_", "'", " ", " ", "Us", "es", " ", "Xs", "press", "3", "?'_", ")_", ",_", "(_", "1_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "txt_", "(_", "'", " ", " ", "Epi", "cs", " ", "Pref", "ix", "'_", ")_", ",_", "(_", "2_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "txt_", "(_", "'", " ", " ", "#", " ", "Element", "s", "'_", ")_", ",_", "(_", "3_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "self_", "._", "det", "type_", ",_", "(_", "0_", ",_", "1_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "self_", "._", "is", "\\u", "xsp", "3_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "self_", "._", "prefix_", ",_", "(_", "2_", ",_", "1_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "self_", "._", "nele", "m_", ",_", "(_", "3_", ",_", "1_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "hline", "_", ",_", "(_", "4_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "2_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "btn", "sizer_", ",_", "(_", "5_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "2_", ")_", ",_", "sty", "_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "Sizer_", "(_", "sizer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Fit_", "(_", "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_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "about_", "=_", "\"\"\"", "Epi", "cs", " ", "XR", "F", " ", "Spectra", " ", "Display", "\\", "10", ";", " ", " ", "Matt", " ", "New", "vil", "le", " ", "<", "newv", "ille", " ", "@", " ", "cars", ".", "uch", "ica", "go", ".", "edu", ">", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "me", "4", "\\u", "layout_", "=_", "(_", "(_", "0_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "(_", "0_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main", "\\u", "title_", "=_", "'", "Epi", "cs", " ", "XR", "F", " ", "Control", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "update", "\\u", "mca", "(", "self", ",", " ", "count", "s", ",", " ", "**", "kw", "s", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "det", ".", "need", "s", "\\u", "refre", "sh", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", "=_", "None_", ",_", "\\u", "lar", "ch_", "=_", "None_", ",_", "prefix_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "det", "\\u", "type_", "=_", "'", "ME", "-", "4", "'_", ",_", "is", "\\u", "xsp", "3_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nm", "ca_", "=_", "4_", ",_", "size_", "=_", "(_", "725", "_", ",_", "580", "_", ")_", ",_", "scan", "db", "\\u", "conn_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "'", "Epi", "cs", " ", "XR", "F", " ", "Display", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "title_", "=_", "'", "XR", "F", "'_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det", "\\u", "type_", "=_", "det", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "\\u", "xsp", "3_", "=_", "is", "\\u", "xsp", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "nm", "ca_", "=_", "nm", "ca_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det", "\\u", "fore", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det", "\\u", "back_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scan", "db_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "scan", "db", "\\u", "conn_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Connect", "Sca", "n", "DB_", "(_", "**_", "scan", "db", "\\u", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "on", "Connect", "Epi", "cs_", "(_", "event_", "=_", "None_", ",_", "prefix_", "=_", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "XR", "FD", "isp", "lay", "Frame_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "parent_", "=_", "parent_", ",_", "\\u", "lar", "ch_", "=_", "\\u", "lar", "ch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "title_", "=_", "title_", ",_", "size_", "=_", "size_", ",_", "**_", "kws_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Connect", "Epi", "cs_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "prefix_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prefix_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "self_", "._", "prompt", "\\u", "for", "\\u", "detector_", "(_", "prefix_", "=_", "prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "xsp", "3_", "=_", "self_", "._", "is", "\\u", "xsp", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nm", "ca_", "=_", "self_", "._", "nm", "ca_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prefix_", ",_", "self_", "._", "det", "\\u", "type_", ",_", "self_", "._", "is", "\\u", "xsp", "3_", ",_", "self_", "._", "nm", "ca_", "=_", "res_", "\\u\\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_", "._", "prefix_", "=_", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "det", "\\u", "fore", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det", "\\u", "back_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "\\u", "mca", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connect", "\\u", "to", "\\u", "detector_", "(_", "prefix_", "=_", "self_", "._", "prefix_", ",_", "is", "\\u", "xsp", "3_", "=_", "self_", "._", "is", "\\u", "xsp", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "det", "\\u", "type_", "=_", "self_", "._", "det", "\\u", "type_", ",_", "nm", "ca_", "=_", "self_", "._", "nm", "ca_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Connect", "Sca", "n", "DB_", "(_", "self_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "scan", "db_", "=_", "Sca", "n", "DB_", "(_", "**_", "kws_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "\"", "Sca", "ndb", " ", "\",", " ", "self", ".", "scan", "db_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "scan", "db_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basedir_", "=_", "self_", "._", "scan", "db_", "._", "get", "\\u", "info_", "(_", "'", "user", "\\u", "folder", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filer", "oot_", "=_", "self_", "._", "scan", "db_", "._", "get", "\\u", "info_", "(_", "'", "server", "\\u", "filer", "oot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "basedir_", "=_", "str_", "(_", "basedir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filer", "oot_", "=_", "str_", "(_", "filer", "oot_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "basedir_", "._", "startswith_", "(_", "filer", "oot_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basedir_", "=_", "basedir_", "[_", "len_", "(_", "filer", "oot_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fullpath_", "=_", "os_", "._", "path_", "._", "join_", "(_", "filer", "oot_", ",_", "basedir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fullpath_", "=_", "fullpath_", "._", "replace_", "(_", "'\\\\\\\\'_", ",_", "'/'_", ")_", "._", "replace_", "(_", "'//'_", ",_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curdir_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "chdir_", "(_", "fullpath_", ")_", "\\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 ", " _", "os_", "._", "chdir_", "(_", "curdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "scan", "db_", "._", "connect", "\\u", "pvs", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Save", "MC", "AF", "ile_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp_", "=_", "'''", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "print", " ", "'", "Save", "MC", "A", " ", "File", "'", "\\", "10", ";", " ", " ", " ", " ", "def", "file", " ", "=", " ", "''", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "has", "attr", "(", "self", ".", "mca", ",", " ", "'", "sourcef", "ile", "')", ":", "\\", "10", ";", " ", " ", " ", " ", "def", "file", " ", "=", " ", "\"%", "s", "%", "s", "\"", " ", "%", " ", "(", "def", "file", ",", " ", "getattr", "(", "self", ".", "mca", ",", " ", "'", "sourcef", "ile", "'))", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "has", "attr", "(", "self", ".", "mca", ",", " ", "'", "area", "name", "')", ":", "\\", "10", ";", " ", " ", " ", " ", "def", "file", " ", "=", " ", "\"%", "s", "%", "s", "\"", " ", "%", " ", "(", "def", "file", ",", " ", "getattr", "(", "self", ".", "mca", ",", " ", "'", "area", "name", "'))", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "def", "file", " ", "==", " ", "''", ":", "\\", "10", ";", " ", " ", " ", " ", "def", "file", " ", "='", "test", "'", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "not", " ", "def", "file", ".", "ends", "with", "('.", "mca", "')", ":", "\\", "10", ";", " ", " ", " ", " ", "def", "file", " ", "=", " ", "def", "file", " ", "+", " ", "'.", "mca", "'", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def", "file_", "=_", "'", "save", ".", "mca", "'_", "#", " ", "fix", "\\u", "filename", "(", "str", "(", "def", "file", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outfile_", "=_", "File", "Save_", "(_", "self_", ",_", "\"", "Save", " ", "MC", "A", " ", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "file_", "=_", "def", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wildcard_", "=_", "FILE", "\\u", "WIL", "DC", "ARD", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "environ_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "scan", "db_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", ",_", "table_", "=_", "self_", "._", "scan", "db_", "._", "get", "\\u", "table_", "(_", "'", "pvs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pv", "rows_", "=_", "self_", "._", "scan", "db_", "._", "query_", "(_", "table_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "pv", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "addr_", "=_", "str_", "(_", "row_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc_", "=_", "str_", "(_", "row_", "._", "notes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "self_", "._", "scan", "db_", "._", "pvs", "_", "[_", "addr_", "]_", "._", "get_", "(_", "as", "\\u", "string_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "._", "append_", "(_", "(_", "addr_", ",_", "val_", ",_", "desc_", ")_", ")_", "\\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_", "outfile_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "._", "save", "\\u", "mca", "file_", "(_", "outfile_", ",_", "environ_", "=_", "environ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Save", "Colum", "n", "File_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", " ", " ", "EPI", "CS", "-", "XR", "FD", "isp", "lay", " ", "on", "Save", "Colum", "n", "File", " ", "not", " ", "ye", "t", " ", "implemented", " ", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prompt", "\\u", "for", "\\u", "detector_", "(_", "self_", ",_", "prefix_", "=_", "None_", ",_", "is", "\\u", "xsp", "3_", "=_", "False_", ",_", "nm", "ca_", "=_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dlg_", "=_", "Detect", "or", "Select", "Dialog_", "(_", "prefix_", "=_", "prefix_", ",_", "is", "\\u", "xsp", "3_", "=_", "is", "\\u", "xsp", "3_", ",_", "nm", "ca_", "=_", "nm", "ca_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dlg_", "._", "Raise_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dlg_", "._", "Show", "Modal_", "(_", ")_", "==_", "wx_", "._", "ID", "\\u", "OK_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dpr", "ef_", "=_", "dlg_", "._", "prefix_", "._", "Get", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "atype_", "=_", "dlg_", "._", "is", "\\u", "xsp", "3_", "._", "Is", "Checked_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dtype_", "=_", "dlg_", "._", "det", "type_", "._", "Get", "String", "Selection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nm", "ca_", "=_", "dlg_", "._", "nele", "m_", "._", "Get", "Value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dlg_", "._", "Destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dpr", "ef_", ",_", "dtype_", ",_", "atype_", ",_", "nm", "ca_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connect", "\\u", "to", "\\u", "detector_", "(_", "self_", ",_", "prefix_", "=_", "None_", ",_", "is", "\\u", "xsp", "3_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "det", "\\u", "type_", "=_", "None_", ",_", "nm", "ca_", "=_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "xsp", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "=_", "Epi", "cs", "\\u", "Xs", "press", "3_", "(_", "prefix_", "=_", "prefix_", ",_", "nm", "ca_", "=_", "nm", "ca_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "get", "\\u", "mca", "_", "(_", "mca", "_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "need", "s", "\\u", "newp", "lot_", "=_", "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_", "._", "det_", "=_", "Epi", "cs", "\\u", "Multi", "XM", "AP_", "(_", "prefix_", "=_", "prefix_", ",_", "nm", "ca_", "=_", "nm", "ca_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "\\u", "mca", "_", "(_", "self_", ",_", "init_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "need", "s", "\\u", "newp", "lot_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "mca", "_", "is_", "None_", "or_", "self_", "._", "need", "s", "\\u", "newp", "lot_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mca", "_", "=_", "self_", "._", "det_", "._", "get", "\\u", "mca", "_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "fore", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "plot", "mca", "_", "(_", "self_", "._", "mca", "_", ",_", "set\\u", "title_", "=_", "False_", ",_", "init_", "=_", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "\"", "Fore", "ground", ":", " ", "MC", "A", "{:", "d", "}\"_", "._", "format_", "(_", "self_", "._", "det", "\\u", "fore", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "det", "\\u", "back_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "mca", "2_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mca", "2_", "=_", "self_", "._", "det_", "._", "get", "\\u", "mca", "_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c2_", "=_", "self_", "._", "det_", "._", "get", "\\u", "array_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e2_", "=_", "self_", "._", "det_", "._", "get", "\\u", "energy_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "\"{:", "s", "}", " ", " ", "Back", "ground", ":", " ", "MC", "A", "{:", "d", "}\"_", "._", "format_", "(_", "title_", ",_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "opl", "ot_", "(_", "e2_", ",_", "c2_", ")_", "\\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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "roi", "name_", "=_", "self_", "._", "get", "\\u", "roi", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "roi", "name_", "in_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Get", "Strings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Get", "Strings_", "(_", ")_", "._", "index_", "(_", "roi", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Ensur", "e", "Visible_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "ROI", "_", "(_", "label_", "=_", "roi", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "Set", "Title_", "(_", "\"%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "main", "\\u", "title_", ",_", "title_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "need", "s", "\\u", "newp", "lot_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Save", "ROI", "s_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dlg_", "=_", "wx_", "._", "File", "Dialog_", "(_", "self_", ",_", "message_", "=_", "\"", "Save", " ", "ROI", " ", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "Dir_", "=_", "os_", "._", "getcwd_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wildcard_", "=_", "ROI", "\\u", "WIL", "DC", "ARD", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "wx_", "._", "FD", "\\u", "SAVE", "_", "|_", "wx_", "._", "FD", "\\u", "CHANGE", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dlg_", "._", "Show", "Modal_", "(_", ")_", "==_", "wx_", "._", "ID", "\\u", "OK_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "roi", "file_", "=_", "dlg_", "._", "Get", "Path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "det_", "._", "save", "\\u", "rois_", "(_", "roi", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Restor", "e", "ROI", "s_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dlg_", "=_", "wx_", "._", "File", "Dialog_", "(_", "self_", ",_", "message_", "=_", "\"", "Read", " ", "ROI", " ", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "Dir_", "=_", "os_", "._", "getcwd_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wildcard_", "=_", "ROI", "\\u", "WIL", "DC", "ARD", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "wx_", "._", "FD", "\\u", "OPEN_", "|_", "wx_", "._", "FD", "\\u", "CHANGE", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dlg_", "._", "Show", "Modal_", "(_", ")_", "==_", "wx_", "._", "ID", "\\u", "OK_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "roi", "file_", "=_", "dlg_", "._", "Get", "Path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "restore", "\\u", "rois_", "(_", "roi", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "roi", "list_", "(_", "mca", "_", "=_", "self_", "._", "mca", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "show", "\\u", "mca", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "Select", "Det", "_", "(_", "event_", "=_", "None_", ",_", "index_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "Custom", "Menu", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "menu_", "=_", "wx_", "._", "Menu_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Menu", "Item_", "(_", "self_", ",_", "menu_", ",_", "\"", "Connect", " ", "to", " ", "Detect", "or", "\\\\", "t", "Ctrl", "+", "D", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Connect", " ", "to", " ", "MC", "A", " ", "or", " ", "XS", "Press", "3", " ", "Detect", "or", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "on", "Connect", "Epi", "cs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "menu_", "._", "Append", "Separator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "menus_", "._", "insert_", "(_", "1_", ",_", "(_", "menu_", ",_", "'", "Detect", "or", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "Main", "Panel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "epic", "span", "el_", "=_", "self_", "._", "create", "Epi", "cs", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctrl", "panel_", "=_", "self_", "._", "create", "Control", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "panel_", "=_", "self_", "._", "panel_", "=_", "self_", "._", "create", "Plot", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "panel_", "._", "Set", "Name_", "(_", "'", "plot", "panel", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", ",_", "ty_", "=_", "self_", "._", "wids_", "[_", "'", "ptable", "'_", "]_", "._", "Get", "Bes", "t", "Size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cx_", ",_", "cy_", "=_", "ctrl", "panel_", "._", "Get", "Bes", "t", "Size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "px_", ",_", "py_", "=_", "plot", "panel_", "._", "Get", "Bes", "t", "Size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Set", "Size_", "(_", "(_", "950", "_", ",_", "625_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "Min", "Size_", "(_", "(_", "450_", ",_", "350_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "style_", "=_", "wx_", "._", "ALIGN", "\\u", "LEFT_", "|_", "wx_", "._", "EXPAND_", "|_", "wx_", "._", "ALL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bsi", "zer_", "=_", "wx_", "._", "Box", "Sizer_", "(_", "wx_", "._", "HORIZONTAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bsi", "zer_", "._", "Add_", "(_", "ctrl", "panel_", ",_", "0_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bsi", "zer_", "._", "Add_", "(_", "plot", "panel_", ",_", "1_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hline", "_", "=_", "wx_", "._", "Static", "Line_", "(_", "self_", ",_", "size_", "=_", "(_", "425", "_", ",_", "2_", ")_", ",_", "style_", "=_", "wx_", "._", "LI", "\\u", "HORIZONTAL_", "|_", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sizer_", "=_", "wx_", "._", "Box", "Sizer_", "(_", "wx_", "._", "VERTICAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "epic", "span", "el_", ",_", "0_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "hline", "_", ",_", "0_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sizer_", "._", "Add_", "(_", "bsi", "zer_", ",_", "1_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pack_", "(_", "self_", ",_", "sizer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "roi", "list_", "(_", "mca", "_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "Epi", "cs", "Panel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pane_", "=_", "wx_", "._", "Panel_", "(_", "self_", ",_", "name_", "=_", "'", "epic", "s", " ", "panel", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "=_", "wx_", "._", "Grid", "Bag", "Sizer_", "(_", "4_", ",_", "12_", ")_", "#", " ", "wx", ".", "Box", "Sizer", "(", "wx", ".", "HORI", "ZON", "TAL", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "btn", "panel_", "=_", "wx_", "._", "Panel_", "(_", "pane_", ",_", "name_", "=_", "'", "buttons", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nm", "ca_", "=_", "self_", "._", "nm", "ca_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NP", "ERR", "OW", "_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "Font_", "(_", "Font_", "(_", "9_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "det", "\\u", "type_", "._", "lower_", "(_", ")_", "._", "startswith_", "(_", "'", "me", "-", "4", "'_", ")_", "and_", "nm", "ca_", "<_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "btn", "sizer_", "=_", "wx_", "._", "Grid", "Bag", "Sizer_", "(_", "2_", ",_", "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 ", " _", "btn", "sizer_", "=_", "wx_", "._", "Grid", "Bag", "Sizer_", "(_", "int_", "(_", "(_", "nm", "ca_", "+_", "NP", "ERR", "OW", "_", "-_", "2_", ")_", "/_", "(_", "1.0_", "*_", "NP", "ERR", "OW", "_", ")_", ")_", ",_", "NP", "ERR", "OW", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "style_", "=_", "wx_", "._", "ALIGN", "\\u", "LEFT_", "|_", "wx_", "._", "ALIGN", "\\u", "CENTER", "\\u", "VERTICAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rst", "yle", "_", "=_", "wx_", "._", "ALIGN", "\\u", "RIGHT_", "|_", "wx_", "._", "ALIGN", "\\u", "CENTER", "\\u", "VERTICAL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bkg", "\\u", "choices_", "=_", "[_", "'", "Non", "e", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "Simple", "Text_", "(_", "pane_", ",_", "'", " ", "MC", "As", ":", " ", "'_", ")_", ",_", "(_", "0_", ",_", "0_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "1_", "+_", "nm", "ca_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bkg", "\\u", "choices_", "._", "append_", "(_", "\"%", "i", "\"_", "%_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Button_", "(_", "btn", "panel_", ",_", "'%", "i", "'_", "%_", "i_", ",_", "size_", "=_", "(_", "30_", ",_", "25_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "partial_", "(_", "self_", "._", "on", "Select", "Det", "_", ",_", "index_", "=_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "det", "%", "i", "'_", "%_", "i_", "]_", "=_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc_", "=_", "divmod_", "(_", "i_", "-_", "1_", ",_", "NP", "ERR", "OW", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "det", "\\u", "type_", "._", "lower_", "(_", ")_", "._", "startswith_", "(_", "'", "me", "-", "4", "'_", ")_", "and_", "nm", "ca_", "<_", "NP", "ERR", "OW", "_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loc_", "=_", "self_", "._", "me", "4", "\\u", "layout_", "[_", "i_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "btn", "sizer_", "._", "Add_", "(_", "b_", ",_", "loc_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pack_", "(_", "btn", "panel_", ",_", "btn", "sizer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nrows_", "=_", "1_", "+_", "loc_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "det", "\\u", "type_", "._", "lower_", "(_", ")_", "._", "startswith_", "(_", "'", "me", "-", "4", "'_", ")_", "and_", "nm", "ca_", "<_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nrows_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "btn", "panel_", ",_", "(_", "0_", ",_", "1_", ")_", ",_", "(_", "nrows_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "det", "\\u", "status", "'_", "]_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", " ", "'_", ",_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ",_", "style_", "=_", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "dead", "time", "'_", "]_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", " ", "'_", ",_", "size_", "=_", "(_", "120_", ",_", "-_", "1_", ")_", ",_", "style_", "=_", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "bkg", "\\u", "det", "'_", "]_", "=_", "Choice_", "(_", "pane_", ",_", "size_", "=_", "(_", "75_", ",_", "-_", "1_", ")_", ",_", "choices_", "=_", "bkg", "\\u", "choices_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "on", "Select", "Det", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "dwe", "ll", "time", "'_", "]_", "=_", "Float", "Ctrl_", "(_", "pane_", ",_", "value_", "=_", "0.0_", ",_", "precision_", "=_", "1_", ",_", "minval_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "size_", "=_", "(_", "80_", ",_", "-_", "1_", ")_", ",_", "act", "\\u", "on", "\\u", "lose", "focus_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", "._", "on", "Set", "Dw", "ell", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "ela", "pse", "d", "'_", "]_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", " ", "'_", ",_", "size_", "=_", "(_", "80_", ",_", "-_", "1_", ")_", ",_", "style_", "=_", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "b1_", "=_", "Button_", "(_", "pane_", ",_", "'", "Start", "'_", ",_", "size_", "=_", "(_", "90_", ",_", "25_", ")_", ",_", "action_", "=_", "self_", "._", "on", "Start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b2_", "=_", "Button_", "(_", "pane_", ",_", "'", "Sto", "p", "'_", ",_", "size_", "=_", "(_", "90_", ",_", "25_", ")_", ",_", "action_", "=_", "self_", "._", "on", "Stop_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b3_", "=_", "Button_", "(_", "pane_", ",_", "'", "Erase", "'_", ",_", "size_", "=_", "(_", "90_", ",_", "25_", ")_", ",_", "action_", "=_", "self_", "._", "on", "Erase", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b4", "_", "=_", "Button_", "(_", "pane_", ",_", "'", "Continu", "ous", "'_", ",_", "size_", "=_", "(_", "90_", ",_", "25_", ")_", ",_", "action_", "=_", "partial_", "(_", "self_", "._", "on", "Start_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dtime", "_", "=_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bkg", "\\u", "lab_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", "Back", "ground", " ", "MC", "A", ":'_", ",_", "size_", "=_", "(_", "150_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pre", "\\u", "lab_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", "Preset", " ", "Time", " ", "(", "s", "):'_", ",_", "size_", "=_", "(_", "125_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ela", "\\u", "lab_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", "El", "aps", "ed", " ", "Time", " ", "(", "s", "):'_", ",_", "size_", "=_", "(_", "125_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sta", "\\u", "lab_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'", "Status", " ", ":'_", ",_", "size_", "=_", "(_", "100_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dea", "\\u", "lab_", "=_", "Simple", "Text_", "(_", "pane_", ",_", "'%", " ", "Dead", "time", ":'_", ",_", "size_", "=_", "(_", "100_", ",_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "bkg", "\\u", "lab_", ",_", "(_", "0_", ",_", "2_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "self_", "._", "wids_", "[_", "'", "bkg", "\\u", "det", "'_", "]_", ",_", "(_", "1_", ",_", "2_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "pre", "\\u", "lab_", ",_", "(_", "0_", ",_", "3_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "ela", "\\u", "lab_", ",_", "(_", "1_", ",_", "3_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "self_", "._", "wids_", "[_", "'", "dwe", "ll", "time", "'_", "]_", ",_", "(_", "0_", ",_", "4_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "self_", "._", "wids_", "[_", "'", "ela", "pse", "d", "'_", "]_", ",_", "(_", "1_", ",_", "4_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "b1_", ",_", "(_", "0_", ",_", "5_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "b4", "_", ",_", "(_", "0_", ",_", "6_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "b2_", ",_", "(_", "1_", ",_", "5_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "b3_", ",_", "(_", "1_", ",_", "6_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "sta", "\\u", "lab_", ",_", "(_", "0_", ",_", "7_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "self_", "._", "wids_", "[_", "'", "det", "\\u", "status", "'_", "]_", ",_", "(_", "0_", ",_", "8_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "dea", "\\u", "lab_", ",_", "(_", "1_", ",_", "7_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "psi", "zer_", "._", "Add_", "(_", "self_", "._", "wids_", "[_", "'", "dead", "time", "'_", "]_", ",_", "(_", "1_", ",_", "8_", ")_", ",_", "(_", "1_", ",_", "1_", ")_", ",_", "style_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pack_", "(_", "pane_", ",_", "psi", "zer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pane", ".", "Set", "Min", "Size", "((", "500", ",", " ", "5", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "det_", "._", "connect", "\\u", "display", "s_", "(_", "status_", "=_", "self_", "._", "wids_", "[_", "'", "det", "\\u", "status", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "elapsed_", "=_", "self_", "._", "wids_", "[_", "'", "ela", "pse", "d", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dead", "time_", "=_", "self_", "._", "wids_", "[_", "'", "dead", "time", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wx_", "._", "Call", "After_", "(_", "self_", "._", "on", "Select", "Det", "_", ",_", "index_", "=_", "1_", ",_", "init_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "timer", "\\u", "counter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mca", "\\u", "timer_", "=_", "wx_", "._", "Timer_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Bind_", "(_", "wx_", "._", "EV", "T", "\\u", "TIMER", "_", ",_", "self_", "._", "Update", "Data_", ",_", "self_", "._", "mca", "\\u", "timer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mca", "\\u", "timer_", "._", "Start_", "(_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "pane_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Update", "Data_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "force_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "timer", "\\u", "counter_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "mca", "_", "is_", "None_", "or_", "self_", "._", "need", "s", "\\u", "newp", "lot_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "show", "\\u", "mca", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "ela", "pse", "d\\u", "real", " ", "=", " ", "self", ".", "det", ".", "ela", "pse", "d\\u", "real_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "mca", "_", "._", "real", "\\u", "time_", "=_", "self_", "._", "det_", "._", "ela", "pse", "d\\u", "real_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "force_", "or_", "self_", "._", "det_", "._", "need", "s", "\\u", "refresh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "._", "need", "s", "\\u", "refresh_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "det", "\\u", "back_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "mca", "2_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "mca", "2_", "=_", "self_", "._", "det_", "._", "get", "\\u", "mca", "_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "counts_", "=_", "self_", "._", "det_", "._", "get", "\\u", "array_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "energy_", "=_", "self_", "._", "det_", "._", "get", "\\u", "energy_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "update", "\\u", "mca", "_", "(_", "counts_", ",_", "energy_", "=_", "energy_", ",_", "is", "\\u", "mca", "2_", "=_", "True_", ",_", "draw_", "=_", "False_", ")_", "\\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 ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "mca", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mca", "_", "=_", "self_", "._", "det_", "._", "get", "\\u", "mca", "_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "fore", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "counts_", "=_", "self_", "._", "det_", "._", "get", "\\u", "array_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "fore", "_", ")_", "*_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "energy_", "=_", "self_", "._", "det_", "._", "get", "\\u", "energy_", "(_", "mca", "_", "=_", "self_", "._", "det", "\\u", "fore", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max_", "(_", "counts_", ")_", "<_", "1.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "=_", "1e-4_", "*_", "np_", "._", "ones_", "(_", "len_", "(_", "counts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counts_", "[_", "0_", "]_", "=_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "update", "\\u", "mca", "_", "(_", "counts_", ",_", "energy_", "=_", "energy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Show", "ROI", "Status_", "(_", "self_", ",_", "left_", ",_", "right_", ",_", "name_", "=_", "''_", ",_", "panel_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "left_", ">_", "right_", ":_", "\\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_", "sum_", "=_", "self_", "._", "ydata_", "[_", "left_", ":_", "right_", "]_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt_", "=_", "self_", "._", "mca", "_", "._", "real", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "roi", "\\u", "ave_", "=_", "self_", "._", "roi", "\\u", "ave", "s_", "[_", "panel_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "roi", "\\u", "ave_", "._", "update_", "(_", "sum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cps", "_", "=_", "roi", "\\u", "ave_", "._", "get", "\\u", "cps", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nms", "g_", ",_", "cms", "g_", ",_", "rms", "g_", "=_", "''_", ",_", "''_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "name_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nms", "g_", "=_", "\"", " ", "%", "s", "\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cms", "g_", "=_", "\"", " ", "Count", "s", "={", ":", "10", ",.", "0f", "}\"_", "._", "format_", "(_", "sum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cps", "_", "is_", "not_", "None_", "and_", "cps", "_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rms", "g_", "=_", "\"", " ", "CPS", "={", ":", "10", ",.", "1f", "}\"_", "._", "format_", "(_", "cps", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write", "\\u", "message_", "(_", "\"%", "s", "%", "s", "%", "s", "\"_", "%_", "(_", "nms", "g_", ",_", "cms", "g_", ",_", "rms", "g_", ")_", ",_", "panel_", "=_", "panel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Select", "Det", "_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "index_", "=_", "0_", ",_", "init_", "=_", "False_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "index_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det", "\\u", "fore", "_", "=_", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "det", "\\u", "back_", "=_", "self_", "._", "wids_", "[_", "'", "bkg", "\\u", "det", "'_", "]_", "._", "Get", "Selection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "det", "\\u", "fore", "_", "==_", "self_", "._", "det", "\\u", "back_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det", "\\u", "back_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "self_", "._", "nm", "ca_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dname_", "=_", "'", "det", "%", "i", "'_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bco", "l_", "=_", "(_", "220_", ",_", "220_", ",_", "220_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fco", "l_", "=_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "==_", "self_", "._", "det", "\\u", "fore", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bco", "l_", "=_", "(_", "60_", ",_", "50_", ",_", "245_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fco", "l_", "=_", "(_", "240_", ",_", "230_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "==_", "self_", "._", "det", "\\u", "back_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bco", "l_", "=_", "(_", "80_", ",_", "200_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wids_", "[_", "dname_", "]_", "._", "Set", "Back", "ground", "Colour_", "(_", "bco", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "dname_", "]_", "._", "Set", "Fore", "ground", "Colour_", "(_", "fco", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "clear", "\\u", "mca", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "show", "\\u", "mca", "_", "(_", "init_", "=_", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Refresh_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "swap", "\\u", "mca", "s_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "mca", "2_", "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_", "self_", "._", "mca", "_", ",_", "self_", "._", "mca", "2_", "=_", "self_", "._", "mca", "2_", ",_", "self_", "._", "mca", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fore", "_", ",_", "back_", "=_", "self_", "._", "det", "\\u", "fore", "_", ",_", "self_", "._", "det", "\\u", "back_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "bkg", "\\u", "det", "'_", "]_", "._", "Set", "Selection_", "(_", "fore", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "Select", "Det", "_", "(_", "index_", "=_", "back_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Set", "Dw", "ell", "time_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "dwe", "ll", "time", "'_", "in_", "self_", "._", "wids_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "._", "set\\u", "dwe", "ll", "time_", "(_", "dtime", "_", "=_", "self_", "._", "wids_", "[_", "'", "dwe", "ll", "time", "'_", "]_", "._", "Get", "Value_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "\\u", "mca", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "mca", "_", "=_", "self_", "._", "mca", "2_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "x2", "data_", "=_", "self_", "._", "y2", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "need", "s", "\\u", "newp", "lot_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Start_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "dtime", "_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "dtime", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wids_", "[_", "'", "dwe", "ll", "time", "'_", "]_", "._", "Set", "Value_", "(_", "\"%", ".1", "f", "\"_", "%_", "dtime", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "set\\u", "dwe", "ll", "time_", "(_", "dtime", "_", "=_", "dtime", "_", ")_", "\\u\\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_", "._", "det_", "._", "set\\u", "dwe", "ll", "time_", "(_", "dtime", "_", "=_", "self_", "._", "wids_", "[_", "'", "dwe", "ll", "time", "'_", "]_", "._", "Get", "Value_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "rave", "_", "._", "clear_", "(_", ")_", "for_", "rave", "_", "in_", "self_", "._", "roi", "\\u", "ave", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Stop_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "need", "s", "\\u", "refresh_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "0.125_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Update", "Data_", "(_", "event_", "=_", "None_", ",_", "force_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Erase", "_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "need", "s", "\\u", "newp", "lot_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "det_", "._", "erase_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Del", "ROI", "_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "roi", "name_", "=_", "self_", "._", "get", "\\u", "roi", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errmsg_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "roi", "list", "\\u", "sel_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "'", "No", " ", "ROI", " ", "selecte", "d", " ", "to", " ", "delete", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errmsg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Popup_", "(_", "self_", ",_", "errmsg_", ",_", "'", "Cann", "ot", " ", "Delete", " ", "ROI", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "det_", "._", "del", "\\u", "roi_", "(_", "roi", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XR", "FD", "isp", "lay", "Frame_", "._", "on", "Del", "ROI", "_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "New", "ROI", "_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "roi", "name_", "=_", "self_", "._", "get", "\\u", "roi", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errmsg_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "xma", "rke", "r", "\\u", "left_", "is_", "None_", "or_", "self_", "._", "xma", "rke", "r", "\\u", "right_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "'", "Mus", "t", " ", "select", " ", "right", " ", "and", " ", "left", " ", "marker", "s", " ", "to", " ", "defin", "e", " ", "ROI", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "roi", "name_", "in_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Get", "Strings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "'%", "s", " ", "is", " ", "alr", "ead", "y", " ", "in", " ", "ROI", " ", "list", " ", "-", " ", "use", " ", "a", " ", "unique", " ", "name", ".'_", "%_", "roi", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errmsg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Popup_", "(_", "self_", ",_", "errmsg_", ",_", "'", "Cann", "ot", " ", "Define", " ", "ROI", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "confirmed_", "=_", "XR", "FD", "isp", "lay", "Frame_", "._", "on", "New", "ROI", "_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "confirmed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "._", "add", "\\u", "roi_", "(_", "roi", "name_", ",_", "lo_", "=_", "self_", "._", "xma", "rke", "r", "\\u", "left_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hi_", "=_", "self_", "._", "xma", "rke", "r", "\\u", "right_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Rename", "ROI", "_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "roi", "name_", "=_", "self_", "._", "get", "\\u", "roi", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errmsg_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "roi", "name_", "in_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Get", "Strings_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "'%", "s", " ", "is", " ", "alr", "ead", "y", " ", "in", " ", "ROI", " ", "list", " ", "-", " ", "use", " ", "a", " ", "unique", " ", "name", ".'_", "%_", "roi", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "roi", "list", "\\u", "sel_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errmsg_", "=_", "'", "No", " ", "ROI", " ", "selecte", "d", " ", "to", " ", "rename", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errmsg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Popup_", "(_", "self_", ",_", "errmsg_", ",_", "'", "Cann", "ot", " ", "Rename", " ", "ROI", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "roi", "list", "\\u", "sel_", "<_", "len_", "(_", "self_", "._", "det_", "._", "mca", "s_", "[_", "0_", "]_", "._", "rois_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "det_", "._", "rename", "\\u", "roi_", "(_", "self_", "._", "roi", "list", "\\u", "sel_", ",_", "roi", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Get", "Strings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "[_", "self_", "._", "roi", "list", "\\u", "sel_", "]_", "=_", "roi", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sname_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Append_", "(_", "sname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "wids_", "[_", "'", "roi", "list", "'_", "]_", "._", "Set", "Selection_", "(_", "self_", "._", "roi", "list", "\\u", "sel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Calibrat", "e", "Energy_", "(_", "self_", ",_", "event_", "=_", "None_", ",_", "**_", "kws_", ")_", ":_", "\\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_", "._", "win", "\\u", "calib", "_", "._", "Raise_", "(_", ")_", "\\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_", "._", "win", "\\u", "calib", "_", "=_", "Calibrat", "ion", "Frame_", "(_", "self_", ",_", "mca", "_", "=_", "self_", "._", "mca", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lar", "ch_", "=_", "self_", "._", "lar", "ch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "callback_", "=_", "self_", "._", "on", "Set", "Cali", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Set", "Cali", "b_", "(_", "self_", ",_", "offset_", ",_", "slope_", ",_", "mca", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "XR", "FC", "ontr", "ol", " ", "Set", " ", "Energ", "y", " ", "Calibrat", "ione", "'_", ",_", "offset_", ",_", "slope_", ",_", "mca", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Close_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "on", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XR", "FD", "isp", "lay", "Frame_", "._", "on", "Close_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "XR", "FD", "isp", "lay", "Frame_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Exit_", "(_", "self_", ",_", "event_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "on", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XR", "FD", "isp", "lay", "Frame_", "._", "on", "Exit_", "(_", "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_", "Epi", "cs", "XR", "FA", "pp_", "(_", "wx_", "._", "App_", ",_", "wx_", "._", "lib_", "._", "mixins_", "._", "inspection", "_", "._", "Inspect", "ion", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FA", "pp_", "(_", "wx_", "._", "App_", ",_", "wx_", "._", "lib_", "._", "mixins_", "._", "inspection", "_", "._", "Inspect", "ion", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kws_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "kws_", "=_", "kws_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wx_", "._", "App_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Epi", "cs", "XR", "FA", "pp_", "(_", "wx_", "._", "App_", ",_", "wx_", "._", "lib_", "._", "mixins_", "._", "inspection", "_", "._", "Inspect", "ion", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "=_", "Epi", "cs", "XR", "FD", "isp", "lay", "Frame_", "(_", "**_", "self_", "._", "kws_", ")_", "#", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frame_", "._", "Show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Set", "Top", "Window_", "(_", "frame_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 1, 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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1,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 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Constant in conditional expression or statement
cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_Path.py
[ { "content": "def test_main(debug=0):\n if 1:\n\trun_test(NewTestCase, debug)\n if 1:\n\trun_test(RelationTestCase, debug)\n\trun_test(RootTestCase, debug)\n if 1:\n\trun_test(PathTestCase, debug)\n if 1:\n\trun_test(MultiTestCase, debug)\n\trun_test(AvoidTestCase, debug)", "metadata": "root.test_main", "header": "['module', '___EOS___']", "index": 1030 } ]
[ { "span": "1:", "start_line": 1031, "start_column": 7, "end_line": 1031, "end_column": 8 }, { "span": "1:", "start_line": 1033, "start_column": 7, "end_line": 1033, "end_column": 8 }, { "span": "1:", "start_line": 1036, "start_column": 7, "end_line": 1036, "end_column": 8 }, { "span": "1:", "start_line": 1038, "start_column": 7, "end_line": 1038, "end_column": 8 } ]
[]
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_", "def_", "test\\u", "main_", "(_", "debug_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "run", "\\u", "test_", "(_", "New", "Test", "Case_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "run", "\\u", "test_", "(_", "Relation", "Test", "Case_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "test_", "(_", "Roo", "t", "Test", "Case_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "run", "\\u", "test_", "(_", "Path", "Test", "Case_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "run", "\\u", "test_", "(_", "Multi", "Test", "Case_", ",_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "test_", "(_", "Av", "oid", "Test", "Case_", ",_", "debug_", ")_", "\\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, 0, 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, 0, 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 ]
Imprecise assert
ImageEngine/gaffer/python/GafferTest/OrphanRemoverTest.py
[ { "content": "\tdef test( self ) :\n\n\t\tp = Gaffer.GraphComponent()\n\t\tc1 = Gaffer.GraphComponent()\n\t\tc2 = Gaffer.GraphComponent()\n\t\tp[\"c1\"] = c1\n\t\tp[\"c2\"] = c2\n\n\t\ts = Gaffer.StandardSet( p.children() )\n\t\tb = Gaffer.Behaviours.OrphanRemover( s )\n\n\t\tself.assertEqual( len( s ), 2 )\n\t\tself.assertTrue( c1 in s )\n\t\tself.assertTrue( c2 in s )\n\n\t\tp.removeChild( c1 )\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertTrue( c2 in s )\n\n\t\tp[\"c1\"] = c1\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertTrue( c2 in s )\n\n\t\ts.add( c1 )\n\n\t\tself.assertEqual( len( s ), 2 )\n\t\tself.assertTrue( c1 in s )\n\t\tself.assertTrue( c2 in s )\n\n\t\tp.removeChild( c1 )\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertTrue( c2 in s )\n\n\t\tp.removeChild( c2 )\n\n\t\tself.assertEqual( len( s ), 0 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertFalse( c2 in s )\n\n\t\tc3 = Gaffer.GraphComponent()\n\t\ts.add( c3 )\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertFalse( c2 in s )\n\t\tself.assertTrue( c3 in s )\n\n\t\tp[\"c3\"] = c3\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertFalse( c2 in s )\n\t\tself.assertTrue( c3 in s )\n\n\t\tp.removeChild( c3 )\n\n\t\tself.assertEqual( len( s ), 0 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertFalse( c2 in s )\n\t\tself.assertFalse( c3 in s )\n\n\t\tp[\"c3\"] = c3\n\t\ts.add( c3 )\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertFalse( c2 in s )\n\t\tself.assertTrue( c3 in s )\n\n\t\tdel b\n\t\tp.removeChild( c3 )\n\n\t\tself.assertEqual( len( s ), 1 )\n\t\tself.assertFalse( c1 in s )\n\t\tself.assertFalse( c2 in s )\n\t\tself.assertTrue( c3 in s )", "metadata": "root.OrphanRemoverTest.test", "header": "['class', 'OrphanRemoverTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 45 }, { "content": "\tdef testImportFrom( self ) :\n\n\t\tfrom Gaffer.Behaviours import OrphanRemover\n\n\t\tself.assertTrue( OrphanRemover is Gaffer.Behaviours.OrphanRemover )", "metadata": "root.OrphanRemoverTest.testImportFrom", "header": "['class', 'OrphanRemoverTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 128 } ]
[ { "span": "self.assertTrue( c1 in s )", "start_line": 57, "start_column": 2, "end_line": 57, "end_column": 28 }, { "span": "self.assertTrue( c2 in s )", "start_line": 58, "start_column": 2, "end_line": 58, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 63, "start_column": 2, "end_line": 63, "end_column": 29 }, { "span": "self.assertTrue( c2 in s )", "start_line": 64, "start_column": 2, "end_line": 64, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 69, "start_column": 2, "end_line": 69, "end_column": 29 }, { "span": "self.assertTrue( c2 in s )", "start_line": 70, "start_column": 2, "end_line": 70, "end_column": 28 }, { "span": "self.assertTrue( c1 in s )", "start_line": 75, "start_column": 2, "end_line": 75, "end_column": 28 }, { "span": "self.assertTrue( c2 in s )", "start_line": 76, "start_column": 2, "end_line": 76, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 81, "start_column": 2, "end_line": 81, "end_column": 29 }, { "span": "self.assertTrue( c2 in s )", "start_line": 82, "start_column": 2, "end_line": 82, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 87, "start_column": 2, "end_line": 87, "end_column": 29 }, { "span": "self.assertFalse( c2 in s )", "start_line": 88, "start_column": 2, "end_line": 88, "end_column": 29 }, { "span": "self.assertFalse( c1 in s )", "start_line": 94, "start_column": 2, "end_line": 94, "end_column": 29 }, { "span": "self.assertFalse( c2 in s )", "start_line": 95, "start_column": 2, "end_line": 95, "end_column": 29 }, { "span": "self.assertTrue( c3 in s )", "start_line": 96, "start_column": 2, "end_line": 96, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 101, "start_column": 2, "end_line": 101, "end_column": 29 }, { "span": "self.assertFalse( c2 in s )", "start_line": 102, "start_column": 2, "end_line": 102, "end_column": 29 }, { "span": "self.assertTrue( c3 in s )", "start_line": 103, "start_column": 2, "end_line": 103, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 108, "start_column": 2, "end_line": 108, "end_column": 29 }, { "span": "self.assertFalse( c2 in s )", "start_line": 109, "start_column": 2, "end_line": 109, "end_column": 29 }, { "span": "self.assertFalse( c3 in s )", "start_line": 110, "start_column": 2, "end_line": 110, "end_column": 29 }, { "span": "self.assertFalse( c1 in s )", "start_line": 116, "start_column": 2, "end_line": 116, "end_column": 29 }, { "span": "self.assertFalse( c2 in s )", "start_line": 117, "start_column": 2, "end_line": 117, "end_column": 29 }, { "span": "self.assertTrue( c3 in s )", "start_line": 118, "start_column": 2, "end_line": 118, "end_column": 28 }, { "span": "self.assertFalse( c1 in s )", "start_line": 124, "start_column": 2, "end_line": 124, "end_column": 29 }, { "span": "self.assertFalse( c2 in s )", "start_line": 125, "start_column": 2, "end_line": 125, "end_column": 29 }, { "span": "self.assertTrue( c3 in s )", "start_line": 126, "start_column": 2, "end_line": 126, "end_column": 28 }, { "span": "self.assertTrue( OrphanRemover is Gaffer.Behaviours.OrphanRemover )", "start_line": 132, "start_column": 2, "end_line": 132, "end_column": 69 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Or", "phan", "Remove", "r", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p_", "=_", "Ga", "ffer", "_", "._", "Graph", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "Ga", "ffer", "_", "._", "Graph", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "Ga", "ffer", "_", "._", "Graph", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "\"", "c1", "\"_", "]_", "=_", "c1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "\"", "c2", "\"_", "]_", "=_", "c2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "_", "._", "Standard", "Set_", "(_", "p_", "._", "children_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "Ga", "ffer", "_", "._", "Behavio", "urs", "_", "._", "Or", "phan", "Remove", "r_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "remove", "Child_", "(_", "c1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "\"", "c1", "\"_", "]_", "=_", "c1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "add_", "(_", "c1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "remove", "Child_", "(_", "c1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "remove", "Child_", "(_", "c2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c3_", "=_", "Ga", "ffer", "_", "._", "Graph", "Component_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c3_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "\"", "c3", "\"_", "]_", "=_", "c3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c3_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "remove", "Child_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c3_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "\"", "c3", "\"_", "]_", "=_", "c3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c3_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "del_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "remove", "Child_", "(_", "c3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "s_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c1_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "c2_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "c3_", "in_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Or", "phan", "Remove", "r", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Import", "From_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "from_", "Ga", "ffer", "_", "._", "Behavio", "urs", "_", "import_", "Or", "phan", "Remove", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\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 1, 1, 1, 1, 1, 1, 1, 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, 0, 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
uwdata/termite-data-server/web2py/gluon/contrib/fpdf/__init__.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"FPDF for python\"\n\n__license__ = \"LGPL 3.0\"\n__version__ = \"1.7\"\n\nfrom fpdf import *\ntry:\n from html import HTMLMixin\nexcept ImportError:\n import warnings\n warnings.warn(\"web2py gluon package not installed, required for html2pdf\")\n\nfrom template import Template\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from template import Template", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "FP", "DF", " ", "for", " ", "python", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "license\\u\\u_", "=_", "\"", "LGP", "L", " ", "3.0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "\"", "1.7", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fp", "df_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "html_", "import_", "HTM", "LM", "ix", "in_", "\\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_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "\"", "web", "2py", " ", "glu", "on", " ", "package", " ", "not", " ", "install", "ed", ",", " ", "require", "d", " ", "for", " ", "html", "2p", "df", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "template_", "import_", "Template_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AppScale/appscale/AppServer/lib/grizzled/grizzled/db/__init__.py
[ { "content": "# $Id: fa873c96e7b5ed23437473a2b6d0b9a3871d4a18 $\n\n\"\"\"\nIntroduction\n============\n\nThe ``db`` module is a DB API wrapper. It provides a DB API-compliant API that\nwraps real underlying DB API drivers, simplifying some non-portable operations\nlike ``connect()`` and providing some new operations.\n\nSome drivers come bundled with this package. Others can be added on the fly.\n\nGetting the List of Drivers\n===========================\n\nTo get a list of all drivers currently registered with this module, use the\n``get_driver_names()`` method:\n\n.. python::\n\n import db\n\n for driver_name in db.get_driver_names():\n print driver_name\n\nCurrently, this module provides the following bundled drivers:\n\n +------------------+------------+-------------------+\n | Driver Name, | | |\n | as passed to | | Underlying Python |\n | ``get_driver()`` | Database | DB API module |\n +==================+============+===================+\n | dummy | None | ``db.DummyDB`` |\n +------------------+------------+-------------------+\n | gadfly | Gadfly | ``gadfly`` |\n +------------------+------------+-------------------+\n | mysql | MySQL | ``MySQLdb`` |\n +------------------+------------+-------------------+\n | oracle | Oracle | ``cx_Oracle`` |\n +------------------+------------+-------------------+\n | postgresql | PostgreSQL | ``psycopg2`` |\n +------------------+------------+-------------------+\n | sqlserver | SQL Server | ``pymssql`` |\n +------------------+------------+-------------------+\n | sqlite | SQLite 3 | ``sqlite3`` |\n +------------------+------------+-------------------+\n\nTo use a given driver, you must have the corresponding Python DB API module\ninstalled on your system.\n\nAdding a Driver\n===============\n\nIt's possible to add a new driver to the list of drivers supplied by this\nmodule. To do so:\n\n 1. The driver class must extend ``DBDriver`` and provide the appropriate\n methods. See examples in this module.\n 2. The driver's module (or the calling program) must register the driver\n with this module by calling the ``add_driver()`` function.\n\n\nDB API Factory Functions\n========================\n\nThe ``Binary()``, ``Date()``, ``DateFromTicks()``, ``Time()``,\n``TimeFromTicks()``, ``TimeStamp()`` and ``TimestampFromTicks()`` DB API\nfunctions can be found in the DB class. Thus, to make a string into a BLOB\nwith this API, you use:\n\n.. python::\n\n driver = db.get_driver(driver_name)\n db = driver.connect(...)\n blob = db.Binary(some_string)\n\"\"\"\n\n__docformat__ = \"restructuredtext en\"\n\n# ---------------------------------------------------------------------------\n# Imports\n# ---------------------------------------------------------------------------\n\nimport re\nimport time\nimport os\nimport sys\nfrom datetime import date, datetime\n\nfrom grizzled.exception import ExceptionWithMessage\nfrom grizzled.decorators import abstract\nfrom grizzled.db import (base, dummydb, dbgadfly, mysql, oracle, postgresql,\n sqlite, sqlserver)\nfrom grizzled.db.base import *\n\n# ---------------------------------------------------------------------------\n# Exports\n# ---------------------------------------------------------------------------\n\n__all__ = ['get_driver', 'add_driver', 'get_driver_names', 'DBDriver',\n 'DB', 'Cursor', 'DBError', 'Error', 'Warning', 'apilevel',\n 'threadsafety', 'paramstyle']\n\n# ---------------------------------------------------------------------------\n# Globals\n# ---------------------------------------------------------------------------\n\nDummyDriver = dummydb.DummyDriver\nGadflyDriver = dbgadfly.GadflyDriver\nMySQLDriver = mysql.MySQLDriver\nOracleDriver = oracle.OracleDriver\nPostgreSQLDriver = postgresql.PostgreSQLDriver\nSQLite3Driver = sqlite.SQLite3Driver\nSQLServerDriver = sqlserver.SQLServerDriver\n\ndrivers = { 'dummy' : 'DummyDriver',\n 'mysql' : 'MySQLDriver',\n 'postgresql' : 'PostgreSQLDriver',\n 'sqlserver' : 'SQLServerDriver',\n 'sqlite' : 'SQLite3Driver',\n 'oracle' : 'OracleDriver',\n 'gadfly' : 'GadflyDriver'}\n\napilevel = '2.0'\nthreadsafety = '1'\nparamstyle = None\n\n# ---------------------------------------------------------------------------\n# Functions\n# ---------------------------------------------------------------------------\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def add_driver(key, driver_class, force=False):\n \"\"\"\n Add a driver class to the list of drivers.\n\n :Parameters:\n key : str\n the key, also used as the driver's name\n driver_class : class\n the ``DBDriver`` subclass object\n force : bool\n ``True`` to force registration of the driver, even if there's an\n existing driver with the same key; ``False`` to throw an exception\n if there's an existing driver with the same key.\n\n :raise ValueError: There's an existing driver with the same key, and\n ``force`` is ``False``\n \"\"\"\n try:\n drivers[key]\n if not force:\n raise ValueError, 'A DB driver named \"%s\" is already installed' %\\\n key\n except KeyError:\n pass\n\n drivers[key] = driver_class", "metadata": "root.add_driver", "header": "['module', '___EOS___']", "index": 131 }, { "content": "def get_drivers():\n \"\"\"\n Get the list of drivers currently registered with this API. The result is\n a list of ``DBDriver`` subclasses. Note that these are classes, not\n instances. Once way to use the resulting list is as follows:\n\n .. python::\n\n for driver in db.get_drivers():\n print driver.__doc__\n\n :rtype: list\n :return: list of ``DBDriver`` class names\n \"\"\"\n return [str(d) for d in drivers.values()]", "metadata": "root.get_drivers", "header": "['module', '___EOS___']", "index": 158 }, { "content": "def get_driver_names():\n \"\"\"\n Get the list of driver names currently registered with this API.\n Each of the returned names may be used as the first parameter to\n the ``get_driver()`` function.\n \"\"\"\n return drivers.keys()", "metadata": "root.get_driver_names", "header": "['module', '___EOS___']", "index": 174 }, { "content": "def get_driver(driver_name):\n \"\"\"\n Get the DB API object for the specific database type. The list of\n legal database types are available by calling ``get_driver_names()``.\n\n :Parameters:\n driver_name : str\n name (key) of the driver\n\n :rtype: DBDriver\n :return: the instantiated driver\n\n :raise ValueError: Unknown driver name\n \"\"\"\n try:\n o = drivers[driver_name]\n if type(o) == str:\n exec 'd = %s()' % o\n else:\n d = o()\n return d\n except KeyError:\n raise ValueError, 'Unknown driver name: \"%s\"' % driver_name", "metadata": "root.get_driver", "header": "['module', '___EOS___']", "index": 182 } ]
[ { "span": "import re", "start_line": 83, "start_column": 0, "end_line": 83, "end_column": 9 }, { "span": "import time", "start_line": 84, "start_column": 0, "end_line": 84, "end_column": 11 }, { "span": "import os", "start_line": 85, "start_column": 0, "end_line": 85, "end_column": 9 }, { "span": "import sys", "start_line": 86, "start_column": 0, "end_line": 86, "end_column": 10 }, { "span": "from grizzled.exception import ExceptionWithMessage", "start_line": 89, "start_column": 0, "end_line": 89, "end_column": 51 }, { "span": "from grizzled.decorators import abstract", "start_line": 90, "start_column": 0, "end_line": 90, "end_column": 40 }, { "span": "from grizzled.db import (base, dummydb, dbgadfly, mysql, oracle, postgresql,\n sqlite, sqlserver)", "start_line": 91, "start_column": 0, "end_line": 92, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "$", "Id", ":", " ", "fa", "873", "c9", "6e", "7b", "5e", "d2", "343", "747", "3a", "2b", "6d", "0b", "9", "a3", "871", "d4", "a1", "8", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Introduc", "tion", "\\", "10", ";", "============", "\\", "10", ";", "\\", "10", ";", "The", " ", "``", "db", "``", " ", "module", " ", "is", " ", "a", " ", "DB", " ", "API", " ", "wrapp", "er", ".", " ", "It", " ", "provide", "s", " ", "a", " ", "DB", " ", "API", "-", "compliant", " ", "API", " ", "tha", "t", "\\", "10", ";", "wrap", "s", " ", "real", " ", "underl", "ying", " ", "DB", " ", "API", " ", "driver", "s", ",", " ", "simplify", "ing", " ", "some", " ", "non", "-", "portab", "le", " ", "operati", "ons", "\\", "10", ";", "like", " ", "``", "connect", "()``", " ", "and", " ", "provi", "ding", " ", "some", " ", "new", " ", "operati", "ons", ".", "\\", "10", ";", "\\", "10", ";", "Some", " ", "driver", "s", " ", "come", " ", "bundle", "d", " ", "with", " ", "this", " ", "package", ".", " ", "Ot", "hers", " ", "can", " ", "be", " ", "adde", "d", " ", "on", " ", "the", " ", "fly", ".", "\\", "10", ";", "\\", "10", ";", "Get", "ting", " ", "the", " ", "List", " ", "of", " ", "Drive", "rs", "\\", "10", ";", "==============", "============", "=", "\\", "10", ";", "\\", "10", ";", "To", " ", "get", " ", "a", " ", "list", " ", "of", " ", "all", " ", "driver", "s", " ", "currentl", "y", " ", "register", "ed", " ", "with", " ", "this", " ", "module", ",", " ", "use", " ", "the", "\\", "10", ";", "``", "get", "\\u", "driver", "\\u", "names", "()``", " ", "method", ":", "\\", "10", ";", "\\", "10", ";", "..", " ", "python", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "import", " ", "db", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "driver", "\\u", "name", " ", "in", " ", "db", ".", "get", "\\u", "driver", "\\u", "names", "():", "\\", "10", ";", " ", " ", " ", " ", "print", " ", "driver", "\\u", "name", "\\", "10", ";", "\\", "10", ";", "Curr", "ent", "ly", ",", " ", "this", " ", "module", " ", "provide", "s", " ", "the", " ", "follow", "ing", " ", "bundle", "d", " ", "driver", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "Drive", "r", " ", "Name", ",", " ", "|", " ", " ", " ", " ", "|", " ", "|", "\\", "10", ";", " ", " ", "|", " ", "as", " ", "pass", "ed", " ", "to", " ", "|", " ", " ", " ", " ", "|", " ", "Underl", "ying", " ", "Pyth", "on", " ", "|", "\\", "10", ";", " ", " ", "|", " ", "``", "get", "\\u", "driver", "()``", " ", "|", " ", "Databa", "se", " ", " ", " ", "|", " ", "DB", " ", "API", " ", "module", " ", "|", "\\", "10", ";", " ", " ", "+===", "==============", "=+", "============", "+===", "==============", "==", "+", "\\", "10", ";", " ", " ", "|", " ", "dummy", " ", " ", " ", " ", "|", " ", "Non", "e", " ", " ", " ", "|", " ", "``", "db", ".", "Du", "mm", "y", "DB", "``", " ", " ", " ", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "gad", "fly", " ", " ", " ", "|", " ", "Ga", "dfl", "y", " ", "|", " ", "``", "gad", "fly", "``", " ", " ", " ", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "mysql", " ", " ", " ", " ", "|", " ", "My", "SQL", " ", " ", "|", " ", "``", "My", "SQL", "db", "``", " ", " ", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "oracle", " ", " ", " ", "|", " ", "Ora", "cle", " ", "|", " ", "``", "cx", "\\u", "Ora", "cle", "``", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "postgres", "ql", " ", " ", " ", "|", " ", "Post", "gre", "SQL", " ", "|", " ", "``", "psy", "cop", "g2", "``", " ", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "sqls", "erver", " ", " ", " ", " ", "|", " ", "SQL", " ", "Server", " ", "|", " ", "``", "pym", "ss", "ql", "``", " ", " ", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", " ", " ", "|", " ", "sql", "ite", " ", " ", " ", "|", " ", "SQL", "ite", " ", "3", " ", " ", " ", "|", " ", "``", "sql", "ite", "3", "``", " ", " ", " ", "|", "\\", "10", ";", " ", " ", "+----------", "--------", "+----------", "--+", "--------------", "-----+", "\\", "10", ";", "\\", "10", ";", "To", " ", "use", " ", "a", " ", "give", "n", " ", "driver", ",", " ", "you", " ", "must", " ", "have", " ", "the", " ", "correspond", "ing", " ", "Pyth", "on", " ", "DB", " ", "API", " ", "module", "\\", "10", ";", "install", "ed", " ", "on", " ", "your", " ", "system", ".", "\\", "10", ";", "\\", "10", ";", "Add", "ing", " ", "a", " ", "Drive", "r", "\\", "10", ";", "==============", "=", "\\", "10", ";", "\\", "10", ";", "It", "'", "s", " ", "possib", "le", " ", "to", " ", "add", " ", "a", " ", "new", " ", "driver", " ", "to", " ", "the", " ", "list", " ", "of", " ", "driver", "s", " ", "supplie", "d", " ", "by", " ", "this", "\\", "10", ";", "module", ".", " ", "To", " ", "do", " ", "so", ":", "\\", "10", ";", "\\", "10", ";", " ", "1", ".", " ", "The", " ", "driver", " ", "class", " ", "must", " ", "extend", " ", "``", "DB", "Drive", "r", "``", " ", "and", " ", "provide", " ", "the", " ", "appropr", "iate", "\\", "10", ";", " ", " ", " ", " ", "method", "s", ".", " ", "See", " ", "example", "s", " ", "in", " ", "this", " ", "module", ".", "\\", "10", ";", " ", "2", ".", " ", "The", " ", "driver", "'", "s", " ", "module", " ", "(", "or", " ", "the", " ", "calling", " ", "program", ")", " ", "must", " ", "register", " ", "the", " ", "driver", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "this", " ", "module", " ", "by", " ", "calling", " ", "the", " ", "``", "add", "\\u", "driver", "()``", " ", "function", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "DB", " ", "API", " ", "Factor", "y", " ", "Function", "s", "\\", "10", ";", "==============", "=========", "=", "\\", "10", ";", "\\", "10", ";", "The", " ", "``", "Bin", "ary", "()``", ",", " ", "``", "Date", "()``", ",", " ", "``", "Date", "Fro", "m", "Ticks", "()``", ",", " ", "``", "Time", "()``", ",", "\\", "10", ";", "``", "Time", "Fro", "m", "Ticks", "()``", ",", " ", "``", "Time", "Sta", "mp", "()``", " ", "and", " ", "``", "Timest", "amp", "Fro", "m", "Ticks", "()``", " ", "DB", " ", "API", "\\", "10", ";", "function", "s", " ", "can", " ", "be", " ", "found", " ", "in", " ", "the", " ", "DB", " ", "class", ".", " ", "Thu", "s", ",", " ", "to", " ", "make", " ", "a", " ", "string", " ", "int", "o", " ", "a", " ", "BLOB", "\\", "10", ";", "with", " ", "this", " ", "API", ",", " ", "you", " ", "use", ":", "\\", "10", ";", "\\", "10", ";", "..", " ", "python", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "driver", " ", "=", " ", "db", ".", "get", "\\u", "driver", "(", "driver", "\\u", "name", ")", "\\", "10", ";", " ", " ", " ", " ", "db", " ", "=", " ", "driver", ".", "connect", "(...)", "\\", "10", ";", " ", " ", " ", " ", "blob", " ", "=", " ", "db", ".", "Bin", "ary", "(", "some", "\\u", "string", ")", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "\"", "restructur", "edt", "ext", " ", "en", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "date_", ",_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gri", "zzle", "d_", "._", "exception_", "import_", "Except", "ion", "With", "Message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gri", "zzle", "d_", "._", "decorators_", "import_", "abstract_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gri", "zzle", "d_", "._", "db_", "import_", "(_", "base_", ",_", "dummy", "db_", ",_", "dbg", "adf", "ly_", ",_", "mysql_", ",_", "oracle", "_", ",_", "postgresql_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sqlite_", ",_", "sqls", "erver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gri", "zzle", "d_", "._", "db_", "._", "base_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Export", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "get", "\\u", "driver", "'_", ",_", "'", "add", "\\u", "driver", "'_", ",_", "'", "get", "\\u", "driver", "\\u", "names", "'_", ",_", "'", "DB", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DB", "'_", ",_", "'", "Curs", "or", "'_", ",_", "'", "DB", "Error", "'_", ",_", "'", "Error", "'_", ",_", "'", "Warn", "ing", "'_", ",_", "'", "api", "level", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "thread", "safety", "'_", ",_", "'", "params", "tyl", "e", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Globals_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Du", "mm", "y", "Driver_", "=_", "dummy", "db_", "._", "Du", "mm", "y", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ga", "dfl", "y", "Driver_", "=_", "dbg", "adf", "ly_", "._", "Ga", "dfl", "y", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "My", "SQL", "Driver_", "=_", "mysql_", "._", "My", "SQL", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ora", "cle", "Driver_", "=_", "oracle", "_", "._", "Ora", "cle", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Post", "gre", "SQL", "Driver_", "=_", "postgresql_", "._", "Post", "gre", "SQL", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SQL", "ite", "3", "Driver_", "=_", "sqlite_", "._", "SQL", "ite", "3", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SQL", "Server", "Driver_", "=_", "sqls", "erver_", "._", "SQL", "Server", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drivers_", "=_", "{_", "'", "dummy", "'_", ":_", "'", "Du", "mm", "y", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mysql", "'_", ":_", "'", "My", "SQL", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "postgres", "ql", "'_", ":_", "'", "Post", "gre", "SQL", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sqls", "erver", "'_", ":_", "'", "SQL", "Server", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sql", "ite", "'_", ":_", "'", "SQL", "ite", "3", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "oracle", "'_", ":_", "'", "Ora", "cle", "Drive", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gad", "fly", "'_", ":_", "'", "Ga", "dfl", "y", "Drive", "r", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "api", "level_", "=_", "'", "2.0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread", "safety", "_", "=_", "'", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params", "tyle_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Functions_", "\\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\\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_", "add", "\\u", "driver_", "(_", "key_", ",_", "driver", "\\u", "class_", ",_", "force_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "a", " ", "driver", " ", "class", " ", "to", " ", "the", " ", "list", " ", "of", " ", "driver", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "key", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "key", ",", " ", "als", "o", " ", "used", " ", "as", " ", "the", " ", "driver", "'", "s", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "driver", "\\u", "class", " ", ":", " ", "class", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "``", "DB", "Drive", "r", "``", " ", "subclass", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "force", " ", ":", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "``", "Tru", "e", "``", " ", "to", " ", "force", " ", "registration", " ", "of", " ", "the", " ", "driver", ",", " ", "even", " ", "if", " ", "there", "'", "s", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "exist", "ing", " ", "driver", " ", "with", " ", "the", " ", "same", " ", "key", ";", " ", "``", "Fal", "se", "``", " ", "to", " ", "throw", " ", "an", " ", "exception", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "there", "'", "s", " ", "an", " ", "exist", "ing", " ", "driver", " ", "with", " ", "the", " ", "same", " ", "key", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", " ", "Value", "Error", ":", " ", "There", "'", "s", " ", "an", " ", "exist", "ing", " ", "driver", " ", "with", " ", "the", " ", "same", " ", "key", ",", " ", "and", "\\", "10", ";", " ", " ", " ", " ", " ", "``", "force", "``", " ", "is", " ", "``", "Fal", "se", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drivers_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "force_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "'", "A", " ", "DB", " ", "driver", " ", "named", " ", "\"%", "s", "\"", " ", "is", " ", "alr", "ead", "y", " ", "install", "ed", "'_", "%_", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "drivers_", "[_", "key_", "]_", "=_", "driver", "\\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_", "get", "\\u", "drivers_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "list", " ", "of", " ", "driver", "s", " ", "currentl", "y", " ", "register", "ed", " ", "with", " ", "this", " ", "API", ".", " ", "The", " ", "result", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "list", " ", "of", " ", "``", "DB", "Drive", "r", "``", " ", "subclasses", ".", " ", "Not", "e", " ", "tha", "t", " ", "these", " ", "are", " ", "classe", "s", ",", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "instance", "s", ".", " ", "On", "ce", " ", "way", " ", "to", " ", "use", " ", "the", " ", "result", "ing", " ", "list", " ", "is", " ", "as", " ", "follow", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "python", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "driver", " ", "in", " ", "db", ".", "get", "\\u", "driver", "s", "():", "\\", "10", ";", " ", " ", " ", " ", "print", " ", "driver", ".\\u", "\\u", "doc", "\\u\\u", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", " ", "list", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "list", " ", "of", " ", "``", "DB", "Drive", "r", "``", " ", "class", " ", "names", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "str_", "(_", "d_", ")_", "for_", "d_", "in_", "drivers_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "driver", "\\u", "names_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "list", " ", "of", " ", "driver", " ", "names", " ", "currentl", "y", " ", "register", "ed", " ", "with", " ", "this", " ", "API", ".", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "of", " ", "the", " ", "return", "ed", " ", "names", " ", "may", " ", "be", " ", "used", " ", "as", " ", "the", " ", "first", " ", "parameter", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "``", "get", "\\u", "driver", "()``", " ", "function", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "drivers_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "driver_", "(_", "driver", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "DB", " ", "API", " ", "object", " ", "for", " ", "the", " ", "specific", " ", "databa", "se", " ", "type", ".", " ", "The", " ", "list", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "lega", "l", " ", "databa", "se", " ", "types", " ", "are", " ", "avail", "able", " ", "by", " ", "calling", " ", "``", "get", "\\u", "driver", "\\u", "names", "()``", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "driver", "\\u", "name", " ", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", "name", " ", "(", "key", ")", " ", "of", " ", "the", " ", "driver", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "DB", "Drive", "r", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "the", " ", "instantiate", "d", " ", "driver", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", " ", "Value", "Error", ":", " ", "Un", "know", "n", " ", "driver", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "o_", "=_", "drivers_", "[_", "driver", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "o_", ")_", "==_", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec_", "'", "d", " ", "=", " ", "%", "s", "()'_", "%_", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "o_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", ",_", "'", "Un", "know", "n", " ", "driver", " ", "name", ":", " ", "\"%", "s", "\"'_", "%_", "driver", "\\u", "name_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
goyalsid/phageParser/orderByExpect.py
[ { "content": "import time, os, operator, csv\n\n\n \n\n\n\n \n\nfor fn in os.listdir(\"output/\"):\n csv_cont = csv_to_list('output/'+fn)\n convert_cells_to_floats(csv_cont)\n csv_sorted = sort_by_column(csv_cont, \"Expect\")\n write_csv(\"output/sorted/\"+\"sorted.\"+fn, csv_sorted)\n #print_csv(csv_sorted)\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def csv_to_list(csv_file, delimiter=\",\"):\n with open (csv_file, 'r') as csv_con:\n reader = csv.reader(csv_con, delimiter=delimiter)\n return list(reader)", "metadata": "root.csv_to_list", "header": "['module', '___EOS___']", "index": 3 }, { "content": "def convert_cells_to_floats(csv_cont):\n for row in range(len(csv_cont)):\n for cell in range(len(csv_cont[row])):\n try:\n csv_cont[row][cell] = float(csv_cont[row][cell])\n except ValueError:\n pass", "metadata": "root.convert_cells_to_floats", "header": "['module', '___EOS___']", "index": 8 }, { "content": "def sort_by_column(csv_cont, col, reverse=False):\n header = csv_cont[0]\n body = csv_cont[1:]\n if isinstance(col,str):\n col_index = header.index(col)\n else:\n col_index = col\n body = sorted(body,\n key=operator.itemgetter(col_index),\n reverse=reverse)\n body.insert(0,header)\n return body", "metadata": "root.sort_by_column", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def print_csv(csv_content):\n print (50*'-')\n for row in csv_content:\n row=[str(e) for e in row]\n print ('\\t' .join(row))\n print (50*'_')", "metadata": "root.print_csv", "header": "['module', '___EOS___']", "index": 29 }, { "content": "def write_csv(dest, csv_cont):\n with open(dest, 'w') as out_file:\n writer= csv.writer(out_file, delimiter=',')\n for row in csv_cont:\n writer.writerow(row)", "metadata": "root.write_csv", "header": "['module', '___EOS___']", "index": 36 } ]
[ { "span": "import time, os, operator, csv", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 30 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "time_", ",_", "os_", ",_", "operator_", ",_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "fn_", "in_", "os_", "._", "listdir_", "(_", "\"", "output", "/\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csv", "\\u", "cont_", "=_", "csv", "\\u", "to", "\\u", "list_", "(_", "'", "output", "/'_", "+_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "convert", "\\u", "cells", "\\u", "to", "\\u", "floats_", "(_", "csv", "\\u", "cont_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "csv", "\\u", "sorted_", "=_", "sort", "\\u", "by", "\\u", "column_", "(_", "csv", "\\u", "cont_", ",_", "\"", "Expect", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "csv_", "(_", "\"", "output", "/", "sorte", "d", "/\"_", "+_", "\"", "sorte", "d", ".\"_", "+_", "fn_", ",_", "csv", "\\u", "sorted_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", "\\u", "csv", "(", "csv", "\\u", "sorte", "d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "csv", "\\u", "to", "\\u", "list_", "(_", "csv", "\\u", "file_", ",_", "delimiter_", "=_", "\",\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "csv", "\\u", "file_", ",_", "'", "r", "'_", ")_", "as_", "csv", "\\u", "con_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reader_", "=_", "csv_", "._", "reader_", "(_", "csv", "\\u", "con_", ",_", "delimiter_", "=_", "delimiter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "list_", "(_", "reader_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "convert", "\\u", "cells", "\\u", "to", "\\u", "floats_", "(_", "csv", "\\u", "cont_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "row_", "in_", "range_", "(_", "len_", "(_", "csv", "\\u", "cont_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "cell_", "in_", "range_", "(_", "len_", "(_", "csv", "\\u", "cont_", "[_", "row_", "]_", ")_", ")_", ":_", "\\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 ", " _", "csv", "\\u", "cont_", "[_", "row_", "]_", "[_", "cell_", "]_", "=_", "float_", "(_", "csv", "\\u", "cont_", "[_", "row_", "]_", "[_", "cell_", "]_", ")_", "\\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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sort", "\\u", "by", "\\u", "column_", "(_", "csv", "\\u", "cont_", ",_", "col_", ",_", "reverse_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "csv", "\\u", "cont_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "csv", "\\u", "cont_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "col_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "\\u", "index_", "=_", "header_", "._", "index_", "(_", "col_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "\\u", "index_", "=_", "col_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "body_", "=_", "sorted_", "(_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "operator_", "._", "itemgetter_", "(_", "col", "\\u", "index_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "reverse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "._", "insert_", "(_", "0_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "csv_", "(_", "csv", "\\u", "content_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "50_", "*_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "csv", "\\u", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "[_", "str_", "(_", "e_", ")_", "for_", "e_", "in_", "row_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'\\\\", "t", "'_", "._", "join_", "(_", "row_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "50_", "*_", "'\\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_", "write", "\\u", "csv_", "(_", "dest_", ",_", "csv", "\\u", "cont_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "dest_", ",_", "'", "w", "'_", ")_", "as_", "out", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "writer_", "=_", "csv_", "._", "writer_", "(_", "out", "\\u", "file_", ",_", "delimiter_", "=_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "csv", "\\u", "cont_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "writer_", "._", "writerow_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Non-callable called
twilio/twilio-python/tests/task_router/test_task_router_capability.py
[ { "content": " def test_worker_default(self):\n account_sid = \"AC123\"\n auth_token = \"foobar\"\n workspace_sid = \"WS456\"\n worker_sid = \"WK789\"\n capability = TaskRouterCapability(account_sid, auth_token, workspace_sid, worker_sid)\n\n capability.generate_token()\n\n token = capability.generate_token()\n self.assertNotEqual(None, token)\n\n decoded = jwt.decode(token, auth_token)\n self.assertNotEqual(None, decoded)\n\n self.check_decoded(decoded, account_sid, workspace_sid, worker_sid, worker_sid)\n\n policies = decoded['policies']\n self.assertEqual(len(policies), 6)\n\n for method, url, policy in [\n ('GET', \"https://event-bridge.twilio.com/v1/wschannels/AC123/WK789\", policies[0]),\n ('POST', \"https://event-bridge.twilio.com/v1/wschannels/AC123/WK789\", policies[1]),\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789\", policies[2])\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/Activities\", policies[3]),\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/Tasks/**\", policies[4]),\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789/Reservations/**\", policies[5])\n ]:\n yield self.check_policy, method, url, policy", "metadata": "root.TaskRouterCapabilityTest.test_worker_default", "header": "['class', 'TaskRouterCapabilityTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_task_queue_default(self):\n account_sid = \"AC123\"\n auth_token = \"foobar\"\n workspace_sid = \"WS456\"\n taskqueue_sid = \"WQ789\"\n capability = TaskRouterCapability(account_sid, auth_token, workspace_sid, taskqueue_sid)\n\n capability.generate_token()\n\n token = capability.generate_token()\n self.assertNotEqual(None, token)\n\n decoded = jwt.decode(token, auth_token)\n self.assertNotEqual(None, decoded)\n\n self.check_decoded(decoded, account_sid, workspace_sid, taskqueue_sid, taskqueue_sid)\n\n policies = decoded['policies']\n self.assertEqual(len(policies), 3)\n\n for method, url, policy in [\n ('GET', \"https://event-bridge.twilio.com/v1/wschannels/AC123/WQ789\", policies[0]),\n ('POST', \"https://event-bridge.twilio.com/v1/wschannels/AC123/WQ789\", policies[1])\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/TaskQueues/WQ789\", policies[2])\n ]:\n yield self.check_policy, method, url, policy", "metadata": "root.TaskRouterCapabilityTest.test_task_queue_default", "header": "['class', 'TaskRouterCapabilityTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 86 } ]
[ { "span": "('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789\", policies[2])\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/Activities\", policies[3]),", "start_line": 79, "start_column": 12, "end_line": 80, "end_column": 96 }, { "span": "('POST', \"https://event-bridge.twilio.com/v1/wschannels/AC123/WQ789\", policies[1])\n ('GET', \"https://taskrouter.twilio.com/v1/Workspaces/WS456/TaskQueues/WQ789\", policies[2])", "start_line": 108, "start_column": 12, "end_line": 109, "end_column": 102 } ]
[]
1
false
[ "[CLS]_", "Non", "_", "-_", "callable_", "called_", "[SEP]_", "class_", "Task", "Route", "r", "Capa", "bilit", "y", "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\\u", "worker", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "account", "\\u", "sid_", "=_", "\"", "AC", "123", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "token_", "=_", "\"", "fooba", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "works", "pace\\u", "sid_", "=_", "\"", "WS", "456", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worker", "\\u", "sid_", "=_", "\"", "WK", "789", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "capability_", "=_", "Task", "Route", "r", "Capa", "bility_", "(_", "account", "\\u", "sid_", ",_", "auth", "\\u", "token_", ",_", "works", "pace\\u", "sid_", ",_", "worker", "\\u", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "capability_", "._", "generat", "e\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "token_", "=_", "capability_", "._", "generat", "e\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "None_", ",_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "decoded_", "=_", "jwt_", "._", "decode_", "(_", "token_", ",_", "auth", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "None_", ",_", "decoded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "check", "\\u", "decoded_", "(_", "decoded_", ",_", "account", "\\u", "sid_", ",_", "works", "pace\\u", "sid_", ",_", "worker", "\\u", "sid_", ",_", "worker", "\\u", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "policies_", "=_", "decoded_", "[_", "'", "poli", "cies", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "policies_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "method_", ",_", "url_", ",_", "policy_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "event", "-", "bridge", ".", "twilio", ".", "com", "/", "v1", "/", "wsc", "hannel", "s", "/", "AC", "123", "/", "WK", "789", "\"_", ",_", "policies_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "POST", "'_", ",_", "\"", "https", "://", "event", "-", "bridge", ".", "twilio", ".", "com", "/", "v1", "/", "wsc", "hannel", "s", "/", "AC", "123", "/", "WK", "789", "\"_", ",_", "policies_", "[_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "task", "router", ".", "twilio", ".", "com", "/", "v1", "/", "Works", "paces", "/", "WS", "456", "/", "Worke", "rs", "/", "WK", "789", "\"_", ",_", "policies_", "[_", "2_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "task", "router", ".", "twilio", ".", "com", "/", "v1", "/", "Works", "paces", "/", "WS", "456", "/", "Activ", "iti", "es", "\"_", ",_", "policies_", "[_", "3_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "task", "router", ".", "twilio", ".", "com", "/", "v1", "/", "Works", "paces", "/", "WS", "456", "/", "Task", "s", "/**", "\"_", ",_", "policies_", "[_", "4_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "task", "router", ".", "twilio", ".", "com", "/", "v1", "/", "Works", "paces", "/", "WS", "456", "/", "Worke", "rs", "/", "WK", "789", "/", "Reserva", "tion", "s", "/**", "\"_", ",_", "policies_", "[_", "5_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "check", "\\u", "policy_", ",_", "method_", ",_", "url_", ",_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "Route", "r", "Capa", "bilit", "y", "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\\u", "task", "\\u", "queue", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "account", "\\u", "sid_", "=_", "\"", "AC", "123", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "token_", "=_", "\"", "fooba", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "works", "pace\\u", "sid_", "=_", "\"", "WS", "456", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "queue", "\\u", "sid_", "=_", "\"", "WQ", "789", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "capability_", "=_", "Task", "Route", "r", "Capa", "bility_", "(_", "account", "\\u", "sid_", ",_", "auth", "\\u", "token_", ",_", "works", "pace\\u", "sid_", ",_", "task", "queue", "\\u", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "capability_", "._", "generat", "e\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "token_", "=_", "capability_", "._", "generat", "e\\u", "token_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "None_", ",_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "decoded_", "=_", "jwt_", "._", "decode_", "(_", "token_", ",_", "auth", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "None_", ",_", "decoded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "check", "\\u", "decoded_", "(_", "decoded_", ",_", "account", "\\u", "sid_", ",_", "works", "pace\\u", "sid_", ",_", "task", "queue", "\\u", "sid_", ",_", "task", "queue", "\\u", "sid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "policies_", "=_", "decoded_", "[_", "'", "poli", "cies", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "policies_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "method_", ",_", "url_", ",_", "policy_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "event", "-", "bridge", ".", "twilio", ".", "com", "/", "v1", "/", "wsc", "hannel", "s", "/", "AC", "123", "/", "WQ", "789", "\"_", ",_", "policies_", "[_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "POST", "'_", ",_", "\"", "https", "://", "event", "-", "bridge", ".", "twilio", ".", "com", "/", "v1", "/", "wsc", "hannel", "s", "/", "AC", "123", "/", "WQ", "789", "\"_", ",_", "policies_", "[_", "1_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "GET", "'_", ",_", "\"", "https", "://", "task", "router", ".", "twilio", ".", "com", "/", "v1", "/", "Works", "paces", "/", "WS", "456", "/", "Task", "Queue", "s", "/", "WQ", "789", "\"_", ",_", "policies_", "[_", "2_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "check", "\\u", "policy_", ",_", "method_", ",_", "url_", ",_", "policy_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
jilljenn/tryalgo/tryalgo/roman_numbers.py
[ { "content": "#!/usr/bin/env python3\n# Evaluate an arithmetic expression\n# jill-jenn vie et christoph durr - 2014-2015\n\n# convert roman numbers\n\nimport sys\n\nroman = [['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],\n ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],\n ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'],\n ['', 'M', 'MM', 'M'*3, 'M'*4,'M'*5,'M'*6,'M'*7,'M'*8,'M'*9]]\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def roman2int(s):\n \"\"\"Decode roman number\n\n :param s: string representing a roman number between 1 and 9999\n :returns: the decoded roman number\n :complexity: linear (if that makes sense for constant bounded input size)\n \"\"\"\n val = 0\n pos10 = 1000\n beg = 0\n for pos in range(3, -1, -1):\n for digit in range(9,-1,-1):\n r = roman[pos][digit]\n if s.startswith(r, beg):\n beg += len(r)\n val += digit * pos10\n break\n pos10 //= 10\n return val", "metadata": "root.roman2int", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def int2roman(val):\n \"\"\"Code roman number\n\n :param val: integer between 1 and 9999\n :returns: the corresponding roman number\n :complexity: linear (if that makes sense for constant bounded input size)\n \"\"\"\n s = ''\n pos10 = 1000\n for pos in range(3, -1, -1):\n digit = val // pos10\n s += roman[pos][digit]\n val %= pos10\n pos10 //= 10\n return s", "metadata": "root.int2roman", "header": "['module', '___EOS___']", "index": 35 } ]
[ { "span": "import sys", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 10 } ]
[]
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_", "#", " ", "Evaluate", " ", "an", " ", "arithmetic", " ", "expression_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ji", "ll", "-", "jen", "n", " ", "vie", " ", "et", " ", "chris", "top", "h", " ", "dur", "r", " ", "-", " ", "2014", "-", "2015_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "roman", " ", "numbers_", "\\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_", "roman", "_", "=_", "[_", "[_", "''_", ",_", "'", "I", "'_", ",_", "'", "II", "'_", ",_", "'", "III", "'_", ",_", "'", "IV", "'_", ",_", "'", "V", "'_", ",_", "'", "VI", "'_", ",_", "'", "VI", "I", "'_", ",_", "'", "VI", "II", "'_", ",_", "'", "IX", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "''_", ",_", "'", "X", "'_", ",_", "'", "XX", "'_", ",_", "'", "XX", "X", "'_", ",_", "'", "XL", "'_", ",_", "'", "L", "'_", ",_", "'", "LX", "'_", ",_", "'", "LX", "X", "'_", ",_", "'", "LX", "XX", "'_", ",_", "'", "XC", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "''_", ",_", "'", "C", "'_", ",_", "'", "CC", "'_", ",_", "'", "CCC", "'_", ",_", "'", "CD", "'_", ",_", "'", "D", "'_", ",_", "'", "DC", "'_", ",_", "'", "DC", "C", "'_", ",_", "'", "DC", "CC", "'_", ",_", "'", "CM", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "''_", ",_", "'", "M", "'_", ",_", "'", "MM", "'_", ",_", "'", "M", "'_", "*_", "3_", ",_", "'", "M", "'_", "*_", "4_", ",_", "'", "M", "'_", "*_", "5_", ",_", "'", "M", "'_", "*_", "6_", ",_", "'", "M", "'_", "*_", "7_", ",_", "'", "M", "'_", "*_", "8_", ",_", "'", "M", "'_", "*_", "9_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "roman", "2in", "t_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Decode", " ", "roman", " ", "number", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "s", ":", " ", "string", " ", "represent", "ing", " ", "a", " ", "roman", " ", "number", " ", "bet", "ween", " ", "1", " ", "and", " ", "9999", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "the", " ", "decode", "d", " ", "roman", " ", "number", "\\", "10", ";", " ", " ", " ", " ", ":", "complex", "it", "y", ":", " ", "linear", " ", "(", "if", " ", "tha", "t", " ", "make", "s", " ", "sense", " ", "for", " ", "constant", " ", "bounded", " ", "input", " ", "size", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos", "10_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "beg_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pos_", "in_", "range_", "(_", "3_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "digit_", "in_", "range_", "(_", "9_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "roman", "_", "[_", "pos_", "]_", "[_", "digit_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s_", "._", "startswith_", "(_", "r_", ",_", "beg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "beg_", "+=_", "len_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "val_", "+=_", "digit_", "*_", "pos", "10_", "\\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_", "pos", "10_", "//", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "int2", "roman", "_", "(_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Code", " ", "roman", " ", "number", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "val", ":", " ", "integ", "er", " ", "bet", "ween", " ", "1", " ", "and", " ", "9999", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "the", " ", "correspond", "ing", " ", "roman", " ", "number", "\\", "10", ";", " ", " ", " ", " ", ":", "complex", "it", "y", ":", " ", "linear", " ", "(", "if", " ", "tha", "t", " ", "make", "s", " ", "sense", " ", "for", " ", "constant", " ", "bounded", " ", "input", " ", "size", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos", "10_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pos_", "in_", "range_", "(_", "3_", ",_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\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 ]
Imprecise assert
wharris/dougrain/test/test_document.py
[ { "content": " def testLinksIsNotAnAttribute(self):\n self.assertFalse('_links' in self.doc.properties)\n self.assertFalse(hasattr(self.doc, '_links'))", "metadata": "root.ParseLinksTestMixin.testLinksIsNotAnAttribute", "header": "['class', 'ParseLinksTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 89 }, { "content": " def testEmbeddedIsNotAnAttribute(self):\n self.assertFalse('_embedded' in self.doc.properties)\n self.assertFalse(hasattr(self.doc, '_embedded'))", "metadata": "root.ParseEmbeddedObjectsTestMixin.testEmbeddedIsNotAnAttribute", "header": "['class', 'ParseEmbeddedObjectsTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 131 }, { "content": " def testHasHostLinkRel(self):\n host_role = self.doc.expand_curie('role:host')\n self.assertTrue(host_role in self.doc.rels)\n self.assertEquals([\"http://localhost/hosts/1\"],\n [x.url() for x in self.doc.rels[host_role]])", "metadata": "root.RelsTestMixin.testHasHostLinkRel", "header": "['class', 'RelsTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 388 }, { "content": " def testHasConsumerEmbeddedRel(self):\n consumer_role = self.doc.expand_curie('role:consumer')\n self.assertTrue(consumer_role in self.doc.rels)\n consumer = self.doc.rels[consumer_role][0]\n self.assertEquals(\"http://localhost/clients/1\", consumer.url())\n self.assertEquals(\"Client 1\", consumer.properties['name'])", "metadata": "root.RelsTestMixin.testHasConsumerEmbeddedRel", "header": "['class', 'RelsTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 394 }, { "content": " def testHasApplicationLinkAndEmbeddedRels(self):\n application_role = self.doc.expand_curie('role:application')\n applications = self.doc.rels[application_role]\n self.assertTrue(self.doc.embedded['role:application'] in applications)\n self.assertTrue(self.doc.links['role:application'] in applications)", "metadata": "root.RelsTestMixin.testHasApplicationLinkAndEmbeddedRels", "header": "['class', 'RelsTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 401 }, { "content": " def testEmbeddedRelOverridesLinkRelWithSameHref(self):\n dept_role = self.doc.expand_curie('role:dept')\n\n filter_url = \"http://localhost/departments/2\"\n dept_2_link = [link for link in self.doc.links['role:dept']\n if link.url() == filter_url][0]\n dept_2_embedded = [link for link in self.doc.embedded['role:dept']\n if link.url() == filter_url][0]\n\n departments = self.doc.rels[dept_role]\n self.assertTrue(dept_2_embedded in departments)\n self.assertFalse(dept_2_link in departments)\n\n urls = [x.url() for x in departments]\n urls.sort()\n self.assertEqual(\n [\"http://localhost/departments/%d\" % x for x in [1, 2, 3]],\n urls)", "metadata": "root.RelsTestMixin.testEmbeddedRelOverridesLinkRelWithSameHref", "header": "['class', 'RelsTestMixin', '(', 'object', ')', ':', '___EOS___']", "index": 407 }, { "content": " def testRemoveAttributeRemovesAttribute(self):\n doc = dougrain.Document.empty()\n doc.set_property('foo', \"bar\")\n\n doc.delete_property('foo')\n\n self.assertFalse(hasattr(doc, 'foo'))\n self.assertFalse('foo' in doc.properties)", "metadata": "root.AttributeMutationTests.testRemoveAttributeRemovesAttribute", "header": "['class', 'AttributeMutationTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 612 }, { "content": " def testDeleteOnlyLinkForRel(self):\n initial = {\n '_links': {\n 'self': {'href': \"http://localhost/2\"},\n 'child': {'href': \"http://localhost/2/1\"}\n }\n }\n\n target = {\n '_links': {\n 'self': {'href': \"http://localhost/2\"},\n }\n }\n\n doc = dougrain.Document.from_object(initial, \"http://localhost/\")\n target_doc = dougrain.Document.from_object(target, \"http://localhost/\")\n\n doc.delete_link(\"child\")\n\n self.assertEquals(target_doc, doc)\n self.assertFalse('child' in doc.links)", "metadata": "root.DeleteLinkTests.testDeleteOnlyLinkForRel", "header": "['class', 'DeleteLinkTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 785 }, { "content": " def testDeleteEveryLinkForRel(self):\n initial = {\n '_links': {\n 'self': {'href': \"http://localhost/2\"},\n 'child': [\n {'href': \"http://localhost/2/1\"},\n {'href': \"http://localhost/2/2\"},\n {'href': \"http://localhost/2/3\"}\n ]\n }\n }\n\n target = {\n '_links': {\n 'self': {'href': \"http://localhost/2\"}\n }\n }\n\n doc = dougrain.Document.from_object(initial, \"http://localhost/\")\n target_doc = dougrain.Document.from_object(target, \"http://localhost/\")\n\n doc.delete_link(\"child\")\n\n self.assertEquals(target_doc.as_object(), doc.as_object())\n self.assertFalse('child' in doc.links)", "metadata": "root.DeleteLinkTests.testDeleteEveryLinkForRel", "header": "['class', 'DeleteLinkTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 807 }, { "content": " def testDeleteIndividualLinks(self):\n initial = {\n '_links': {\n 'self': {'href': \"http://localhost/2\"},\n 'child': [\n {'href': \"http://localhost/2/1\"},\n {'href': \"http://localhost/2/2\"},\n {'href': \"http://localhost/2/3\"}\n ]\n }\n }\n\n doc = dougrain.Document.from_object(initial, \"http://localhost/\")\n\n doc.delete_link(\"child\", \"http://localhost/2/1\")\n self.assertEquals([{'href': \"http://localhost/2/2\"},\n {'href': \"http://localhost/2/3\"}],\n doc.as_object()['_links']['child'])\n\n doc.delete_link(\"child\", \"http://localhost/2/3\")\n self.assertEquals({'href': \"http://localhost/2/2\"},\n doc.as_object()['_links']['child'])\n\n doc.delete_link(\"child\", \"http://localhost/2/2\")\n self.assertFalse(\"child\" in doc.as_object()['_links'])\n\n doc.delete_link(\"self\", \"http://localhost/2\")\n self.assertFalse('_links' in doc.as_object())", "metadata": "root.DeleteLinkTests.testDeleteIndividualLinks", "header": "['class', 'DeleteLinkTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 851 }, { "content": " def testDeleteOnlyEmbedForRel(self):\n doc = self.make_doc(\"http://localhost/2\")\n doc.embed('child', self.make_doc(\"http://localhost/2/1\"))\n doc.embed('root', self.make_doc(\"http://localhost/\"))\n\n target_doc = self.make_doc(\"http://localhost/2\")\n target_doc.embed('root', self.make_doc(\"http://localhost/\"))\n\n doc.delete_embedded(\"child\")\n\n self.assertEquals(target_doc.as_object().get(self.EMBEDDED_KEY),\n doc.as_object().get(self.EMBEDDED_KEY))\n self.assertFalse('child' in doc.embedded)\n self.assertTrue('root' in doc.embedded)", "metadata": "root.DeleteEmbeddedTestsMixin.testDeleteOnlyEmbedForRel", "header": "['class', 'DeleteEmbeddedTestsMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1111 }, { "content": " def testDeleteEveryEmbedForRel(self):\n doc = self.make_doc(\"http://localhost/2\")\n doc.embed('root', self.make_doc(\"http://localhost/\"))\n doc.embed('child', self.make_doc(\"http://localhost/2/1\"))\n doc.embed('child', self.make_doc(\"http://localhost/2/1\"))\n doc.embed('child', self.make_doc(\"http://localhost/2/1\"))\n\n target_doc = self.make_doc(\"http://localhost/2\")\n target_doc.embed('root', self.make_doc(\"http://localhost/\"))\n\n doc.delete_embedded(\"child\")\n\n self.assertEquals(target_doc.as_object().get(self.EMBEDDED_KEY),\n doc.as_object().get(self.EMBEDDED_KEY))\n self.assertFalse('child' in doc.embedded)\n self.assertTrue('root' in doc.embedded)", "metadata": "root.DeleteEmbeddedTestsMixin.testDeleteEveryEmbedForRel", "header": "['class', 'DeleteEmbeddedTestsMixin', '(', 'object', ')', ':', '___EOS___']", "index": 1126 }, { "content": " def testCuriesAreNotLinksDraft5(self):\n doc = dougrain.Document({\n '_links': {\n 'curies': [{\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n }],\n 'self': {\n 'href': \"http://localhost/0\"\n }\n }\n }, \"http://localhost/0\", draft=dougrain.drafts.DRAFT_5)\n\n self.assertFalse('curies' in doc.links)", "metadata": "root.CurieHidingTests.testCuriesAreNotLinksDraft5", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1337 }, { "content": " def testCuriesAreNotLinksDraft4(self):\n doc = dougrain.Document({\n '_links': {\n 'curies': [{\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n }],\n 'self': {\n 'href': \"http://localhost/0\"\n }\n }\n }, \"http://localhost/0\", draft=dougrain.drafts.DRAFT_4)\n\n self.assertFalse('curies' in doc.links)", "metadata": "root.CurieHidingTests.testCuriesAreNotLinksDraft4", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1353 }, { "content": " def testCuriesAreNotLinksDraft3(self):\n doc = dougrain.Document({\n '_links': {\n 'curie': {\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n },\n 'self': {\n 'href': \"http://localhost/0\"\n }\n }\n }, \"http://localhost/0\", draft=dougrain.drafts.DRAFT_3)\n\n self.assertFalse('curie' in doc.links)", "metadata": "root.CurieHidingTests.testCuriesAreNotLinksDraft3", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1369 }, { "content": " def testDraft4CuriesAreLinksInDraft43Documents(self):\n modern_doc = dougrain.Document.empty(\"http://localhost/0\",\n draft=dougrain.drafts.DRAFT_4)\n modern_doc.set_curie('rel', '/rel/{rel}')\n doc = dougrain.Document.from_object(modern_doc.as_object(),\n base_uri=\"http://localhost/0\",\n draft=dougrain.drafts.DRAFT_3)\n self.assertTrue('curies' in doc.links)\n self.assertFalse('curie' in doc.links)", "metadata": "root.CurieHidingTests.testDraft4CuriesAreLinksInDraft43Documents", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1385 }, { "content": " def testDraft5CuriesAreLinksInDraft43Documents(self):\n modern_doc = dougrain.Document.empty(\"http://localhost/0\",\n draft=dougrain.drafts.DRAFT_5)\n modern_doc.set_curie('rel', '/rel/{rel}')\n doc = dougrain.Document.from_object(modern_doc.as_object(),\n base_uri=\"http://localhost/0\",\n draft=dougrain.drafts.DRAFT_3)\n self.assertTrue('curies' in doc.links)\n self.assertFalse('curie' in doc.links)", "metadata": "root.CurieHidingTests.testDraft5CuriesAreLinksInDraft43Documents", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1395 }, { "content": " def testDraft3CuriesAreLinksInDraft5Document(self):\n doc = dougrain.Document({\n '_links': {\n 'curie': {\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n },\n 'curies': [{\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n }],\n 'self': {\n 'href': \"http://localhost/0\"\n }\n }\n }, \"http://localhost/0\", draft=dougrain.drafts.DRAFT_5)\n\n self.assertFalse('curies' in doc.links)\n self.assertTrue('curie' in doc.links)", "metadata": "root.CurieHidingTests.testDraft3CuriesAreLinksInDraft5Document", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1405 }, { "content": " def testDraft3CuriesAreLinksInDraft4Document(self):\n doc = dougrain.Document({\n '_links': {\n 'curie': {\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n },\n 'curies': [{\n 'href': \"http://localhost/rel/{rel}\",\n 'name': \"rel\",\n 'templated': True\n }],\n 'self': {\n 'href': \"http://localhost/0\"\n }\n }\n }, \"http://localhost/0\", draft=dougrain.drafts.DRAFT_4)\n\n self.assertFalse('curies' in doc.links)\n self.assertTrue('curie' in doc.links)", "metadata": "root.CurieHidingTests.testDraft3CuriesAreLinksInDraft4Document", "header": "['class', 'CurieHidingTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1427 }, { "content": " def testSetReservedAttributeSilentlyFails(self):\n doc = dougrain.Document.empty(\"http://localhost\")\n doc.set_property('_links', {'self': {'href': \"/1\"}})\n doc.set_property('_embedded', {'child': {'foo': \"bar\"}})\n\n self.assertFalse('_links' in doc.properties)\n self.assertIsNone(doc.url())\n\n self.assertFalse('_embedded' in doc.properties)\n self.assertFalse('child' in doc.embedded)", "metadata": "root.EdgeCasesTests.testSetReservedAttributeSilentlyFails", "header": "['class', 'EdgeCasesTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1589 }, { "content": " def testDeleteReservedAttributeSilentlyFails(self):\n doc = dougrain.Document.empty(\"http://localhost\")\n doc.embed('child', dougrain.Document.from_object({'foo': \"bar\"},\n \"http://localhost\"))\n doc.add_link('self', \"/1\")\n\n with self.assertRaises(KeyError):\n doc.delete_property('_links')\n with self.assertRaises(KeyError):\n doc.delete_property('_embedded')\n\n self.assertFalse('_links' in doc.properties)\n self.assertEquals(\"http://localhost/1\", doc.url())\n\n self.assertFalse('_embedded' in doc.properties)\n self.assertEquals(\"bar\", doc.embedded['child'].properties['foo'])", "metadata": "root.EdgeCasesTests.testDeleteReservedAttributeSilentlyFails", "header": "['class', 'EdgeCasesTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1600 }, { "content": " def testEmbedDocumentInItself(self):\n doc = dougrain.Document.empty(\"http://localhost\")\n doc.add_link('self', \"/1\")\n doc.set_curie('rel', \"/rels/{rel}\")\n doc.set_property('name', \"me\")\n doc.add_link('rel:other', \"/other\")\n doc.add_link('next', \"/2\")\n\n doc.embed('rel:me', doc)\n\n self.assertFalse('rel:me' in doc.embedded)", "metadata": "root.EdgeCasesTests.testEmbedDocumentInItself", "header": "['class', 'EdgeCasesTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1617 }, { "content": " def testDraft3DocumentHasOldCurieBehaviour(self):\n doc = dougrain.Document.empty(\"http://localhost\",\n draft=dougrain.drafts.DRAFT_3)\n self.assertEquals(doc.draft, dougrain.drafts.DRAFT_3)\n doc.add_link('self', \"/1\")\n doc.set_curie('rel', \"/rels/{rel}\")\n\n links = doc.as_object()['_links']\n self.assertTrue('curie' in links)\n self.assertFalse('curies' in links)\n curie = links['curie']\n self.assertTrue(isinstance(curie, dict))\n doc.set_curie('foo', \"/foos/{rel}\")\n curie = links['curie']\n self.assertTrue(isinstance(curie, list))", "metadata": "root.ExplicitDraftTests.testDraft3DocumentHasOldCurieBehaviour", "header": "['class', 'ExplicitDraftTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1634 }, { "content": " def testDraft4DocumentHasNewCurieBehaviour(self):\n doc = dougrain.Document.empty(\"http://localhost\",\n draft=dougrain.drafts.DRAFT_4)\n self.assertEquals(doc.draft, dougrain.drafts.DRAFT_4)\n doc.add_link('self', \"/1\")\n doc.set_curie('rel', \"/rels/{rel}\")\n\n links = doc.as_object()['_links']\n self.assertFalse('curie' in links)\n self.assertTrue('curies' in links)\n curie = links['curies']\n self.assertTrue(isinstance(curie, list))\n doc.set_curie('foo', \"/foos/{rel}\")\n curie = links['curies']\n self.assertTrue(isinstance(curie, list))", "metadata": "root.ExplicitDraftTests.testDraft4DocumentHasNewCurieBehaviour", "header": "['class', 'ExplicitDraftTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1650 }, { "content": " def testDraft5DocumentHasNewCurieBehaviour(self):\n doc = dougrain.Document.empty(\"http://localhost\",\n draft=dougrain.drafts.DRAFT_5)\n self.assertEquals(doc.draft, dougrain.drafts.DRAFT_5)\n doc.add_link('self', \"/1\")\n doc.set_curie('rel', \"/rels/{rel}\")\n\n links = doc.as_object()['_links']\n self.assertFalse('curie' in links)\n self.assertTrue('curies' in links)\n curie = links['curies']\n self.assertTrue(isinstance(curie, list))\n doc.set_curie('foo', \"/foos/{rel}\")\n curie = links['curies']\n self.assertTrue(isinstance(curie, list))", "metadata": "root.ExplicitDraftTests.testDraft5DocumentHasNewCurieBehaviour", "header": "['class', 'ExplicitDraftTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1666 } ]
[ { "span": "self.assertFalse('_links' in self.doc.properties)", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 57 }, { "span": "self.assertFalse('_embedded' in self.doc.properties)", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 60 }, { "span": "self.assertTrue(host_role in self.doc.rels)", "start_line": 390, "start_column": 8, "end_line": 390, "end_column": 51 }, { "span": "self.assertTrue(consumer_role in self.doc.rels)", "start_line": 396, "start_column": 8, "end_line": 396, "end_column": 55 }, { "span": "self.assertTrue(self.doc.embedded['role:application'] in applications)", "start_line": 404, "start_column": 8, "end_line": 404, "end_column": 78 }, { "span": "self.assertTrue(self.doc.links['role:application'] in applications)", "start_line": 405, "start_column": 8, "end_line": 405, "end_column": 75 }, { "span": "self.assertTrue(dept_2_embedded in departments)", "start_line": 417, "start_column": 8, "end_line": 417, "end_column": 55 }, { "span": "self.assertFalse(dept_2_link in departments)", "start_line": 418, "start_column": 8, "end_line": 418, "end_column": 52 }, { "span": "self.assertFalse('foo' in doc.properties)", "start_line": 619, "start_column": 8, "end_line": 619, "end_column": 49 }, { "span": "self.assertFalse('child' in doc.links)", "start_line": 805, "start_column": 8, "end_line": 805, "end_column": 46 }, { "span": "self.assertFalse('child' in doc.links)", "start_line": 831, "start_column": 8, "end_line": 831, "end_column": 46 }, { "span": "self.assertFalse(\"child\" in doc.as_object()['_links'])", "start_line": 875, "start_column": 8, "end_line": 875, "end_column": 62 }, { "span": "self.assertFalse('_links' in doc.as_object())", "start_line": 878, "start_column": 8, "end_line": 878, "end_column": 53 }, { "span": "self.assertFalse('child' in doc.embedded)", "start_line": 1123, "start_column": 8, "end_line": 1123, "end_column": 49 }, { "span": "self.assertTrue('root' in doc.embedded)", "start_line": 1124, "start_column": 8, "end_line": 1124, "end_column": 47 }, { "span": "self.assertFalse('child' in doc.embedded)", "start_line": 1140, "start_column": 8, "end_line": 1140, "end_column": 49 }, { "span": "self.assertTrue('root' in doc.embedded)", "start_line": 1141, "start_column": 8, "end_line": 1141, "end_column": 47 }, { "span": "self.assertFalse('curies' in doc.links)", "start_line": 1351, "start_column": 8, "end_line": 1351, "end_column": 47 }, { "span": "self.assertFalse('curies' in doc.links)", "start_line": 1367, "start_column": 8, "end_line": 1367, "end_column": 47 }, { "span": "self.assertFalse('curie' in doc.links)", "start_line": 1383, "start_column": 8, "end_line": 1383, "end_column": 46 }, { "span": "self.assertTrue('curies' in doc.links)", "start_line": 1392, "start_column": 8, "end_line": 1392, "end_column": 46 }, { "span": "self.assertFalse('curie' in doc.links)", "start_line": 1393, "start_column": 8, "end_line": 1393, "end_column": 46 }, { "span": "self.assertTrue('curies' in doc.links)", "start_line": 1402, "start_column": 8, "end_line": 1402, "end_column": 46 }, { "span": "self.assertFalse('curie' in doc.links)", "start_line": 1403, "start_column": 8, "end_line": 1403, "end_column": 46 }, { "span": "self.assertFalse('curies' in doc.links)", "start_line": 1424, "start_column": 8, "end_line": 1424, "end_column": 47 }, { "span": "self.assertTrue('curie' in doc.links)", "start_line": 1425, "start_column": 8, "end_line": 1425, "end_column": 45 }, { "span": "self.assertFalse('curies' in doc.links)", "start_line": 1446, "start_column": 8, "end_line": 1446, "end_column": 47 }, { "span": "self.assertTrue('curie' in doc.links)", "start_line": 1447, "start_column": 8, "end_line": 1447, "end_column": 45 }, { "span": "self.assertFalse('_links' in doc.properties)", "start_line": 1594, "start_column": 8, "end_line": 1594, "end_column": 52 }, { "span": "self.assertFalse('_embedded' in doc.properties)", "start_line": 1597, "start_column": 8, "end_line": 1597, "end_column": 55 }, { "span": "self.assertFalse('child' in doc.embedded)", "start_line": 1598, "start_column": 8, "end_line": 1598, "end_column": 49 }, { "span": "self.assertFalse('_links' in doc.properties)", "start_line": 1611, "start_column": 8, "end_line": 1611, "end_column": 52 }, { "span": "self.assertFalse('_embedded' in doc.properties)", "start_line": 1614, "start_column": 8, "end_line": 1614, "end_column": 55 }, { "span": "self.assertFalse('rel:me' in doc.embedded)", "start_line": 1627, "start_column": 8, "end_line": 1627, "end_column": 50 }, { "span": "self.assertTrue('curie' in links)", "start_line": 1642, "start_column": 8, "end_line": 1642, "end_column": 41 }, { "span": "self.assertFalse('curies' in links)", "start_line": 1643, "start_column": 8, "end_line": 1643, "end_column": 43 }, { "span": "self.assertFalse('curie' in links)", "start_line": 1658, "start_column": 8, "end_line": 1658, "end_column": 42 }, { "span": "self.assertTrue('curies' in links)", "start_line": 1659, "start_column": 8, "end_line": 1659, "end_column": 42 }, { "span": "self.assertFalse('curie' in links)", "start_line": 1674, "start_column": 8, "end_line": 1674, "end_column": 42 }, { "span": "self.assertTrue('curies' in links)", "start_line": 1675, "start_column": 8, "end_line": 1675, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Pars", "e", "Link", "s", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Link", "s", "Is", "Not", "An", "Attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "'\\u", "link", "s", "'_", "in_", "self_", "._", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "hasattr_", "(_", "self_", "._", "doc_", ",_", "'\\u", "link", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pars", "e", "Emb", "edd", "ed", "Object", "s", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Emb", "edd", "ed", "Is", "Not", "An", "Attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "'\\u", "embedde", "d", "'_", "in_", "self_", "._", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "hasattr_", "(_", "self_", "._", "doc_", ",_", "'\\u", "embedde", "d", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rel", "s", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Has", "Host", "Link", "Rel", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "role_", "=_", "self_", "._", "doc_", "._", "expand", "\\u", "curi", "e_", "(_", "'", "role", ":", "host", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "host", "\\u", "role_", "in_", "self_", "._", "doc_", "._", "rels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "[_", "\"", "http", "://", "local", "host", "/", "host", "s", "/", "1", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "._", "url_", "(_", ")_", "for_", "x_", "in_", "self_", "._", "doc_", "._", "rels_", "[_", "host", "\\u", "role_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rel", "s", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Has", "Consume", "r", "Emb", "edd", "ed", "Rel", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "consume", "r", "\\u", "role_", "=_", "self_", "._", "doc_", "._", "expand", "\\u", "curi", "e_", "(_", "'", "role", ":", "consume", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "consume", "r", "\\u", "role_", "in_", "self_", "._", "doc_", "._", "rels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "consumer_", "=_", "self_", "._", "doc_", "._", "rels_", "[_", "consume", "r", "\\u", "role_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "http", "://", "local", "host", "/", "clients", "/", "1", "\"_", ",_", "consumer_", "._", "url_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "Client", " ", "1", "\"_", ",_", "consumer_", "._", "properties_", "[_", "'", "name", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rel", "s", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Has", "Applica", "tion", "Link", "And", "Emb", "edd", "ed", "Rel", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "applica", "tion", "\\u", "role_", "=_", "self_", "._", "doc_", "._", "expand", "\\u", "curi", "e_", "(_", "'", "role", ":", "applica", "tion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "applications_", "=_", "self_", "._", "doc_", "._", "rels_", "[_", "applica", "tion", "\\u", "role_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "doc_", "._", "embedde", "d_", "[_", "'", "role", ":", "applica", "tion", "'_", "]_", "in_", "applications_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "doc_", "._", "links_", "[_", "'", "role", ":", "applica", "tion", "'_", "]_", "in_", "applications_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rel", "s", "Test", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Emb", "edd", "ed", "Rel", "Override", "s", "Link", "Rel", "With", "Sam", "e", "Hr", "ef_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dept", "\\u", "role_", "=_", "self_", "._", "doc_", "._", "expand", "\\u", "curi", "e_", "(_", "'", "role", ":", "dept", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filter", "\\u", "url_", "=_", "\"", "http", "://", "local", "host", "/", "department", "s", "/", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dept", "\\u", "2", "\\u", "link_", "=_", "[_", "link_", "for_", "link_", "in_", "self_", "._", "doc_", "._", "links_", "[_", "'", "role", ":", "dept", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "link_", "._", "url_", "(_", ")_", "==_", "filter", "\\u", "url_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dept", "\\u", "2", "\\u", "embedde", "d_", "=_", "[_", "link_", "for_", "link_", "in_", "self_", "._", "doc_", "._", "embedde", "d_", "[_", "'", "role", ":", "dept", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "link_", "._", "url_", "(_", ")_", "==_", "filter", "\\u", "url_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "department", "s_", "=_", "self_", "._", "doc_", "._", "rels_", "[_", "dept", "\\u", "role_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dept", "\\u", "2", "\\u", "embedde", "d_", "in_", "department", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "dept", "\\u", "2", "\\u", "link_", "in_", "department", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "urls_", "=_", "[_", "x_", "._", "url_", "(_", ")_", "for_", "x_", "in_", "department", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urls_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "http", "://", "local", "host", "/", "department", "s", "/", "%", "d", "\"_", "%_", "x_", "for_", "x_", "in_", "[_", "1_", ",_", "2_", ",_", "3_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "urls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Attribute", "Mutation", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Remove", "Attribute", "Remove", "s", "Attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "property_", "(_", "'", "foo", "'_", ",_", "\"", "bar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "property_", "(_", "'", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "hasattr_", "(_", "doc_", ",_", "'", "foo", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "foo", "'_", "in_", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delete", "Link", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Delete", "On", "ly", "Link", "For", "Rel", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "child", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", "}_", "\\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_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "initial_", ",_", "\"", "http", "://", "local", "host", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "target_", ",_", "\"", "http", "://", "local", "host", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "link_", "(_", "\"", "child", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "target", "\\u", "doc_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "child", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delete", "Link", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Delete", "Every", "Link", "For", "Rel", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "child", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "3", "\"_", "}_", "\\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_", "target_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "\"_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "initial_", ",_", "\"", "http", "://", "local", "host", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "target_", ",_", "\"", "http", "://", "local", "host", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "link_", "(_", "\"", "child", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "target", "\\u", "doc_", "._", "as", "\\u", "object_", "(_", ")_", ",_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "child", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delete", "Link", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Delete", "Individual", "Links_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "initial_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "child", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "3", "\"_", "}_", "\\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_", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "initial_", ",_", "\"", "http", "://", "local", "host", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "link_", "(_", "\"", "child", "\"_", ",_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "[_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "3", "\"_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "[_", "'\\u", "link", "s", "'_", "]_", "[_", "'", "child", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "link_", "(_", "\"", "child", "\"_", ",_", "\"", "http", "://", "local", "host", "/", "2", "/", "3", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "{_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "2", "/", "2", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "[_", "'\\u", "link", "s", "'_", "]_", "[_", "'", "child", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "link_", "(_", "\"", "child", "\"_", ",_", "\"", "http", "://", "local", "host", "/", "2", "/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "child", "\"_", "in_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "[_", "'\\u", "link", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "link_", "(_", "\"", "self", "\"_", ",_", "\"", "http", "://", "local", "host", "/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\u", "link", "s", "'_", "in_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delete", "Emb", "edd", "ed", "Test", "s", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Delete", "On", "ly", "Emb", "ed", "For", "Rel", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "child", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "root", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "doc_", "=_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "doc_", "._", "embed_", "(_", "'", "root", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "embedde", "d_", "(_", "\"", "child", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "target", "\\u", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "._", "get_", "(_", "self_", "._", "EMBED", "DED", "\\u", "KEY_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "._", "get_", "(_", "self_", "._", "EMBED", "DED", "\\u", "KEY_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "child", "'_", "in_", "doc_", "._", "embedde", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "root", "'_", "in_", "doc_", "._", "embedde", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delete", "Emb", "edd", "ed", "Test", "s", "Mixin_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Delete", "Every", "Emb", "ed", "For", "Rel", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "root", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "child", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "child", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "child", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "/", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "doc_", "=_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "doc_", "._", "embed_", "(_", "'", "root", "'_", ",_", "self_", "._", "make", "\\u", "doc_", "(_", "\"", "http", "://", "local", "host", "/\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "delete", "\\u", "embedde", "d_", "(_", "\"", "child", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "target", "\\u", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "._", "get_", "(_", "self_", "._", "EMBED", "DED", "\\u", "KEY_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "._", "get_", "(_", "self_", "._", "EMBED", "DED", "\\u", "KEY_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "child", "'_", "in_", "doc_", "._", "embedde", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "root", "'_", "in_", "doc_", "._", "embedde", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Cur", "ies", "Are", "Not", "Link", "s", "Dra", "ft", "5_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "es", "'_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "0", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "es", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Cur", "ies", "Are", "Not", "Link", "s", "Dra", "ft", "4_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "es", "'_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "0", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "es", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Cur", "ies", "Are", "Not", "Link", "s", "Dra", "ft", "3_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "e", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "0", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "e", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dra", "ft", "4", "Cur", "ies", "Are", "Link", "s", "In", "Dra", "ft", "4", "3", "Document", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "moder", "n", "\\u", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "moder", "n", "\\u", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "rel", "'_", ",_", "'/", "rel", "/{", "rel", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "moder", "n", "\\u", "doc_", "._", "as", "\\u", "object_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "base", "\\u", "uri_", "=_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "es", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "e", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dra", "ft", "5", "Cur", "ies", "Are", "Link", "s", "In", "Dra", "ft", "4", "3", "Document", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "moder", "n", "\\u", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "moder", "n", "\\u", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "rel", "'_", ",_", "'/", "rel", "/{", "rel", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "moder", "n", "\\u", "doc_", "._", "as", "\\u", "object_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "base", "\\u", "uri_", "=_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "es", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "e", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dra", "ft", "3", "Cur", "ies", "Are", "Link", "s", "In", "Dra", "ft", "5", "Document_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "e", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "es", "'_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "0", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "es", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "e", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cur", "ie", "Hi", "ding", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dra", "ft", "3", "Cur", "ies", "Are", "Link", "s", "In", "Dra", "ft", "4", "Document_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "link", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "e", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "curi", "es", "'_", ":_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "rel", "/{", "rel", "}\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "\"", "rel", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "template", "d", "'_", ":_", "True_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "self", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "href", "'_", ":_", "\"", "http", "://", "local", "host", "/", "0", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\"", "http", "://", "local", "host", "/", "0", "\"_", ",_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "es", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "e", "'_", "in_", "doc_", "._", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ed", "ge", "Case", "s", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Set", "Reserve", "d", "Attribute", "Sile", "ntl", "y", "Fail", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "property_", "(_", "'\\u", "link", "s", "'_", ",_", "{_", "'", "self", "'_", ":_", "{_", "'", "href", "'_", ":_", "\"/", "1", "\"_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "property_", "(_", "'\\u", "embedde", "d", "'_", ",_", "{_", "'", "child", "'_", ":_", "{_", "'", "foo", "'_", ":_", "\"", "bar", "\"_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\u", "link", "s", "'_", "in_", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "doc_", "._", "url_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\u", "embedde", "d", "'_", "in_", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "child", "'_", "in_", "doc_", "._", "embedde", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ed", "ge", "Case", "s", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Delete", "Reserve", "d", "Attribute", "Sile", "ntl", "y", "Fail", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "child", "'_", ",_", "dou", "grain", "_", "._", "Document_", "._", "from", "\\u", "object_", "(_", "{_", "'", "foo", "'_", ":_", "\"", "bar", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "http", "://", "local", "host", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "self", "'_", ",_", "\"/", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "._", "delete", "\\u", "property_", "(_", "'\\u", "link", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "._", "delete", "\\u", "property_", "(_", "'\\u", "embedde", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\u", "link", "s", "'_", "in_", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "http", "://", "local", "host", "/", "1", "\"_", ",_", "doc_", "._", "url_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'\\u", "embedde", "d", "'_", "in_", "doc_", "._", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "\"", "bar", "\"_", ",_", "doc_", "._", "embedde", "d_", "[_", "'", "child", "'_", "]_", "._", "properties_", "[_", "'", "foo", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ed", "ge", "Case", "s", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Emb", "ed", "Document", "In", "It", "self_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "self", "'_", ",_", "\"/", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "rel", "'_", ",_", "\"/", "rel", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "property_", "(_", "'", "name", "'_", ",_", "\"", "me", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "rel", ":", "other", "'_", ",_", "\"/", "other", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "next", "'_", ",_", "\"/", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "._", "embed_", "(_", "'", "rel", ":", "me", "'_", ",_", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "rel", ":", "me", "'_", "in_", "doc_", "._", "embedde", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exp", "licit", "Dra", "ft", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Dra", "ft", "3", "Document", "Has", "Old", "Cur", "ie", "Behavio", "ur_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "doc_", "._", "draft_", ",_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "self", "'_", ",_", "\"/", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "rel", "'_", ",_", "\"/", "rel", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "links_", "=_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "[_", "'\\u", "link", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "e", "'_", "in_", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "es", "'_", "in_", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curi", "e_", "=_", "links_", "[_", "'", "curi", "e", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "curi", "e_", ",_", "dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "foo", "'_", ",_", "\"/", "foo", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curi", "e_", "=_", "links_", "[_", "'", "curi", "e", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "curi", "e_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exp", "licit", "Dra", "ft", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dra", "ft", "4", "Document", "Has", "New", "Cur", "ie", "Behavio", "ur_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "doc_", "._", "draft_", ",_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "self", "'_", ",_", "\"/", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "rel", "'_", ",_", "\"/", "rel", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "links_", "=_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "[_", "'\\u", "link", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "e", "'_", "in_", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "es", "'_", "in_", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curi", "e_", "=_", "links_", "[_", "'", "curi", "es", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "curi", "e_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "foo", "'_", ",_", "\"/", "foo", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curi", "e_", "=_", "links_", "[_", "'", "curi", "es", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "curi", "e_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Exp", "licit", "Dra", "ft", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dra", "ft", "5", "Document", "Has", "New", "Cur", "ie", "Behavio", "ur_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "dou", "grain", "_", "._", "Document_", "._", "empty_", "(_", "\"", "http", "://", "local", "host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "draft_", "=_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "doc_", "._", "draft_", ",_", "dou", "grain", "_", "._", "draft", "s_", "._", "DRA", "FT", "\\u", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "add", "\\u", "link_", "(_", "'", "self", "'_", ",_", "\"/", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "rel", "'_", ",_", "\"/", "rel", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "links_", "=_", "doc_", "._", "as", "\\u", "object_", "(_", ")_", "[_", "'\\u", "link", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "curi", "e", "'_", "in_", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "curi", "es", "'_", "in_", "links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curi", "e_", "=_", "links_", "[_", "'", "curi", "es", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "curi", "e_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "._", "set\\u", "curi", "e_", "(_", "'", "foo", "'_", ",_", "\"/", "foo", "s", "/{", "rel", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curi", "e_", "=_", "links_", "[_", "'", "curi", "es", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "curi", "e_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1,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'\n USER_AGENT = 'SPECTO for Kodi/1.0'\n\n if not '' in credentials()['realdebrid'].values():\n if control.yesnoDialog(control.lang(32411).encode('utf-8'), control.lang(32413).encode('utf-8'), '', 'RealDebrid', control.lang(32415).encode('utf-8'), control.lang(32414).encode('utf-8')):\n control.set_setting('realdebrid_client_id','')\n control.set_setting('realdebrid_client_secret', '')\n control.set_setting('realdebrid_token', '')\n control.set_setting('realdebrid_refresh', '')\n control.set_setting('realdebrid_auth', '')\n raise Exception()\n\n headers = {'User-Agent': USER_AGENT}\n url = 'https://api.real-debrid.com/oauth/v2/device/code?client_id=%s&new_credentials=yes' % (CLIENT_ID)\n result = client.request(url, headers=headers)\n result = json.loads(result)\n verification_url = control.lang(30416).encode('utf-8') + '[COLOR skyblue]%s[/COLOR]' % (result['verification_url'])\n user_code = control.lang(30417).encode('utf-8') + '[COLOR skyblue]%s[/COLOR]' % (result['user_code'])\n device_code = result['device_code']\n interval = result['interval']\n\n progressDialog = control.progressDialog\n progressDialog.create('RealDebrid', verification_url, user_code)\n\n for i in range(0, 3600):\n try:\n if progressDialog.iscanceled(): break\n time.sleep(1)\n if not float(i) % interval == 0: raise Exception()\n url = 'https://api.real-debrid.com/oauth/v2/device/credentials?client_id=%s&code=%s' % (CLIENT_ID, device_code)\n result = client.request(url, headers=headers, error=True)\n result = json.loads(result)\n if 'client_secret' in result: break\n except:\n pass\n\n try: progressDialog.close()\n except: pass\n\n id, secret = result['client_id'], result['client_secret']\n\n url = 'https://api.real-debrid.com/oauth/v2/token'\n post = {'client_id': id, 'client_secret': secret, 'code': device_code, 'grant_type': 'http://oauth.net/grant_type/device/1.0'}\n\n result = client.request(url, post=post, headers=headers)\n result = json.loads(result)\n\n token, refresh = result['access_token'], result['refresh_token']\n\n control.set_setting('realdebrid_client_id', id)\n control.set_setting('realdebrid_client_secret', secret)\n control.set_setting('realdebrid_token', token)\n control.set_setting('realdebrid_refresh', refresh)\n control.set_setting('realdebrid_auth', '*************')\n raise Exception()\n except:\n control.openSettings('3.13')", "metadata": "root.rdAuthorize", "header": "['module', '___EOS___']", "index": 29 }, { "content": "def rdDict():\n try:\n if '' in credentials()['realdebrid'].values(): raise Exception()\n url = 'https://api.real-debrid.com/rest/1.0/hosts/domains'\n result = cache.get(client.request, 24, url)\n hosts = json.loads(result)\n hosts = [i.lower() for i in hosts]\n return hosts\n except:\n return []", "metadata": "root.rdDict", "header": "['module', '___EOS___']", "index": 90 }, { "content": "def pzDict():\n try:\n if '' in credentials()['premiumize'].values(): raise Exception()\n user, password = credentials()['premiumize']['user'], credentials()['premiumize']['pass']\n url = 'http://api.premiumize.me/pm-api/v1.php?method=hosterlist&params[login]=%s&params[pass]=%s' % (user, password)\n result = cache.get(client.request, 24, url)\n hosts = json.loads(result)['result']['hosterlist']\n hosts = [i.lower() for i in hosts]\n return hosts\n except:\n return []", "metadata": "root.pzDict", "header": "['module', '___EOS___']", "index": 102 }, { "content": "def adDict():\n try:\n if '' in credentials()['alldebrid'].values(): raise Exception()\n url = 'http://alldebrid.com/api.php?action=get_host'\n result = cache.get(client.request, 24, url)\n hosts = json.loads('[%s]' % result)\n hosts = [i.lower() for i in hosts]\n return hosts\n except:\n return []", "metadata": "root.adDict", "header": "['module', '___EOS___']", "index": 115 }, { "content": "def rpDict():\n try:\n if '' in credentials()['rpnet'].values(): raise Exception()\n url = 'http://premium.rpnet.biz/hoster2.json'\n result = cache.get(client.request, 24, url)\n result = json.loads(result)\n hosts = result['supported']\n hosts = [i.lower() for i in hosts]\n return hosts\n except:\n return []", "metadata": "root.rpDict", "header": "['module', '___EOS___']", "index": 127 }, { "content": "def status():\n try:\n c = [i for i in credentials().values() if not '' in i.values()]\n if len(c) == 0: return False\n else: return True\n except:\n return False", "metadata": "root.status", "header": "['module', '___EOS___']", "index": 171 }, { "content": "def resolve(url, debrid='realdebrid'):\n u = url\n u = u.replace('filefactory.com/stream/', 'filefactory.com/file/')\n #control.log(\"@@@@ REALDEBRID INIT %s ### %s\" % (url,debrid))\n try:\n u1 = urlparse.urlparse(url)[1].split('.')\n u1 = u[-2] + '.' + u[-1]\n if status() is False:raise Exception()\n if not debrid == 'realdebrid' and not debrid == True: raise Exception()\n #raise Exception()\n\n if '' in credentials()['realdebrid'].values(): raise Exception()\n id, secret, token, refresh = credentials()['realdebrid']['id'], credentials()['realdebrid']['secret'], credentials()['realdebrid']['token'], credentials()['realdebrid']['refresh']\n\n USER_AGENT = 'Kodi Exodus/3.0'\n\n post = {'link': u}\n headers = {'Authorization': 'Bearer %s' % token, 'User-Agent': USER_AGENT}\n url = 'http://api.real-debrid.com/rest/1.0/unrestrict/link'\n\n result = client.request(url, post=post, headers=headers, error=True)\n control.log('@@ DEBRID RESULTS@@ %s' % result)\n\n result = json.loads(result)\n\n if 'error' in result and result['error'] == 'bad_token':\n result = client.request('https://api.real-debrid.com/oauth/v2/token', post={'client_id': id, 'client_secret': secret, 'code': refresh, 'grant_type': 'http://oauth.net/grant_type/device/1.0'}, headers={'User-Agent': USER_AGENT}, error=True)\n result = json.loads(result)\n control.log('Refreshing Expired Real Debrid Token: |%s|%s|' % (id, refresh))\n control.log('Refreshing Expired : |%s|' % (result))\n\n if 'error' in result: return\n token, refresh = result['access_token'], result['refresh_token']\n\n control.set_setting('realdebrid_token', token)\n control.set_setting('realdebrid_refresh', refresh)\n\n headers['Authorization'] = 'Bearer %s' % result['access_token']\n result = client.request(url, post=post, headers=headers)\n result = json.loads(result)\n if 'error' in result and result['error'] == 'file_unavailable':\n control.log(\"@@@@ REALDEBRID FILE UNAVAIL %s ### %s\" % (url))\n\n return\n\n url = result['download']\n control.log('@@ DEBRID URl@@ %s' % url)\n\n return url\n except:\n pass\n\n try:\n if not debrid == 'premiumize' and not debrid == True: raise Exception()\n\n if '' in credentials()['premiumize'].values(): raise Exception()\n user, password = credentials()['premiumize']['user'], credentials()['premiumize']['pass']\n\n url = 'http://api.premiumize.me/pm-api/v1.php?method=directdownloadlink&params[login]=%s&params[pass]=%s&params[link]=%s' % (user, password, urllib.quote_plus(u))\n result = client.request(url, close=False)\n url = json.loads(result)['result']['location']\n return url\n except:\n pass\n\n try:\n if not debrid == 'alldebrid' and not debrid == True: raise Exception()\n\n if '' in credentials()['alldebrid'].values(): raise Exception()\n user, password = credentials()['alldebrid']['user'], credentials()['alldebrid']['pass']\n\n login_data = {'action': 'login', 'login_login': user, 'login_password': password}\n login_link = 'http://alldebrid.com/register/?%s' % login_data\n cookie = client.request(login_link, output='cookie', close=False)\n\n url = 'http://www.alldebrid.com/service.php?link=%s' % urllib.quote_plus(u)\n result = client.request(url, cookie=cookie, close=False)\n url = client.parseDOM(result, 'a', ret='href', attrs = {'class': 'link_dl'})[0]\n url = client.replaceHTMLCodes(url)\n url = '%s|Cookie=%s' % (url, urllib.quote_plus(cookie))\n return url\n except:\n pass\n\n try:\n if not debrid == 'rpnet' and not debrid == True: raise Exception()\n\n if '' in credentials()['rpnet'].values(): raise Exception()\n user, password = credentials()['rpnet']['user'], credentials()['rpnet']['pass']\n\n login_data = {'username': user, 'password': password, 'action': 'generate', 'links': u}\n login_link = 'http://premium.rpnet.biz/client_api.php?%s' % login_data\n result = client.request(login_link, close=False)\n result = json.loads(result)\n url = result['links'][0]['generated']\n return url\n except:\n return", "metadata": "root.resolve", "header": "['module', '___EOS___']", "index": 188 } ]
[ { "span": "except:", "start_line": 64, "start_column": 12, "end_line": 64, "end_column": 19 }, { "span": "except: ", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 15 }, { "span": "except:", "start_line": 86, "start_column": 4, "end_line": 86, "end_column": 11 }, { "span": "except:", "start_line": 98, "start_column": 4, "end_line": 98, "end_column": 11 }, { "span": "except:", "start_line": 111, "start_column": 4, "end_line": 111, "end_column": 11 }, { "span": "except:", "start_line": 123, "start_column": 4, "end_line": 123, "end_column": 11 }, { "span": "except:", "start_line": 136, "start_column": 4, "end_line": 136, "end_column": 11 }, { "span": "except:", "start_line": 176, "start_column": 4, "end_line": 176, "end_column": 11 }, { "span": "except:", "start_line": 237, "start_column": 4, "end_line": 237, "end_column": 11 }, { "span": "except:", "start_line": 250, "start_column": 4, "end_line": 250, "end_column": 11 }, { "span": "except:", "start_line": 269, "start_column": 4, "end_line": 269, "end_column": 11 }, { "span": "except:", "start_line": 284, "start_column": 4, "end_line": 284, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "rd", "Authoriz", "e_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "CLIENT", "\\u", "ID_", "=_", "'", "TC", "3", "DG", "7", "YF", "NB", "KQ", "K", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "USER", "\\u", "AGENT_", "=_", "'", "SPEC", "TO", " ", "for", " ", "Kodi", "/", "1.0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "control_", "._", "yesno", "Dialog_", "(_", "control_", "._", "lang_", "(_", "324", "11_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ",_", "control_", "._", "lang_", "(_", "324", "13_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ",_", "''_", ",_", "'", "Real", "Deb", "rid", "'_", ",_", "control_", "._", "lang_", "(_", "324", "15_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ",_", "control_", "._", "lang_", "(_", "324", "14_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "client", "\\u", "id", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "client", "\\u", "secret", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "token", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "refre", "sh", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "auth", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "headers_", "=_", "{_", "'", "User", "-", "Agent", "'_", ":_", "USER", "\\u", "AGENT_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "https", "://", "api", ".", "real", "-", "deb", "rid", ".", "com", "/", "oauth", "/", "v2", "/", "device", "/", "code", "?", "client", "\\u", "id", "=", "%", "s", "&", "new", "\\u", "cred", "ential", "s", "=", "ye", "s", "'_", "%_", "(_", "CLIENT", "\\u", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verification", "\\u", "url_", "=_", "control_", "._", "lang_", "(_", "304", "16_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "+_", "'[", "COLOR", " ", "sky", "blue", "]%", "s", "[", "/", "COLOR", "]'_", "%_", "(_", "result_", "[_", "'", "verification", "\\u", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "code_", "=_", "control_", "._", "lang_", "(_", "304", "17_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "+_", "'[", "COLOR", " ", "sky", "blue", "]%", "s", "[", "/", "COLOR", "]'_", "%_", "(_", "result_", "[_", "'", "user", "\\u", "code", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "device", "\\u", "code_", "=_", "result_", "[_", "'", "device", "\\u", "code", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interval_", "=_", "result_", "[_", "'", "interval", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "progress", "Dialog_", "=_", "control_", "._", "progress", "Dialog_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "progress", "Dialog_", "._", "create_", "(_", "'", "Real", "Deb", "rid", "'_", ",_", "verification", "\\u", "url_", ",_", "user", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "3600_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "progress", "Dialog_", "._", "isc", "anc", "ele", "d_", "(_", ")_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "float_", "(_", "i_", ")_", "%_", "interval_", "==_", "0_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "https", "://", "api", ".", "real", "-", "deb", "rid", ".", "com", "/", "oauth", "/", "v2", "/", "device", "/", "cred", "ential", "s", "?", "client", "\\u", "id", "=", "%", "s", "&", "code", "=", "%", "s", "'_", "%_", "(_", "CLIENT", "\\u", "ID_", ",_", "device", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "headers_", "=_", "headers_", ",_", "error_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "client", "\\u", "secret", "'_", "in_", "result_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "progress", "Dialog_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "id_", ",_", "secret_", "=_", "result_", "[_", "'", "client", "\\u", "id", "'_", "]_", ",_", "result_", "[_", "'", "client", "\\u", "secret", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "https", "://", "api", ".", "real", "-", "deb", "rid", ".", "com", "/", "oauth", "/", "v2", "/", "token", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "{_", "'", "client", "\\u", "id", "'_", ":_", "id_", ",_", "'", "client", "\\u", "secret", "'_", ":_", "secret_", ",_", "'", "code", "'_", ":_", "device", "\\u", "code_", ",_", "'", "grant", "\\u", "type", "'_", ":_", "'", "http", "://", "oauth", ".", "net", "/", "grant", "\\u", "type", "/", "device", "/", "1.0", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "token_", ",_", "refresh_", "=_", "result_", "[_", "'", "access", "\\u", "token", "'_", "]_", ",_", "result_", "[_", "'", "refre", "sh", "\\u", "token", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "client", "\\u", "id", "'_", ",_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "client", "\\u", "secret", "'_", ",_", "secret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "token", "'_", ",_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "refre", "sh", "'_", ",_", "refresh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "auth", "'_", ",_", "'*******", "*****", "*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", ")_", "\\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 ", " _", "control_", "._", "open", "Settings_", "(_", "'", "3.1", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rd", "Dict_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "https", "://", "api", ".", "real", "-", "deb", "rid", ".", "com", "/", "rest", "/", "1.0", "/", "host", "s", "/", "domains", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "cache_", "._", "get_", "(_", "client_", "._", "request_", ",_", "24_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "[_", "i_", "._", "lower_", "(_", ")_", "for_", "i_", "in_", "hosts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pz", "Dict_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "premium", "ize", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "password_", "=_", "credentials_", "(_", ")_", "[_", "'", "premium", "ize", "'_", "]_", "[_", "'", "user", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "premium", "ize", "'_", "]_", "[_", "'", "pass", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "api", ".", "premium", "ize", ".", "me", "/", "pm", "-", "api", "/", "v1", ".", "php", "?", "method", "=", "hoste", "rli", "st", "&", "params", "[", "login", "]=", "%", "s", "&", "params", "[", "pass", "]=", "%", "s", "'_", "%_", "(_", "user_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "cache_", "._", "get_", "(_", "client_", "._", "request_", ",_", "24_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "[_", "'", "result", "'_", "]_", "[_", "'", "hoste", "rli", "st", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "[_", "i_", "._", "lower_", "(_", ")_", "for_", "i_", "in_", "hosts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ad", "Dict_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "alld", "eb", "rid", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "alld", "eb", "rid", ".", "com", "/", "api", ".", "php", "?", "action", "=", "get", "\\u", "host", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "cache_", "._", "get_", "(_", "client_", "._", "request_", ",_", "24_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "json_", "._", "loads_", "(_", "'[", "%", "s", "]'_", "%_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "[_", "i_", "._", "lower_", "(_", ")_", "for_", "i_", "in_", "hosts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rp", "Dict_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "rpn", "et", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "premium", ".", "rpn", "et", ".", "biz", "/", "hoste", "r2", ".", "json", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "cache_", "._", "get_", "(_", "client_", "._", "request_", ",_", "24_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "result_", "[_", "'", "support", "ed", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hosts_", "=_", "[_", "i_", "._", "lower_", "(_", ")_", "for_", "i_", "in_", "hosts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "hosts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "status_", "(_", ")_", ":_", "\\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 ", " _", "c_", "=_", "[_", "i_", "for_", "i_", "in_", "credentials_", "(_", ")_", "._", "values_", "(_", ")_", "if_", "not_", "''_", "in_", "i_", "._", "values_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "c_", ")_", "==_", "0_", ":_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "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]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resolve_", "(_", "url_", ",_", "deb", "rid_", "=_", "'", "real", "deb", "rid", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "u_", "._", "replace_", "(_", "'", "filef", "actor", "y", ".", "com", "/", "stream", "/'_", ",_", "'", "filef", "actor", "y", ".", "com", "/", "file", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "@@@@", " ", " ", "REAL", "DEB", "RID", " ", "INIT", " ", "%", "s", " ", "###", " ", "%", "s", "\"", " ", "%", " ", "(", "url", ",", "deb", "rid", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u1_", "=_", "urlparse_", "._", "urlparse_", "(_", "url_", ")_", "[_", "1_", "]_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u1_", "=_", "u_", "[_", "-_", "2_", "]_", "+_", "'.'_", "+_", "u_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "status_", "(_", ")_", "is_", "False_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "deb", "rid_", "==_", "'", "real", "deb", "rid", "'_", "and_", "not_", "deb", "rid_", "==_", "True_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "raise", " ", "Except", "ion", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", ",_", "secret_", ",_", "token_", ",_", "refresh_", "=_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "[_", "'", "id", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "[_", "'", "secret", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "[_", "'", "token", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "real", "deb", "rid", "'_", "]_", "[_", "'", "refre", "sh", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "USER", "\\u", "AGENT_", "=_", "'", "Kodi", " ", "Exo", "dus", "/", "3.0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", "=_", "{_", "'", "link", "'_", ":_", "u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "{_", "'", "Authoriz", "ation", "'_", ":_", "'", "Bear", "er", " ", "%", "s", "'_", "%_", "token_", ",_", "'", "User", "-", "Agent", "'_", ":_", "USER", "\\u", "AGENT_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "api", ".", "real", "-", "deb", "rid", ".", "com", "/", "rest", "/", "1.0", "/", "unres", "tric", "t", "/", "link", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ",_", "error_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "log_", "(_", "'@", "@", " ", "DEB", "RID", " ", " ", "RESULTS", "@@", " ", "%", "s", "'_", "%_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "error", "'_", "in_", "result_", "and_", "result_", "[_", "'", "error", "'_", "]_", "==_", "'", "bad", "\\u", "token", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "client_", "._", "request_", "(_", "'", "https", "://", "api", ".", "real", "-", "deb", "rid", ".", "com", "/", "oauth", "/", "v2", "/", "token", "'_", ",_", "post_", "=_", "{_", "'", "client", "\\u", "id", "'_", ":_", "id_", ",_", "'", "client", "\\u", "secret", "'_", ":_", "secret_", ",_", "'", "code", "'_", ":_", "refresh_", ",_", "'", "grant", "\\u", "type", "'_", ":_", "'", "http", "://", "oauth", ".", "net", "/", "grant", "\\u", "type", "/", "device", "/", "1.0", "'_", "}_", ",_", "headers_", "=_", "{_", "'", "User", "-", "Agent", "'_", ":_", "USER", "\\u", "AGENT_", "}_", ",_", "error_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "log_", "(_", "'", "Refr", "esh", "ing", " ", "Expire", "d", " ", "Real", " ", "Deb", "rid", " ", "Token", ":", " ", "|", "%", "s", "|", "%", "s", "|'_", "%_", "(_", "id_", ",_", "refresh_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "log_", "(_", "'", "Refr", "esh", "ing", " ", "Expire", "d", " ", ":", " ", "|", "%", "s", "|'_", "%_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "error", "'_", "in_", "result_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", ",_", "refresh_", "=_", "result_", "[_", "'", "access", "\\u", "token", "'_", "]_", ",_", "result_", "[_", "'", "refre", "sh", "\\u", "token", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "token", "'_", ",_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "set\\u", "setting_", "(_", "'", "real", "deb", "rid", "\\u", "refre", "sh", "'_", ",_", "refresh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "[_", "'", "Authoriz", "ation", "'_", "]_", "=_", "'", "Bear", "er", " ", "%", "s", "'_", "%_", "result_", "[_", "'", "access", "\\u", "token", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ",_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "error", "'_", "in_", "result_", "and_", "result_", "[_", "'", "error", "'_", "]_", "==_", "'", "file", "\\u", "unava", "ilab", "le", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "control_", "._", "log_", "(_", "\"@", "@@", "@", " ", " ", "REAL", "DEB", "RID", " ", "FILE", " ", "UNA", "VA", "IL", " ", "%", "s", " ", "###", " ", "%", "s", "\"_", "%_", "(_", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "result_", "[_", "'", "download", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "control_", "._", "log_", "(_", "'@", "@", " ", "DEB", "RID", " ", " ", "UR", "l", "@@", " ", "%", "s", "'_", "%_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "deb", "rid_", "==_", "'", "premium", "ize", "'_", "and_", "not_", "deb", "rid_", "==_", "True_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "premium", "ize", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "password_", "=_", "credentials_", "(_", ")_", "[_", "'", "premium", "ize", "'_", "]_", "[_", "'", "user", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "premium", "ize", "'_", "]_", "[_", "'", "pass", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "api", ".", "premium", "ize", ".", "me", "/", "pm", "-", "api", "/", "v1", ".", "php", "?", "method", "=", "direct", "download", "link", "&", "params", "[", "login", "]=", "%", "s", "&", "params", "[", "pass", "]=", "%", "s", "&", "params", "[", "link", "]=", "%", "s", "'_", "%_", "(_", "user_", ",_", "password_", ",_", "urllib_", "._", "quote", "\\u", "plus_", "(_", "u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "close_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "[_", "'", "result", "'_", "]_", "[_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "deb", "rid_", "==_", "'", "alld", "eb", "rid", "'_", "and_", "not_", "deb", "rid_", "==_", "True_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "alld", "eb", "rid", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "password_", "=_", "credentials_", "(_", ")_", "[_", "'", "alld", "eb", "rid", "'_", "]_", "[_", "'", "user", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "alld", "eb", "rid", "'_", "]_", "[_", "'", "pass", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "login", "\\u", "data_", "=_", "{_", "'", "action", "'_", ":_", "'", "login", "'_", ",_", "'", "login", "\\u", "login", "'_", ":_", "user_", ",_", "'", "login", "\\u", "password", "'_", ":_", "password_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "login", "\\u", "link_", "=_", "'", "http", "://", "alld", "eb", "rid", ".", "com", "/", "register", "/?", "%", "s", "'_", "%_", "login", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cookie_", "=_", "client_", "._", "request_", "(_", "login", "\\u", "link_", ",_", "output_", "=_", "'", "cookie", "'_", ",_", "close_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "http", "://", "www", ".", "alld", "eb", "rid", ".", "com", "/", "service", ".", "php", "?", "link", "=", "%", "s", "'_", "%_", "urllib_", "._", "quote", "\\u", "plus_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "cookie_", "=_", "cookie_", ",_", "close_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ",_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "link", "\\u", "dl", "'_", "}_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "replace", "HTM", "LC", "odes_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'%", "s", "|", "Cooki", "e", "=", "%", "s", "'_", "%_", "(_", "url_", ",_", "urllib_", "._", "quote", "\\u", "plus_", "(_", "cookie_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "deb", "rid_", "==_", "'", "rpn", "et", "'_", "and_", "not_", "deb", "rid_", "==_", "True_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "''_", "in_", "credentials_", "(_", ")_", "[_", "'", "rpn", "et", "'_", "]_", "._", "values_", "(_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "password_", "=_", "credentials_", "(_", ")_", "[_", "'", "rpn", "et", "'_", "]_", "[_", "'", "user", "'_", "]_", ",_", "credentials_", "(_", ")_", "[_", "'", "rpn", "et", "'_", "]_", "[_", "'", "pass", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "login", "\\u", "data_", "=_", "{_", "'", "user", "name", "'_", ":_", "user_", ",_", "'", "password", "'_", ":_", "password_", ",_", "'", "action", "'_", ":_", "'", "generat", "e", "'_", ",_", "'", "link", "s", "'_", ":_", "u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "login", "\\u", "link_", "=_", "'", "http", "://", "premium", ".", "rpn", "et", ".", "biz", "/", "client", "\\u", "api", ".", "php", "?", "%", "s", "'_", "%_", "login", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "login", "\\u", "link_", ",_", "close_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "json_", "._", "loads_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "result_", "[_", "'", "link", "s", "'_", "]_", "[_", "0_", "]_", "[_", "'", "generat", "ed", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 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, 0, 1, 1, 2, 2, 2, 2 ]
Unused import
jambonrose/DjangoUnleashed-1.8/blog/migrations/0004_add_view_future_post_permission.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(migrations.Migration):\n\n dependencies = [\n ('blog', '0003_post_fields_startups_and_tags_optional'),\n ]\n\n operations = [\n migrations.AlterModelOptions(\n name='post',\n options={'ordering': ['-pub_date', 'title'], 'verbose_name': 'blog post', 'get_latest_by': 'pub_date', 'permissions': (('view_future_post', 'Can view unpublished Post'),)},\n ),\n ]", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 } ]
[ { "span": "from django.db import migrations, models", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "migrations_", ",_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "migrations_", "._", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dependencies_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "blog", "'_", ",_", "'", "0003", "\\u", "post", "\\u", "fields", "\\u", "start", "ups", "\\u", "and", "\\u", "tags", "\\u", "option", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "operations_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "migrations_", "._", "Alter", "Model", "Options_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "=_", "{_", "'", "orderi", "ng", "'_", ":_", "[_", "'-", "pub", "\\u", "date", "'_", ",_", "'", "title", "'_", "]_", ",_", "'", "verbo", "se", "\\u", "name", "'_", ":_", "'", "blog", " ", "post", "'_", ",_", "'", "get", "\\u", "late", "st", "\\u", "by", "'_", ":_", "'", "pub", "\\u", "date", "'_", ",_", "'", "permissi", "ons", "'_", ":_", "(_", "(_", "'", "view", "\\u", "future", "\\u", "post", "'_", ",_", "'", "Can", " ", "view", " ", "unp", "ubli", "shed", " ", "Post", "'_", ")_", ",_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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/db/api/permission.py
[ { "content": "# 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\"\"\"Permission database operations.\"\"\"\nimport re\n\nfrom compass.db.api import database\nfrom compass.db.api import user as user_api\nfrom compass.db.api import utils\nfrom compass.db import exception\nfrom compass.db import models\nfrom compass.utils import util\n\n\nSUPPORTED_FIELDS = ['id', 'name', 'alias', 'description']\nRESP_FIELDS = ['id', 'name', 'alias', 'description']\n\n\n\n\nPERMISSION_LIST_PERMISSIONS = PermissionWrapper(\n 'list_permissions', 'list permissions', 'list all permissions'\n)\nPERMISSION_LIST_SWITCHES = PermissionWrapper(\n 'list_switches', 'list switches', 'list all switches'\n)\nPERMISSION_LIST_SWITCH_FILTERS = PermissionWrapper(\n 'list_switch_filters',\n 'list switch filters',\n 'list switch filters'\n)\nPERMISSION_ADD_SWITCH = PermissionWrapper(\n 'add_switch', 'add switch', 'add switch'\n)\nPERMISSION_UPDATE_SWITCH_FILTERS = PermissionWrapper(\n 'update_switch_filters',\n 'update switch filters',\n 'update switch filters'\n)\nPERMISSION_DEL_SWITCH = PermissionWrapper(\n 'delete_switch', 'delete switch', 'delete switch'\n)\nPERMISSION_LIST_SWITCH_MACHINES = PermissionWrapper(\n 'list_switch_machines', 'list switch machines', 'list switch machines'\n)\nPERMISSION_ADD_SWITCH_MACHINE = PermissionWrapper(\n 'add_switch_machine', 'add switch machine', 'add switch machine'\n)\nPERMISSION_DEL_SWITCH_MACHINE = PermissionWrapper(\n 'del_switch_machine', 'delete switch machine', 'del switch machine'\n)\nPERMISSION_UPDATE_SWITCH_MACHINES = PermissionWrapper(\n 'update_switch_machines',\n 'update switch machines',\n 'update switch machines'\n)\nPERMISSION_LIST_MACHINES = PermissionWrapper(\n 'list_machines', 'list machines', 'list machines'\n)\nPERMISSION_ADD_MACHINE = PermissionWrapper(\n 'add_machine', 'add machine', 'add machine'\n)\nPERMISSION_DEL_MACHINE = PermissionWrapper(\n 'delete_machine', 'delete machine', 'delete machine'\n)\nPERMISSION_LIST_ADAPTERS = PermissionWrapper(\n 'list_adapters', 'list adapters', 'list adapters'\n)\nPERMISSION_LIST_METADATAS = PermissionWrapper(\n 'list_metadatas', 'list metadatas', 'list metadatas'\n)\nPERMISSION_LIST_SUBNETS = PermissionWrapper(\n 'list_subnets', 'list subnets', 'list subnets'\n)\nPERMISSION_ADD_SUBNET = PermissionWrapper(\n 'add_subnet', 'add subnet', 'add subnet'\n)\nPERMISSION_DEL_SUBNET = PermissionWrapper(\n 'del_subnet', 'del subnet', 'del subnet'\n)\nPERMISSION_LIST_CLUSTERS = PermissionWrapper(\n 'list_clusters', 'list clusters', 'list clusters'\n)\nPERMISSION_ADD_CLUSTER = PermissionWrapper(\n 'add_cluster', 'add cluster', 'add cluster'\n)\nPERMISSION_DEL_CLUSTER = PermissionWrapper(\n 'del_cluster', 'del cluster', 'del cluster'\n)\nPERMISSION_LIST_CLUSTER_CONFIG = PermissionWrapper(\n 'list_cluster_config', 'list cluster config', 'list cluster config'\n)\nPERMISSION_ADD_CLUSTER_CONFIG = PermissionWrapper(\n 'add_cluster_config', 'add cluster config', 'add cluster config'\n)\nPERMISSION_DEL_CLUSTER_CONFIG = PermissionWrapper(\n 'del_cluster_config', 'del cluster config', 'del cluster config'\n)\nPERMISSION_UPDATE_CLUSTER_HOSTS = PermissionWrapper(\n 'update_cluster_hosts',\n 'update cluster hosts',\n 'update cluster hosts'\n)\nPERMISSION_DEL_CLUSTER_HOST = PermissionWrapper(\n 'del_clusterhost', 'delete clusterhost', 'delete clusterhost'\n)\nPERMISSION_REVIEW_CLUSTER = PermissionWrapper(\n 'review_cluster', 'review cluster', 'review cluster'\n)\nPERMISSION_DEPLOY_CLUSTER = PermissionWrapper(\n 'deploy_cluster', 'deploy cluster', 'deploy cluster'\n)\nPERMISSION_DEPLOY_HOST = PermissionWrapper(\n 'deploy_host', 'deploy host', 'deploy host'\n)\nPERMISSION_GET_CLUSTER_STATE = PermissionWrapper(\n 'get_cluster_state', 'get cluster state', 'get cluster state'\n)\nPERMISSION_UPDATE_CLUSTER_STATE = PermissionWrapper(\n 'update_cluster_state', 'update cluster state',\n 'update cluster state'\n)\nPERMISSION_LIST_HOSTS = PermissionWrapper(\n 'list_hosts', 'list hosts', 'list hosts'\n)\nPERMISSION_LIST_HOST_CLUSTERS = PermissionWrapper(\n 'list_host_clusters',\n 'list host clusters',\n 'list host clusters'\n)\nPERMISSION_UPDATE_HOST = PermissionWrapper(\n 'update_host', 'update host', 'update host'\n)\nPERMISSION_DEL_HOST = PermissionWrapper(\n 'del_host', 'del host', 'del host'\n)\nPERMISSION_LIST_HOST_CONFIG = PermissionWrapper(\n 'list_host_config', 'list host config', 'list host config'\n)\nPERMISSION_ADD_HOST_CONFIG = PermissionWrapper(\n 'add_host_config', 'add host config', 'add host config'\n)\nPERMISSION_DEL_HOST_CONFIG = PermissionWrapper(\n 'del_host_config', 'del host config', 'del host config'\n)\nPERMISSION_LIST_HOST_NETWORKS = PermissionWrapper(\n 'list_host_networks',\n 'list host networks',\n 'list host networks'\n)\nPERMISSION_ADD_HOST_NETWORK = PermissionWrapper(\n 'add_host_network', 'add host network', 'add host network'\n)\nPERMISSION_DEL_HOST_NETWORK = PermissionWrapper(\n 'del_host_network', 'del host network', 'del host network'\n)\nPERMISSION_GET_HOST_STATE = PermissionWrapper(\n 'get_host_state', 'get host state', 'get host state'\n)\nPERMISSION_UPDATE_HOST_STATE = PermissionWrapper(\n 'update_host_state', 'update host sate', 'update host state'\n)\nPERMISSION_LIST_CLUSTERHOSTS = PermissionWrapper(\n 'list_clusterhosts', 'list cluster hosts', 'list cluster hosts'\n)\nPERMISSION_LIST_CLUSTERHOST_CONFIG = PermissionWrapper(\n 'list_clusterhost_config',\n 'list clusterhost config',\n 'list clusterhost config'\n)\nPERMISSION_ADD_CLUSTERHOST_CONFIG = PermissionWrapper(\n 'add_clusterhost_config',\n 'add clusterhost config',\n 'add clusterhost config'\n)\nPERMISSION_DEL_CLUSTERHOST_CONFIG = PermissionWrapper(\n 'del_clusterhost_config',\n 'del clusterhost config',\n 'del clusterhost config'\n)\nPERMISSION_GET_CLUSTERHOST_STATE = PermissionWrapper(\n 'get_clusterhost_state',\n 'get clusterhost state',\n 'get clusterhost state'\n)\nPERMISSION_UPDATE_CLUSTERHOST_STATE = PermissionWrapper(\n 'update_clusterhost_state',\n 'update clusterhost state',\n 'update clusterhost state'\n)\nPERMISSION_LIST_HEALTH_REPORT = PermissionWrapper(\n 'list_health_reports',\n 'list health check report',\n 'list health check report'\n)\nPERMISSION_GET_HEALTH_REPORT = PermissionWrapper(\n 'get_health_report',\n 'get health report',\n 'get health report'\n)\nPERMISSION_CHECK_CLUSTER_HEALTH = PermissionWrapper(\n 'start_check_cluster_health',\n 'start check cluster health',\n 'start check cluster health'\n)\nPERMISSION_SET_HEALTH_CHECK_ERROR = PermissionWrapper(\n 'set_error_state',\n 'set health check into error state',\n 'set health check into error state'\n)\nPERMISSION_DELETE_REPORT = PermissionWrapper(\n 'delete_reports',\n 'delete health reports',\n 'delete health reports'\n)\nPERMISSIONS = [\n PERMISSION_LIST_PERMISSIONS,\n PERMISSION_LIST_SWITCHES,\n PERMISSION_ADD_SWITCH,\n PERMISSION_DEL_SWITCH,\n PERMISSION_LIST_SWITCH_FILTERS,\n PERMISSION_UPDATE_SWITCH_FILTERS,\n PERMISSION_LIST_SWITCH_MACHINES,\n PERMISSION_ADD_SWITCH_MACHINE,\n PERMISSION_DEL_SWITCH_MACHINE,\n PERMISSION_UPDATE_SWITCH_MACHINES,\n PERMISSION_LIST_MACHINES,\n PERMISSION_ADD_MACHINE,\n PERMISSION_DEL_MACHINE,\n PERMISSION_LIST_ADAPTERS,\n PERMISSION_LIST_METADATAS,\n PERMISSION_LIST_SUBNETS,\n PERMISSION_ADD_SUBNET,\n PERMISSION_DEL_SUBNET,\n PERMISSION_LIST_CLUSTERS,\n PERMISSION_ADD_CLUSTER,\n PERMISSION_DEL_CLUSTER,\n PERMISSION_LIST_CLUSTER_CONFIG,\n PERMISSION_ADD_CLUSTER_CONFIG,\n PERMISSION_DEL_CLUSTER_CONFIG,\n PERMISSION_UPDATE_CLUSTER_HOSTS,\n PERMISSION_DEL_CLUSTER_HOST,\n PERMISSION_REVIEW_CLUSTER,\n PERMISSION_DEPLOY_CLUSTER,\n PERMISSION_GET_CLUSTER_STATE,\n PERMISSION_UPDATE_CLUSTER_STATE,\n PERMISSION_LIST_HOSTS,\n PERMISSION_LIST_HOST_CLUSTERS,\n PERMISSION_UPDATE_HOST,\n PERMISSION_DEL_HOST,\n PERMISSION_LIST_HOST_CONFIG,\n PERMISSION_ADD_HOST_CONFIG,\n PERMISSION_DEL_HOST_CONFIG,\n PERMISSION_LIST_HOST_NETWORKS,\n PERMISSION_ADD_HOST_NETWORK,\n PERMISSION_DEL_HOST_NETWORK,\n PERMISSION_GET_HOST_STATE,\n PERMISSION_UPDATE_HOST_STATE,\n PERMISSION_DEPLOY_HOST,\n PERMISSION_LIST_CLUSTERHOSTS,\n PERMISSION_LIST_CLUSTERHOST_CONFIG,\n PERMISSION_ADD_CLUSTERHOST_CONFIG,\n PERMISSION_DEL_CLUSTERHOST_CONFIG,\n PERMISSION_GET_CLUSTERHOST_STATE,\n PERMISSION_UPDATE_CLUSTERHOST_STATE,\n PERMISSION_LIST_HEALTH_REPORT,\n PERMISSION_GET_HEALTH_REPORT,\n PERMISSION_CHECK_CLUSTER_HEALTH,\n PERMISSION_SET_HEALTH_CHECK_ERROR,\n PERMISSION_DELETE_REPORT\n]\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PermissionWrapper(object):\n", "metadata": "root.PermissionWrapper", "header": "['module', '___EOS___']", "index": 29 }, { "content": " def __init__(self, name, alias, description):\n self.name = name\n self.alias = alias\n self.description = description", "metadata": "root.PermissionWrapper.__init__", "header": "['class', 'PermissionWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 30 }, { "content": " def to_dict(self):\n return {\n 'name': self.name,\n 'alias': self.alias,\n 'description': self.description\n }", "metadata": "root.PermissionWrapper.to_dict", "header": "['class', 'PermissionWrapper', '(', 'object', ')', ':', '___EOS___']", "index": 35 }, { "content": "@util.deprecated\ndef list_permissions_internal(session, **filters):\n \"\"\"internal functions used only by other db.api modules.\"\"\"\n return utils.list_db_objects(session, models.Permission, **filters)", "metadata": "root.list_permissions_internal", "header": "['module', '___EOS___']", "index": 296 }, { "content": "@utils.supported_filters(optional_support_keys=SUPPORTED_FIELDS)\n@database.run_in_session()\n@user_api.check_user_permission(PERMISSION_LIST_PERMISSIONS)\n@utils.wrap_to_dict(RESP_FIELDS)\ndef list_permissions(user=None, session=None, **filters):\n \"\"\"list permissions.\"\"\"\n return utils.list_db_objects(\n session, models.Permission, **filters\n )", "metadata": "root.list_permissions", "header": "['module', '___EOS___']", "index": 302 }, { "content": "def _get_permission(permission_id, session=None, **kwargs):\n \"\"\"Get permission object by the unique key of Permission table.\"\"\"\n if isinstance(permission_id, (int, long)):\n return utils.get_db_object(\n session, models.Permission, id=permission_id, **kwargs)\n raise exception.InvalidParameter(\n 'permission id %s type is not int compatible' % permission_id\n )", "metadata": "root._get_permission", "header": "['module', '___EOS___']", "index": 313 }, { "content": "def get_permission_internal(permission_id, session=None, **kwargs):\n return _get_permission(permission_id, session=session, **kwargs)", "metadata": "root.get_permission_internal", "header": "['module', '___EOS___']", "index": 323 }, { "content": "@utils.supported_filters()\n@database.run_in_session()\n@user_api.check_user_permission(PERMISSION_LIST_PERMISSIONS)\n@utils.wrap_to_dict(RESP_FIELDS)\ndef get_permission(\n permission_id, exception_when_missing=True,\n user=None, session=None, **kwargs\n):\n \"\"\"get permissions.\"\"\"\n return _get_permission(\n permission_id, session=session,\n exception_when_missing=exception_when_missing\n )", "metadata": "root.get_permission", "header": "['module', '___EOS___']", "index": 327 }, { "content": "def add_permissions_internal(session=None):\n \"\"\"internal functions used by other db.api modules only.\"\"\"\n permissions = []\n for permission in PERMISSIONS:\n permissions.append(\n utils.add_db_object(\n session, models.Permission,\n True,\n permission.name,\n alias=permission.alias,\n description=permission.description\n )\n )\n\n return permissions", "metadata": "root.add_permissions_internal", "header": "['module', '___EOS___']", "index": 342 } ]
[ { "span": "import re", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "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_", "\"\"\"", "Permi", "ssion", " ", "databa", "se", " ", "operati", "ons", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "._", "api_", "import_", "database_", "\\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_", "._", "api_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "import_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "compass", "_", "._", "db_", "import_", "models_", "\\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_", "SUPPORTED", "\\u", "FIELDS_", "=_", "[_", "'", "id", "'_", ",_", "'", "name", "'_", ",_", "'", "alias", "'_", ",_", "'", "description", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RESP", "\\u", "FIELDS_", "=_", "[_", "'", "id", "'_", ",_", "'", "name", "'_", ",_", "'", "alias", "'_", ",_", "'", "description", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "PERMISSION", "\\u", "LIST", "\\u", "PERMISSION", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "permissi", "ons", "'_", ",_", "'", "list", " ", "permissi", "ons", "'_", ",_", "'", "list", " ", "all", " ", "permissi", "ons", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SWITCH", "ES_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "switche", "s", "'_", ",_", "'", "list", " ", "switche", "s", "'_", ",_", "'", "list", " ", "all", " ", "switche", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SWITCH", "\\u", "FILTER", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "switch", "\\u", "filter", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "switch", " ", "filter", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "switch", " ", "filter", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "SWITCH", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "switch", "'_", ",_", "'", "add", " ", "switch", "'_", ",_", "'", "add", " ", "switch", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "SWITCH", "\\u", "FILTER", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "switch", "\\u", "filter", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "switch", " ", "filter", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "switch", " ", "filter", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "SWITCH", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "\\u", "switch", "'_", ",_", "'", "delete", " ", "switch", "'_", ",_", "'", "delete", " ", "switch", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SWITCH", "\\u", "MACHINE", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "switch", "\\u", "machine", "s", "'_", ",_", "'", "list", " ", "switch", " ", "machine", "s", "'_", ",_", "'", "list", " ", "switch", " ", "machine", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "SWITCH", "\\u", "MACHINE", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "switch", "\\u", "machine", "'_", ",_", "'", "add", " ", "switch", " ", "machine", "'_", ",_", "'", "add", " ", "switch", " ", "machine", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "SWITCH", "\\u", "MACHINE", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "switch", "\\u", "machine", "'_", ",_", "'", "delete", " ", "switch", " ", "machine", "'_", ",_", "'", "del", " ", "switch", " ", "machine", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "SWITCH", "\\u", "MACHINE", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "switch", "\\u", "machine", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "switch", " ", "machine", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "switch", " ", "machine", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "MACHINE", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "machine", "s", "'_", ",_", "'", "list", " ", "machine", "s", "'_", ",_", "'", "list", " ", "machine", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "MACHINE", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "machine", "'_", ",_", "'", "add", " ", "machine", "'_", ",_", "'", "add", " ", "machine", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "MACHINE", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "\\u", "machine", "'_", ",_", "'", "delete", " ", "machine", "'_", ",_", "'", "delete", " ", "machine", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "ADA", "PTE", "RS_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "adapter", "s", "'_", ",_", "'", "list", " ", "adapter", "s", "'_", ",_", "'", "list", " ", "adapter", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "METAD", "ATA", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "metadata", "s", "'_", ",_", "'", "list", " ", "metadata", "s", "'_", ",_", "'", "list", " ", "metadata", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SUB", "NET", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "subnet", "s", "'_", ",_", "'", "list", " ", "subnet", "s", "'_", ",_", "'", "list", " ", "subnet", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "SUB", "NET", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "subnet", "'_", ",_", "'", "add", " ", "subnet", "'_", ",_", "'", "add", " ", "subnet", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "SUB", "NET", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "subnet", "'_", ",_", "'", "del", " ", "subnet", "'_", ",_", "'", "del", " ", "subnet", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "cluster", "s", "'_", ",_", "'", "list", " ", "cluster", "s", "'_", ",_", "'", "list", " ", "cluster", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "CLUSTER", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "cluster", "'_", ",_", "'", "add", " ", "cluster", "'_", ",_", "'", "add", " ", "cluster", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "cluster", "'_", ",_", "'", "del", " ", "cluster", "'_", ",_", "'", "del", " ", "cluster", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "cluster", "\\u", "config", "'_", ",_", "'", "list", " ", "cluster", " ", "config", "'_", ",_", "'", "list", " ", "cluster", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "CLUSTER", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "cluster", "\\u", "config", "'_", ",_", "'", "add", " ", "cluster", " ", "config", "'_", ",_", "'", "add", " ", "cluster", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "cluster", "\\u", "config", "'_", ",_", "'", "del", " ", "cluster", " ", "config", "'_", ",_", "'", "del", " ", "cluster", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "CLUSTER", "\\u", "HOSTS_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "cluster", "\\u", "host", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "cluster", " ", "host", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "cluster", " ", "host", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "\\u", "HOST_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "cluster", "host", "'_", ",_", "'", "delete", " ", "cluster", "host", "'_", ",_", "'", "delete", " ", "cluster", "host", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "REVI", "EW", "\\u", "CLUSTER", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "review", "\\u", "cluster", "'_", ",_", "'", "review", " ", "cluster", "'_", ",_", "'", "review", " ", "cluster", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEPLOY", "\\u", "CLUSTER", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deploy", "\\u", "cluster", "'_", ",_", "'", "deploy", " ", "cluster", "'_", ",_", "'", "deploy", " ", "cluster", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEPLOY", "\\u", "HOST_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "deploy", "\\u", "host", "'_", ",_", "'", "deploy", " ", "host", "'_", ",_", "'", "deploy", " ", "host", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "CLUSTER", "\\u", "STATE_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", "\\u", "cluster", "\\u", "state", "'_", ",_", "'", "get", " ", "cluster", " ", "state", "'_", ",_", "'", "get", " ", "cluster", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "CLUSTER", "\\u", "STATE_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "cluster", "\\u", "state", "'_", ",_", "'", "update", " ", "cluster", " ", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "cluster", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOSTS_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "host", "s", "'_", ",_", "'", "list", " ", "host", "s", "'_", ",_", "'", "list", " ", "host", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOST", "\\u", "CLUSTER", "S_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "host", "\\u", "cluster", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "host", " ", "cluster", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "host", " ", "cluster", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "HOST_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "host", "'_", ",_", "'", "update", " ", "host", "'_", ",_", "'", "update", " ", "host", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "HOST_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "host", "'_", ",_", "'", "del", " ", "host", "'_", ",_", "'", "del", " ", "host", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOST", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "host", "\\u", "config", "'_", ",_", "'", "list", " ", "host", " ", "config", "'_", ",_", "'", "list", " ", "host", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "HOST", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "host", "\\u", "config", "'_", ",_", "'", "add", " ", "host", " ", "config", "'_", ",_", "'", "add", " ", "host", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "HOST", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "host", "\\u", "config", "'_", ",_", "'", "del", " ", "host", " ", "config", "'_", ",_", "'", "del", " ", "host", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOST", "\\u", "NET", "WORKS", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "host", "\\u", "network", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "host", " ", "network", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "host", " ", "network", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "HOST", "\\u", "NETWORK_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "host", "\\u", "network", "'_", ",_", "'", "add", " ", "host", " ", "network", "'_", ",_", "'", "add", " ", "host", " ", "network", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "HOST", "\\u", "NETWORK_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "host", "\\u", "network", "'_", ",_", "'", "del", " ", "host", " ", "network", "'_", ",_", "'", "del", " ", "host", " ", "network", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "HOST", "\\u", "STATE_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", "\\u", "host", "\\u", "state", "'_", ",_", "'", "get", " ", "host", " ", "state", "'_", ",_", "'", "get", " ", "host", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "HOST", "\\u", "STATE_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "host", "\\u", "state", "'_", ",_", "'", "update", " ", "host", " ", "sat", "e", "'_", ",_", "'", "update", " ", "host", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "HOSTS_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "cluster", "host", "s", "'_", ",_", "'", "list", " ", "cluster", " ", "host", "s", "'_", ",_", "'", "list", " ", "cluster", " ", "host", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "HOST", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "cluster", "host", "\\u", "config", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "cluster", "host", " ", "config", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "cluster", "host", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "CLUSTER", "HOST", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", "\\u", "cluster", "host", "\\u", "config", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", " ", "cluster", "host", " ", "config", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "add", " ", "cluster", "host", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "HOST", "\\u", "CONFIG_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", "\\u", "cluster", "host", "\\u", "config", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", " ", "cluster", "host", " ", "config", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "del", " ", "cluster", "host", " ", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "CLUSTER", "HOST", "\\u", "STATE_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", "\\u", "cluster", "host", "\\u", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", " ", "cluster", "host", " ", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", " ", "cluster", "host", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "CLUSTER", "HOST", "\\u", "STATE_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", "\\u", "cluster", "host", "\\u", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "cluster", "host", " ", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "update", " ", "cluster", "host", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HEAL", "TH", "\\u", "REPORT", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "health", "\\u", "report", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "health", " ", "check", " ", "report", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", " ", "health", " ", "check", " ", "report", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "HEAL", "TH", "\\u", "REPORT", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", "\\u", "health", "\\u", "report", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", " ", "health", " ", "report", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "get", " ", "health", " ", "report", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "CHECK", "\\u", "CLUSTER", "\\u", "HEAL", "TH_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "check", "\\u", "cluster", "\\u", "health", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", " ", "check", " ", "cluster", " ", "health", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", " ", "check", " ", "cluster", " ", "health", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "SET", "\\u", "HEAL", "TH", "\\u", "CHECK", "\\u", "ERROR_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "set\\u", "error", "\\u", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "set", " ", "health", " ", "check", " ", "int", "o", " ", "error", " ", "state", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "set", " ", "health", " ", "check", " ", "int", "o", " ", "error", " ", "state", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "\\u", "DELET", "E", "\\u", "REPORT", "_", "=_", "Permi", "ssion", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", "\\u", "report", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", " ", "health", " ", "report", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "delete", " ", "health", " ", "report", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERMISSION", "S_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "PERMISSION", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SWITCH", "ES_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "SWITCH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "SWITCH", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SWITCH", "\\u", "FILTER", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "SWITCH", "\\u", "FILTER", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SWITCH", "\\u", "MACHINE", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "SWITCH", "\\u", "MACHINE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "SWITCH", "\\u", "MACHINE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "SWITCH", "\\u", "MACHINE", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "MACHINE", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "MACHINE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "MACHINE", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "ADA", "PTE", "RS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "METAD", "ATA", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "SUB", "NET", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "SUB", "NET", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "SUB", "NET", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "CLUSTER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "CLUSTER", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "CLUSTER", "\\u", "HOSTS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "\\u", "HOST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "REVI", "EW", "\\u", "CLUSTER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEPLOY", "\\u", "CLUSTER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "CLUSTER", "\\u", "STATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "CLUSTER", "\\u", "STATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOSTS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOST", "\\u", "CLUSTER", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "HOST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "HOST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOST", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "HOST", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "HOST", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HOST", "\\u", "NET", "WORKS", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "HOST", "\\u", "NETWORK_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "HOST", "\\u", "NETWORK_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "HOST", "\\u", "STATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "HOST", "\\u", "STATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEPLOY", "\\u", "HOST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "HOSTS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "CLUSTER", "HOST", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "ADD", "\\u", "CLUSTER", "HOST", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DEL", "\\u", "CLUSTER", "HOST", "\\u", "CONFIG_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "CLUSTER", "HOST", "\\u", "STATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "UPDATE", "\\u", "CLUSTER", "HOST", "\\u", "STATE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "LIST", "\\u", "HEAL", "TH", "\\u", "REPORT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "GET", "\\u", "HEAL", "TH", "\\u", "REPORT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "CHECK", "\\u", "CLUSTER", "\\u", "HEAL", "TH_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "SET", "\\u", "HEAL", "TH", "\\u", "CHECK", "\\u", "ERROR_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "PERMISSION", "\\u", "DELET", "E", "\\u", "REPORT", "_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Permi", "ssion", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "alias_", ",_", "description_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "alias_", "=_", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description_", "=_", "description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Permi", "ssion", "Wrapper_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "alias", "'_", ":_", "self_", "._", "alias_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "self_", "._", "description_", "\\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_", "@_", "util_", "._", "deprecated_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "\\u", "permissi", "ons", "\\u", "internal_", "(_", "session_", ",_", "**_", "filters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "internal", " ", "function", "s", " ", "used", " ", "only", " ", "by", " ", "other", " ", "db", ".", "api", " ", "module", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "utils_", "._", "list", "\\u", "db", "\\u", "objects_", "(_", "session_", ",_", "models_", "._", "Permission_", ",_", "**_", "filters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "utils_", "._", "support", "ed", "\\u", "filters_", "(_", "option", "al", "\\u", "support", "\\u", "keys_", "=_", "SUPPORTED", "\\u", "FIELDS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "database_", "._", "run", "\\u", "in", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "user", "\\u", "api_", "._", "check", "\\u", "user", "\\u", "permission_", "(_", "PERMISSION", "\\u", "LIST", "\\u", "PERMISSION", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "utils_", "._", "wrap", "\\u", "to", "\\u", "dict_", "(_", "RESP", "\\u", "FIELDS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "\\u", "permissions_", "(_", "user_", "=_", "None_", ",_", "session_", "=_", "None_", ",_", "**_", "filters_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "list", " ", "permissi", "ons", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "utils_", "._", "list", "\\u", "db", "\\u", "objects_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "session_", ",_", "models_", "._", "Permission_", ",_", "**_", "filters_", "\\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_", "\\u", "get", "\\u", "permission_", "(_", "permissi", "on", "\\u", "id_", ",_", "session_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", " ", "permissi", "on", " ", "object", " ", "by", " ", "the", " ", "unique", " ", "key", " ", "of", " ", "Permi", "ssion", " ", "table", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "permissi", "on", "\\u", "id_", ",_", "(_", "int_", ",_", "long_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "utils_", "._", "get", "\\u", "db", "\\u", "object_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "session_", ",_", "models_", "._", "Permission_", ",_", "id_", "=_", "permissi", "on", "\\u", "id_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "exception_", "._", "Inva", "lid", "Parameter_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "on", " ", "id", " ", "%", "s", " ", "type", " ", "is", " ", "not", " ", "int", " ", "compatible", "'_", "%_", "permissi", "on", "\\u", "id_", "\\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_", "get", "\\u", "permissi", "on", "\\u", "internal_", "(_", "permissi", "on", "\\u", "id_", ",_", "session_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "get", "\\u", "permission_", "(_", "permissi", "on", "\\u", "id_", ",_", "session_", "=_", "session_", ",_", "**_", "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_", "@_", "utils_", "._", "support", "ed", "\\u", "filters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "database_", "._", "run", "\\u", "in", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "user", "\\u", "api_", "._", "check", "\\u", "user", "\\u", "permission_", "(_", "PERMISSION", "\\u", "LIST", "\\u", "PERMISSION", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "utils_", "._", "wrap", "\\u", "to", "\\u", "dict_", "(_", "RESP", "\\u", "FIELDS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "permission_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "permissi", "on", "\\u", "id_", ",_", "exception", "\\u", "whe", "n", "\\u", "missing_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "None_", ",_", "session_", "=_", "None_", ",_", "**_", "kwargs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "get", " ", "permissi", "ons", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "get", "\\u", "permission_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "permissi", "on", "\\u", "id_", ",_", "session_", "=_", "session_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exception", "\\u", "whe", "n", "\\u", "missing_", "=_", "exception", "\\u", "whe", "n", "\\u", "missing_", "\\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_", "add", "\\u", "permissi", "ons", "\\u", "internal_", "(_", "session_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "internal", " ", "function", "s", " ", "used", " ", "by", " ", "other", " ", "db", ".", "api", " ", "module", "s", " ", "only", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "permissions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "permission_", "in_", "PERMISSION", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "permissions_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "utils_", "._", "add", "\\u", "db", "\\u", "object_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "session_", ",_", "models_", "._", "Permission_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "permission_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alias_", "=_", "permission_", "._", "alias_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "permission_", "._", "description_", "\\u\\u\\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_", "return_", "permissions_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
bolme/pyvision/src/pyvision/surveillance/BackgroundSubtraction.py
[ { "content": " def _computeBGDiff(self):\n self._flow.update( self._imageBuffer.getLast() )\n \n n = len(self._imageBuffer) \n prev_im = self._imageBuffer[0]\n forward = None\n for i in range(0,n/2):\n if forward == None:\n forward = self._imageBuffer[i].to_next\n else:\n forward = forward * self._imageBuffer[i].to_next\n \n w,h = size = prev_im.size\n mask = cv.CreateImage(size,cv.IPL_DEPTH_8U,1)\n cv.Set(mask,0)\n interior = cv.GetSubRect(mask, pv.Rect(2,2,w-4,h-4).asOpenCV()) \n cv.Set(interior,255)\n mask = pv.Image(mask)\n\n prev_im = forward(prev_im)\n prev_mask = forward(mask)\n \n\n next_im = self._imageBuffer[n-1]\n back = None\n for i in range(n-1,n/2,-1):\n if back == None:\n back = self._imageBuffer[i].to_prev\n else:\n back = back * self._imageBuffer[i].to_prev\n \n next_im = back(next_im)\n next_mask = back(mask)\n \n curr_im = self._imageBuffer[n/2]\n\n \n prevImg = prev_im.asMatrix2D()\n curImg = curr_im.asMatrix2D()\n nextImg = next_im.asMatrix2D()\n prevMask = prev_mask.asMatrix2D()\n nextMask = next_mask.asMatrix2D()\n\n # Compute transformed images\n delta1 = sp.absolute(curImg - prevImg) #frame diff 1\n delta2 = sp.absolute(nextImg - curImg) #frame diff 2\n \n delta1 = sp.minimum(delta1,prevMask)\n delta2 = sp.minimum(delta2,nextMask)\n \n #use element-wise minimum of the two difference images, which is what\n # gets compared to threshold to yield foreground mask\n return sp.minimum(delta1, delta2)", "metadata": "root.MotionCompensatedFrameDifferencer._computeBGDiff", "header": "['class', 'MotionCompensatedFrameDifferencer', '(', 'AbstractBGModel', ')', ':', '___EOS___']", "index": 161 } ]
[ { "span": "forward == None:", "start_line": 168, "start_column": 15, "end_line": 168, "end_column": 30 }, { "span": "back == None:", "start_line": 187, "start_column": 15, "end_line": 187, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Motion", "Comp", "ensa", "ted", "Frame", "Difference", "r_", "(_", "Abstract", "BG", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "compute", "BG", "Diff_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "flow_", "._", "update_", "(_", "self_", "._", "\\u", "image", "Buffer_", "._", "get", "Last_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n_", "=_", "len_", "(_", "self_", "._", "\\u", "image", "Buffer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "im_", "=_", "self_", "._", "\\u", "image", "Buffer_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "forward_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "n_", "/_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "forward_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "forward_", "=_", "self_", "._", "\\u", "image", "Buffer_", "[_", "i_", "]_", "._", "to", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "forward_", "=_", "forward_", "*_", "self_", "._", "\\u", "image", "Buffer_", "[_", "i_", "]_", "._", "to", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "w_", ",_", "h_", "=_", "size_", "=_", "prev", "\\u", "im_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "=_", "cv_", "._", "Creat", "e", "Image_", "(_", "size_", ",_", "cv_", "._", "IP", "L", "\\u", "DEPTH", "\\u", "8", "U_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cv_", "._", "Set_", "(_", "mask_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interior", "_", "=_", "cv_", "._", "Get", "Sub", "Rect_", "(_", "mask_", ",_", "pv_", "._", "Rect_", "(_", "2_", ",_", "2_", ",_", "w_", "-_", "4_", ",_", "h_", "-_", "4_", ")_", "._", "as", "Open", "CV_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cv_", "._", "Set_", "(_", "interior", "_", ",_", "255_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "=_", "pv_", "._", "Image_", "(_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prev", "\\u", "im_", "=_", "forward_", "(_", "prev", "\\u", "im_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "\\u", "mask_", "=_", "forward_", "(_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "next", "\\u", "im_", "=_", "self_", "._", "\\u", "image", "Buffer_", "[_", "n_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "back_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "n_", "-_", "1_", ",_", "n_", "/_", "2_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "back_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "back_", "=_", "self_", "._", "\\u", "image", "Buffer_", "[_", "i_", "]_", "._", "to", "\\u", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "back_", "=_", "back_", "*_", "self_", "._", "\\u", "image", "Buffer_", "[_", "i_", "]_", "._", "to", "\\u", "prev_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "next", "\\u", "im_", "=_", "back_", "(_", "next", "\\u", "im_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "mask_", "=_", "back_", "(_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "curr", "\\u", "im_", "=_", "self_", "._", "\\u", "image", "Buffer_", "[_", "n_", "/_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prev", "Img_", "=_", "prev", "\\u", "im_", "._", "as", "Matrix", "2", "D_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "Img_", "=_", "curr", "\\u", "im_", "._", "as", "Matrix", "2", "D_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "Img_", "=_", "next", "\\u", "im_", "._", "as", "Matrix", "2", "D_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prev", "Mask_", "=_", "prev", "\\u", "mask_", "._", "as", "Matrix", "2", "D_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "Mask_", "=_", "next", "\\u", "mask_", "._", "as", "Matrix", "2", "D_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "transforme", "d", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "delta", "1_", "=_", "sp_", "._", "absolute_", "(_", "cur", "Img_", "-_", "prev", "Img_", ")_", "#", "frame", " ", "diff", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta", "2_", "=_", "sp_", "._", "absolute_", "(_", "next", "Img_", "-_", "cur", "Img_", ")_", "#", "frame", " ", "diff", " ", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta", "1_", "=_", "sp_", "._", "minimum_", "(_", "delta", "1_", ",_", "prev", "Mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta", "2_", "=_", "sp_", "._", "minimum_", "(_", "delta", "2_", ",_", "next", "Mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "use", " ", "element", "-", "wis", "e", " ", "minim", "um", " ", "of", " ", "the", " ", "two", " ", "difference", " ", "images", ",", " ", "whi", "ch", " ", "is", " ", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gets", " ", "compare", "d", " ", "to", " ", "threshol", "d", " ", "to", " ", "yield", " ", "fore", "ground", " ", "mask_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "sp_", "._", "minimum_", "(_", "delta", "1_", ",_", "delta", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Variable defined multiple times
pydata/pandas/pandas/tests/frame/test_dtypes.py
[ { "content": " def test_astype_with_view(self):\n\n tf = self.mixed_float.reindex(columns=['A', 'B', 'C'])\n\n casted = tf.astype(np.int64)\n\n casted = tf.astype(np.float32)\n\n # this is the only real reason to do it this way\n tf = np.round(self.frame).astype(np.int32)\n casted = tf.astype(np.float32, copy=False)\n\n # TODO(wesm): verification?\n tf = self.frame.astype(np.float64)\n casted = tf.astype(np.int64, copy=False) # noqa", "metadata": "root.TestDataFrameDataTypes.test_astype_with_view", "header": "['class', 'TestDataFrameDataTypes', '(', 'tm', '.', 'TestCase', ',', 'TestData', ')', ':', '___EOS___']", "index": 315 } ]
[ { "span": "casted ", "start_line": 319, "start_column": 8, "end_line": 319, "end_column": 14 }, { "span": "casted ", "start_line": 321, "start_column": 8, "end_line": 321, "end_column": 14 }, { "span": "casted ", "start_line": 325, "start_column": 8, "end_line": 325, "end_column": 14 } ]
[ { "span": "casted ", "start_line": 329, "start_column": 8, "end_line": 329, "end_column": 14 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Data", "Frame", "Data", "Types_", "(_", "tm_", "._", "Test", "Case_", ",_", "Test", "Data_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ast", "ype", "\\u", "with", "\\u", "view_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tf_", "=_", "self_", "._", "mixed", "\\u", "float_", "._", "reindex", "_", "(_", "columns_", "=_", "[_", "'", "A", "'_", ",_", "'", "B", "'_", ",_", "'", "C", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cast", "ed_", "=_", "tf_", "._", "astype_", "(_", "np_", "._", "int64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cast", "ed_", "=_", "tf_", "._", "astype_", "(_", "np_", "._", "float32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "the", " ", "only", " ", "real", " ", "reason", " ", "to", " ", "do", " ", "it", " ", "this", " ", "way_", "\\u\\u\\uNL\\u\\u\\u_", "tf_", "=_", "np_", "._", "round_", "(_", "self_", "._", "frame_", ")_", "._", "astype_", "(_", "np_", "._", "int32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cast", "ed_", "=_", "tf_", "._", "astype_", "(_", "np_", "._", "float32_", ",_", "copy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", "(", "we", "sm", "):", " ", "verification", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "tf_", "=_", "self_", "._", "frame_", "._", "astype_", "(_", "np_", "._", "float64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cast", "ed_", "=_", "tf_", "._", "astype_", "(_", "np_", "._", "int64_", ",_", "copy_", "=_", "False_", ")_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 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, 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, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
openstack/swift/test/unit/common/middleware/test_xprofile.py
[ { "content": " def test_get_profiler(self):\n if xprofile is None:\n raise SkipTest\n self.assertTrue(xprofile.get_profiler('cProfile') is not None)\n self.assertTrue(xprofile.get_profiler('eventlet.green.profile')\n is not None)", "metadata": "root.TestXProfile.test_get_profiler", "header": "['class', 'TestXProfile', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 51 }, { "content": " def test_runctx(self):\n for p in self.profilers:\n p.runctx('import os;os.getcwd();', globals(), locals())\n p.snapshot_stats()\n self.assertTrue(p.stats is not None)\n self.assertTrue(len(p.stats.keys()) > 0)", "metadata": "root.TestProfilers.test_runctx", "header": "['class', 'TestProfilers', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def test_call(self):\n body = b\"sort=time&limit=-1&fulldirs=1&nfl_filter=&metric=nc\"\n wsgi_input = BytesIO(body + b'&query=query')\n environ = {'HTTP_HOST': 'localhost:8080',\n 'PATH_INFO': '/__profile__',\n 'REQUEST_METHOD': 'GET',\n 'QUERY_STRING': 'profile=all&format=json',\n 'wsgi.input': wsgi_input}\n resp = self.app(environ, self.start_response)\n self.assertTrue(resp[0].find('<html>') > 0, resp)\n self.assertEqual(self.got_statuses, ['200 OK'])\n self.assertEqual(self.headers, [('content-type', 'text/html')])\n wsgi_input = BytesIO(body + b'&plot=plot')\n environ['wsgi.input'] = wsgi_input\n if PLOTLIB_INSTALLED:\n resp = self.app(environ, self.start_response)\n self.assertEqual(self.got_statuses, ['200 OK'])\n self.assertEqual(self.headers, [('content-type', 'image/jpg')])\n else:\n resp = self.app(environ, self.start_response)\n self.assertEqual(self.got_statuses, ['500 Internal Server Error'])\n wsgi_input = BytesIO(body + '&download=download&format=default')\n environ['wsgi.input'] = wsgi_input\n resp = self.app(environ, self.start_response)\n self.assertEqual(self.headers, [('content-type',\n HTMLViewer.format_dict['default'])])\n wsgi_input = BytesIO(body + '&download=download&format=json')\n environ['wsgi.input'] = wsgi_input\n resp = self.app(environ, self.start_response)\n self.assertTrue(self.headers == [('content-type',\n HTMLViewer.format_dict['json'])])\n env2 = environ.copy()\n env2['REQUEST_METHOD'] = 'DELETE'\n resp = self.app(env2, self.start_response)\n self.assertEqual(self.got_statuses, ['405 Method Not Allowed'], resp)\n\n # use a totally bogus profile identifier\n wsgi_input = BytesIO(body + b'&profile=ABC&download=download')\n environ['wsgi.input'] = wsgi_input\n resp = self.app(environ, self.start_response)\n self.assertEqual(self.got_statuses, ['404 Not Found'], resp)\n\n wsgi_input = BytesIO(body + b'&download=download&format=ods')\n environ['wsgi.input'] = wsgi_input\n resp = self.app(environ, self.start_response)\n if ODFLIB_INSTALLED:\n self.assertEqual(self.headers, [('content-type',\n HTMLViewer.format_dict['ods'])])\n else:\n self.assertEqual(self.got_statuses, ['500 Internal Server Error'])", "metadata": "root.TestProfileMiddleware.test_call", "header": "['class', 'TestProfileMiddleware', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 129 }, { "content": " def test_dump_checkpoint(self):\n self.app.dump_checkpoint()\n self.assertTrue(self.app.last_dump_at is not None)", "metadata": "root.TestProfileMiddleware.test_dump_checkpoint", "header": "['class', 'TestProfileMiddleware', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 180 }, { "content": " def test_renew_profile(self):\n old_profiler = self.app.profiler\n self.app.renew_profile()\n new_profiler = self.app.profiler\n self.assertTrue(old_profiler != new_profiler)", "metadata": "root.TestProfileMiddleware.test_renew_profile", "header": "['class', 'TestProfileMiddleware', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 184 }, { "content": " def test_get_all_pids(self):\n self.assertEqual(self.profile_log1.get_all_pids(),\n sorted(self.pids1, reverse=True))\n for pid in self.profile_log2.get_all_pids():\n self.assertTrue(pid.split('-')[0] in self.pids2)", "metadata": "root.Test_profile_log.test_get_all_pids", "header": "['class', 'Test_profile_log', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 221 }, { "content": " def test_get_logfiles(self):\n log_files = self.profile_log1.get_logfiles('all')\n self.assertEqual(len(log_files), 3)\n self.assertEqual(len(log_files), len(self.pids1))\n log_files = self.profile_log1.get_logfiles('current')\n self.assertEqual(len(log_files), 1)\n self.assertEqual(log_files, [self.log_filename_prefix1\n + str(os.getpid())])\n log_files = self.profile_log1.get_logfiles(self.pids1[0])\n self.assertEqual(len(log_files), 1)\n self.assertEqual(log_files, [self.log_filename_prefix1\n + self.pids1[0]])\n log_files = self.profile_log2.get_logfiles('all')\n self.assertEqual(len(log_files), 3)\n self.assertEqual(len(log_files), len(self.pids2))\n log_files = self.profile_log2.get_logfiles('current')\n self.assertEqual(len(log_files), 1)\n self.assertTrue(log_files[0].find(self.log_filename_prefix2 +\n str(os.getpid())) > -1)\n log_files = self.profile_log2.get_logfiles(self.pids2[0])\n self.assertEqual(len(log_files), 1)\n self.assertTrue(log_files[0].find(self.log_filename_prefix2 +\n self.pids2[0]) > -1)", "metadata": "root.Test_profile_log.test_get_logfiles", "header": "['class', 'Test_profile_log', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 246 }, { "content": " def test_render(self):\n url = 'http://localhost:8080/__profile__'\n path_entries = ['/__profile__'.split('/'),\n '/__profile__/'.split('/'),\n '/__profile__/123'.split('/'),\n '/__profile__/123/'.split('/'),\n '/__profile__/123/:0(getcwd)'.split('/'),\n '/__profile__/all'.split('/'),\n '/__profile__/all/'.split('/'),\n '/__profile__/all/:0(getcwd)'.split('/'),\n '/__profile__/current'.split('/'),\n '/__profile__/current/'.split('/'),\n '/__profile__/current/:0(getcwd)'.split('/')]\n\n content, headers = self.viewer.render(url, 'GET', path_entries[0],\n self.query_dict, None)\n self.assertTrue(content is not None)\n self.assertEqual(headers, [('content-type', 'text/html')])\n\n content, headers = self.viewer.render(url, 'POST', path_entries[0],\n self.query_dict, None)\n self.assertTrue(content is not None)\n self.assertEqual(headers, [('content-type', 'text/html')])\n\n plot_dict = self.query_dict.copy()\n plot_dict['plot'] = ['plot']\n if PLOTLIB_INSTALLED:\n content, headers = self.viewer.render(url, 'POST', path_entries[0],\n plot_dict, None)\n self.assertEqual(headers, [('content-type', 'image/jpg')])\n else:\n self.assertRaises(PLOTLIBNotInstalled, self.viewer.render,\n url, 'POST', path_entries[0], plot_dict, None)\n\n clear_dict = self.query_dict.copy()\n clear_dict['clear'] = ['clear']\n del clear_dict['query']\n clear_dict['profile'] = ['xxx']\n content, headers = self.viewer.render(url, 'POST', path_entries[0],\n clear_dict, None)\n self.assertEqual(headers, [('content-type', 'text/html')])\n\n download_dict = self.query_dict.copy()\n download_dict['download'] = ['download']\n content, headers = self.viewer.render(url, 'POST', path_entries[0],\n download_dict, None)\n self.assertTrue(headers == [('content-type',\n self.viewer.format_dict['default'])])\n\n content, headers = self.viewer.render(url, 'GET', path_entries[1],\n self.query_dict, None)\n self.assertTrue(isinstance(json.loads(content), dict))\n\n for method in ['HEAD', 'PUT', 'DELETE', 'XYZMethod']:\n self.assertRaises(MethodNotAllowed, self.viewer.render, url,\n method, path_entries[10], self.query_dict, None)\n\n for entry in path_entries[2:]:\n download_dict['format'] = 'default'\n content, headers = self.viewer.render(url, 'GET', entry,\n download_dict, None)\n self.assertTrue(\n ('content-type', self.viewer.format_dict['default'])\n in headers, entry)\n download_dict['format'] = 'json'\n content, headers = self.viewer.render(url, 'GET', entry,\n download_dict, None)\n self.assertTrue(isinstance(json.loads(content), dict))", "metadata": "root.Test_html_viewer.test_render", "header": "['class', 'Test_html_viewer', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 330 }, { "content": " def test_index(self):\n content, headers = self.viewer.index_page(self.log_files[0:1],\n profile_id='current')\n self.assertTrue(content.find('<html>') > -1)\n self.assertTrue(headers == [('content-type', 'text/html')])", "metadata": "root.Test_html_viewer.test_index", "header": "['class', 'Test_html_viewer', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 399 }, { "content": " def test_index_all(self):\n content, headers = self.viewer.index_page(self.log_files,\n profile_id='all')\n for f in self.log_files:\n self.assertTrue(content.find(f) > 0, content)\n self.assertTrue(headers == [('content-type', 'text/html')])", "metadata": "root.Test_html_viewer.test_index_all", "header": "['class', 'Test_html_viewer', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 405 }, { "content": " def test_download(self):\n content, headers = self.viewer.download(self.log_files)\n self.assertTrue(content is not None)\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['default'])])\n content, headers = self.viewer.download(self.log_files, sort='calls',\n limit=10, nfl_filter='os')\n self.assertTrue(content is not None)\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['default'])])\n content, headers = self.viewer.download(self.log_files,\n output_format='default')\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['default'])])\n content, headers = self.viewer.download(self.log_files,\n output_format='json')\n self.assertTrue(isinstance(json.loads(content), dict))\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['json'])])\n content, headers = self.viewer.download(self.log_files,\n output_format='csv')\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['csv'])])\n if ODFLIB_INSTALLED:\n content, headers = self.viewer.download(self.log_files,\n output_format='ods')\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['ods'])])\n else:\n self.assertRaises(ODFLIBNotInstalled, self.viewer.download,\n self.log_files, output_format='ods')\n content, headers = self.viewer.download(self.log_files,\n nfl_filter=__file__,\n output_format='python')\n self.assertEqual(headers, [('content-type',\n self.viewer.format_dict['python'])])", "metadata": "root.Test_html_viewer.test_download", "header": "['class', 'Test_html_viewer', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 412 }, { "content": " def test_plot(self):\n if PLOTLIB_INSTALLED:\n content, headers = self.viewer.plot(self.log_files)\n self.assertTrue(content is not None)\n self.assertEqual(headers, [('content-type', 'image/jpg')])\n self.assertRaises(NotFoundException, self.viewer.plot, [])\n else:\n self.assertRaises(PLOTLIBNotInstalled, self.viewer.plot,\n self.log_files)", "metadata": "root.Test_html_viewer.test_plot", "header": "['class', 'Test_html_viewer', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 449 }, { "content": " def test_to_json(self):\n for selection in self.selections:\n js = self.stats2.to_json(selection)\n self.assertTrue(isinstance(json.loads(js), dict))\n self.assertTrue(json.loads(js)['stats'] is not None)\n self.assertTrue(json.loads(js)['stats'][0] is not None)", "metadata": "root.TestStats2.test_to_json", "header": "['class', 'TestStats2', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 499 }, { "content": " def test_to_ods(self):\n if ODFLIB_INSTALLED:\n for selection in self.selections:\n self.assertTrue(self.stats2.to_ods(selection) is not None)", "metadata": "root.TestStats2.test_to_ods", "header": "['class', 'TestStats2', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 506 }, { "content": " def test_to_csv(self):\n for selection in self.selections:\n self.assertTrue(self.stats2.to_csv(selection) is not None)\n self.assertTrue('function calls' in self.stats2.to_csv(selection))", "metadata": "root.TestStats2.test_to_csv", "header": "['class', 'TestStats2', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 511 } ]
[ { "span": "self.assertTrue(xprofile.get_profiler('cProfile') is not None)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 70 }, { "span": "self.assertTrue(xprofile.get_profiler('eventlet.green.profile')\n is not None)", "start_line": 55, "start_column": 8, "end_line": 56, "end_column": 36 }, { "span": "self.assertTrue(p.stats is not None)", "start_line": 79, "start_column": 12, "end_line": 79, "end_column": 48 }, { "span": "self.assertTrue(len(p.stats.keys()) > 0)", "start_line": 80, "start_column": 12, "end_line": 80, "end_column": 52 }, { "span": "self.assertTrue(self.headers == [('content-type',\n HTMLViewer.format_dict['json'])])", "start_line": 158, "start_column": 8, "end_line": 159, "end_column": 75 }, { "span": "self.assertTrue(self.app.last_dump_at is not None)", "start_line": 182, "start_column": 8, "end_line": 182, "end_column": 58 }, { "span": "self.assertTrue(old_profiler != new_profiler)", "start_line": 188, "start_column": 8, "end_line": 188, "end_column": 53 }, { "span": "self.assertTrue(pid.split('-')[0] in self.pids2)", "start_line": 225, "start_column": 12, "end_line": 225, "end_column": 60 }, { "span": "self.assertTrue(log_files[0].find(self.log_filename_prefix2 +\n str(os.getpid())) > -1)", "start_line": 263, "start_column": 8, "end_line": 264, "end_column": 65 }, { "span": "self.assertTrue(log_files[0].find(self.log_filename_prefix2 +\n self.pids2[0]) > -1)", "start_line": 267, "start_column": 8, "end_line": 268, "end_column": 62 }, { "span": "self.assertTrue(content is not None)", "start_line": 346, "start_column": 8, "end_line": 346, "end_column": 44 }, { "span": "self.assertTrue(content is not None)", "start_line": 351, "start_column": 8, "end_line": 351, "end_column": 44 }, { "span": "self.assertTrue(headers == [('content-type',\n self.viewer.format_dict['default'])])", "start_line": 376, "start_column": 8, "end_line": 377, "end_column": 73 }, { "span": "self.assertTrue(content.find('<html>') > -1)", "start_line": 402, "start_column": 8, "end_line": 402, "end_column": 52 }, { "span": "self.assertTrue(headers == [('content-type', 'text/html')])", "start_line": 403, "start_column": 8, "end_line": 403, "end_column": 67 }, { "span": "self.assertTrue(headers == [('content-type', 'text/html')])", "start_line": 410, "start_column": 12, "end_line": 410, "end_column": 71 }, { "span": "self.assertTrue(content is not None)", "start_line": 414, "start_column": 8, "end_line": 414, "end_column": 44 }, { "span": "self.assertTrue(content is not None)", "start_line": 419, "start_column": 8, "end_line": 419, "end_column": 44 }, { "span": "self.assertTrue(content is not None)", "start_line": 452, "start_column": 12, "end_line": 452, "end_column": 48 }, { "span": "self.assertTrue(json.loads(js)['stats'] is not None)", "start_line": 503, "start_column": 12, "end_line": 503, "end_column": 64 }, { "span": "self.assertTrue(json.loads(js)['stats'][0] is not None)", "start_line": 504, "start_column": 12, "end_line": 504, "end_column": 67 }, { "span": "self.assertTrue(self.stats2.to_ods(selection) is not None)", "start_line": 509, "start_column": 16, "end_line": 509, "end_column": 74 }, { "span": "self.assertTrue(self.stats2.to_csv(selection) is not None)", "start_line": 513, "start_column": 12, "end_line": 513, "end_column": 70 }, { "span": "self.assertTrue('function calls' in self.stats2.to_csv(selection))", "start_line": 514, "start_column": 12, "end_line": 514, "end_column": 78 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "XP", "rofile", "_", "(_", "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", "\\u", "profiler_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "xpr", "ofile_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Ski", "p", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "xpr", "ofile_", "._", "get", "\\u", "profiler_", "(_", "'", "c", "Profil", "e", "'_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "xpr", "ofile_", "._", "get", "\\u", "profiler_", "(_", "'", "eventl", "et", ".", "green", ".", "profile", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Profiler", "s_", "(_", "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", "runc", "tx_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "p_", "in_", "self_", "._", "profiler", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "._", "runc", "tx_", "(_", "'", "import", " ", "os", ";", "os", ".", "getc", "wd", "();", "'_", ",_", "globals_", "(_", ")_", ",_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "snapshot", "\\u", "stats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "p_", "._", "stats_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "p_", "._", "stats_", "._", "keys_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Profil", "e", "Middleware_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "call_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "body_", "=_", "b", "\"", "sort", "=", "time", "&", "limit", "=-", "1", "&", "full", "dirs", "=", "1", "&", "nfl", "\\u", "filter", "=", "&", "metric", "=", "nc", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wsgi", "\\u", "input_", "=_", "Byte", "s", "IO_", "(_", "body_", "+_", "b", "'&", "query", "=", "query", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "=_", "{_", "'", "HTTP", "\\u", "HOST", "'_", ":_", "'", "local", "host", ":", "808", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PATH", "\\u", "INFO", "'_", ":_", "'/\\", "u\\u", "profile", "\\u\\u'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "REQUEST", "\\u", "METH", "OD", "'_", ":_", "'", "GET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "QUE", "RY", "\\u", "STRING", "'_", ":_", "'", "profile", "=", "all", "&", "format", "=", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wsgi", ".", "input", "'_", ":_", "wsgi", "\\u", "input_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "resp_", "[_", "0_", "]_", "._", "find_", "(_", "'<", "html", ">'_", ")_", ">_", "0_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "got", "\\u", "statuses_", ",_", "[_", "'", "200", " ", "OK", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "text", "/", "html", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wsgi", "\\u", "input_", "=_", "Byte", "s", "IO_", "(_", "body_", "+_", "b", "'&", "plot", "=", "plot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "[_", "'", "wsgi", ".", "input", "'_", "]_", "=_", "wsgi", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "PLOT", "LIB", "\\u", "INSTALLE", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "got", "\\u", "statuses_", ",_", "[_", "'", "200", " ", "OK", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "image", "/", "jp", "g", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "got", "\\u", "statuses_", ",_", "[_", "'", "500", " ", "Intern", "al", " ", "Server", " ", "Error", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wsgi", "\\u", "input_", "=_", "Byte", "s", "IO_", "(_", "body_", "+_", "'&", "download", "=", "download", "&", "format", "=", "default", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "[_", "'", "wsgi", ".", "input", "'_", "]_", "=_", "wsgi", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTM", "LV", "iew", "er_", "._", "format\\u", "dict_", "[_", "'", "default", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wsgi", "\\u", "input_", "=_", "Byte", "s", "IO_", "(_", "body_", "+_", "'&", "download", "=", "download", "&", "format", "=", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "[_", "'", "wsgi", ".", "input", "'_", "]_", "=_", "wsgi", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "headers_", "==_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTM", "LV", "iew", "er_", "._", "format\\u", "dict_", "[_", "'", "json", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env", "2_", "=_", "environ_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env", "2_", "[_", "'", "REQUEST", "\\u", "METH", "OD", "'_", "]_", "=_", "'", "DELET", "E", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "app_", "(_", "env", "2_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "got", "\\u", "statuses_", ",_", "[_", "'", "405", " ", "Meth", "od", " ", "Not", " ", "All", "owe", "d", "'_", "]_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "use", " ", "a", " ", "total", "ly", " ", "bog", "us", " ", "profile", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "wsgi", "\\u", "input_", "=_", "Byte", "s", "IO_", "(_", "body_", "+_", "b", "'&", "profile", "=", "ABC", "&", "download", "=", "download", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "[_", "'", "wsgi", ".", "input", "'_", "]_", "=_", "wsgi", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "got", "\\u", "statuses_", ",_", "[_", "'", "404", " ", "Not", " ", "Foun", "d", "'_", "]_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wsgi", "\\u", "input_", "=_", "Byte", "s", "IO_", "(_", "body_", "+_", "b", "'&", "download", "=", "download", "&", "format", "=", "ods", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "environ_", "[_", "'", "wsgi", ".", "input", "'_", "]_", "=_", "wsgi", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "app_", "(_", "environ_", ",_", "self_", "._", "start", "\\u", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "OD", "FLI", "B", "\\u", "INSTALLE", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTM", "LV", "iew", "er_", "._", "format\\u", "dict_", "[_", "'", "ods", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "got", "\\u", "statuses_", ",_", "[_", "'", "500", " ", "Intern", "al", " ", "Server", " ", "Error", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Profil", "e", "Middleware_", "(_", "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", "dump", "\\u", "checkpoint_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "app_", "._", "dump", "\\u", "checkpoint_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "app_", "._", "last", "\\u", "dump", "\\u", "at_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Profil", "e", "Middleware_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "renew", "\\u", "profile_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "profiler_", "=_", "self_", "._", "app_", "._", "profiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "app_", "._", "renew", "\\u", "profile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "profiler_", "=_", "self_", "._", "app_", "._", "profiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "old", "\\u", "profiler_", "!=_", "new", "\\u", "profiler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "profile", "\\u", "log_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "all", "\\u", "pids_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "profile", "\\u", "log", "1_", "._", "get", "\\u", "all", "\\u", "pids_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "self_", "._", "pid", "s1_", ",_", "reverse_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pid_", "in_", "self_", "._", "profile", "\\u", "log2_", "._", "get", "\\u", "all", "\\u", "pids_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "pid_", "._", "split_", "(_", "'-'_", ")_", "[_", "0_", "]_", "in_", "self_", "._", "pid", "s2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "profile", "\\u", "log_", "(_", "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", "get", "\\u", "logfile", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "files_", "=_", "self_", "._", "profile", "\\u", "log", "1_", "._", "get", "\\u", "logfile", "s_", "(_", "'", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "len_", "(_", "self_", "._", "pid", "s1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "files_", "=_", "self_", "._", "profile", "\\u", "log", "1_", "._", "get", "\\u", "logfile", "s_", "(_", "'", "current", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "log", "\\u", "files_", ",_", "[_", "self_", "._", "log", "\\u", "filename", "\\u", "prefix", "1_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "str_", "(_", "os_", "._", "getpid_", "(_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "files_", "=_", "self_", "._", "profile", "\\u", "log", "1_", "._", "get", "\\u", "logfile", "s_", "(_", "self_", "._", "pid", "s1_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "log", "\\u", "files_", ",_", "[_", "self_", "._", "log", "\\u", "filename", "\\u", "prefix", "1_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "self_", "._", "pid", "s1_", "[_", "0_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "files_", "=_", "self_", "._", "profile", "\\u", "log2_", "._", "get", "\\u", "logfile", "s_", "(_", "'", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "len_", "(_", "self_", "._", "pid", "s2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "files_", "=_", "self_", "._", "profile", "\\u", "log2_", "._", "get", "\\u", "logfile", "s_", "(_", "'", "current", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "log", "\\u", "files_", "[_", "0_", "]_", "._", "find_", "(_", "self_", "._", "log", "\\u", "filename", "\\u", "prefix", "2_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "os_", "._", "getpid_", "(_", ")_", ")_", ")_", ">_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "files_", "=_", "self_", "._", "profile", "\\u", "log2_", "._", "get", "\\u", "logfile", "s_", "(_", "self_", "._", "pid", "s2_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "log", "\\u", "files_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "log", "\\u", "files_", "[_", "0_", "]_", "._", "find_", "(_", "self_", "._", "log", "\\u", "filename", "\\u", "prefix", "2_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pid", "s2_", "[_", "0_", "]_", ")_", ">_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "html", "\\u", "viewer_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'", "http", "://", "local", "host", ":", "808", "0", "/\\u", "\\u", "profile", "\\u\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "entries_", "=_", "[_", "'/\\", "u\\u", "profile", "\\u\\u'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "123", "'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "123", "/'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "123", "/", ":", "0", "(", "getc", "wd", ")'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "all", "'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "all", "/'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "all", "/", ":", "0", "(", "getc", "wd", ")'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "current", "'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "current", "/'_", "._", "split_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'/\\", "u\\u", "profile", "\\u\\u", "/", "current", "/", ":", "0", "(", "getc", "wd", ")'_", "._", "split_", "(_", "'/'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "GET", "'_", ",_", "path", "\\u", "entries_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "query", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "content_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "text", "/", "html", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "POST", "'_", ",_", "path", "\\u", "entries_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "query", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "content_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "text", "/", "html", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "dict_", "=_", "self_", "._", "query", "\\u", "dict_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot", "\\u", "dict_", "[_", "'", "plot", "'_", "]_", "=_", "[_", "'", "plot", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "PLOT", "LIB", "\\u", "INSTALLE", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "POST", "'_", ",_", "path", "\\u", "entries_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "image", "/", "jp", "g", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "PLOT", "LIB", "Not", "Install", "ed_", ",_", "self_", "._", "viewer_", "._", "render_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url_", ",_", "'", "POST", "'_", ",_", "path", "\\u", "entries_", "[_", "0_", "]_", ",_", "plot", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "clear", "\\u", "dict_", "=_", "self_", "._", "query", "\\u", "dict_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clear", "\\u", "dict_", "[_", "'", "clear", "'_", "]_", "=_", "[_", "'", "clear", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "clear", "\\u", "dict_", "[_", "'", "query", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clear", "\\u", "dict_", "[_", "'", "profile", "'_", "]_", "=_", "[_", "'", "xxx", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "POST", "'_", ",_", "path", "\\u", "entries_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "clear", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "text", "/", "html", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "dict_", "=_", "self_", "._", "query", "\\u", "dict_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "\\u", "dict_", "[_", "'", "download", "'_", "]_", "=_", "[_", "'", "download", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "POST", "'_", ",_", "path", "\\u", "entries_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "headers_", "==_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "default", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "GET", "'_", ",_", "path", "\\u", "entries_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "query", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "json_", "._", "loads_", "(_", "content_", ")_", ",_", "dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "method_", "in_", "[_", "'", "HEAD", "'_", ",_", "'", "PU", "T", "'_", ",_", "'", "DELET", "E", "'_", ",_", "'", "XY", "ZM", "ethod", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "Meth", "od", "Not", "Allowed_", ",_", "self_", "._", "viewer_", "._", "render_", ",_", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", ",_", "path", "\\u", "entries_", "[_", "10_", "]_", ",_", "self_", "._", "query", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "entry_", "in_", "path", "\\u", "entries_", "[_", "2_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "download", "\\u", "dict_", "[_", "'", "format", "'_", "]_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "GET", "'_", ",_", "entry_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "content", "-", "type", "'_", ",_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "default", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "in_", "headers_", ",_", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "download", "\\u", "dict_", "[_", "'", "format", "'_", "]_", "=_", "'", "json", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "render_", "(_", "url_", ",_", "'", "GET", "'_", ",_", "entry_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "download", "\\u", "dict_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "json_", "._", "loads_", "(_", "content_", ")_", ",_", "dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "html", "\\u", "viewer_", "(_", "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", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "index", "\\u", "page_", "(_", "self_", "._", "log", "\\u", "files_", "[_", "0_", ":_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "profile", "\\u", "id_", "=_", "'", "current", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "content_", "._", "find_", "(_", "'<", "html", ">'_", ")_", ">_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "headers_", "==_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "text", "/", "html", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "html", "\\u", "viewer_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "index", "\\u", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "index", "\\u", "page_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "profile", "\\u", "id_", "=_", "'", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "f_", "in_", "self_", "._", "log", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "content_", "._", "find_", "(_", "f_", ")_", ">_", "0_", ",_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "headers_", "==_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "text", "/", "html", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "html", "\\u", "viewer_", "(_", "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", "download_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "content_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "default", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "sort_", "=_", "'", "calls", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "limit_", "=_", "10_", ",_", "nfl", "\\u", "filter_", "=_", "'", "os", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "content_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "default", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "format_", "=_", "'", "default", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "default", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "format_", "=_", "'", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "json_", "._", "loads_", "(_", "content_", ")_", ",_", "dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "json", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "format_", "=_", "'", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "csv", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "OD", "FLI", "B", "\\u", "INSTALLE", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "format_", "=_", "'", "ods", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "ods", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "OD", "FLI", "BN", "ot", "Install", "ed_", ",_", "self_", "._", "viewer_", "._", "download_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "log", "\\u", "files_", ",_", "output", "\\u", "format_", "=_", "'", "ods", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "download_", "(_", "self_", "._", "log", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nfl", "\\u", "filter_", "=_", "\\u\\u", "file\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "format_", "=_", "'", "python", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "viewer_", "._", "format\\u", "dict_", "[_", "'", "python", "'_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "html", "\\u", "viewer_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "plot_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "PLOT", "LIB", "\\u", "INSTALLE", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", ",_", "headers_", "=_", "self_", "._", "viewer_", "._", "plot_", "(_", "self_", "._", "log", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "content_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "headers_", ",_", "[_", "(_", "'", "content", "-", "type", "'_", ",_", "'", "image", "/", "jp", "g", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Not", "Foun", "d", "Exception_", ",_", "self_", "._", "viewer_", "._", "plot_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "PLOT", "LIB", "Not", "Install", "ed_", ",_", "self_", "._", "viewer_", "._", "plot_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "log", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Stat", "s2_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "to", "\\u", "json_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "selection_", "in_", "self_", "._", "selections_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "js_", "=_", "self_", "._", "stats", "2_", "._", "to", "\\u", "json_", "(_", "selection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "json_", "._", "loads_", "(_", "js_", ")_", ",_", "dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "._", "loads_", "(_", "js_", ")_", "[_", "'", "stats", "'_", "]_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "json_", "._", "loads_", "(_", "js_", ")_", "[_", "'", "stats", "'_", "]_", "[_", "0_", "]_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Stat", "s2_", "(_", "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", "to", "\\u", "ods", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "OD", "FLI", "B", "\\u", "INSTALLE", "D_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "selection_", "in_", "self_", "._", "selections_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "stats", "2_", "._", "to", "\\u", "ods", "_", "(_", "selection_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Stat", "s2_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "to", "\\u", "csv_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "selection_", "in_", "self_", "._", "selections_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "stats", "2_", "._", "to", "\\u", "csv_", "(_", "selection_", ")_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "function", " ", "calls", "'_", "in_", "self_", "._", "stats", "2_", "._", "to", "\\u", "csv_", "(_", "selection_", ")_", ")_", "\\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, 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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
caktus/django-scribbler/scribbler/views.py
[ { "content": "from __future__ import unicode_literals\n\nimport json\n\nfrom django import template\nfrom django.core.serializers.json import DjangoJSONEncoder\nfrom django.http import HttpResponse, HttpResponseForbidden\nfrom django.shortcuts import get_object_or_404\nfrom django.template import RequestContext, Template\nfrom django.views.debug import ExceptionReporter\nfrom django.views.decorators.http import require_POST\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.shortcuts import render\n\nfrom .forms import ScribbleForm, PreviewForm, FieldScribbleForm\nfrom .models import Scribble\nfrom .utils import get_variables\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def build_scribble_context(scribble):\n \"Create context for rendering a scribble or scribble preview.\"\n context = {\n 'scribble': scribble,\n }\n\n return context", "metadata": "root.build_scribble_context", "header": "['module', '___EOS___']", "index": 19 }, { "content": "@require_POST\ndef preview_scribble(request, ct_pk):\n \"Render scribble content or return error information.\"\n if not request.user.is_authenticated():\n return HttpResponseForbidden()\n content_type = get_object_or_404(ContentType, pk=ct_pk)\n change_scribble = '{0}.change_{1}'.format(\n content_type.app_label, content_type.model)\n add_scribble = '{0}.add_{1}'.format(\n content_type.app_label, content_type.model)\n can_edit = request.user.has_perm(change_scribble)\n can_create = request.user.has_perm(add_scribble)\n if not (can_edit or can_create):\n return HttpResponseForbidden()\n results = {\n 'valid': False,\n 'html': '',\n }\n form = PreviewForm(request.POST)\n if form.is_valid():\n results['valid'] = True\n if hasattr(template, 'engines'):\n scribbler_template = template.engines['django'].from_string(form.cleaned_data.get('content', ''))\n else:\n scribbler_template = template.Template(form.cleaned_data.get('content', ''))\n context = build_scribble_context(form.instance)\n results['html'] = scribbler_template.render(context, request)\n results['variables'] = get_variables(RequestContext(request, context))\n else:\n if hasattr(form, 'exc_info'):\n # Pre Django 1.9\n try:\n exc_type, exc_value, tb = form.exc_info\n reporter = ExceptionReporter(request, exc_type, exc_value, tb)\n reporter.get_template_exception_info()\n results['error'] = reporter.template_info\n # Django >= 1.9: get_template_info() is moved from ExceptionReporter\n # onto Template. We pass the data it returns from scribbler/forms.py\n # to here.\n except (ValueError, AttributeError):\n # ValueError is raised when we pass in all 12 the arguments,\n # in form.exc_info and AttributeError is raised when\n # ExceptionReporter.get_template_exception_info() is called.\n results['error'] = form.exc_info\n else:\n # Not sure what to do here\n results['error'] = {\n 'message': 'Content is not valid',\n 'line': '',\n }\n content = json.dumps(results, cls=DjangoJSONEncoder, ensure_ascii=False)\n return HttpResponse(content, content_type='application/json')", "metadata": "root.preview_scribble", "header": "['module', '___EOS___']", "index": 28 }, { "content": "@require_POST\ndef create_edit_scribble(request, scribble_id=None):\n \"Create a new Scribble or edit an existing one.\"\n if not request.user.is_authenticated():\n return HttpResponseForbidden()\n if scribble_id is not None:\n scribble = get_object_or_404(Scribble, pk=scribble_id)\n if not request.user.has_perm('scribbler.change_scribble'):\n return HttpResponseForbidden()\n else:\n scribble = Scribble()\n if not request.user.has_perm('scribbler.add_scribble'):\n return HttpResponseForbidden()\n form = ScribbleForm(request.POST, instance=scribble)\n results = {\n 'valid': False,\n }\n if form.is_valid():\n results['valid'] = True\n scribble = form.save()\n results['url'] = scribble.get_save_url()\n content = json.dumps(results, cls=DjangoJSONEncoder, ensure_ascii=False)\n return HttpResponse(content, content_type='application/json')", "metadata": "root.create_edit_scribble", "header": "['module', '___EOS___']", "index": 82 }, { "content": "@require_POST\ndef edit_scribble_field(request, ct_pk, instance_pk, field_name):\n if not request.user.is_authenticated():\n return HttpResponseForbidden()\n content_type = get_object_or_404(ContentType, pk=ct_pk)\n perm_name = '{0}.change_{1}'.format(content_type.app_label, content_type.model)\n if not request.user.has_perm(perm_name):\n return HttpResponseForbidden()\n form = FieldScribbleForm(content_type, instance_pk, field_name, data=request.POST)\n results = {\n 'valid': False,\n }\n if form.is_valid():\n results['valid'] = True\n form.save()\n else:\n results['error'] = {\n 'message': ','.join('%s' % e for e in form.errors.values()),\n 'line': '',\n }\n results['url'] = form.get_save_url()\n content = json.dumps(results, cls=DjangoJSONEncoder, ensure_ascii=False)\n return HttpResponse(content, content_type='application/json')", "metadata": "root.edit_scribble_field", "header": "['module', '___EOS___']", "index": 107 }, { "content": "@require_POST\ndef delete_scribble(request, scribble_id):\n \"Delete an existing scribble.\"\n if not request.user.is_authenticated():\n return HttpResponseForbidden()\n scribble = get_object_or_404(Scribble, pk=scribble_id)\n if not request.user.has_perm('scribbler.delete_scribble'):\n return HttpResponseForbidden()\n scribble.delete()\n results = {\n 'valid': True,\n 'url': scribble.get_save_url()\n }\n content = json.dumps(results, cls=DjangoJSONEncoder, ensure_ascii=False)\n return HttpResponse(content, content_type='application/json')", "metadata": "root.delete_scribble", "header": "['module', '___EOS___']", "index": 132 } ]
[ { "span": "from django.template import RequestContext, Template", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 52 }, { "span": "from django.shortcuts import render", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "import_", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "serializers_", "._", "json_", "import_", "Dj", "ang", "o", "JSO", "NE", "ncode", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", ",_", "Http", "Respons", "e", "Forbidden_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "get", "\\u", "object\\u", "or", "\\u", "404_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Request", "Context_", ",_", "Template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "debug_", "import_", "Except", "ion", "Reporter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "decorators_", "._", "http_", "import_", "require", "\\u", "POST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "contenttype", "s_", "._", "models_", "import_", "Conten", "t", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "shortcuts_", "import_", "render_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "forms_", "import_", "Scr", "ib", "ble", "Form_", ",_", "Preview", "Form_", ",_", "Field", "Scr", "ib", "ble", "Form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "models_", "import_", "Scr", "ib", "ble_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "utils_", "import_", "get", "\\u", "variables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "build", "\\u", "scri", "bble", "\\u", "context_", "(_", "scri", "bble", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Creat", "e", " ", "context", " ", "for", " ", "render", "ing", " ", "a", " ", "scri", "bble", " ", "or", " ", "scri", "bble", " ", "previe", "w", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scri", "bble", "'_", ":_", "scri", "bble", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "require", "\\u", "POST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "previe", "w", "\\u", "scri", "bble", "_", "(_", "request_", ",_", "ct", "\\u", "pk_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Render", " ", "scri", "bble", " ", "content", " ", "or", " ", "return", " ", "error", " ", "informati", "on", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content", "\\u", "type_", "=_", "get", "\\u", "object\\u", "or", "\\u", "404_", "(_", "Conten", "t", "Type_", ",_", "pk_", "=_", "ct", "\\u", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change", "\\u", "scri", "bble", "_", "=_", "'{", "0", "}.", "change", "\\u{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "._", "app", "\\u", "label_", ",_", "content", "\\u", "type_", "._", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "scri", "bble", "_", "=_", "'{", "0", "}.", "add", "\\u{", "1", "}'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "._", "app", "\\u", "label_", ",_", "content", "\\u", "type_", "._", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "\\u", "edit_", "=_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "change", "\\u", "scri", "bble", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "\\u", "create_", "=_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "add", "\\u", "scri", "bble", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "can", "\\u", "edit_", "or_", "can", "\\u", "create_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "valid", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "html", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Preview", "Form_", "(_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "'", "valid", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "template_", ",_", "'", "engines", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scri", "bble", "r", "\\u", "template_", "=_", "template_", "._", "engines_", "[_", "'", "django", "'_", "]_", "._", "from", "\\u", "string_", "(_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "content", "'_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scri", "bble", "r", "\\u", "template_", "=_", "template_", "._", "Template_", "(_", "form_", "._", "clean", "ed", "\\u", "data_", "._", "get_", "(_", "'", "content", "'_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "context_", "=_", "build", "\\u", "scri", "bble", "\\u", "context_", "(_", "form_", "._", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "'", "html", "'_", "]_", "=_", "scri", "bble", "r", "\\u", "template_", "._", "render_", "(_", "context_", ",_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "'", "variab", "les", "'_", "]_", "=_", "get", "\\u", "variables_", "(_", "Request", "Context_", "(_", "request_", ",_", "context_", ")_", ")_", "\\u\\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_", "hasattr_", "(_", "form_", ",_", "'", "exc", "\\u", "info", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pre", " ", "Dj", "ang", "o", " ", "1.9", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", "=_", "form_", "._", "exc", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reporter_", "=_", "Except", "ion", "Reporter_", "(_", "request_", ",_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "tb_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reporter_", "._", "get", "\\u", "template", "\\u", "exception", "\\u", "info_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "[_", "'", "error", "'_", "]_", "=_", "reporter_", "._", "template", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Dj", "ang", "o", " ", ">=", " ", "1.9", ":", " ", "get", "\\u", "template", "\\u", "info", "()", " ", "is", " ", "moved", " ", "from", " ", "Except", "ion", "Reporter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "onto", " ", "Templa", "te", ".", " ", "We", " ", "pass", " ", "the", " ", "data", " ", "it", " ", "return", "s", " ", "from", " ", "scri", "bble", "r", "/", "forms", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Value", "Error_", ",_", "Attribute", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Value", "Error", " ", "is", " ", "raise", "d", " ", "whe", "n", " ", "we", " ", "pass", " ", "in", " ", "all", " ", "1", "2", " ", "the", " ", "argu", "ment", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "form", ".", "exc", "\\u", "info", " ", "and", " ", "Attribute", "Error", " ", "is", " ", "raise", "d", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Except", "ion", "Reporte", "r", ".", "get", "\\u", "template", "\\u", "exception", "\\u", "info", "()", " ", "is", " ", "call", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "'", "error", "'_", "]_", "=_", "form_", "._", "exc", "\\u", "info_", "\\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_", "#", " ", "Not", " ", "sure", " ", "what", " ", "to", " ", "do", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "'", "error", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "'", "Conten", "t", " ", "is", " ", "not", " ", "valid", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "=_", "json_", "._", "dumps_", "(_", "results_", ",_", "cls_", "=_", "Dj", "ang", "o", "JSO", "NE", "ncode", "r_", ",_", "ensure", "\\u", "ascii_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Response_", "(_", "content_", ",_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "require", "\\u", "POST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create", "\\u", "edit", "\\u", "scri", "bble", "_", "(_", "request_", ",_", "scri", "bble", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Creat", "e", " ", "a", " ", "new", " ", "Scr", "ib", "ble", " ", "or", " ", "edit", " ", "an", " ", "exist", "ing", " ", "one", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "scri", "bble", "\\u", "id_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scri", "bble", "_", "=_", "get", "\\u", "object\\u", "or", "\\u", "404_", "(_", "Scr", "ib", "ble_", ",_", "pk_", "=_", "scri", "bble", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "'", "scri", "bble", "r", ".", "change", "\\u", "scri", "bble", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\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 ", " _", "scri", "bble", "_", "=_", "Scr", "ib", "ble_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "'", "scri", "bble", "r", ".", "add", "\\u", "scri", "bble", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "Scr", "ib", "ble", "Form_", "(_", "request_", "._", "POST_", ",_", "instance_", "=_", "scri", "bble", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "valid", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "'", "valid", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scri", "bble", "_", "=_", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "[_", "'", "url", "'_", "]_", "=_", "scri", "bble", "_", "._", "get", "\\u", "save", "\\u", "url_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "json_", "._", "dumps_", "(_", "results_", ",_", "cls_", "=_", "Dj", "ang", "o", "JSO", "NE", "ncode", "r_", ",_", "ensure", "\\u", "ascii_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Response_", "(_", "content_", ",_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "require", "\\u", "POST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "edit", "\\u", "scri", "bble", "\\u", "field_", "(_", "request_", ",_", "ct", "\\u", "pk_", ",_", "instance", "\\u", "pk_", ",_", "field", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content", "\\u", "type_", "=_", "get", "\\u", "object\\u", "or", "\\u", "404_", "(_", "Conten", "t", "Type_", ",_", "pk_", "=_", "ct", "\\u", "pk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "perm", "\\u", "name_", "=_", "'{", "0", "}.", "change", "\\u{", "1", "}'_", "._", "format_", "(_", "content", "\\u", "type_", "._", "app", "\\u", "label_", ",_", "content", "\\u", "type_", "._", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "perm", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "form_", "=_", "Field", "Scr", "ib", "ble", "Form_", "(_", "content", "\\u", "type_", ",_", "instance", "\\u", "pk_", ",_", "field", "\\u", "name_", ",_", "data_", "=_", "request_", "._", "POST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "valid", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "'", "valid", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "'", "error", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "','_", "._", "join_", "(_", "'%", "s", "'_", "%_", "e_", "for_", "e_", "in_", "form_", "._", "errors_", "._", "values_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "[_", "'", "url", "'_", "]_", "=_", "form_", "._", "get", "\\u", "save", "\\u", "url_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "json_", "._", "dumps_", "(_", "results_", ",_", "cls_", "=_", "Dj", "ang", "o", "JSO", "NE", "ncode", "r_", ",_", "ensure", "\\u", "ascii_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Response_", "(_", "content_", ",_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "require", "\\u", "POST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "delete", "\\u", "scri", "bble", "_", "(_", "request_", ",_", "scri", "bble", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Delete", " ", "an", " ", "exist", "ing", " ", "scri", "bble", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scri", "bble", "_", "=_", "get", "\\u", "object\\u", "or", "\\u", "404_", "(_", "Scr", "ib", "ble_", ",_", "pk_", "=_", "scri", "bble", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "request_", "._", "user_", "._", "has", "\\u", "perm_", "(_", "'", "scri", "bble", "r", ".", "delete", "\\u", "scri", "bble", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Respons", "e", "Forbidden_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scri", "bble", "_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "valid", "'_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "scri", "bble", "_", "._", "get", "\\u", "save", "\\u", "url_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "json_", "._", "dumps_", "(_", "results_", ",_", "cls_", "=_", "Dj", "ang", "o", "JSO", "NE", "ncode", "r_", ",_", "ensure", "\\u", "ascii_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Response_", "(_", "content_", ",_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
colemana/PyPDF2/PyPDF2/merger.py
[ { "content": " def _write_dests(self):\n dests = self.named_dests\n \n for v in dests:\n pageno = None\n pdf = None\n if v.has_key('/Page'):\n for i, p in enumerate(self.pages):\n if p.id == v['/Page']:\n v[NameObject('/Page')] = p.out_pagedata\n pageno = i\n pdf = p.src\n if pageno != None:\n self.output.addNamedDestinationObject(v)", "metadata": "root.PdfFileMerger._write_dests", "header": "['class', 'PdfFileMerger', '(', 'object', ')', ':', '___EOS___']", "index": 233 }, { "content": " def _write_bookmarks(self, bookmarks=None, parent=None):\n \n if bookmarks == None:\n bookmarks = self.bookmarks\n \n\n last_added = None\n for b in bookmarks:\n if type(b) == list:\n self._write_bookmarks(b, last_added)\n continue\n \n pageno = None\n pdf = None\n if b.has_key('/Page'):\n for i, p in enumerate(self.pages):\n if p.id == b['/Page']:\n b[NameObject('/Page')] = p.out_pagedata\n pageno = i\n pdf = p.src\n if pageno != None:\n last_added = self.output.addBookmarkDestination(b, parent)", "metadata": "root.PdfFileMerger._write_bookmarks", "header": "['class', 'PdfFileMerger', '(', 'object', ')', ':', '___EOS___']", "index": 248 } ]
[ { "span": "pdf ", "start_line": 244, "start_column": 24, "end_line": 244, "end_column": 27 }, { "span": "pdf ", "start_line": 267, "start_column": 24, "end_line": 267, "end_column": 27 } ]
[ { "span": "pdf ", "start_line": 238, "start_column": 12, "end_line": 238, "end_column": 15 }, { "span": "pdf ", "start_line": 261, "start_column": 12, "end_line": 261, "end_column": 15 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Pd", "f", "File", "Merge", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "write", "\\u", "dest", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dest", "s_", "=_", "self_", "._", "named", "\\u", "dest", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "v_", "in_", "dest", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pagen", "o_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdf_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "v_", "._", "has", "\\u", "key_", "(_", "'/", "Page", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", ",_", "p_", "in_", "enumerate_", "(_", "self_", "._", "pages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "p_", "._", "id_", "==_", "v_", "[_", "'/", "Page", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "v_", "[_", "Name", "Object_", "(_", "'/", "Page", "'_", ")_", "]_", "=_", "p_", "._", "out", "\\u", "paged", "ata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pagen", "o_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdf_", "=_", "p_", "._", "src_", "\\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_", "pagen", "o_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "output_", "._", "add", "Name", "d", "Dest", "ination", "Object_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pd", "f", "File", "Merge", "r_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "write", "\\u", "bookmarks_", "(_", "self_", ",_", "bookmarks_", "=_", "None_", ",_", "parent_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bookmarks_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bookmarks_", "=_", "self_", "._", "bookmarks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last", "\\u", "added_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "b_", "in_", "bookmarks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "b_", ")_", "==_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "write", "\\u", "bookmarks_", "(_", "b_", ",_", "last", "\\u", "added_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pagen", "o_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdf_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "b_", "._", "has", "\\u", "key_", "(_", "'/", "Page", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", ",_", "p_", "in_", "enumerate_", "(_", "self_", "._", "pages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "p_", "._", "id_", "==_", "b_", "[_", "'/", "Page", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "b_", "[_", "Name", "Object_", "(_", "'/", "Page", "'_", ")_", "]_", "=_", "p_", "._", "out", "\\u", "paged", "ata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pagen", "o_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pdf_", "=_", "p_", "._", "src_", "\\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_", "pagen", "o_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "added_", "=_", "self_", "._", "output_", "._", "add", "Bookmark", "Destination_", "(_", "b_", ",_", "parent_", ")_", "\\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, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
rcbops/glance-buildpackage/glance/registry/db/migrate_repo/versions/004_add_checksum.py
[ { "content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2011 OpenStack LLC.\n# All Rights Reserved.\n#\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\nfrom migrate.changeset import *\nfrom sqlalchemy import *\nfrom sqlalchemy.sql import and_, not_\n\nfrom glance.registry.db.migrate_repo.schema import (\n Boolean, DateTime, Integer, String, Text, from_migration_import)\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_images_table(meta):\n \"\"\"\n Returns the Table object for the images table that\n corresponds to the images table definition of this version.\n \"\"\"\n images = Table('images', meta,\n Column('id', Integer(), primary_key=True, nullable=False),\n Column('name', String(255)),\n Column('disk_format', String(20)),\n Column('container_format', String(20)),\n Column('size', Integer()),\n Column('status', String(30), nullable=False),\n Column('is_public', Boolean(), nullable=False, default=False,\n index=True),\n Column('location', Text()),\n Column('created_at', DateTime(), nullable=False),\n Column('updated_at', DateTime()),\n Column('deleted_at', DateTime()),\n Column('deleted', Boolean(), nullable=False, default=False,\n index=True),\n Column('checksum', String(32)),\n mysql_engine='InnoDB',\n useexisting=True)\n\n return images", "metadata": "root.get_images_table", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def get_image_properties_table(meta):\n \"\"\"\n No changes to the image properties table from 002...\n \"\"\"\n (define_image_properties_table,) = from_migration_import(\n '002_add_image_properties_table', ['define_image_properties_table'])\n\n image_properties = define_image_properties_table(meta)\n return image_properties", "metadata": "root.get_image_properties_table", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def upgrade(migrate_engine):\n meta = MetaData()\n meta.bind = migrate_engine\n\n images = get_images_table(meta)\n\n checksum = Column('checksum', String(32))\n checksum.create(images)", "metadata": "root.upgrade", "header": "['module', '___EOS___']", "index": 63 }, { "content": "def downgrade(migrate_engine):\n meta = MetaData()\n meta.bind = migrate_engine\n\n images = get_images_table(meta)\n\n images.columns['checksum'].drop()", "metadata": "root.downgrade", "header": "['module', '___EOS___']", "index": 73 } ]
[ { "span": "from sqlalchemy.sql import and_, not_", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 37 } ]
[]
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", " ", "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_", "from_", "migrate_", "._", "changeset_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "sql_", "import_", "and\\u_", ",_", "not", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "glance_", "._", "registry_", "._", "db_", "._", "migr", "ate", "\\u", "repo_", "._", "schema_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Boolean_", ",_", "Date", "Time_", ",_", "Integer_", ",_", "String_", ",_", "Text_", ",_", "from", "\\u", "migrati", "on", "\\u", "import_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "images", "\\u", "table_", "(_", "meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "Table", " ", "object", " ", "for", " ", "the", " ", "images", " ", "table", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "correspond", "s", " ", "to", " ", "the", " ", "images", " ", "table", " ", "definit", "ion", " ", "of", " ", "this", " ", "version", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "images_", "=_", "Table_", "(_", "'", "images", "'_", ",_", "meta_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "255_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "disk", "\\u", "format", "'_", ",_", "String_", "(_", "20_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "container", "\\u", "format", "'_", ",_", "String_", "(_", "20_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "size", "'_", ",_", "Integer_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "status", "'_", ",_", "String_", "(_", "30_", ")_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "is", "\\u", "public", "'_", ",_", "Boolean_", "(_", ")_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "location", "'_", ",_", "Text_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "created", "\\u", "at", "'_", ",_", "Date", "Time_", "(_", ")_", ",_", "nullable_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "update", "d\\u", "at", "'_", ",_", "Date", "Time_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "delete", "d\\u", "at", "'_", ",_", "Date", "Time_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "delete", "d", "'_", ",_", "Boolean_", "(_", ")_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", "=_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "'", "checks", "um", "'_", ",_", "String_", "(_", "32_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mysql", "\\u", "engine_", "=_", "'", "Inno", "DB", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "existing_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "images_", "\\u\\u\\uNEWLINE\\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", "image", "\\u", "proper", "ties", "\\u", "table_", "(_", "meta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "No", " ", "change", "s", " ", "to", " ", "the", " ", "image", " ", "proper", "ties", " ", "table", " ", "from", " ", "002", "...", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "defin", "e\\u", "image", "\\u", "proper", "ties", "\\u", "table_", ",_", ")_", "=_", "from", "\\u", "migrati", "on", "\\u", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "002", "\\u", "add", "\\u", "image", "\\u", "proper", "ties", "\\u", "table", "'_", ",_", "[_", "'", "defin", "e\\u", "image", "\\u", "proper", "ties", "\\u", "table", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "properties_", "=_", "defin", "e\\u", "image", "\\u", "proper", "ties", "\\u", "table_", "(_", "meta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "image", "\\u", "properties_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "upgrade_", "(_", "migr", "ate", "\\u", "engine_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta_", "=_", "Meta", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta_", "._", "bind_", "=_", "migr", "ate", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "get", "\\u", "images", "\\u", "table_", "(_", "meta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "checksum_", "=_", "Column_", "(_", "'", "checks", "um", "'_", ",_", "String_", "(_", "32_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checksum_", "._", "create_", "(_", "images_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "downgrade_", "(_", "migr", "ate", "\\u", "engine_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta_", "=_", "Meta", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "meta_", "._", "bind_", "=_", "migr", "ate", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "=_", "get", "\\u", "images", "\\u", "table_", "(_", "meta_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "images_", "._", "columns_", "[_", "'", "checks", "um", "'_", "]_", "._", "drop_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Testing equality to None
renmengye/imageqa-public/src/imageqa_compare.py
[ { "content": "import sys\nimport os\nimport nn\nimport numpy as np\nimport imageqa_test as it\nimport imageqa_render as ir\nimport imageqa_ensemble as ie\n\nnameList = ['object', 'number', 'color', 'location']\n\n\n\n\n\nif __name__ == '__main__':\n \"\"\"\n Usage: python imageqa_compare.py \n -m[odel] {name1:modelId1}\n -m[odel] {name2:modelId2}\n -em[odel] {name3:ensembleModelId3,ensembleModelId4,...}\n -pem[odel] {name3:ensembleModelId5,ensembleModelId6,...}\n -d[ata] {dataFolder}\n -o[utput] {outputFolder}\n [-k {top K answers}]\n [-r[esults] {resultsFolder}]\n [-dataset {daquar/cocoqa}]\n \"\"\"\n params = ir.parseComparativeParams(sys.argv)\n \n urlDict = ir.loadImgUrl(params['dataset'], params['dataFolder'])\n data = it.loadDataset(params['dataFolder'])\n\n print('Running models...')\n inputTest = data['testData'][0]\n targetTest = data['testData'][1]\n questionTypeArray = data['questionTypeArray']\n modelOutputs = ie.runAllModels(\n inputTest, \n questionTypeArray, \n params['models'], \n params['resultsFolder'],\n params['dataset'],\n params['dataFolder'])\n\n # Sort questions by question types.\n # Sort questions by correctness differences.\n print('Sorting questions...')\n numCategories = np.max(questionTypeArray) + 1\n numModels = len(params['models'])\n numCorrect = 1 << numModels\n numBins = numCategories * numCorrect\n modelAnswers = np.zeros((numModels, inputTest.shape[0]), dtype='int')\n bins = [None] * numBins\n names = []\n for i in range(numCategories):\n catName = getCatName(i)\n for j in range(numCorrect):\n binName = getBinName(j)\n names.append(getName(catName, binName))\n for i in range(numModels):\n modelAnswers[i] = np.argmax(modelOutputs[i], axis=-1)\n for n in range(inputTest.shape[0]):\n correct = targetTest[n, 0]\n bintmp = 0\n for i in range(numModels):\n if modelAnswers[i, n] == correct:\n bintmp += 1 << (numModels - i - 1)\n category = questionTypeArray[n]\n binNum = category * numCorrect + bintmp\n if bins[binNum] == None:\n bins[binNum] = [n]\n else:\n bins[binNum].append(n)\n\n for i, bin in enumerate(bins):\n if bin is None:\n bins[i] = []\n\n # Render\n print('Rendering webpages...')\n print('Rendering index...')\n outputFolder = params['outputFolder']\n\n if not os.path.exists(outputFolder):\n os.makedirs(outputFolder)\n with open(os.path.join(outputFolder, 'index.html'), 'w') as f:\n f.write(renderIndex(\n ir.getModelNames(params['models']), numCategories, bins))\n\n for i in range(numBins):\n if bins[i] is not None:\n print 'Rendering %s...' % names[i]\n outputSubFolder = os.path.join(outputFolder, names[i])\n idx = np.array(bins[i], dtype='int')\n inputTestSubset = inputTest[idx]\n targetTestSubset = targetTest[idx]\n modelOutputsSubset = []\n for j in range(numModels):\n modelOutputsSubset.append(modelOutputs[j][idx])\n if not os.path.exists(outputSubFolder):\n os.makedirs(outputSubFolder)\n htmlHyperLink = '%d.html'\n pages = ir.renderHtml(\n inputTestSubset, \n targetTestSubset, \n data['questionIdict'], \n data['ansIdict'], \n urlDict, \n topK=params['topK'],\n modelOutputs=modelOutputsSubset,\n modelNames=ir.getModelNames(params['models']),\n questionIds=idx)\n for j, page in enumerate(pages):\n with open(os.path.join(outputSubFolder, \n htmlHyperLink % j), 'w') as f:\n f.write(page)", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "bins[binNum] == None:", "start_line": 114, "start_column": 11, "end_line": 114, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "nn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "image", "qa", "\\u", "test_", "as_", "it_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "image", "qa", "\\u", "render_", "as_", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "image", "qa", "\\u", "ensemble_", "as_", "ie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name", "List_", "=_", "[_", "'", "object", "'_", ",_", "'", "number", "'_", ",_", "'", "color", "'_", ",_", "'", "location", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", " ", "python", " ", "image", "qa", "\\u", "compare", ".", "py", " ", "\\", "10", ";", " ", " ", "-", "m", "[", "odel", "]", " ", "{", "name", "1", ":", "model", "Id", "1", "}", "\\", "10", ";", " ", " ", "-", "m", "[", "odel", "]", " ", "{", "name2", ":", "model", "Id", "2", "}", "\\", "10", ";", " ", " ", "-", "em", "[", "odel", "]", " ", "{", "name", "3", ":", "ensembl", "e", "Model", "Id", "3", ",", "ensembl", "e", "Model", "Id", "4", ",...", "}", "\\", "10", ";", " ", " ", "-", "pe", "m", "[", "odel", "]", " ", "{", "name", "3", ":", "ensembl", "e", "Model", "Id", "5", ",", "ensembl", "e", "Model", "Id", "6", ",...", "}", "\\", "10", ";", " ", " ", "-", "d", "[", "ata", "]", " ", "{", "data", "Fold", "er", "}", "\\", "10", ";", " ", " ", "-", "o", "[", "ut", "put", "]", " ", "{", "output", "Fold", "er", "}", "\\", "10", ";", " ", " ", "[-", "k", " ", "{", "top", " ", "K", " ", "answer", "s", "}]", "\\", "10", ";", " ", " ", "[-", "r", "[", "esult", "s", "]", " ", "{", "results", "Fold", "er", "}]", "\\", "10", ";", " ", " ", "[-", "dataset", " ", "{", "da", "quar", "/", "coco", "qa", "}]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "ir_", "._", "parse", "Compara", "tiv", "e", "Params_", "(_", "sys_", "._", "argv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url", "Dict_", "=_", "ir_", "._", "load", "Im", "g", "Url_", "(_", "params_", "[_", "'", "dataset", "'_", "]_", ",_", "params_", "[_", "'", "data", "Fold", "er", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "it_", "._", "load", "Dataset_", "(_", "params_", "[_", "'", "data", "Fold", "er", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Run", "ning", " ", "model", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "Test_", "=_", "data_", "[_", "'", "test", "Data", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Test_", "=_", "data_", "[_", "'", "test", "Data", "'_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "question", "Type", "Array_", "=_", "data_", "[_", "'", "question", "Type", "Array", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Output", "s_", "=_", "ie_", "._", "run", "All", "Models_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "input", "Test_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "question", "Type", "Array_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "model", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "results", "Fold", "er", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "dataset", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "'", "data", "Fold", "er", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sort", " ", "question", "s", " ", "by", " ", "question", " ", "types", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sort", " ", "question", "s", " ", "by", " ", "correct", "ness", " ", "difference", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Sort", "ing", " ", "question", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Categories_", "=_", "np_", "._", "max_", "(_", "question", "Type", "Array_", ")_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Models_", "=_", "len_", "(_", "params_", "[_", "'", "model", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Correct", "_", "=_", "1_", "<<_", "num", "Models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Bins_", "=_", "num", "Categories_", "*_", "num", "Correct", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Answer", "s_", "=_", "np_", "._", "zeros_", "(_", "(_", "num", "Models_", ",_", "input", "Test_", "._", "shape_", "[_", "0_", "]_", ")_", ",_", "dtype_", "=_", "'", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bins_", "=_", "[_", "None_", "]_", "*_", "num", "Bins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Categories_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cat", "Name_", "=_", "get", "Cat", "Name_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "num", "Correct", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "Name_", "=_", "get", "Bin", "Name_", "(_", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "names_", "._", "append_", "(_", "get", "Name_", "(_", "cat", "Name_", ",_", "bin", "Name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "Answer", "s_", "[_", "i_", "]_", "=_", "np_", "._", "argmax_", "(_", "model", "Output", "s_", "[_", "i_", "]_", ",_", "axis_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "range_", "(_", "input", "Test_", "._", "shape_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "correct_", "=_", "target", "Test_", "[_", "n_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "tmp_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model", "Answer", "s_", "[_", "i_", ",_", "n_", "]_", "==_", "correct_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "tmp_", "+=_", "1_", "<<_", "(_", "num", "Models_", "-_", "i_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "category_", "=_", "question", "Type", "Array_", "[_", "n_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "Num_", "=_", "category_", "*_", "num", "Correct", "_", "+_", "bin", "tmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "bins_", "[_", "bin", "Num_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "[_", "bin", "Num_", "]_", "=_", "[_", "n_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "[_", "bin", "Num_", "]_", "._", "append_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "bin_", "in_", "enumerate_", "(_", "bins_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bin_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "[_", "i_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Render_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Rendering", " ", "webpage", "s", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Rendering", " ", "index", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Folder_", "=_", "params_", "[_", "'", "output", "Fold", "er", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "output", "Folder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "output", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "output", "Folder_", ",_", "'", "index", ".", "html", "'_", ")_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "render", "Index_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ir_", "._", "get", "Model", "Names_", "(_", "params_", "[_", "'", "model", "s", "'_", "]_", ")_", ",_", "num", "Categories_", ",_", "bins_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "num", "Bins_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bins_", "[_", "i_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Rendering", " ", "%", "s", "...'_", "%_", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Sub", "Folder_", "=_", "os_", "._", "path_", "._", "join_", "(_", "output", "Folder_", ",_", "names_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "np_", "._", "array_", "(_", "bins_", "[_", "i_", "]_", ",_", "dtype_", "=_", "'", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "Test", "Subset", "_", "=_", "input", "Test_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "Test", "Subset", "_", "=_", "target", "Test_", "[_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Output", "s", "Subset", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "num", "Models_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "Output", "s", "Subset", "_", "._", "append_", "(_", "model", "Output", "s_", "[_", "j_", "]_", "[_", "idx_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "output", "Sub", "Folder_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "output", "Sub", "Folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html", "Hyper", "Link_", "=_", "'%", "d", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pages_", "=_", "ir_", "._", "render", "Html_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "input", "Test", "Subset", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "Test", "Subset", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "'", "question", "Id", "ict", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "'", "ans", "Id", "ict", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "Dict_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "top", "K_", "=_", "params_", "[_", "'", "top", "K", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "Output", "s_", "=_", "model", "Output", "s", "Subset", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model", "Names_", "=_", "ir_", "._", "get", "Model", "Names_", "(_", "params_", "[_", "'", "model", "s", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "question", "Ids_", "=_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", ",_", "page_", "in_", "enumerate_", "(_", "pages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "output", "Sub", "Folder_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "html", "Hyper", "Link_", "%_", "j_", ")_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "f_", "._", "write_", "(_", "page_", ")_" ]
[ 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,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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 ]
Unused import
eBay/bayesian-belief-networks/bayesian/gaussian_bayesian_network.py
[ { "content": "'''Classes for pure Gaussian Bayesian Networks'''\nimport math\nimport types\nfrom functools import wraps\nfrom numbers import Number\nfrom collections import Counter\nfrom itertools import product as xproduct\nfrom StringIO import StringIO\n\nfrom bayesian.graph import Graph, Node, connect\nfrom bayesian.gaussian import make_gaussian_cdf\nfrom bayesian.gaussian import marginalize_joint\nfrom bayesian.gaussian import joint_to_conditional, conditional_to_joint\nfrom bayesian.gaussian import CovarianceMatrix, MeansVector\nfrom bayesian.linear_algebra import zeros, Matrix\nfrom bayesian.utils import get_args\nfrom bayesian.utils import get_original_factors\nfrom bayesian.exceptions import VariableNotInGraphError\nfrom bayesian.linear_algebra import Matrix\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def gaussian(mu, sigma):\n # This is the gaussian decorator\n # which is a decorator with parameters\n # This means it should return a\n # 'normal' decorated ie twice wrapped...\n\n def gaussianize(f):\n\n @wraps(f)\n def gaussianized(*args):\n x = args[0]\n return 1 / (sigma * (2 * math.pi) ** 0.5) * \\\n math.exp((-(x - mu) ** 2) / (2 * sigma ** 2))\n\n gaussianized.mean = mu\n gaussianized.std_dev = sigma\n gaussianized.variance = sigma ** 2\n gaussianized.cdf = make_gaussian_cdf(mu, sigma)\n gaussianized.argspec = get_args(f)\n gaussianized.entropy = types.MethodType(\n lambda x: 0.5 * math.log(2 * math.pi * math.e * x.variance),\n gaussianized)\n\n return gaussianized\n return gaussianize", "metadata": "root.gaussian", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def conditional_gaussian(mu, sigma, betas):\n\n def conditional_gaussianize(f):\n\n @wraps(f)\n def conditional_gaussianized(*args, **kwds):\n '''Since this function will never\n be called directly we dont need anything here.\n '''\n # First we need to construct a vector\n # out of the args...\n x = zeros((len(args), 1))\n for i, a in enumerate(args):\n x[i, 0] = a\n sigma = conditional_gaussianized.covariance_matrix\n mu = conditional_gaussianized.joint_mu\n return 1 / (2 * math.pi * sigma.det()) ** 0.5 \\\n * math.exp(-0.5 * ((x - mu).T * sigma.I * (x - mu))[0, 0])\n\n conditional_gaussianized.mean = mu\n conditional_gaussianized.std_dev = sigma\n conditional_gaussianized.variance = sigma ** 2\n conditional_gaussianized.raw_betas = betas\n conditional_gaussianized.argspec = get_args(f)\n conditional_gaussianized.entropy = types.MethodType(\n lambda x: len(x.joint_mu) / 2 * \\\n (1 + math.log(2 * math.pi)) + \\\n 0.5 * math.log(x.covariance_matrix.det()), conditional_gaussianized)\n\n # NOTE: the joint parameters are\n # add to this function at the time of the\n # graph construction\n\n return conditional_gaussianized\n\n return conditional_gaussianize", "metadata": "root.conditional_gaussian", "header": "['module', '___EOS___']", "index": 47 }, { "content": "class GBNNode(Node):\n\n\n", "metadata": "root.GBNNode", "header": "['module', '___EOS___']", "index": 85 }, { "content": " def __init__(self, factor):\n super(GBNNode, self).__init__(factor.__name__)\n self.func = factor\n self.argspec = get_args(factor)", "metadata": "root.GBNNode.__init__", "header": "['class', 'GBNNode', '(', 'Node', ')', ':', '___EOS___']", "index": 87 }, { "content": " def __repr__(self):\n return '<GuassianNode %s (%s)>' % (\n self.name,\n self.argspec)", "metadata": "root.GBNNode.__repr__", "header": "['class', 'GBNNode', '(', 'Node', ')', ':', '___EOS___']", "index": 92 }, { "content": " @property\n def variance(self):\n return self.func.variance", "metadata": "root.GBNNode.variance", "header": "['class', 'GBNNode', '(', 'Node', ')', ':', '___EOS___']", "index": 97 }, { "content": "class GaussianBayesianGraph(Graph):\n\n\n\n\n\n\n\n", "metadata": "root.GaussianBayesianGraph", "header": "['module', '___EOS___']", "index": 102 }, { "content": " def __init__(self, nodes, name=None):\n self.nodes = nodes\n self.name = name\n # Assign integer indices\n # to the nodes to trace\n # matrix rows and cols\n # back to the nodes.\n # The indices must be in\n # topological order.\n ordered = self.get_topological_sort()\n for i, node in enumerate(ordered):\n node.index = i", "metadata": "root.GaussianBayesianGraph.__init__", "header": "['class', 'GaussianBayesianGraph', '(', 'Graph', ')', ':', '___EOS___']", "index": 104 }, { "content": " def get_joint_parameters(self):\n '''Return the vector of means\n and the covariance matrix\n for the full joint distribution.\n For now, by definition, all\n the variables in a Gaussian\n Bayesian Network are either\n univariate gaussian or\n conditional guassians.\n '''\n ordered = self.get_topological_sort()\n mu_x = Matrix([[ordered[0].func.mean]])\n sigma_x = Matrix([[ordered[0].func.variance]])\n # Iteratively build up the mu and sigma matrices\n for node in ordered[1:]:\n beta_0 = node.func.mean\n beta = zeros((node.index, 1))\n total = 0\n for parent in node.parents:\n #beta_0 -= node.func.betas[parent.variable_name] * \\\n # parent.func.mean\n beta[parent.index, 0] = node.func.betas[parent.variable_name]\n sigma_c = node.func.variance\n mu_x, sigma_x = conditional_to_joint(\n mu_x, sigma_x, beta_0, beta, sigma_c)\n # Now set the names on the covariance matrix to\n # the graphs variabe names\n names = [n.variable_name for n in ordered]\n mu_x.set_names(names)\n sigma_x.set_names(names)\n return mu_x, sigma_x", "metadata": "root.GaussianBayesianGraph.get_joint_parameters", "header": "['class', 'GaussianBayesianGraph', '(', 'Graph', ')', ':', '___EOS___']", "index": 117 }, { "content": " def query(self, **kwds):\n\n # Ensure the evidence variables are actually\n # present\n invalid_vars = [v for v in kwds.keys() if v not in self.nodes]\n if invalid_vars:\n raise VariableNotInGraphError(invalid_vars)\n\n mu, sigma = self.get_joint_parameters()\n\n # Iteratively apply the evidence...\n result = dict()\n result['evidence'] = kwds\n\n for k, v in kwds.items():\n x = MeansVector([[v]], names=[k])\n sigma_yy, sigma_yx, sigma_xy, sigma_xx = (\n sigma.split(k))\n mu_y, mu_x = mu.split(k)\n # See equations (6) and (7) of CK\n mu_y_given_x = MeansVector(\n (mu_y + sigma_yx * sigma_xx.I * (x - mu_x)).rows,\n names = mu_y.name_ordering)\n sigma_y_given_x = CovarianceMatrix(\n (sigma_yy - sigma_yx * sigma_xx.I * sigma_xy).rows,\n names=sigma_yy.name_ordering)\n sigma = sigma_y_given_x\n mu = mu_y_given_x\n\n result['joint'] = dict(mu=mu, sigma=sigma)\n return result", "metadata": "root.GaussianBayesianGraph.query", "header": "['class', 'GaussianBayesianGraph', '(', 'Graph', ')', ':', '___EOS___']", "index": 149 }, { "content": " def q(self, **kwds):\n '''Wrapper around query\n\n This method formats the query\n result in a nice human readable format\n for interactive use.\n '''\n result = self.query(**kwds)\n mu = result['joint']['mu']\n sigma = result['joint']['sigma']\n evidence = result['evidence']\n print 'Evidence: %s' % str(evidence)\n print 'Covariance Matrix:'\n print sigma\n print 'Means:'\n print mu", "metadata": "root.GaussianBayesianGraph.q", "header": "['class', 'GaussianBayesianGraph', '(', 'Graph', ')', ':', '___EOS___']", "index": 181 }, { "content": " def discover_sample_ordering(self):\n return discover_sample_ordering(self)", "metadata": "root.GaussianBayesianGraph.discover_sample_ordering", "header": "['class', 'GaussianBayesianGraph', '(', 'Graph', ')', ':', '___EOS___']", "index": 199 }, { "content": " def get_graphviz_source(self):\n fh = StringIO()\n fh.write('digraph G {\\n')\n fh.write(' graph [ dpi = 300 bgcolor=\"transparent\" rankdir=\"LR\"];\\n')\n edges = set()\n for node in sorted(self.nodes.values(), key=lambda x:x.name):\n fh.write(' %s [ shape=\"ellipse\" color=\"blue\"];\\n' % node.name)\n for child in node.children:\n edge = (node.name, child.name)\n edges.add(edge)\n for source, target in sorted(edges, key=lambda x:(x[0], x[1])):\n fh.write(' %s -> %s;\\n' % (source, target))\n fh.write('}\\n')\n return fh.getvalue()", "metadata": "root.GaussianBayesianGraph.get_graphviz_source", "header": "['class', 'GaussianBayesianGraph', '(', 'Graph', ')', ':', '___EOS___']", "index": 203 }, { "content": "def build_gbn(*args, **kwds):\n '''Builds a Gaussian Bayesian Graph from\n a list of functions'''\n variables = set()\n name = kwds.get('name')\n variable_nodes = dict()\n factor_nodes = dict()\n\n if isinstance(args[0], list):\n # Assume the functions were all\n # passed in a list in the first\n # argument. This makes it possible\n # to build very large graphs with\n # more than 255 functions, since\n # Python functions are limited to\n # 255 arguments.\n args = args[0]\n\n for factor in args:\n factor_args = get_args(factor)\n variables.update(factor_args)\n node = GBNNode(factor)\n factor_nodes[factor.__name__] = node\n\n # Now lets create the connections\n # To do this we need to find the\n # factor node representing the variables\n # in a child factors argument and connect\n # it to the child node.\n # Note that calling original_factors\n # here can break build_gbn if the\n # factors do not correctly represent\n # a valid network. This will be fixed\n # in next release\n original_factors = get_original_factors(factor_nodes.values())\n for var_name, factor in original_factors.items():\n factor.variable_name = var_name\n for factor_node in factor_nodes.values():\n factor_args = get_args(factor_node)\n parents = [original_factors[arg] for arg in\n factor_args if original_factors[arg] != factor_node]\n for parent in parents:\n connect(parent, factor_node)\n # Now process the raw_betas to create a dict\n for factor_node in factor_nodes.values():\n # Now we want betas to always be a dict\n # but in the case that the node only\n # has one parent we will allow the user to specify\n # the single beta for that parent simply\n # as a number and not a dict.\n if hasattr(factor_node.func, 'raw_betas'):\n if isinstance(factor_node.func.raw_betas, Number):\n # Make sure that if they supply a number\n # there is only one parent\n assert len(get_args(factor_node)) == 2\n betas = dict()\n for arg in get_args(factor_node):\n if arg != factor_node.variable_name:\n betas[arg] = factor_node.func.raw_betas\n factor_node.func.betas = betas\n else:\n factor_node.func.betas = factor_node.func.raw_betas\n gbn = GaussianBayesianGraph(original_factors, name=name)\n # Now for any conditional gaussian nodes\n # we need to tell the node function what the\n # parent parameters are so that the pdf can\n # be computed.\n sorted = gbn.get_topological_sort()\n joint_mu, joint_sigma = gbn.get_joint_parameters()\n for node in sorted:\n if hasattr(node.func, 'betas'):\n # This means its multivariate gaussian\n names = [n.variable_name for n in node.parents] + [node.variable_name]\n node.func.joint_mu = MeansVector.zeros((len(names), 1), names=names)\n for name in names:\n node.func.joint_mu[name] = joint_mu[name][0, 0]\n node.func.covariance_matrix = CovarianceMatrix.zeros(\n (len(names), len(names)), names)\n for row, col in xproduct(names, names):\n node.func.covariance_matrix[row, col] = joint_sigma[row, col]\n return gbn", "metadata": "root.build_gbn", "header": "['module', '___EOS___']", "index": 218 }, { "content": "def build_graph(*args, **kwds):\n '''For compatibility, this is\n just a wrapper around build_gbn'''\n return build_gbn(*args, **kwds)", "metadata": "root.build_graph", "header": "['module', '___EOS___']", "index": 301 } ]
[ { "span": "from collections import Counter", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 31 }, { "span": "from bayesian.gaussian import marginalize_joint", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 47 }, { "span": "from bayesian.gaussian import joint_to_conditional, conditional_to_joint", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 72 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "Class", "es", " ", "for", " ", "pure", " ", "Gaussian", " ", "Bayes", "ian", " ", "Network", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "functools_", "import_", "wraps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numbers_", "import_", "Number_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Counter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "product_", "as_", "xpr", "od", "uct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bayes", "ian_", "._", "graph_", "import_", "Graph_", ",_", "Node_", ",_", "connect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "gaussian_", "import_", "make", "\\u", "gauss", "ian", "\\u", "cdf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "gaussian_", "import_", "marginal", "ize", "\\u", "joint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "gaussian_", "import_", "joint", "\\u", "to", "\\u", "conditional", "_", ",_", "conditional", "\\u", "to", "\\u", "joint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "gaussian_", "import_", "Covar", "iance", "Matrix_", ",_", "Means", "Vector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "linear", "\\u", "algebra", "_", "import_", "zeros_", ",_", "Matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "utils_", "import_", "get", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "utils_", "import_", "get", "\\u", "original", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "exceptions_", "import_", "Varia", "ble", "Not", "In", "Graph", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bayes", "ian_", "._", "linear", "\\u", "algebra", "_", "import_", "Matrix_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "gaussian_", "(_", "mu_", ",_", "sigma_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "gauss", "ian", " ", "decorator_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "is", " ", "a", " ", "decorat", "or", " ", "with", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "means", " ", "it", " ", "shou", "ld", " ", "return", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "normal", "'", " ", "decorated", " ", "ie", " ", "twi", "ce", " ", "wrapp", "ed", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "gauss", "ian", "ize_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "wraps_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gauss", "ian", "ized_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "/_", "(_", "sigma_", "*_", "(_", "2_", "*_", "math_", "._", "pi_", ")_", "**_", "0.5_", ")_", "*_", "math_", "._", "exp_", "(_", "(_", "-_", "(_", "x_", "-_", "mu_", ")_", "**_", "2_", ")_", "/_", "(_", "2_", "*_", "sigma_", "**_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gauss", "ian", "ized_", "._", "mean_", "=_", "mu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gauss", "ian", "ized_", "._", "std", "\\u", "dev_", "=_", "sigma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gauss", "ian", "ized_", "._", "variance_", "=_", "sigma_", "**_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gauss", "ian", "ized_", "._", "cdf_", "=_", "make", "\\u", "gauss", "ian", "\\u", "cdf_", "(_", "mu_", ",_", "sigma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gauss", "ian", "ized_", "._", "argspec_", "=_", "get", "\\u", "args_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gauss", "ian", "ized_", "._", "entropy_", "=_", "types_", "._", "Meth", "od", "Type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "x_", ":_", "0.5_", "*_", "math_", "._", "log_", "(_", "2_", "*_", "math_", "._", "pi_", "*_", "math_", "._", "e_", "*_", "x_", "._", "variance_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gauss", "ian", "ized_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "gauss", "ian", "ized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "gauss", "ian", "ize_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "conditional", "\\u", "gaussian_", "(_", "mu_", ",_", "sigma_", ",_", "betas", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "conditional", "\\u", "gauss", "ian", "ize_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "wraps_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "conditional", "\\u", "gauss", "ian", "ized_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Sin", "ce", " ", "this", " ", "function", " ", "will", " ", "neve", "r", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "call", "ed", " ", "direct", "ly", " ", "we", " ", "don", "t", " ", "need", " ", "anyt", "hing", " ", "here", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "we", " ", "need", " ", "to", " ", "construct", " ", "a", " ", "vector_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "out", " ", "of", " ", "the", " ", "args", "..._", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "zeros_", "(_", "(_", "len_", "(_", "args_", ")_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "a_", "in_", "enumerate_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "[_", "i_", ",_", "0_", "]_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sigma_", "=_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "covariance", "\\u", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu_", "=_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "joint", "\\u", "mu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "/_", "(_", "2_", "*_", "math_", "._", "pi_", "*_", "sigma_", "._", "det_", "(_", ")_", ")_", "**_", "0.5_", "*_", "math_", "._", "exp_", "(_", "-_", "0.5_", "*_", "(_", "(_", "x_", "-_", "mu_", ")_", "._", "T_", "*_", "sigma_", "._", "I_", "*_", "(_", "x_", "-_", "mu_", ")_", ")_", "[_", "0_", ",_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "mean_", "=_", "mu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "std", "\\u", "dev_", "=_", "sigma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "variance_", "=_", "sigma_", "**_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "raw", "\\u", "betas", "_", "=_", "betas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "argspec_", "=_", "get", "\\u", "args_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conditional", "\\u", "gauss", "ian", "ized_", "._", "entropy_", "=_", "types_", "._", "Meth", "od", "Type_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "x_", ":_", "len_", "(_", "x_", "._", "joint", "\\u", "mu_", ")_", "/_", "2_", "*_", "(_", "1_", "+_", "math_", "._", "log_", "(_", "2_", "*_", "math_", "._", "pi_", ")_", ")_", "+_", "0.5_", "*_", "math_", "._", "log_", "(_", "x_", "._", "covariance", "\\u", "matrix_", "._", "det_", "(_", ")_", ")_", ",_", "conditional", "\\u", "gauss", "ian", "ized_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "the", " ", "joint", " ", "parameter", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "to", " ", "this", " ", "function", " ", "at", " ", "the", " ", "time", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "graph", " ", "constructi", "on_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "conditional", "\\u", "gauss", "ian", "ized_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "conditional", "\\u", "gauss", "ian", "ize_", "\\u\\u\\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_", "GB", "NN", "ode_", "(_", "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_", "[SEP]_", "class_", "GB", "NN", "ode_", "(_", "Node_", ")_", ":_", "\\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_", ",_", "factor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "GB", "NN", "ode_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "factor_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "func_", "=_", "factor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "argspec_", "=_", "get", "\\u", "args_", "(_", "factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GB", "NN", "ode_", "(_", "Node_", ")_", ":_", "\\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_", "'<", "Gua", "ssi", "an", "Node", " ", "%", "s", " ", "(%", "s", ")>", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "argspec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GB", "NN", "ode_", "(_", "Node_", ")_", ":_", "\\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_", "variance_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "func_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\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_", ",_", "nodes_", ",_", "name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "nodes_", "=_", "nodes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Assign", " ", "integ", "er", " ", "indices_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "nodes", " ", "to", " ", "trace_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "matrix", " ", "rows", " ", "and", " ", "cols_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", " ", "to", " ", "the", " ", "nodes", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "indice", "s", " ", "must", " ", "be", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "topologi", "cal", " ", "order", "._", "\\u\\u\\uNL\\u\\u\\u_", "ordered_", "=_", "self_", "._", "get", "\\u", "topologi", "cal", "\\u", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "node_", "in_", "enumerate_", "(_", "ordered_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "._", "index_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\u\\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", "joint", "\\u", "parameters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Return", " ", "the", " ", "vector", " ", "of", " ", "means", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "the", " ", "covariance", " ", "matrix", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "the", " ", "full", " ", "joint", " ", "distribu", "tion", ".", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "now", ",", " ", "by", " ", "definit", "ion", ",", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "variab", "les", " ", "in", " ", "a", " ", "Gaussian", "\\", "10", ";", " ", " ", " ", " ", "Bayes", "ian", " ", "Network", " ", "are", " ", "eit", "her", "\\", "10", ";", " ", " ", " ", " ", "univ", "aria", "te", " ", "gauss", "ian", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "conditional", " ", "gua", "ssi", "ans", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ordered_", "=_", "self_", "._", "get", "\\u", "topologi", "cal", "\\u", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu", "\\u", "x_", "=_", "Matrix_", "(_", "[_", "[_", "ordered_", "[_", "0_", "]_", "._", "func_", "._", "mean_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "\\u", "x_", "=_", "Matrix_", "(_", "[_", "[_", "ordered_", "[_", "0_", "]_", "._", "func_", "._", "variance_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Iterat", "ively", " ", "build", " ", "up", " ", "the", " ", "mu", " ", "and", " ", "sigma", " ", "matrices_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", "in_", "ordered_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "beta", "\\u", "0_", "=_", "node_", "._", "func_", "._", "mean_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "beta_", "=_", "zeros_", "(_", "(_", "node_", "._", "index_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "parent_", "in_", "node_", "._", "parents_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "beta", "\\u", "0", " ", "-=", " ", "node", ".", "func", ".", "betas", "[", "parent", ".", "variab", "le", "\\u", "name", "]", " ", "*", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "parent", ".", "func", ".", "mean_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "beta_", "[_", "parent_", "._", "index_", ",_", "0_", "]_", "=_", "node_", "._", "func_", "._", "betas", "_", "[_", "parent_", "._", "variab", "le", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sigma", "\\u", "c_", "=_", "node_", "._", "func_", "._", "variance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu", "\\u", "x_", ",_", "sigma", "\\u", "x_", "=_", "conditional", "\\u", "to", "\\u", "joint_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mu", "\\u", "x_", ",_", "sigma", "\\u", "x_", ",_", "beta", "\\u", "0_", ",_", "beta_", ",_", "sigma", "\\u", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "set", " ", "the", " ", "names", " ", "on", " ", "the", " ", "covariance", " ", "matrix", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "graph", "s", " ", "variab", "e", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "names_", "=_", "[_", "n_", "._", "variab", "le", "\\u", "name_", "for_", "n_", "in_", "ordered_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu", "\\u", "x_", "._", "set\\u", "names_", "(_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "\\u", "x_", "._", "set\\u", "names_", "(_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "mu", "\\u", "x_", ",_", "sigma", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "query_", "(_", "self_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "the", " ", "eviden", "ce", " ", "variab", "les", " ", "are", " ", "actual", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "present_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "invalid", "\\u", "vars_", "=_", "[_", "v_", "for_", "v_", "in_", "kwds_", "._", "keys_", "(_", ")_", "if_", "v_", "not_", "in_", "self_", "._", "nodes_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "invalid", "\\u", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Varia", "ble", "Not", "In", "Graph", "Error_", "(_", "invalid", "\\u", "vars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mu_", ",_", "sigma_", "=_", "self_", "._", "get", "\\u", "joint", "\\u", "parameters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Iterat", "ively", " ", "appl", "y", " ", "the", " ", "eviden", "ce", "..._", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "'", "eviden", "ce", "'_", "]_", "=_", "kwds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "kwds_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "Means", "Vector_", "(_", "[_", "[_", "v_", "]_", "]_", ",_", "names_", "=_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "\\u", "yy_", ",_", "sigma", "\\u", "yx", "_", ",_", "sigma", "\\u", "xy_", ",_", "sigma", "\\u", "xx_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sigma_", "._", "split_", "(_", "k_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu", "\\u", "y_", ",_", "mu", "\\u", "x_", "=_", "mu_", "._", "split_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", " ", "equation", "s", " ", "(", "6", ")", " ", "and", " ", "(", "7", ")", " ", "of", " ", "CK_", "\\u\\u\\uNL\\u\\u\\u_", "mu", "\\u", "y", "\\u", "give", "n", "\\u", "x_", "=_", "Means", "Vector_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "mu", "\\u", "y_", "+_", "sigma", "\\u", "yx", "_", "*_", "sigma", "\\u", "xx_", "._", "I_", "*_", "(_", "x_", "-_", "mu", "\\u", "x_", ")_", ")_", "._", "rows_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "mu", "\\u", "y_", "._", "name", "\\u", "ordering_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "\\u", "y", "\\u", "give", "n", "\\u", "x_", "=_", "Covar", "iance", "Matrix_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "sigma", "\\u", "yy_", "-_", "sigma", "\\u", "yx", "_", "*_", "sigma", "\\u", "xx_", "._", "I_", "*_", "sigma", "\\u", "xy_", ")_", "._", "rows_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "sigma", "\\u", "yy_", "._", "name", "\\u", "ordering_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma_", "=_", "sigma", "\\u", "y", "\\u", "give", "n", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu_", "=_", "mu", "\\u", "y", "\\u", "give", "n", "\\u", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "[_", "'", "joint", "'_", "]_", "=_", "dict_", "(_", "mu_", "=_", "mu_", ",_", "sigma_", "=_", "sigma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "q_", "(_", "self_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Wrapper", " ", "aro", "und", " ", "query", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "formats", " ", "the", " ", "query", "\\", "10", ";", " ", " ", " ", " ", "result", " ", "in", " ", "a", " ", "nice", " ", "human", " ", "reada", "ble", " ", "format", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "interactive", " ", "use", ".", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "query_", "(_", "**_", "kwds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mu_", "=_", "result_", "[_", "'", "joint", "'_", "]_", "[_", "'", "mu", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma_", "=_", "result_", "[_", "'", "joint", "'_", "]_", "[_", "'", "sigma", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "evidence_", "=_", "result_", "[_", "'", "eviden", "ce", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Evi", "denc", "e", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "evidence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Covar", "iance", " ", "Matrix", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sigma_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Means", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "mu_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "discove", "r", "\\u", "sample", "\\u", "ordering_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "discove", "r", "\\u", "sample", "\\u", "ordering_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "Graph_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "graphviz", "\\u", "source_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fh_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "write_", "(_", "'", "digraph", " ", "G", " ", "{\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "._", "write_", "(_", "'", " ", " ", "graph", " ", "[", " ", "dp", "i", " ", "=", " ", "300", " ", "bg", "color", "=\"", "transp", "arent", "\"", " ", "rank", "dir", "=\"", "LR", "\"]", ";\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edges_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "sorted_", "(_", "self_", "._", "nodes_", "._", "values_", "(_", ")_", ",_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fh_", "._", "write_", "(_", "'", " ", " ", "%", "s", " ", "[", " ", "shape", "=\"", "ellips", "e", "\"", " ", "color", "=\"", "blue", "\"]", ";\\\\", "n", "'_", "%_", "node_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "child_", "in_", "node_", "._", "children_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "edge_", "=_", "(_", "node_", "._", "name_", ",_", "child_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edges_", "._", "add_", "(_", "edge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "source_", ",_", "target_", "in_", "sorted_", "(_", "edges_", ",_", "key_", "=_", "lambda_", "x_", ":_", "(_", "x_", "[_", "0_", "]_", ",_", "x_", "[_", "1_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fh_", "._", "write_", "(_", "'", " ", " ", "%", "s", " ", "->", " ", "%", "s", ";\\\\", "n", "'_", "%_", "(_", "source_", ",_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fh_", "._", "write_", "(_", "'}", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "fh_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "gb", "n_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Build", "s", " ", "a", " ", "Gaussian", " ", "Bayes", "ian", " ", "Graph", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "list", " ", "of", " ", "function", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "kwds_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "le", "\\u", "nodes_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factor", "\\u", "nodes_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "args_", "[_", "0_", "]_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Assume", " ", "the", " ", "function", "s", " ", "wer", "e", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass", "ed", " ", "in", " ", "a", " ", "list", " ", "in", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "argu", "ment", ".", " ", "Thi", "s", " ", "make", "s", " ", "it", " ", "possible_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "build", " ", "very", " ", "large", " ", "graph", "s", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "more", " ", "than", " ", "255", " ", "function", "s", ",", " ", "since_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "function", "s", " ", "are", " ", "limited", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "255", " ", "argu", "ment", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "factor_", "in_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factor", "\\u", "args_", "=_", "get", "\\u", "args_", "(_", "factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "._", "update_", "(_", "factor", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "=_", "GB", "NN", "ode_", "(_", "factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factor", "\\u", "nodes_", "[_", "factor_", "._", "\\u\\u", "name\\u\\u_", "]_", "=_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "lets", " ", "create", " ", "the", " ", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "do", " ", "this", " ", "we", " ", "need", " ", "to", " ", "find", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "factor", " ", "node", " ", "represent", "ing", " ", "the", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "a", " ", "child", " ", "factor", "s", " ", "argu", "ment", " ", "and", " ", "connect_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "to", " ", "the", " ", "child", " ", "node", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "calling", " ", "original", "\\u", "factors_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "here", " ", "can", " ", "break", " ", "build", "\\u", "gb", "n", " ", "if", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "factor", "s", " ", "do", " ", "not", " ", "correct", "ly", " ", "represent_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "valid", " ", "network", ".", " ", "Thi", "s", " ", "will", " ", "be", " ", "fixed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "next", " ", "release_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "original", "\\u", "factors_", "=_", "get", "\\u", "original", "\\u", "factors_", "(_", "factor", "\\u", "nodes_", "._", "values_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "var", "\\u", "name_", ",_", "factor_", "in_", "original", "\\u", "factors_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factor_", "._", "variab", "le", "\\u", "name_", "=_", "var", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "factor", "\\u", "node_", "in_", "factor", "\\u", "nodes_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factor", "\\u", "args_", "=_", "get", "\\u", "args_", "(_", "factor", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parents_", "=_", "[_", "original", "\\u", "factors_", "[_", "arg_", "]_", "for_", "arg_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "factor", "\\u", "args_", "if_", "original", "\\u", "factors_", "[_", "arg_", "]_", "!=_", "factor", "\\u", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "parent_", "in_", "parents_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connect_", "(_", "parent_", ",_", "factor", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "process", " ", "the", " ", "raw", "\\u", "betas", " ", "to", " ", "create", " ", "a", " ", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "factor", "\\u", "node_", "in_", "factor", "\\u", "nodes_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "want", " ", "betas", " ", "to", " ", "alw", "ay", "s", " ", "be", " ", "a", " ", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "in", " ", "the", " ", "case", " ", "tha", "t", " ", "the", " ", "node", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "one", " ", "parent", " ", "we", " ", "will", " ", "allow", " ", "the", " ", "user", " ", "to", " ", "speci", "fy_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "single", " ", "beta", " ", "for", " ", "tha", "t", " ", "parent", " ", "simp", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "a", " ", "number", " ", "and", " ", "not", " ", "a", " ", "dict", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "factor", "\\u", "node_", "._", "func_", ",_", "'", "raw", "\\u", "betas", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "factor", "\\u", "node_", "._", "func_", "._", "raw", "\\u", "betas", "_", ",_", "Number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "tha", "t", " ", "if", " ", "the", "y", " ", "supply", " ", "a", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "there", " ", "is", " ", "only", " ", "one", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "len_", "(_", "get", "\\u", "args_", "(_", "factor", "\\u", "node_", ")_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "betas", "_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "get", "\\u", "args_", "(_", "factor", "\\u", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "arg_", "!=_", "factor", "\\u", "node_", "._", "variab", "le", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "betas", "_", "[_", "arg_", "]_", "=_", "factor", "\\u", "node_", "._", "func_", "._", "raw", "\\u", "betas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "factor", "\\u", "node_", "._", "func_", "._", "betas", "_", "=_", "betas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factor", "\\u", "node_", "._", "func_", "._", "betas", "_", "=_", "factor", "\\u", "node_", "._", "func_", "._", "raw", "\\u", "betas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gb", "n_", "=_", "Gaussian", "Bayes", "ian", "Graph_", "(_", "original", "\\u", "factors_", ",_", "name_", "=_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "for", " ", "any", " ", "conditional", " ", "gauss", "ian", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "need", " ", "to", " ", "tell", " ", "the", " ", "node", " ", "function", " ", "what", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parent", " ", "parameter", "s", " ", "are", " ", "so", " ", "tha", "t", " ", "the", " ", "pdf", " ", "can_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "be", " ", "compute", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "=_", "gb", "n_", "._", "get", "\\u", "topologi", "cal", "\\u", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "joint", "\\u", "mu_", ",_", "joint", "\\u", "sigma_", "=_", "gb", "n_", "._", "get", "\\u", "joint", "\\u", "parameters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "sorted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "node_", "._", "func_", ",_", "'", "betas", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "means", " ", "its", " ", "multivariate", " ", "gaussian_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "[_", "n_", "._", "variab", "le", "\\u", "name_", "for_", "n_", "in_", "node_", "._", "parents_", "]_", "+_", "[_", "node_", "._", "variab", "le", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", "._", "func_", "._", "joint", "\\u", "mu_", "=_", "Means", "Vector_", "._", "zeros_", "(_", "(_", "len_", "(_", "names_", ")_", ",_", "1_", ")_", ",_", "names_", "=_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", "in_", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "._", "func_", "._", "joint", "\\u", "mu_", "[_", "name_", "]_", "=_", "joint", "\\u", "mu_", "[_", "name_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "node_", "._", "func_", "._", "covariance", "\\u", "matrix_", "=_", "Covar", "iance", "Matrix_", "._", "zeros_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "len_", "(_", "names_", ")_", ",_", "len_", "(_", "names_", ")_", ")_", ",_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", ",_", "col_", "in_", "xpr", "od", "uct_", "(_", "names_", ",_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "._", "func_", "._", "covariance", "\\u", "matrix_", "[_", "row_", ",_", "col_", "]_", "=_", "joint", "\\u", "sigma_", "[_", "row_", ",_", "col_", "]_", "\\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_", "gb", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "graph_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "For", " ", "compatibility", ",", " ", "this", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "just", " ", "a", " ", "wrapp", "er", " ", "aro", "und", " ", "build", "\\u", "gb", "n", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "build", "\\u", "gb", "n_", "(_", "*_", "args_", ",_", "**_", "kwds_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
taoliu/taolib/CoreLib/Algorithm/BWT.py
[ { "content": "# Time-stamp: <2009-05-08 12:18:16 Tao Liu>\n\n\"\"\"Module Description: Burrows-Wheeler transform\n\nCopyright (c) 2008 Tao Liu <taoliu@jimmy.harvard.edu>\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the BSD License (see the file COPYING included with\nthe distribution).\n\n@status: experimental\n@version: $Revision$\n@author: Tao Liu\n@contact: taoliu@jimmy.harvard.edu\n\"\"\"\n\n# ------------------------------------\n# python modules\n# ------------------------------------\n\nimport sys\nimport re\n\n# ------------------------------------\n# constants\n# ------------------------------------\n\n# ------------------------------------\n# Misc functions\n# ------------------------------------\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def bwt(s):\n s = s + '\\0'\n return ''.join([x[-1] for x in # Take last character\n sorted([s[i:] + s[:i] for i in range(len(s))])]) # Of each sorted row", "metadata": "root.bwt", "header": "['module', '___EOS___']", "index": 30 }, { "content": "def ibwt(s):\n L = [''] * len(s) # Make empty table\n for i in range(len(s)):\n L = sorted([s[i] + L[i] for i in range(len(s))]) # Sort rows after adding s as first column\n return [x for x in L if x.endswith('\\0')][0][:-1] # Get row ending with null, [:-1] removes the null", "metadata": "root.ibwt", "header": "['module', '___EOS___']", "index": 35 } ]
[ { "span": "import sys", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 10 }, { "span": "import re", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Time", "-", "stamp", ":", " ", "<", "200", "9", "-0", "5", "-0", "8", " ", "1", "2", ":", "1", "8", ":", "16", " ", "Ta", "o", " ", "Li", "u", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Modul", "e", " ", "Descripti", "on", ":", " ", "Bur", "rows", "-", "Whe", "ele", "r", " ", "transform", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2008", " ", "Ta", "o", " ", "Li", "u", " ", "<", "ta", "oli", "u", "@", "jim", "my", ".", "har", "vard", ".", "edu", ">", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "code", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", " ", "it", "\\", "10", ";", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "BS", "D", " ", "License", " ", "(", "see", " ", "the", " ", "file", " ", "COPY", "ING", " ", "include", "d", " ", "with", "\\", "10", ";", "the", " ", "distribu", "tion", ").", "\\", "10", ";", "\\", "10", ";", "@", "status", ":", " ", " ", "experimental", "\\", "10", ";", "@", "version", ":", " ", "$", "Revi", "sion", "$", "\\", "10", ";", "@", "author", ":", " ", " ", "Ta", "o", " ", "Li", "u", "\\", "10", ";", "@", "contact", ":", " ", "ta", "oli", "u", "@", "jim", "my", ".", "har", "vard", ".", "edu", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "python", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mis", "c", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "bw", "t_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "s_", "+_", "'\\\\", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "[_", "x_", "[_", "-_", "1_", "]_", "for_", "x_", "in_", "#", " ", "Tak", "e", " ", "last", " ", "character_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "[_", "s_", "[_", "i_", ":_", "]_", "+_", "s_", "[_", ":_", "i_", "]_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "s_", ")_", ")_", "]_", ")_", "]_", ")_", "#", " ", "Of", " ", "each", " ", "sorte", "d", " ", "row_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ib", "wt_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "[_", "''_", "]_", "*_", "len_", "(_", "s_", ")_", "#", " ", "Make", " ", "empty", " ", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "s_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "L_", "=_", "sorted_", "(_", "[_", "s_", "[_", "i_", "]_", "+_", "L_", "[_", "i_", "]_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "s_", ")_", ")_", "]_", ")_", "#", " ", "Sort", " ", "rows", " ", "after", " ", "addin", "g", " ", "s", " ", "as", " ", "first", " ", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "x_", "for_", "x_", "in_", "L_", "if_", "x_", "._", "endswith_", "(_", "'\\\\", "0", "'_", ")_", "]_", "[_", "0_", "]_", "[_", ":_", "-_", "1_", "]_", "#", " ", "Get", " ", "row", " ", "ending", " ", "with", " ", "null", ",", " ", "[:", "-1", "]", " ", "remove", "s", " ", "the", " ", "null_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
manahl/mdf/mdf/tests/test_nodes.py
[ { "content": "from mdf import (\n MDFContext,\n evalnode,\n queuenode,\n nansumnode,\n cumprodnode,\n delaynode,\n ffillnode,\n vargroup,\n datanode,\n run,\n DataFrameBuilder\n)\n\nfrom datetime import datetime\nfrom numpy.testing.utils import assert_almost_equal\nimport pandas as pd\nimport numpy as np\nimport unittest\nimport logging\nimport operator\n\n# this is necessary to stop namespace from looking\n# too far up the stack as it looks for the first frame\n# not in the mdf package\n\n__package__ = None\n\n_logger = logging.getLogger(__name__)\n\nparams = vargroup(C=None, D=None)\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": "@queuenode\ndef queue_output():\n return A() + B()", "metadata": "root.queue_output", "header": "['module', '___EOS___']", "index": 32 }, { "content": "@queuenode\ndef queue_yield():\n while True:\n yield A() + B()", "metadata": "root.queue_yield", "header": "['module', '___EOS___']", "index": 36 }, { "content": "@evalnode\ndef queue_filter():\n yield False\n while True:\n yield True", "metadata": "root.queue_filter", "header": "['module', '___EOS___']", "index": 41 }, { "content": "@queuenode(filter=queue_filter)\ndef queue_filter_test():\n yield \"THIS SHOULD NOT BE IN THE QUEUE\"\n while True:\n yield 0", "metadata": "root.queue_filter_test", "header": "['module', '___EOS___']", "index": 47 }, { "content": "@nansumnode()\ndef nansum_output():\n return A() + sometimes_nan_B()", "metadata": "root.nansum_output", "header": "['module', '___EOS___']", "index": 53 }, { "content": "@cumprodnode()\ndef cumprod_output():\n return A() + B()", "metadata": "root.cumprod_output", "header": "['module', '___EOS___']", "index": 57 }, { "content": "@evalnode\ndef sometimes_nan_B():\n b = B()\n return np.nan if b % 2 else b", "metadata": "root.sometimes_nan_B", "header": "['module', '___EOS___']", "index": 61 }, { "content": "@evalnode\ndef A():\n return params.C() * params.D()", "metadata": "root.A", "header": "['module', '___EOS___']", "index": 66 }, { "content": "@evalnode\ndef B():\n accum = 0\n\n while True:\n yield accum\n accum += 1", "metadata": "root.B", "header": "['module', '___EOS___']", "index": 70 }, { "content": "@evalnode\ndef A_plus_B():\n return A() + B()", "metadata": "root.A_plus_B", "header": "['module', '___EOS___']", "index": 78 }, { "content": "@evalnode\ndef Counter():\n accum = -2.0\n while True:\n if accum != 0.0:\n yield accum\n accum += 0.5", "metadata": "root.Counter", "header": "['module', '___EOS___']", "index": 82 }, { "content": "class DelayNodeTest(object): \n\n\n\n\n", "metadata": "root.DelayNodeTest", "header": "['module', '___EOS___']", "index": 90 }, { "content": " @evalnode\n def initial_value(cls):\n return 0", "metadata": "root.DelayNodeTest.initial_value", "header": "['class', 'DelayNodeTest', '(', 'object', ')', ':', '___EOS___']", "index": 92 }, { "content": " @delaynode(periods=1, initial_value=initial_value)\n def delayed_node(cls):\n i = 1\n while True:\n yield i\n i += 1", "metadata": "root.DelayNodeTest.delayed_node", "header": "['class', 'DelayNodeTest', '(', 'object', ')', ':', '___EOS___']", "index": 96 }, { "content": " @delaynode(periods=1, initial_value=initial_value, lazy=True)\n def delayed_node_lazy(cls):\n return cls.delay_test()[-1]", "metadata": "root.DelayNodeTest.delayed_node_lazy", "header": "['class', 'DelayNodeTest', '(', 'object', ')', ':', '___EOS___']", "index": 103 }, { "content": " @queuenode\n def delay_test(cls):\n return 1 + cls.delayed_node()", "metadata": "root.DelayNodeTest.delay_test", "header": "['class', 'DelayNodeTest', '(', 'object', ')', ':', '___EOS___']", "index": 107 }, { "content": " @queuenode\n def delay_test_lazy(cls):\n return 1 + cls.delayed_node_lazy()", "metadata": "root.DelayNodeTest.delay_test_lazy", "header": "['class', 'DelayNodeTest', '(', 'object', ')', ':', '___EOS___']", "index": 111 }, { "content": "@queuenode\ndef ffill_queue():\n return ffill_test()", "metadata": "root.ffill_queue", "header": "['module', '___EOS___']", "index": 115 }, { "content": "@ffillnode\ndef ffill_test():\n i = 0\n while True:\n yield np.nan if i % 2 else float(i)\n i += 1", "metadata": "root.ffill_test", "header": "['module', '___EOS___']", "index": 119 }, { "content": "@ffillnode\ndef ffill_array_test():\n return ffill_array_test_not_filled()", "metadata": "root.ffill_array_test", "header": "['module', '___EOS___']", "index": 126 }, { "content": "@evalnode\ndef ffill_array_test_not_filled():\n i = 0\n array = np.ndarray((5,), dtype=float)\n array.fill(10.0)\n yield array\n \n array.fill(np.nan)\n while True:\n yield array", "metadata": "root.ffill_array_test_not_filled", "header": "['module', '___EOS___']", "index": 130 }, { "content": "class NodeTest(unittest.TestCase):\n\n\n\n\n \n\n\n\n\n\n\n\n \n\n\n \n \n ", "metadata": "root.NodeTest", "header": "['module', '___EOS___']", "index": 141 }, { "content": " def setUp(self):\n self.daterange = pd.bdate_range(datetime(1970, 1, 1), datetime(1970, 1, 10))\n self.ctx = MDFContext()\n self.ctx[params.C] = 10\n self.ctx[params.D] = 20", "metadata": "root.NodeTest.setUp", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 143 }, { "content": " def test_queuenode(self):\n self._run(queue_output)\n queue = self.ctx[queue_output]\n self.assertEqual(len(queue), len(self.daterange))", "metadata": "root.NodeTest.test_queuenode", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 149 }, { "content": " def test_queueyield(self):\n self._run(queue_yield)\n queue = self.ctx[queue_yield]\n self.assertEqual(len(queue), len(self.daterange))", "metadata": "root.NodeTest.test_queueyield", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 154 }, { "content": " def test_queue_filter(self):\n self._run(queue_filter_test)\n queue = self.ctx[queue_filter_test]\n self.assertEqual(list(queue), [0] * (len(self.daterange) - 1))", "metadata": "root.NodeTest.test_queue_filter", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " @staticmethod\n def diff_dfs(lhs_df, rhs_df, tolerance):\n diffs = np.abs(lhs_df - rhs_df)\n mask = (diffs > tolerance).values\n mask &= ~(np.isnan(lhs_df) and np.isnan(rhs_df)).values\n mask |= np.isnan(lhs_df).values & ~np.isnan(rhs_df).values\n mask |= np.isnan(rhs_df).values & ~np.isnan(lhs_df).values\n return mask.any()", "metadata": "root.NodeTest.diff_dfs", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 164 }, { "content": " def test_nansumnode(self):\n self._run(nansum_output)\n nansum = self.ctx[nansum_output]\n self.assertEqual(nansum, 812)", "metadata": "root.NodeTest.test_nansumnode", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 173 }, { "content": " def test_cumprodnode(self):\n self._run(cumprod_output)\n cumprod = self.ctx[cumprod_output]\n self.assertEqual(cumprod, 14201189062704000)", "metadata": "root.NodeTest.test_cumprodnode", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 178 }, { "content": " def test_delaynode(self):\n self._run(DelayNodeTest.delay_test, DelayNodeTest.delay_test_lazy)\n value = self.ctx[DelayNodeTest.delay_test]\n value_lazy = self.ctx[DelayNodeTest.delay_test_lazy]\n self.assertEqual(list(value), list(range(1, len(self.daterange)+1)))\n self.assertEqual(list(value_lazy), list(range(1, len(self.daterange)+1)))", "metadata": "root.NodeTest.test_delaynode", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_ffillnode(self):\n self._run(ffill_queue)\n value = self.ctx[ffill_queue]\n self.assertEqual(tuple(value), (0.0, 0.0, 2.0, 2.0, 4.0, 4.0, 6.0))", "metadata": "root.NodeTest.test_ffillnode", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 190 }, { "content": " def test_ffill_array(self):\n self._run(ffill_array_test)\n value = self.ctx[ffill_array_test]\n unfilled_value = self.ctx[ffill_array_test_not_filled]\n self.assertTrue(np.isnan(unfilled_value).all())\n self.assertEquals(value.tolist(), [10., 10., 10., 10., 10.])", "metadata": "root.NodeTest.test_ffill_array", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 195 }, { "content": " def test_datanode_ffill(self):\n data = pd.Series(range(len(self.daterange)), self.daterange, dtype=float)\n data = data[[bool(i % 2) for i in range(len(data.index))]]\n\n expected = data.reindex(self.daterange, method=\"ffill\")\n expected[np.isnan(expected)] = np.inf\n\n node = datanode(\"test_datanode_ffill\", data, ffill=True, missing_value=np.inf)\n qnode = node.queuenode()\n\n self._run(qnode)\n value = self.ctx[qnode]\n\n self.assertEquals(list(value), expected.values.tolist())", "metadata": "root.NodeTest.test_datanode_ffill", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 202 }, { "content": " def test_lookahead_node(self):\n B_queue = B.queuenode()\n B_lookahead = B.lookaheadnode(periods=len(self.daterange))\n\n self.ctx.set_date(self.daterange[0])\n actual = self.ctx[B_lookahead]\n\n self._run(B_queue)\n expected = self.ctx[B_queue]\n\n self.assertEquals(actual.values.tolist(), list(expected))\n self.assertEquals(actual.index.tolist(), list(self.daterange))", "metadata": "root.NodeTest.test_lookahead_node", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 217 }, { "content": " def test_apply_node(self):\n actual_node = A.applynode(func=operator.add, args=(B,)).queuenode()\n expected_node = A_plus_B.queuenode()\n\n self._run(actual_node, expected_node)\n actual = self.ctx[actual_node]\n expected = self.ctx[expected_node]\n\n self.assertEquals(actual, expected)", "metadata": "root.NodeTest.test_apply_node", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 230 }, { "content": " def test_binary_operators_with_constant(self):\n self._test(Counter, [-2.0, -1.5, -1.0, -0.5, 0.5, 1.0, 1.5])\n self._test(Counter + 0.2, [-1.8, -1.3, -0.8, -0.3, 0.7, 1.2, 1.7])\n self._test(Counter - 0.2, [-2.2, -1.7, -1.2, -0.7, 0.3, 0.8, 1.3])\n self._test(Counter * 2.0, [-4.0, -3.0, -2.0, -1.0, 1.0, 2.0, 3.0])\n self._test(Counter / 0.5, [-4.0, -3.0, -2.0, -1.0, 1.0, 2.0, 3.0])\n\n self._test(0.2 + Counter, [-1.8, -1.3, -0.8, -0.3, 0.7, 1.2, 1.7])\n self._test(1.0 - Counter, [ 3.0, 2.5, 2.0, 1.5, 0.5, 0.0, -0.5])\n self._test(2.0 * Counter, [-4.0, -3.0, -2.0, -1.0, 1.0, 2.0, 3.0])\n self._test(12 / (Counter+.25), [-6.8571428571428568, -9.6000000000000014, -16.0,\n -48.0, 16.0, 9.6000000000000014, 6.8571428571428568])", "metadata": "root.NodeTest.test_binary_operators_with_constant", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 240 }, { "content": " def test_binary_operators_with_node(self):\n self._test(Counter + Counter, [-4.0, -3.0, -2.0, -1.0, 1.0, 2.0, 3.0])\n self._test(Counter - Counter, [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])\n self._test(Counter * Counter, [ 4.0, 2.25, 1.0, 0.25, 0.25, 1.0, 2.25])\n self._test(Counter / Counter, [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])", "metadata": "root.NodeTest.test_binary_operators_with_node", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 253 }, { "content": " def _test(self, node, expected_values):\n values = node.queuenode()\n self._run(values)\n actual = self.ctx[values]\n self.assertEquals(list(actual), expected_values)", "metadata": "root.NodeTest._test", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 259 }, { "content": " def _run_for_daterange(self, date_range, *nodes):\n for t in date_range:\n self.ctx.set_date(t)\n for node in nodes:\n self.ctx[node] ", "metadata": "root.NodeTest._run_for_daterange", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 265 }, { "content": " def _run(self, *nodes):\n self._run_for_daterange(self.daterange, *nodes)", "metadata": "root.NodeTest._run", "header": "['class', 'NodeTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 271 } ]
[ { "span": "from mdf import (\n MDFContext,\n evalnode,\n queuenode,\n nansumnode,\n cumprodnode,\n delaynode,\n ffillnode,\n vargroup,\n datanode,\n run,\n DataFrameBuilder\n)", "start_line": 0, "start_column": 0, "end_line": 12, "end_column": 1 }, { "span": "from numpy.testing.utils import assert_almost_equal", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "md", "f_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "MD", "FC", "onte", "xt_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "eval", "node_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "queue", "node_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nans", "umn", "ode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cum", "prod", "node_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dela", "yn", "ode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ffil", "lno", "de_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "var", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datan", "ode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "run_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Data", "Frame", "Builder_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "._", "testing_", "._", "utils_", "import_", "assert", "\\u", "alm", "ost", "\\u", "equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "operator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "necessar", "y", " ", "to", " ", "stop", " ", "namespace", " ", "from", " ", "look", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "too", " ", "far", " ", "up", " ", "the", " ", "stack", " ", "as", " ", "it", " ", "look", "s", " ", "for", " ", "the", " ", "first", " ", "frame_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "in", " ", "the", " ", "md", "f", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "package", "\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "var", "group_", "(_", "C_", "=_", "None_", ",_", "D_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "@_", "queue", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "queue", "\\u", "output_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "A_", "(_", ")_", "+_", "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_", "@_", "queue", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "queue", "\\u", "yield_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "A_", "(_", ")_", "+_", "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_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "queue", "\\u", "filter_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "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_", "@_", "queue", "node_", "(_", "filter_", "=_", "queue", "\\u", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "queue", "\\u", "filter", "\\u", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "\"", "THIS", " ", "SHO", "UL", "D", " ", "NOT", " ", "BE", " ", "IN", " ", "THE", " ", "QUEUE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "nans", "umn", "ode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "nans", "um", "\\u", "output_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "A_", "(_", ")_", "+_", "somet", "imes", "\\u", "nan", "\\u", "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_", "@_", "cum", "prod", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cum", "prod", "\\u", "output_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "A_", "(_", ")_", "+_", "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_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "somet", "imes", "\\u", "nan", "\\u", "B_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "B_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "np_", "._", "nan_", "if_", "b_", "%_", "2_", "else_", "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_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "A_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "params_", "._", "C_", "(_", ")_", "*_", "params_", "._", "D_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "B_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accum_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "accum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accum_", "+=_", "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_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "A", "\\u", "plus", "\\u", "B_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "A_", "(_", ")_", "+_", "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_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Counter_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "accum_", "=_", "-_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "accum_", "!=_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "accum_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "accum_", "+=_", "0.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_", "class_", "Delay", "Node", "Test_", "(_", "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_", "Delay", "Node", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "initial", "\\u", "value_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delay", "Node", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "dela", "yn", "ode_", "(_", "periods_", "=_", "1_", ",_", "initial", "\\u", "value_", "=_", "initial", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "delayed", "\\u", "node_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delay", "Node", "Test_", "(_", "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_", "@_", "dela", "yn", "ode_", "(_", "periods_", "=_", "1_", ",_", "initial", "\\u", "value_", "=_", "initial", "\\u", "value_", ",_", "lazy_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "delayed", "\\u", "node", "\\u", "lazy_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "._", "dela", "y", "\\u", "test_", "(_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delay", "Node", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "queue", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dela", "y", "\\u", "test_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "+_", "cls_", "._", "delayed", "\\u", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Delay", "Node", "Test_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "queue", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dela", "y", "\\u", "test\\u", "lazy_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "+_", "cls_", "._", "delayed", "\\u", "node", "\\u", "lazy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "queue", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ffil", "l\\u", "queue_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ffil", "l\\u", "test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "ffil", "lno", "de_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ffil", "l\\u", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "np_", "._", "nan_", "if_", "i_", "%_", "2_", "else_", "float_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "ffil", "lno", "de_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ffil", "l\\u", "array", "\\u", "test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ffil", "l\\u", "array", "\\u", "test\\u", "not", "\\u", "filled_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "eval", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ffil", "l\\u", "array", "\\u", "test\\u", "not", "\\u", "filled_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "=_", "np_", "._", "ndarray_", "(_", "(_", "5_", ",_", ")_", ",_", "dtype_", "=_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "array_", "._", "fill_", "(_", "10.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "array_", "._", "fill_", "(_", "np_", "._", "nan_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Node", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Node", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "date", "range_", "=_", "pd_", "._", "bda", "te", "\\u", "range_", "(_", "datetime_", "(_", "1970_", ",_", "1_", ",_", "1_", ")_", ",_", "datetime_", "(_", "1970_", ",_", "1_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "=_", "MD", "FC", "onte", "xt_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "[_", "params_", "._", "C_", "]_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "[_", "params_", "._", "D_", "]_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "queue", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "queue", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queue_", "=_", "self_", "._", "ctx_", "[_", "queue", "\\u", "output_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "queue_", ")_", ",_", "len_", "(_", "self_", "._", "date", "range_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "queue", "yield_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "queue", "\\u", "yield_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queue_", "=_", "self_", "._", "ctx_", "[_", "queue", "\\u", "yield_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "queue_", ")_", ",_", "len_", "(_", "self_", "._", "date", "range_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "queue", "\\u", "filter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "queue", "\\u", "filter", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "queue_", "=_", "self_", "._", "ctx_", "[_", "queue", "\\u", "filter", "\\u", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "queue_", ")_", ",_", "[_", "0_", "]_", "*_", "(_", "len_", "(_", "self_", "._", "date", "range_", ")_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "diff", "\\u", "dfs_", "(_", "lh", "s", "\\u", "df_", ",_", "rhs", "\\u", "df_", ",_", "tolerance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "=_", "np_", "._", "abs_", "(_", "lh", "s", "\\u", "df_", "-_", "rhs", "\\u", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "=_", "(_", "diffs_", ">_", "tolerance_", ")_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "&=_", "~_", "(_", "np_", "._", "isnan_", "(_", "lh", "s", "\\u", "df_", ")_", "and_", "np_", "._", "isnan_", "(_", "rhs", "\\u", "df_", ")_", ")_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "|=_", "np_", "._", "isnan_", "(_", "lh", "s", "\\u", "df_", ")_", "._", "values_", "&_", "~_", "np_", "._", "isnan_", "(_", "rhs", "\\u", "df_", ")_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mask_", "|=_", "np_", "._", "isnan_", "(_", "rhs", "\\u", "df_", ")_", "._", "values_", "&_", "~_", "np_", "._", "isnan_", "(_", "lh", "s", "\\u", "df_", ")_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "mask_", "._", "any_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "nans", "umn", "ode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "nans", "um", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nans", "um_", "=_", "self_", "._", "ctx_", "[_", "nans", "um", "\\u", "output_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "nans", "um_", ",_", "812", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "cum", "prod", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "cum", "prod", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cum", "prod_", "=_", "self_", "._", "ctx_", "[_", "cum", "prod", "\\u", "output_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "cum", "prod_", ",_", "142", "011", "890", "627", "0400", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "dela", "yn", "ode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "Delay", "Node", "Test_", "._", "dela", "y", "\\u", "test_", ",_", "Delay", "Node", "Test_", "._", "dela", "y", "\\u", "test\\u", "lazy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "ctx_", "[_", "Delay", "Node", "Test_", "._", "dela", "y", "\\u", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "lazy_", "=_", "self_", "._", "ctx_", "[_", "Delay", "Node", "Test_", "._", "dela", "y", "\\u", "test\\u", "lazy_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "value_", ")_", ",_", "list_", "(_", "range_", "(_", "1_", ",_", "len_", "(_", "self_", "._", "date", "range_", ")_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "list_", "(_", "value", "\\u", "lazy_", ")_", ",_", "list_", "(_", "range_", "(_", "1_", ",_", "len_", "(_", "self_", "._", "date", "range_", ")_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "ffil", "lno", "de_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "ffil", "l\\u", "queue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "ctx_", "[_", "ffil", "l\\u", "queue_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "tuple_", "(_", "value_", ")_", ",_", "(_", "0.0_", ",_", "0.0_", ",_", "2.0_", ",_", "2.0_", ",_", "4.0_", ",_", "4.0_", ",_", "6.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "ffil", "l\\u", "array_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run_", "(_", "ffil", "l\\u", "array", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "ctx_", "[_", "ffil", "l\\u", "array", "\\u", "test_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unfi", "lle", "d\\u", "value_", "=_", "self_", "._", "ctx_", "[_", "ffil", "l\\u", "array", "\\u", "test\\u", "not", "\\u", "filled_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "np_", "._", "isnan_", "(_", "unfi", "lle", "d\\u", "value_", ")_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "value_", "._", "tolist_", "(_", ")_", ",_", "[_", "10._", ",_", "10._", ",_", "10._", ",_", "10._", ",_", "10._", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "datan", "ode", "\\u", "ffil", "l_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "pd_", "._", "Series_", "(_", "range_", "(_", "len_", "(_", "self_", "._", "date", "range_", ")_", ")_", ",_", "self_", "._", "date", "range_", ",_", "dtype_", "=_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "data_", "[_", "[_", "bool_", "(_", "i_", "%_", "2_", ")_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "data_", "._", "index_", ")_", ")_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "data_", "._", "reindex", "_", "(_", "self_", "._", "date", "range_", ",_", "method_", "=_", "\"", "ffil", "l", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "[_", "np_", "._", "isnan_", "(_", "expected_", ")_", "]_", "=_", "np_", "._", "inf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node_", "=_", "datan", "ode_", "(_", "\"", "test\\u", "datan", "ode", "\\u", "ffil", "l", "\"_", ",_", "data_", ",_", "ffil", "l_", "=_", "True_", ",_", "missi", "ng", "\\u", "value_", "=_", "np_", "._", "inf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qn", "ode_", "=_", "node_", "._", "queue", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "run_", "(_", "qn", "ode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "ctx_", "[_", "qn", "ode_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "list_", "(_", "value_", ")_", ",_", "expected_", "._", "values_", "._", "tolist_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "looka", "head", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "B", "\\u", "queue_", "=_", "B_", "._", "queue", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "B", "\\u", "looka", "head_", "=_", "B_", "._", "looka", "head", "node_", "(_", "periods_", "=_", "len_", "(_", "self_", "._", "date", "range_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ctx_", "._", "set\\u", "date_", "(_", "self_", "._", "date", "range_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "self_", "._", "ctx_", "[_", "B", "\\u", "looka", "head_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "run_", "(_", "B", "\\u", "queue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "self_", "._", "ctx_", "[_", "B", "\\u", "queue_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "actual_", "._", "values_", "._", "tolist_", "(_", ")_", ",_", "list_", "(_", "expected_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "actual_", "._", "index_", "._", "tolist_", "(_", ")_", ",_", "list_", "(_", "self_", "._", "date", "range_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "appl", "y", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "actual", "\\u", "node_", "=_", "A_", "._", "appl", "yn", "ode_", "(_", "func_", "=_", "operator_", "._", "add_", ",_", "args_", "=_", "(_", "B_", ",_", ")_", ")_", "._", "queue", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "node_", "=_", "A", "\\u", "plus", "\\u", "B_", "._", "queue", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "run_", "(_", "actual", "\\u", "node_", ",_", "expected", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "self_", "._", "ctx_", "[_", "actual", "\\u", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "self_", "._", "ctx_", "[_", "expected", "\\u", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "actual_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "binar", "y", "\\u", "opera", "tors", "\\u", "with", "\\u", "constant_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test_", "(_", "Counter_", ",_", "[_", "-_", "2.0_", ",_", "-_", "1.5_", ",_", "-_", "1.0_", ",_", "-_", "0.5_", ",_", "0.5_", ",_", "1.0_", ",_", "1.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "+_", "0.2_", ",_", "[_", "-_", "1.8_", ",_", "-_", "1.3_", ",_", "-_", "0.8_", ",_", "-_", "0.3_", ",_", "0.7_", ",_", "1.2_", ",_", "1.7", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "-_", "0.2_", ",_", "[_", "-_", "2.2_", ",_", "-_", "1.7", "_", ",_", "-_", "1.2_", ",_", "-_", "0.7_", ",_", "0.3_", ",_", "0.8_", ",_", "1.3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "*_", "2.0_", ",_", "[_", "-_", "4.0_", ",_", "-_", "3.0_", ",_", "-_", "2.0_", ",_", "-_", "1.0_", ",_", "1.0_", ",_", "2.0_", ",_", "3.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "/_", "0.5_", ",_", "[_", "-_", "4.0_", ",_", "-_", "3.0_", ",_", "-_", "2.0_", ",_", "-_", "1.0_", ",_", "1.0_", ",_", "2.0_", ",_", "3.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "0.2_", "+_", "Counter_", ",_", "[_", "-_", "1.8_", ",_", "-_", "1.3_", ",_", "-_", "0.8_", ",_", "-_", "0.3_", ",_", "0.7_", ",_", "1.2_", ",_", "1.7", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "1.0_", "-_", "Counter_", ",_", "[_", "3.0_", ",_", "2.5_", ",_", "2.0_", ",_", "1.5_", ",_", "0.5_", ",_", "0.0_", ",_", "-_", "0.5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "2.0_", "*_", "Counter_", ",_", "[_", "-_", "4.0_", ",_", "-_", "3.0_", ",_", "-_", "2.0_", ",_", "-_", "1.0_", ",_", "1.0_", ",_", "2.0_", ",_", "3.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "12_", "/_", "(_", "Counter_", "+_", ".25_", ")_", ",_", "[_", "-_", "6.8", "57142", "857", "142", "856", "8_", ",_", "-_", "9.6", "0000000000000", "14_", ",_", "-_", "16.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "-_", "48.", "0_", ",_", "16.0_", ",_", "9.6", "0000000000000", "14_", ",_", "6.8", "57142", "857", "142", "856", "8_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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", "binar", "y", "\\u", "opera", "tors", "\\u", "with", "\\u", "node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test_", "(_", "Counter_", "+_", "Counter_", ",_", "[_", "-_", "4.0_", ",_", "-_", "3.0_", ",_", "-_", "2.0_", ",_", "-_", "1.0_", ",_", "1.0_", ",_", "2.0_", ",_", "3.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "-_", "Counter_", ",_", "[_", "0.0_", ",_", "0.0_", ",_", "0.0_", ",_", "0.0_", ",_", "0.0_", ",_", "0.0_", ",_", "0.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "*_", "Counter_", ",_", "[_", "4.0_", ",_", "2.2", "5_", ",_", "1.0_", ",_", "0.25_", ",_", "0.25_", ",_", "1.0_", ",_", "2.2", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test_", "(_", "Counter_", "/_", "Counter_", ",_", "[_", "1.0_", ",_", "1.0_", ",_", "1.0_", ",_", "1.0_", ",_", "1.0_", ",_", "1.0_", ",_", "1.0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test_", "(_", "self_", ",_", "node_", ",_", "expected", "\\u", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "values_", "=_", "node_", "._", "queue", "node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "run_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "self_", "._", "ctx_", "[_", "values_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "list_", "(_", "actual_", ")_", ",_", "expected", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "run", "\\u", "for", "\\u", "date", "range_", "(_", "self_", ",_", "date", "\\u", "range_", ",_", "*_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "t_", "in_", "date", "\\u", "range_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ctx_", "._", "set\\u", "date_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ctx_", "[_", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "run_", "(_", "self_", ",_", "*_", "nodes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "run", "\\u", "for", "\\u", "date", "range_", "(_", "self_", "._", "date", "range_", ",_", "*_", "nodes_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
vmware/nsxramlclient/tests/controllers.py
[ { "content": "def wait_for_controller(job_id):\n status_poll_count = 0\n while status_poll_count < 20:\n response = s.read('nsxControllerJob', uri_parameters={'jobId': job_id})\n s.view_response(response)\n status = response['body']['controllerDeploymentInfo']['status']\n if status == 'Success':\n return True\n elif status == 'Failure':\n raise Exception('Controller deployment failed')\n else:\n time.sleep(30)\n\n raise Exception('Timeout waiting for controller to be deployed')", "metadata": "root.wait_for_controller", "header": "['module', '___EOS___']", "index": 57 } ]
[ { "span": "raise Exception('Timeout waiting for controller to be deployed')", "start_line": 70, "start_column": 4, "end_line": 70, "end_column": 68 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait", "\\u", "for", "\\u", "controller_", "(_", "job", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status", "\\u", "poll", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "status", "\\u", "poll", "\\u", "count_", "<_", "20_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "s_", "._", "read_", "(_", "'", "ns", "x", "Controlle", "r", "Jo", "b", "'_", ",_", "uri", "\\u", "parameters_", "=_", "{_", "'", "job", "Id", "'_", ":_", "job", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "view", "\\u", "response_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "response_", "[_", "'", "body", "'_", "]_", "[_", "'", "controlle", "r", "Deployment", "Info", "'_", "]_", "[_", "'", "status", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "status_", "==_", "'", "Success", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status_", "==_", "'", "Fail", "ure", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Controlle", "r", " ", "deploy", "ment", " ", "fail", "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 ", " _", "time_", "._", "sleep_", "(_", "30_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Exception_", "(_", "'", "Time", "out", " ", "wait", "ing", " ", "for", " ", "controlle", "r", " ", "to", " ", "be", " ", "deploye", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
lisa-lab/pylearn2/pylearn2/expr/tests/test_nnet.py
[ { "content": "def test_kl():\n \"\"\"\n Test whether function kl() has properly processed the input.\n \"\"\"\n init_mode = theano.config.compute_test_value\n theano.config.compute_test_value = 'raise'\n\n try:\n mlp = MLP(layers=[Sigmoid(dim=10, layer_name='Y', irange=0.1)],\n nvis=10)\n X = mlp.get_input_space().make_theano_batch()\n Y = mlp.get_output_space().make_theano_batch()\n X.tag.test_value = np.random.random(\n get_debug_values(X)[0].shape).astype(theano.config.floatX)\n Y_hat = mlp.fprop(X)\n\n # This call should not raise any error:\n ave = kl(Y, Y_hat, 1)\n\n # The following calls should raise ValueError exceptions:\n Y.tag.test_value[2][3] = 1.1\n np.testing.assert_raises(ValueError, kl, Y, Y_hat, 1)\n Y.tag.test_value[2][3] = -0.1\n np.testing.assert_raises(ValueError, kl, Y, Y_hat, 1)\n\n finally:\n theano.config.compute_test_value = init_mode", "metadata": "root.test_kl", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def test_elemwise_kl():\n \"\"\"\n Test whether elemwise_kl() function has properly processed the\n input.\n \"\"\"\n init_mode = theano.config.compute_test_value\n theano.config.compute_test_value = 'raise'\n\n try:\n mlp = MLP(layers=[Sigmoid(dim=10, layer_name='Y', irange=0.1)],\n nvis=10)\n X = mlp.get_input_space().make_theano_batch()\n Y = mlp.get_output_space().make_theano_batch()\n X.tag.test_value = np.random.random(\n get_debug_values(X)[0].shape).astype(theano.config.floatX)\n Y_hat = mlp.fprop(X)\n\n # This call should not raise any error:\n ave = elemwise_kl(Y, Y_hat)\n\n # The following calls should raise ValueError exceptions:\n Y.tag.test_value[2][3] = 1.1\n np.testing.assert_raises(ValueError, elemwise_kl, Y, Y_hat)\n Y.tag.test_value[2][3] = -0.1\n np.testing.assert_raises(ValueError, elemwise_kl, Y, Y_hat)\n\n finally:\n theano.config.compute_test_value = init_mode", "metadata": "root.test_elemwise_kl", "header": "['module', '___EOS___']", "index": 109 }, { "content": "def test_arg_of_sigmoid_bad():\n \"\"\"\n Tests that arg_of_sigmoid raises an error when given a bad input.\n \"\"\"\n\n X = T.matrix()\n Y = T.nnet.softmax(X)\n try:\n Z = arg_of_sigmoid(Y)\n except TypeError:\n return\n assert False # Should have failed", "metadata": "root.test_arg_of_sigmoid_bad", "header": "['module', '___EOS___']", "index": 148 } ]
[ { "span": "ave ", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 11 }, { "span": "ave ", "start_line": 127, "start_column": 8, "end_line": 127, "end_column": 11 }, { "span": "Z ", "start_line": 156, "start_column": 8, "end_line": 156, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "kl_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "whe", "ther", " ", "function", " ", "kl", "()", " ", "has", " ", "proper", "ly", " ", "process", "ed", " ", "the", " ", "input", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "init", "\\u", "mode_", "=_", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "=_", "'", "raise", "'_", "\\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 ", " _", "mlp", "_", "=_", "MLP", "_", "(_", "layers_", "=_", "[_", "Sigm", "oid_", "(_", "dim_", "=_", "10_", ",_", "layer", "\\u", "name_", "=_", "'", "Y", "'_", ",_", "ira", "nge_", "=_", "0.1_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nvi", "s_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "mlp", "_", "._", "get", "\\u", "input", "\\u", "space_", "(_", ")_", "._", "make", "\\u", "theano", "\\u", "batch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "mlp", "_", "._", "get", "\\u", "output", "\\u", "space_", "(_", ")_", "._", "make", "\\u", "theano", "\\u", "batch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "._", "tag_", "._", "test\\u", "value_", "=_", "np_", "._", "random_", "._", "random_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "debug", "\\u", "values_", "(_", "X_", ")_", "[_", "0_", "]_", "._", "shape_", ")_", "._", "astype_", "(_", "theano_", "._", "config_", "._", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "hat_", "=_", "mlp", "_", "._", "fpro", "p_", "(_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "call", " ", "shou", "ld", " ", "not", " ", "raise", " ", "any", " ", "error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "ave_", "=_", "kl_", "(_", "Y_", ",_", "Y", "\\u", "hat_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "calls", " ", "shou", "ld", " ", "raise", " ", "Value", "Error", " ", "exception", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "._", "tag_", "._", "test\\u", "value_", "[_", "2_", "]_", "[_", "3_", "]_", "=_", "1.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "testing_", "._", "assert", "\\u", "raises_", "(_", "Value", "Error_", ",_", "kl_", ",_", "Y_", ",_", "Y", "\\u", "hat_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "._", "tag_", "._", "test\\u", "value_", "[_", "2_", "]_", "[_", "3_", "]_", "=_", "-_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "testing_", "._", "assert", "\\u", "raises_", "(_", "Value", "Error_", ",_", "kl_", ",_", "Y_", ",_", "Y", "\\u", "hat_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "=_", "init", "\\u", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "elem", "wis", "e\\u", "kl_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "whe", "ther", " ", "elem", "wis", "e\\u", "kl", "()", " ", "function", " ", "has", " ", "proper", "ly", " ", "process", "ed", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "input", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "init", "\\u", "mode_", "=_", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "=_", "'", "raise", "'_", "\\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 ", " _", "mlp", "_", "=_", "MLP", "_", "(_", "layers_", "=_", "[_", "Sigm", "oid_", "(_", "dim_", "=_", "10_", ",_", "layer", "\\u", "name_", "=_", "'", "Y", "'_", ",_", "ira", "nge_", "=_", "0.1_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nvi", "s_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "mlp", "_", "._", "get", "\\u", "input", "\\u", "space_", "(_", ")_", "._", "make", "\\u", "theano", "\\u", "batch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "mlp", "_", "._", "get", "\\u", "output", "\\u", "space_", "(_", ")_", "._", "make", "\\u", "theano", "\\u", "batch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "._", "tag_", "._", "test\\u", "value_", "=_", "np_", "._", "random_", "._", "random_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "debug", "\\u", "values_", "(_", "X_", ")_", "[_", "0_", "]_", "._", "shape_", ")_", "._", "astype_", "(_", "theano_", "._", "config_", "._", "float", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "hat_", "=_", "mlp", "_", "._", "fpro", "p_", "(_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "call", " ", "shou", "ld", " ", "not", " ", "raise", " ", "any", " ", "error", ":_", "\\u\\u\\uNL\\u\\u\\u_", "ave_", "=_", "elem", "wis", "e\\u", "kl_", "(_", "Y_", ",_", "Y", "\\u", "hat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "calls", " ", "shou", "ld", " ", "raise", " ", "Value", "Error", " ", "exception", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "._", "tag_", "._", "test\\u", "value_", "[_", "2_", "]_", "[_", "3_", "]_", "=_", "1.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "testing_", "._", "assert", "\\u", "raises_", "(_", "Value", "Error_", ",_", "elem", "wis", "e\\u", "kl_", ",_", "Y_", ",_", "Y", "\\u", "hat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "._", "tag_", "._", "test\\u", "value_", "[_", "2_", "]_", "[_", "3_", "]_", "=_", "-_", "0.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "testing_", "._", "assert", "\\u", "raises_", "(_", "Value", "Error_", ",_", "elem", "wis", "e\\u", "kl_", ",_", "Y_", ",_", "Y", "\\u", "hat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "theano_", "._", "config_", "._", "compute", "\\u", "test\\u", "value_", "=_", "init", "\\u", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "arg", "\\u", "of", "\\u", "sigm", "oid", "\\u", "bad_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", "s", " ", "tha", "t", " ", "arg", "\\u", "of", "\\u", "sigm", "oid", " ", "raise", "s", " ", "an", " ", "error", " ", "whe", "n", " ", "give", "n", " ", "a", " ", "bad", " ", "input", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "X_", "=_", "T_", "._", "matrix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y_", "=_", "T_", "._", "nnet", "_", "._", "softmax_", "(_", "X_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Z_", "=_", "arg", "\\u", "of", "\\u", "sigmoid_", "(_", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "False_", "#", " ", "Sho", "ul", "d", " ", "have", " ", "failed_" ]
[ 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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2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
google/cauliflowervest/src/cauliflowervest/server/handlers/bitlocker.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyright 2011 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\"\"\"Module to handle interaction with a BitLocker.\"\"\"\n\n\n\n\nimport datetime\nimport logging\n\nfrom cauliflowervest.server import handlers\nfrom cauliflowervest.server import models\nfrom cauliflowervest.server import settings\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BitLocker(handlers.BitLockerAccessHandler):\n \"\"\"Handler for /bitlocker URL.\"\"\"\n\n\n\n", "metadata": "root.BitLocker", "header": "['module', '___EOS___']", "index": 30 }, { "content": " def get(self, volume_uuid=None): # pylint: disable=g-bad-name\n \"\"\"Handles GET requests.\"\"\"\n if volume_uuid is not None:\n volume_uuid = volume_uuid.upper()\n super(BitLocker, self).get(volume_uuid)", "metadata": "root.BitLocker.get", "header": "['class', 'BitLocker', '(', 'handlers', '.', 'BitLockerAccessHandler', ')', ':', '___EOS___']", "index": 34 }, { "content": " def _CreateNewSecretEntity(self, unused_owner, volume_uuid, secret):\n return models.BitLockerVolume(\n volume_uuid=volume_uuid,\n recovery_key=str(secret))", "metadata": "root.BitLocker._CreateNewSecretEntity", "header": "['class', 'BitLocker', '(', 'handlers', '.', 'BitLockerAccessHandler', ')', ':', '___EOS___']", "index": 40 }, { "content": " def SanitizeEntityValue(self, prop_name, value):\n if prop_name == 'when_created':\n value = value.strip()\n try:\n return datetime.datetime.strptime(value, '%Y%m%d%H%M%S.0Z')\n except ValueError:\n logging.error('Unknown when_created format: %r', value)\n return None\n return super(BitLocker, self).SanitizeEntityValue(prop_name, value)", "metadata": "root.BitLocker.SanitizeEntityValue", "header": "['class', 'BitLocker', '(', 'handlers', '.', 'BitLockerAccessHandler', ')', ':', '___EOS___']", "index": 45 } ]
[ { "span": "from cauliflowervest.server import settings", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 43 } ]
[]
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", " ", "2011", " ", "Goo", "gle", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", "-", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Modul", "e", " ", "to", " ", "handle", " ", "interacti", "on", " ", "with", " ", "a", " ", "Bit", "Locke", "r", ".\"\"\"_", "\\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_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "cau", "lif", "lower", "ves", "t_", "._", "server_", "import_", "handlers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cau", "lif", "lower", "ves", "t_", "._", "server_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cau", "lif", "lower", "ves", "t_", "._", "server_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Bit", "Locke", "r_", "(_", "handlers_", "._", "Bit", "Locke", "r", "Access", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", "r", " ", "for", " ", "/", "bit", "lock", "er", " ", "URL", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Bit", "Locke", "r_", "(_", "handlers_", "._", "Bit", "Locke", "r", "Access", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "volume", "\\u", "uuid_", "=_", "None_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "g", "-", "bad", "-", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Handle", "s", " ", "GET", " ", "request", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "volume", "\\u", "uuid_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "volume", "\\u", "uuid_", "=_", "volume", "\\u", "uuid_", "._", "upper_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Bit", "Locke", "r_", ",_", "self_", ")_", "._", "get_", "(_", "volume", "\\u", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "Locke", "r_", "(_", "handlers_", "._", "Bit", "Locke", "r", "Access", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Creat", "e", "New", "Sec", "ret", "Entity_", "(_", "self_", ",_", "unu", "sed", "\\u", "owner_", ",_", "volume", "\\u", "uuid_", ",_", "secret_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "models_", "._", "Bit", "Locke", "r", "Volume_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "volume", "\\u", "uuid_", "=_", "volume", "\\u", "uuid_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "recover", "y", "\\u", "key_", "=_", "str_", "(_", "secret_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bit", "Locke", "r_", "(_", "handlers_", "._", "Bit", "Locke", "r", "Access", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Sanit", "ize", "Entit", "y", "Value_", "(_", "self_", ",_", "prop", "\\u", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prop", "\\u", "name_", "==_", "'", "whe", "n", "\\u", "created", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "value_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "value_", ",_", "'%", "Y", "%", "m", "%", "d", "%", "H", "%", "M", "%", "S", ".0", "Z", "'_", ")_", "\\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 ", " _", "logging_", "._", "error_", "(_", "'", "Un", "know", "n", " ", "whe", "n", "\\u", "created", " ", "format", ":", " ", "%", "r", "'_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Bit", "Locke", "r_", ",_", "self_", ")_", "._", "Sanit", "ize", "Entit", "y", "Value_", "(_", "prop", "\\u", "name_", ",_", "value_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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=4:softtabstop=4:smarttab:expandtab\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\n\"\"\"\nStorage unit tests.\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport unittest\n\n\nfrom pycopia import db\nfrom pycopia.db import types\nfrom pycopia.db import tables\nfrom pycopia.db import models\nfrom pycopia.db import cli\nfrom pycopia.db import config\n#from pycopia.db import webhelpers\n\n\n\n\n\nif __name__ == '__main__':\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class StorageTests(unittest.TestCase):\n\n", "metadata": "root.StorageTests", "header": "['module', '___EOS___']", "index": 38 }, { "content": " def setUp(self):\n pass", "metadata": "root.StorageTests.setUp", "header": "['class', 'StorageTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 40 }, { "content": " def tearDown(self):\n pass", "metadata": "root.StorageTests.tearDown", "header": "['class', 'StorageTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 43 } ]
[ { "span": "from pycopia import db", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 22 }, { "span": "from pycopia.db import types", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 28 }, { "span": "from pycopia.db import tables", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 29 }, { "span": "from pycopia.db import models", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 29 }, { "span": "from pycopia.db import cli", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 26 }, { "span": "from pycopia.db import config", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python", "2.7", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "ts", "=", "4", ":", "sw", "=", "4", ":", "soft", "tabs", "top", "=", "4", ":", "smart", "tab", ":", "expand", "tab_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Stor", "age", " ", "unit", " ", "tests", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pycopia_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "._", "db_", "import_", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "._", "db_", "import_", "tables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "._", "db_", "import_", "cli_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pycopia_", "._", "db_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "from", " ", "pyco", "pia", ".", "db", " ", "import", " ", "web", "helpers_", "\\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\\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_", "Stor", "age", "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_", "[SEP]_", "class_", "Stor", "age", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stor", "age", "Tests_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "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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, 0, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 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
matagus/django-planet/planet/south_migrations/0006_auto__chg_field_generator_version.py
[ { "content": "# encoding: utf-8\n# python 3.x compatibility helpers\nfrom __future__ import unicode_literals\n\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 'planet.author': {\n 'Meta': {'ordering': \"('name', 'email')\", 'object_name': 'Author'},\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'profile_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})\n },\n 'planet.blog': {\n 'Meta': {'ordering': \"('title', 'url')\", 'object_name': 'Blog'},\n 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),\n 'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '200', 'db_index': 'True'})\n },\n 'planet.category': {\n 'Meta': {'ordering': \"('title', 'date_created')\", 'object_name': 'Category'},\n 'date_created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})\n },\n 'planet.enclosure': {\n 'Meta': {'ordering': \"('post', 'mime_type', 'link')\", 'object_name': 'Enclosure'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'length': ('django.db.models.fields.CharField', [], {'max_length': '20'}),\n 'link': ('django.db.models.fields.URLField', [], {'max_length': '500', 'db_index': 'True'}),\n 'mime_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),\n 'post': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Post']\"})\n },\n 'planet.feed': {\n 'Meta': {'ordering': \"('title', 'url')\", 'object_name': 'Feed'},\n 'blog': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Blog']\", 'null': 'True', 'blank': 'True'}),\n 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Category']\", 'null': 'True', 'blank': 'True'}),\n 'etag': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '50', 'null': 'True', 'blank': 'True'}),\n 'generator': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Generator']\", 'null': 'True', 'blank': 'True'}),\n 'guid': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'icon_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'image_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'info': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),\n 'language': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),\n 'last_checked': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'last_modified': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),\n 'rights': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['sites.Site']\", 'null': 'True', 'blank': 'True'}),\n 'subtitle': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}),\n 'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '200', 'db_index': 'True'})\n },\n 'planet.feedlink': {\n 'Meta': {'ordering': \"('feed', 'rel', 'mime_type')\", 'object_name': 'FeedLink'},\n 'feed': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Feed']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'link': ('django.db.models.fields.URLField', [], {'max_length': '500', 'db_index': 'True'}),\n 'mime_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),\n 'rel': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})\n },\n 'planet.generator': {\n 'Meta': {'ordering': \"('name', 'version')\", 'unique_together': \"(('name', 'link', 'version'),)\", 'object_name': 'Generator'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'version': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})\n },\n 'planet.post': {\n 'Meta': {'ordering': \"('-date_created', '-date_modified')\", 'unique_together': \"(('feed', 'guid'),)\", 'object_name': 'Post'},\n 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['planet.Author']\", 'through': \"orm['planet.PostAuthorData']\", 'symmetrical': 'False'}),\n 'comments_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'content': ('django.db.models.fields.TextField', [], {}),\n 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'date_modified': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),\n 'feed': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Feed']\"}),\n 'guid': ('django.db.models.fields.TextField', [], {'db_index': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),\n 'url': ('django.db.models.fields.URLField', [], {'max_length': '1000', 'db_index': 'True'})\n },\n 'planet.postauthordata': {\n 'Meta': {'ordering': \"('author', 'post', 'is_contributor')\", 'object_name': 'PostAuthorData'},\n 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Author']\"}),\n 'date_created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_contributor': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'post': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Post']\"})\n },\n 'planet.postlink': {\n 'Meta': {'ordering': \"('post', 'title', 'rel')\", 'object_name': 'PostLink'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'link': ('django.db.models.fields.URLField', [], {'max_length': '500', 'db_index': 'True'}),\n 'mime_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),\n 'post': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['planet.Post']\"}),\n 'rel': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': '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 = ['planet']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 9 }, { "content": " def forwards(self, orm):\n\n # Changing field 'Generator.version'\n db.alter_column('planet_generator', 'version', self.gf('django.db.models.fields.CharField')(max_length=200, null=True))", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 11 }, { "content": " def backwards(self, orm):\n\n # Changing field 'Generator.version'\n db.alter_column('planet_generator', 'version', self.gf('django.db.models.fields.CharField')(max_length=5, null=True))", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "import datetime", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 15 }, { "span": "from django.db import models", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "python", " ", "3", ".", "x", " ", "compatibility", " ", "helpers_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "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_", "'", "planet", ".", "author", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',", " ", "'", "email", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Author", "'_", "}_", ",_", "\\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_", "'", "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", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "profile", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "blog", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "title", "',", " ", "'", "url", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Blog", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "category", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "title", "',", " ", "'", "date", "\\u", "created", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Cate", "gory", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "enclosure", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "post", "',", " ", "'", "mime", "\\u", "type", "',", " ", "'", "link", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Enc", "los", "ure", "'_", "}_", ",_", "\\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_", "'", "length", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mime", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "post", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Post", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "feed", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "title", "',", " ", "'", "url", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Feed", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blog", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Blog", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "category", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Cate", "gory", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "eta", "g", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "generat", "or", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Generat", "or", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "guid", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "icon", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "image", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "info", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "language", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "checke", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rights", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "site", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "sites", ".", "Site", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subtit", "le", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "feed", "link", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "feed", "',", " ", "'", "rel", "',", " ", "'", "mime", "\\u", "type", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Feed", "Link", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Feed", "']\"_", "}_", ")_", ",_", "\\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_", "'", "link", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mime", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rel", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "generat", "or", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',", " ", "'", "version", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "name", "',", " ", "'", "link", "',", " ", "'", "version", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Generat", "or", "'_", "}_", ",_", "\\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_", "'", "link", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "post", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'-", "date", "\\u", "created", "',", " ", "'-", "date", "\\u", "modifi", "ed", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "feed", "',", " ", "'", "guid", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Post", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "author", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Author", "']\"_", ",_", "'", "through", "'_", ":_", "\"", "orm", "['", "planet", ".", "Post", "Author", "Data", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "s", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Feed", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "guid", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "posta", "uthor", "data", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "author", "',", " ", "'", "post", "',", " ", "'", "is", "\\u", "contributor", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Post", "Author", "Data", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "author", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Author", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "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_", "'", "is", "\\u", "contributor", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "post", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Post", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "post", "link", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "post", "',", " ", "'", "title", "',", " ", "'", "rel", "')\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Post", "Link", "'_", "}_", ",_", "\\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_", "'", "link", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "500", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mime", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "post", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Post", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rel", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "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_", "=_", "[_", "'", "planet", "'_", "]_", "[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_", "#", " ", "Chang", "ing", " ", "field", " ", "'", "Generat", "or", ".", "version", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "alter", "\\u", "column_", "(_", "'", "planet", "\\u", "generat", "or", "'_", ",_", "'", "version", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "200_", ",_", "null_", "=_", "True_", ")_", ")_", "\\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_", "#", " ", "Chang", "ing", " ", "field", " ", "'", "Generat", "or", ".", "version", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "alter", "\\u", "column_", "(_", "'", "planet", "\\u", "generat", "or", "'_", ",_", "'", "version", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "5_", ",_", "null_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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ock, patch\nimport six\nfrom . import unittest\n\nfrom kafka import SimpleClient\nfrom kafka.conn import KafkaConnection\nfrom kafka.errors import (\n KafkaUnavailableError, LeaderNotAvailableError, KafkaTimeoutError,\n UnknownTopicOrPartitionError, ConnectionError, FailedPayloadsError)\nfrom kafka.future import Future\nfrom kafka.protocol import KafkaProtocol, create_message\nfrom kafka.protocol.metadata import MetadataResponse\nfrom kafka.structs import ProduceRequestPayload, BrokerMetadata, TopicPartition\n\nfrom test.testutil import Timer\n\nNO_ERROR = 0\nUNKNOWN_TOPIC_OR_PARTITION = 3\nNO_LEADER = 5\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def mock_conn(conn, success=True):\n mocked = MagicMock()\n mocked.connected.return_value = True\n if success:\n mocked.send.return_value = Future().success(True)\n else:\n mocked.send.return_value = Future().failure(Exception())\n conn.return_value = mocked", "metadata": "root.mock_conn", "header": "['module', '___EOS___']", "index": 24 }, { "content": "class TestSimpleClient(unittest.TestCase):\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestSimpleClient", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def test_init_with_list(self):\n with patch.object(SimpleClient, 'load_metadata_for_topics'):\n client = SimpleClient(hosts=['kafka01:9092', 'kafka02:9092', 'kafka03:9092'])\n\n self.assertEqual(\n sorted([('kafka01', 9092, socket.AF_UNSPEC), ('kafka02', 9092, socket.AF_UNSPEC),\n ('kafka03', 9092, socket.AF_UNSPEC)]),\n sorted(client.hosts))", "metadata": "root.TestSimpleClient.test_init_with_list", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": " def test_init_with_csv(self):\n with patch.object(SimpleClient, 'load_metadata_for_topics'):\n client = SimpleClient(hosts='kafka01:9092,kafka02:9092,kafka03:9092')\n\n self.assertEqual(\n sorted([('kafka01', 9092, socket.AF_UNSPEC), ('kafka02', 9092, socket.AF_UNSPEC),\n ('kafka03', 9092, socket.AF_UNSPEC)]),\n sorted(client.hosts))", "metadata": "root.TestSimpleClient.test_init_with_csv", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 44 }, { "content": " def test_init_with_unicode_csv(self):\n with patch.object(SimpleClient, 'load_metadata_for_topics'):\n client = SimpleClient(hosts=u'kafka01:9092,kafka02:9092,kafka03:9092')\n\n self.assertEqual(\n sorted([('kafka01', 9092, socket.AF_UNSPEC), ('kafka02', 9092, socket.AF_UNSPEC),\n ('kafka03', 9092, socket.AF_UNSPEC)]),\n sorted(client.hosts))", "metadata": "root.TestSimpleClient.test_init_with_unicode_csv", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 53 }, { "content": " @patch.object(SimpleClient, '_get_conn')\n @patch.object(SimpleClient, 'load_metadata_for_topics')\n def test_send_broker_unaware_request_fail(self, load_metadata, conn):\n mocked_conns = {\n ('kafka01', 9092): MagicMock(),\n ('kafka02', 9092): MagicMock()\n }\n for val in mocked_conns.values():\n mock_conn(val, success=False)\n\n def mock_get_conn(host, port, afi):\n return mocked_conns[(host, port)]\n conn.side_effect = mock_get_conn\n\n client = SimpleClient(hosts=['kafka01:9092', 'kafka02:9092'])\n\n req = KafkaProtocol.encode_metadata_request()\n with self.assertRaises(KafkaUnavailableError):\n client._send_broker_unaware_request(payloads=['fake request'],\n encoder_fn=MagicMock(return_value='fake encoded message'),\n decoder_fn=lambda x: x)\n\n for key, conn in six.iteritems(mocked_conns):\n conn.send.assert_called_with('fake encoded message')", "metadata": "root.TestSimpleClient.test_send_broker_unaware_request_fail", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 62 }, { "content": " def test_send_broker_unaware_request(self):\n mocked_conns = {\n ('kafka01', 9092): MagicMock(),\n ('kafka02', 9092): MagicMock(),\n ('kafka03', 9092): MagicMock()\n }\n # inject KafkaConnection side effects\n mock_conn(mocked_conns[('kafka01', 9092)], success=False)\n mock_conn(mocked_conns[('kafka03', 9092)], success=False)\n future = Future()\n mocked_conns[('kafka02', 9092)].send.return_value = future\n mocked_conns[('kafka02', 9092)].recv.side_effect = lambda: future.success('valid response')\n\n def mock_get_conn(host, port, afi):\n return mocked_conns[(host, port)]\n\n # patch to avoid making requests before we want it\n with patch.object(SimpleClient, 'load_metadata_for_topics'):\n with patch.object(SimpleClient, '_get_conn', side_effect=mock_get_conn):\n\n client = SimpleClient(hosts='kafka01:9092,kafka02:9092')\n resp = client._send_broker_unaware_request(payloads=['fake request'],\n encoder_fn=MagicMock(),\n decoder_fn=lambda x: x)\n\n self.assertEqual('valid response', resp)\n mocked_conns[('kafka02', 9092)].recv.assert_called_once_with()", "metadata": "root.TestSimpleClient.test_send_broker_unaware_request", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 87 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_load_metadata(self, protocol, conn):\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_ERROR, 'topic_1', [\n (NO_ERROR, 0, 1, [1, 2], [1, 2])\n ]),\n (NO_ERROR, 'topic_noleader', [\n (NO_LEADER, 0, -1, [], []),\n (NO_LEADER, 1, -1, [], []),\n ]),\n (NO_LEADER, 'topic_no_partitions', []),\n (UNKNOWN_TOPIC_OR_PARTITION, 'topic_unknown', []),\n (NO_ERROR, 'topic_3', [\n (NO_ERROR, 0, 0, [0, 1], [0, 1]),\n (NO_ERROR, 1, 1, [1, 0], [1, 0]),\n (NO_ERROR, 2, 0, [0, 1], [0, 1])\n ])\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n # client loads metadata at init\n client = SimpleClient(hosts=['broker_1:4567'])\n self.assertDictEqual({\n TopicPartition('topic_1', 0): brokers[1],\n TopicPartition('topic_noleader', 0): None,\n TopicPartition('topic_noleader', 1): None,\n TopicPartition('topic_3', 0): brokers[0],\n TopicPartition('topic_3', 1): brokers[1],\n TopicPartition('topic_3', 2): brokers[0]},\n client.topics_to_brokers)\n\n # if we ask for metadata explicitly, it should raise errors\n with self.assertRaises(LeaderNotAvailableError):\n client.load_metadata_for_topics('topic_no_partitions')\n\n with self.assertRaises(UnknownTopicOrPartitionError):\n client.load_metadata_for_topics('topic_unknown')\n\n # This should not raise\n client.load_metadata_for_topics('topic_no_leader')", "metadata": "root.TestSimpleClient.test_load_metadata", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 115 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_has_metadata_for_topic(self, protocol, conn):\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_LEADER, 'topic_still_creating', []),\n (UNKNOWN_TOPIC_OR_PARTITION, 'topic_doesnt_exist', []),\n (NO_ERROR, 'topic_noleaders', [\n (NO_LEADER, 0, -1, [], []),\n (NO_LEADER, 1, -1, [], []),\n ]),\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n\n # Topics with no partitions return False\n self.assertFalse(client.has_metadata_for_topic('topic_still_creating'))\n self.assertFalse(client.has_metadata_for_topic('topic_doesnt_exist'))\n\n # Topic with partition metadata, but no leaders return True\n self.assertTrue(client.has_metadata_for_topic('topic_noleaders'))", "metadata": "root.TestSimpleClient.test_has_metadata_for_topic", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 165 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol.decode_metadata_response')\n def test_ensure_topic_exists(self, decode_metadata_response, conn):\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_LEADER, 'topic_still_creating', []),\n (UNKNOWN_TOPIC_OR_PARTITION, 'topic_doesnt_exist', []),\n (NO_ERROR, 'topic_noleaders', [\n (NO_LEADER, 0, -1, [], []),\n (NO_LEADER, 1, -1, [], []),\n ]),\n ]\n decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n\n with self.assertRaises(UnknownTopicOrPartitionError):\n client.ensure_topic_exists('topic_doesnt_exist', timeout=1)\n\n with self.assertRaises(KafkaTimeoutError):\n client.ensure_topic_exists('topic_still_creating', timeout=1)\n\n # This should not raise\n client.ensure_topic_exists('topic_noleaders', timeout=1)", "metadata": "root.TestSimpleClient.test_ensure_topic_exists", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 195 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_get_leader_for_partitions_reloads_metadata(self, protocol, conn):\n \"Get leader for partitions reload metadata if it is not available\"\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_LEADER, 'topic_no_partitions', [])\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n\n # topic metadata is loaded but empty\n self.assertDictEqual({}, client.topics_to_brokers)\n\n topics = [\n (NO_ERROR, 'topic_one_partition', [\n (NO_ERROR, 0, 0, [0, 1], [0, 1])\n ])\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n # calling _get_leader_for_partition (from any broker aware request)\n # will try loading metadata again for the same topic\n leader = client._get_leader_for_partition('topic_one_partition', 0)\n\n self.assertEqual(brokers[0], leader)\n self.assertDictEqual({\n TopicPartition('topic_one_partition', 0): brokers[0]},\n client.topics_to_brokers)", "metadata": "root.TestSimpleClient.test_get_leader_for_partitions_reloads_metadata", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 227 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_get_leader_for_unassigned_partitions(self, protocol, conn):\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_LEADER, 'topic_no_partitions', []),\n (UNKNOWN_TOPIC_OR_PARTITION, 'topic_unknown', []),\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n\n self.assertDictEqual({}, client.topics_to_brokers)\n\n with self.assertRaises(LeaderNotAvailableError):\n client._get_leader_for_partition('topic_no_partitions', 0)\n\n with self.assertRaises(UnknownTopicOrPartitionError):\n client._get_leader_for_partition('topic_unknown', 0)", "metadata": "root.TestSimpleClient.test_get_leader_for_unassigned_partitions", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 265 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_get_leader_exceptions_when_noleader(self, protocol, conn):\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_ERROR, 'topic_noleader', [\n (NO_LEADER, 0, -1, [], []),\n (NO_LEADER, 1, -1, [], []),\n ]),\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n self.assertDictEqual(\n {\n TopicPartition('topic_noleader', 0): None,\n TopicPartition('topic_noleader', 1): None\n },\n client.topics_to_brokers)\n\n # No leader partitions -- raise LeaderNotAvailableError\n with self.assertRaises(LeaderNotAvailableError):\n self.assertIsNone(client._get_leader_for_partition('topic_noleader', 0))\n with self.assertRaises(LeaderNotAvailableError):\n self.assertIsNone(client._get_leader_for_partition('topic_noleader', 1))\n\n # Unknown partitions -- raise UnknownTopicOrPartitionError\n with self.assertRaises(UnknownTopicOrPartitionError):\n self.assertIsNone(client._get_leader_for_partition('topic_noleader', 2))\n\n topics = [\n (NO_ERROR, 'topic_noleader', [\n (NO_ERROR, 0, 0, [0, 1], [0, 1]),\n (NO_ERROR, 1, 1, [1, 0], [1, 0])\n ]),\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n self.assertEqual(brokers[0], client._get_leader_for_partition('topic_noleader', 0))\n self.assertEqual(brokers[1], client._get_leader_for_partition('topic_noleader', 1))", "metadata": "root.TestSimpleClient.test_get_leader_exceptions_when_noleader", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 292 }, { "content": " @patch.object(SimpleClient, '_get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_send_produce_request_raises_when_noleader(self, protocol, conn):\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (NO_ERROR, 'topic_noleader', [\n (NO_LEADER, 0, -1, [], []),\n (NO_LEADER, 1, -1, [], []),\n ]),\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n\n requests = [ProduceRequestPayload(\n \"topic_noleader\", 0,\n [create_message(\"a\"), create_message(\"b\")])]\n\n with self.assertRaises(FailedPayloadsError):\n client.send_produce_request(requests)", "metadata": "root.TestSimpleClient.test_send_produce_request_raises_when_noleader", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 339 }, { "content": " @patch('kafka.SimpleClient._get_conn')\n @patch('kafka.client.KafkaProtocol')\n def test_send_produce_request_raises_when_topic_unknown(self, protocol, conn):\n\n mock_conn(conn)\n\n brokers = [\n BrokerMetadata(0, 'broker_1', 4567),\n BrokerMetadata(1, 'broker_2', 5678)\n ]\n\n topics = [\n (UNKNOWN_TOPIC_OR_PARTITION, 'topic_doesnt_exist', []),\n ]\n protocol.decode_metadata_response.return_value = MetadataResponse[0](brokers, topics)\n\n client = SimpleClient(hosts=['broker_1:4567'])\n\n requests = [ProduceRequestPayload(\n \"topic_doesnt_exist\", 0,\n [create_message(\"a\"), create_message(\"b\")])]\n\n with self.assertRaises(FailedPayloadsError):\n client.send_produce_request(requests)", "metadata": "root.TestSimpleClient.test_send_produce_request_raises_when_topic_unknown", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 366 }, { "content": " def test_timeout(self):\n def _timeout(*args, **kwargs):\n timeout = args[1]\n sleep(timeout)\n raise socket.timeout\n\n with patch.object(socket, \"create_connection\", side_effect=_timeout):\n\n with Timer() as t:\n with self.assertRaises(ConnectionError):\n KafkaConnection(\"nowhere\", 1234, 1.0)\n self.assertGreaterEqual(t.interval, 1.0)", "metadata": "root.TestSimpleClient.test_timeout", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 391 }, { "content": " def test_correlation_rollover(self):\n with patch.object(SimpleClient, 'load_metadata_for_topics'):\n big_num = 2**31 - 3\n client = SimpleClient(hosts=[], correlation_id=big_num)\n self.assertEqual(big_num + 1, client._next_id())\n self.assertEqual(big_num + 2, client._next_id())\n self.assertEqual(0, client._next_id())", "metadata": "root.TestSimpleClient.test_correlation_rollover", "header": "['class', 'TestSimpleClient', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 404 } ]
[ { "span": "from mock import ANY, MagicMock, patch", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 38 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mock_", "import_", "ANY_", ",_", "Mag", "ic", "Mock_", ",_", "patch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "kaf", "ka_", "import_", "Simple", "Client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "conn_", "import_", "Ka", "fk", "a", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "errors_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Ka", "fk", "a", "Una", "vail", "able", "Error_", ",_", "Leader", "Not", "Avail", "able", "Error_", ",_", "Ka", "fk", "a", "Time", "out", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Un", "know", "n", "Topic", "Or", "Partition", "Error_", ",_", "Connect", "ion", "Error_", ",_", "Fail", "ed", "Pay", "load", "s", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "future_", "import_", "Future_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "protocol_", "import_", "Ka", "fk", "a", "Protocol_", ",_", "create", "\\u", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "protocol_", "._", "metadata_", "import_", "Meta", "data", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "structs_", "import_", "Produce", "Request", "Payload_", ",_", "Broker", "Metadata_", ",_", "Topic", "Partition_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "test_", "._", "testu", "til_", "import_", "Timer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "NO", "\\u", "ERROR_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "UNK", "NOW", "N", "\\u", "TOPIC", "\\u", "OR", "\\u", "PARTITION", "_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "NO", "\\u", "LEA", "DER", "_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "mock", "\\u", "conn_", "(_", "conn_", ",_", "success_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mocked", "_", "=_", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mocked", "_", "._", "connected_", "._", "return", "\\u", "value_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mocked", "_", "._", "send_", "._", "return", "\\u", "value_", "=_", "Future_", "(_", ")_", "._", "success_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mocked", "_", "._", "send_", "._", "return", "\\u", "value_", "=_", "Future_", "(_", ")_", "._", "failure_", "(_", "Exception_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conn_", "._", "return", "\\u", "value_", "=_", "mocked", "_", "\\u\\u\\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", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "init", "\\u", "with", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'", "load", "\\u", "metadata", "\\u", "for", "\\u", "topic", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "kaf", "ka", "01", ":", "909", "2", "'_", ",_", "'", "kaf", "ka", "02", ":", "909", "2", "'_", ",_", "'", "kaf", "ka", "03", ":", "909", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "[_", "(_", "'", "kaf", "ka", "01", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", ",_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "03", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "client_", "._", "hosts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u", "with", "\\u", "csv_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'", "load", "\\u", "metadata", "\\u", "for", "\\u", "topic", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "'", "kaf", "ka", "01", ":", "909", "2", ",", "kaf", "ka", "02", ":", "909", "2", ",", "kaf", "ka", "03", ":", "909", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "[_", "(_", "'", "kaf", "ka", "01", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", ",_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "03", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "client_", "._", "hosts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "init", "\\u", "with", "\\u", "unicode", "\\u", "csv_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'", "load", "\\u", "metadata", "\\u", "for", "\\u", "topic", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "u", "'", "kaf", "ka", "01", ":", "909", "2", ",", "kaf", "ka", "02", ":", "909", "2", ",", "kaf", "ka", "03", ":", "909", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "[_", "(_", "'", "kaf", "ka", "01", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", ",_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "03", "'_", ",_", "909", "2_", ",_", "socket_", "._", "AF", "\\u", "UNSPEC", "_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "client_", "._", "hosts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'", "load", "\\u", "metadata", "\\u", "for", "\\u", "topic", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "send", "\\u", "broker", "\\u", "una", "ware", "\\u", "request", "\\u", "fail_", "(_", "self_", ",_", "load", "\\u", "metadata_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mocked", "\\u", "conns_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "01", "'_", ",_", "909", "2_", ")_", ":_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ")_", ":_", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "val_", "in_", "mocked", "\\u", "conns_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "val_", ",_", "success_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mock", "\\u", "get", "\\u", "conn_", "(_", "host_", ",_", "port_", ",_", "afi", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mocked", "\\u", "conns_", "[_", "(_", "host_", ",_", "port_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conn_", "._", "side", "\\u", "effect_", "=_", "mock", "\\u", "get", "\\u", "conn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "kaf", "ka", "01", ":", "909", "2", "'_", ",_", "'", "kaf", "ka", "02", ":", "909", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "req_", "=_", "Ka", "fk", "a", "Protocol_", "._", "encode", "\\u", "metadata", "\\u", "request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Ka", "fk", "a", "Una", "vail", "able", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "\\u", "send", "\\u", "broker", "\\u", "una", "ware", "\\u", "request_", "(_", "payloads_", "=_", "[_", "'", "fake", " ", "request", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encode", "r", "\\u", "fn_", "=_", "Mag", "ic", "Mock_", "(_", "return", "\\u", "value_", "=_", "'", "fake", " ", "encode", "d", " ", "message", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decode", "r", "\\u", "fn_", "=_", "lambda_", "x_", ":_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "conn_", "in_", "six_", "._", "iteritems_", "(_", "mocked", "\\u", "conns_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "send_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "'", "fake", " ", "encode", "d", " ", "message", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "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", "send", "\\u", "broker", "\\u", "una", "ware", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mocked", "\\u", "conns_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "01", "'_", ",_", "909", "2_", ")_", ":_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ")_", ":_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "kaf", "ka", "03", "'_", ",_", "909", "2_", ")_", ":_", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "inject", " ", "Ka", "fk", "a", "Connect", "ion", " ", "side", " ", "effects_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "conn_", "(_", "mocked", "\\u", "conns_", "[_", "(_", "'", "kaf", "ka", "01", "'_", ",_", "909", "2_", ")_", "]_", ",_", "success_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "conn_", "(_", "mocked", "\\u", "conns_", "[_", "(_", "'", "kaf", "ka", "03", "'_", ",_", "909", "2_", ")_", "]_", ",_", "success_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "future_", "=_", "Future_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mocked", "\\u", "conns_", "[_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ")_", "]_", "._", "send_", "._", "return", "\\u", "value_", "=_", "future_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mocked", "\\u", "conns_", "[_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ")_", "]_", "._", "recv_", "._", "side", "\\u", "effect_", "=_", "lambda_", ":_", "future_", "._", "success_", "(_", "'", "valid", " ", "response", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "mock", "\\u", "get", "\\u", "conn_", "(_", "host_", ",_", "port_", ",_", "afi", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mocked", "\\u", "conns_", "[_", "(_", "host_", ",_", "port_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "patch", " ", "to", " ", "avoid", " ", "mak", "ing", " ", "request", "s", " ", "bef", "ore", " ", "we", " ", "want", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'", "load", "\\u", "metadata", "\\u", "for", "\\u", "topic", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'\\u", "get", "\\u", "conn", "'_", ",_", "side", "\\u", "effect_", "=_", "mock", "\\u", "get", "\\u", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "'", "kaf", "ka", "01", ":", "909", "2", ",", "kaf", "ka", "02", ":", "909", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "client_", "._", "\\u", "send", "\\u", "broker", "\\u", "una", "ware", "\\u", "request_", "(_", "payloads_", "=_", "[_", "'", "fake", " ", "request", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encode", "r", "\\u", "fn_", "=_", "Mag", "ic", "Mock_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decode", "r", "\\u", "fn_", "=_", "lambda_", "x_", ":_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "'", "valid", " ", "response", "'_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mocked", "\\u", "conns_", "[_", "(_", "'", "kaf", "ka", "02", "'_", ",_", "909", "2_", ")_", "]_", "._", "recv_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "load", "\\u", "metadata_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "1", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "0_", ",_", "1_", ",_", "[_", "1_", ",_", "2_", "]_", ",_", "[_", "1_", ",_", "2_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "0_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "1_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "'", "topic", "\\u", "no", "\\u", "partit", "ion", "s", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "UNK", "NOW", "N", "\\u", "TOPIC", "\\u", "OR", "\\u", "PARTITION", "_", ",_", "'", "topic", "\\u", "unknown", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "3", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "0_", ",_", "0_", ",_", "[_", "0_", ",_", "1_", "]_", ",_", "[_", "0_", ",_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "1_", ",_", "1_", ",_", "[_", "1_", ",_", "0_", "]_", ",_", "[_", "1_", ",_", "0_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "2_", ",_", "0_", ",_", "[_", "0_", ",_", "1_", "]_", ",_", "[_", "0_", ",_", "1_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "client", " ", "load", "s", " ", "metadata", " ", "at", " ", "init_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Dict", "Equal_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "1", "'_", ",_", "0_", ")_", ":_", "broker", "s_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "0_", ")_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "1_", ")_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "3", "'_", ",_", "0_", ")_", ":_", "broker", "s_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "3", "'_", ",_", "1_", ")_", ":_", "broker", "s_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "3", "'_", ",_", "2_", ")_", ":_", "broker", "s_", "[_", "0_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "topic", "s", "\\u", "to", "\\u", "broker", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "ask", " ", "for", " ", "metadata", " ", "explicit", "ly", ",", " ", "it", " ", "shou", "ld", " ", "raise", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Leader", "Not", "Avail", "able", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "load", "\\u", "metadata", "\\u", "for", "\\u", "topics_", "(_", "'", "topic", "\\u", "no", "\\u", "partit", "ion", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Un", "know", "n", "Topic", "Or", "Partition", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "load", "\\u", "metadata", "\\u", "for", "\\u", "topics_", "(_", "'", "topic", "\\u", "unknown", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "shou", "ld", " ", "not", " ", "raise_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "client_", "._", "load", "\\u", "metadata", "\\u", "for", "\\u", "topics_", "(_", "'", "topic", "\\u", "no", "\\u", "leader", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "has", "\\u", "metadata", "\\u", "for", "\\u", "topic_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "'", "topic", "\\u", "still", "\\u", "creati", "ng", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "UNK", "NOW", "N", "\\u", "TOPIC", "\\u", "OR", "\\u", "PARTITION", "_", ",_", "'", "topic", "\\u", "doesnt", "\\u", "exist", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "nol", "eader", "s", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "0_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "1_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Topic", "s", " ", "with", " ", "no", " ", "partit", "ion", "s", " ", "return", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "client_", "._", "has", "\\u", "metadata", "\\u", "for", "\\u", "topic_", "(_", "'", "topic", "\\u", "still", "\\u", "creati", "ng", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "client_", "._", "has", "\\u", "metadata", "\\u", "for", "\\u", "topic_", "(_", "'", "topic", "\\u", "doesnt", "\\u", "exist", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Topic", " ", "with", " ", "partit", "ion", " ", "metadata", ",", " ", "but", " ", "no", " ", "leader", "s", " ", "return", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "client_", "._", "has", "\\u", "metadata", "\\u", "for", "\\u", "topic_", "(_", "'", "topic", "\\u", "nol", "eader", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", ".", "decode", "\\u", "metadata", "\\u", "response", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "ensure", "\\u", "topic", "\\u", "exists_", "(_", "self_", ",_", "decode", "\\u", "metadata", "\\u", "response_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "'", "topic", "\\u", "still", "\\u", "creati", "ng", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "UNK", "NOW", "N", "\\u", "TOPIC", "\\u", "OR", "\\u", "PARTITION", "_", ",_", "'", "topic", "\\u", "doesnt", "\\u", "exist", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "nol", "eader", "s", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "0_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "1_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Un", "know", "n", "Topic", "Or", "Partition", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "ensure", "\\u", "topic", "\\u", "exists_", "(_", "'", "topic", "\\u", "doesnt", "\\u", "exist", "'_", ",_", "timeout_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Ka", "fk", "a", "Time", "out", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "ensure", "\\u", "topic", "\\u", "exists_", "(_", "'", "topic", "\\u", "still", "\\u", "creati", "ng", "'_", ",_", "timeout_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "shou", "ld", " ", "not", " ", "raise_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "client_", "._", "ensure", "\\u", "topic", "\\u", "exists_", "(_", "'", "topic", "\\u", "nol", "eader", "s", "'_", ",_", "timeout_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partit", "ion", "s", "\\u", "relo", "ads", "\\u", "metadata_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Get", " ", "leader", " ", "for", " ", "partit", "ion", "s", " ", "relo", "ad", " ", "metadata", " ", "if", " ", "it", " ", "is", " ", "not", " ", "avail", "able", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "'", "topic", "\\u", "no", "\\u", "partit", "ion", "s", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "topic", " ", "metadata", " ", "is", " ", "load", "ed", " ", "but", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Dict", "Equal_", "(_", "{_", "}_", ",_", "client_", "._", "topic", "s", "\\u", "to", "\\u", "broker", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "one", "\\u", "partit", "ion", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "0_", ",_", "0_", ",_", "[_", "0_", ",_", "1_", "]_", ",_", "[_", "0_", ",_", "1_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "calling", " ", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partit", "ion", " ", "(", "from", " ", "any", " ", "broker", " ", "awa", "re", " ", "request", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "try", " ", "load", "ing", " ", "metadata", " ", "again", " ", "for", " ", "the", " ", "same", " ", "topic_", "\\u\\u\\uNL\\u\\u\\u_", "leader_", "=_", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "one", "\\u", "partit", "ion", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "broker", "s_", "[_", "0_", "]_", ",_", "leader_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Dict", "Equal_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "one", "\\u", "partit", "ion", "'_", ",_", "0_", ")_", ":_", "broker", "s_", "[_", "0_", "]_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "topic", "s", "\\u", "to", "\\u", "broker", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "unassign", "ed", "\\u", "partitions_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "'", "topic", "\\u", "no", "\\u", "partit", "ion", "s", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "UNK", "NOW", "N", "\\u", "TOPIC", "\\u", "OR", "\\u", "PARTITION", "_", ",_", "'", "topic", "\\u", "unknown", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Dict", "Equal_", "(_", "{_", "}_", ",_", "client_", "._", "topic", "s", "\\u", "to", "\\u", "broker", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Leader", "Not", "Avail", "able", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "no", "\\u", "partit", "ion", "s", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Un", "know", "n", "Topic", "Or", "Partition", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "unknown", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "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_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "leader", "\\u", "exception", "s", "\\u", "whe", "n", "\\u", "nol", "eader", "_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "0_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "1_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Dict", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "0_", ")_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Topic", "Partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "1_", ")_", ":_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "topic", "s", "\\u", "to", "\\u", "broker", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", " ", "leader", " ", "partit", "ion", "s", " ", "--", " ", "raise", " ", "Leader", "Not", "Avail", "able", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Leader", "Not", "Avail", "able", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is", "None_", "(_", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Leader", "Not", "Avail", "able", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is", "None_", "(_", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "know", "n", " ", "partit", "ion", "s", " ", "--", " ", "raise", " ", "Un", "know", "n", "Topic", "Or", "Partition", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Un", "know", "n", "Topic", "Or", "Partition", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is", "None_", "(_", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "0_", ",_", "0_", ",_", "[_", "0_", ",_", "1_", "]_", ",_", "[_", "0_", ",_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "1_", ",_", "1_", ",_", "[_", "1_", ",_", "0_", "]_", ",_", "[_", "1_", ",_", "0_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "broker", "s_", "[_", "0_", "]_", ",_", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "broker", "s_", "[_", "1_", "]_", ",_", "client_", "._", "\\u", "get", "\\u", "leader", "\\u", "for", "\\u", "partition_", "(_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "send", "\\u", "produce", "\\u", "request", "\\u", "raise", "s", "\\u", "whe", "n", "\\u", "nol", "eader", "_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "ERROR_", ",_", "'", "topic", "\\u", "nol", "eader", "'_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "0_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "NO", "\\u", "LEA", "DER", "_", ",_", "1_", ",_", "-_", "1_", ",_", "[_", "]_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "requests_", "=_", "[_", "Produce", "Request", "Payload_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "topic", "\\u", "nol", "eader", "\"_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "create", "\\u", "message_", "(_", "\"", "a", "\"_", ")_", ",_", "create", "\\u", "message_", "(_", "\"", "b", "\"_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Fail", "ed", "Pay", "load", "s", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "send", "\\u", "produce", "\\u", "request_", "(_", "requests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "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_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "Simple", "Client", ".\\u", "get", "\\u", "conn", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "patch_", "(_", "'", "kaf", "ka", ".", "client", ".", "Ka", "fk", "a", "Proto", "col", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "send", "\\u", "produce", "\\u", "request", "\\u", "raise", "s", "\\u", "whe", "n", "\\u", "topic", "\\u", "unknown_", "(_", "self_", ",_", "protocol_", ",_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "conn_", "(_", "conn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "broker", "s_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "0_", ",_", "'", "broker", "\\u", "1", "'_", ",_", "4567", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Broker", "Metadata_", "(_", "1_", ",_", "'", "broker", "\\u", "2", "'_", ",_", "5678", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "UNK", "NOW", "N", "\\u", "TOPIC", "\\u", "OR", "\\u", "PARTITION", "_", ",_", "'", "topic", "\\u", "doesnt", "\\u", "exist", "'_", ",_", "[_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "protocol_", "._", "decode", "\\u", "metadata", "\\u", "response_", "._", "return", "\\u", "value_", "=_", "Meta", "data", "Response_", "[_", "0_", "]_", "(_", "broker", "s_", ",_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "'", "broker", "\\u", "1", ":", "4567", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "requests_", "=_", "[_", "Produce", "Request", "Payload_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "topic", "\\u", "doesnt", "\\u", "exist", "\"_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "create", "\\u", "message_", "(_", "\"", "a", "\"_", ")_", ",_", "create", "\\u", "message_", "(_", "\"", "b", "\"_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Fail", "ed", "Pay", "load", "s", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "._", "send", "\\u", "produce", "\\u", "request_", "(_", "requests_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "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", "timeout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "timeout_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "args_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "socket_", "._", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "patch_", "._", "object_", "(_", "socket_", ",_", "\"", "create", "\\u", "connecti", "on", "\"_", ",_", "side", "\\u", "effect_", "=_", "\\u", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "Timer_", "(_", ")_", "as_", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "assert", "Raises_", "(_", "Connect", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "Ka", "fk", "a", "Connection_", "(_", "\"", "now", "here", "\"_", ",_", "1234_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Great", "er", "Equal_", "(_", "t_", "._", "interval_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Simple", "Client_", "(_", "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", "correlation", "\\u", "rollo", "ver_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "Simple", "Client_", ",_", "'", "load", "\\u", "metadata", "\\u", "for", "\\u", "topic", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "big", "\\u", "num_", "=_", "2_", "**_", "31_", "-_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "Simple", "Client_", "(_", "hosts_", "=_", "[_", "]_", ",_", "correlation", "\\u", "id_", "=_", "big", "\\u", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "big", "\\u", "num_", "+_", "1_", ",_", "client_", "._", "\\u", "next", "\\u", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "big", "\\u", "num_", "+_", "2_", ",_", "client_", "._", "\\u", "next", "\\u", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "client_", "._", "\\u", "next", "\\u", "id_", "(_", ")_", ")_" ]
[ 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
sassoftware/conary/conary_test/flavortest.py
[ { "content": " def testSimpleUpdates(self):\n self.resetRepository()\n self.resetRoot()\n trove = self.build(recipes.manyFlavors, \"ManyFlavors\")\n v1 = trove.getVersion()\n defFlavor = trove.getFlavor()\n assert(str(defFlavor) == 'readline,ssl')\n\n self.overrideBuildFlavor('~!readline')\n trove = self.build(recipes.manyFlavors, \"ManyFlavors\")\n v = trove.getVersion()\n noReadLine = trove.getFlavor()\n assert(str(noReadLine) == '~!readline,ssl')\n assert(v1 == v)\n\n self.overrideBuildFlavor('~readline')\n\n # basic test w/ readline in the flavor\n self.cfg.flavor = [ deps.parseFlavor('use: ~readline,ssl') ]\n self.updatePkg(self.rootDir, 'manyflavors')\n assert(os.path.exists(self.rootDir + '/etc/readline'))\n\n # now test w/ preferring not readline\n self.resetRoot()\n self._updateFlavor('use: ~!readline')\n self.updatePkg(self.rootDir, 'manyflavors')\n assert(not os.path.exists(self.rootDir + '/etc/readline'))\n\n # now test w/ preferring not readline, but an override\n self.resetRoot()\n self._updateFlavor('use: ~!readline')\n self.updatePkg(self.rootDir, 'manyflavors', flavor = 'use:readline,ssl')\n assert(os.path.exists(self.rootDir + '/etc/readline'))\n\n # now test w/ preferring not allowing readline\n self.resetRoot()\n self._updateFlavor('use: !readline')\n self.updatePkg(self.rootDir, 'manyflavors')\n assert(not os.path.exists(self.rootDir + '/etc/readline'))\n\n self._updateFlavor('use: readline')\n\n trove = self.build(recipes.manyFlavors, \"ManyFlavors\")\n v2 = trove.getVersion()\n assert(defFlavor == trove.getFlavor())\n\n # basic test w/ readline in the flavor\n self.resetRoot()\n self.updatePkg(self.rootDir, 'manyflavors', version = v1)\n assert(os.path.exists(self.rootDir + '/etc/readline'))\n self.updatePkg(self.rootDir, 'manyflavors')\n assert(os.path.exists(self.rootDir + '/etc/readline'))\n self._checkVersion(v2)\n\n # with ~!readline, install the old version, and then update to whatever\n # is availble (which should give us the new version, even though it\n # does use readline)\n self.resetRoot()\n self._updateFlavor('use: ~!readline')\n self.updatePkg(self.rootDir, 'manyflavors', version = v1)\n assert(not os.path.exists(self.rootDir + '/etc/readline'))\n self.updatePkg(self.rootDir, 'manyflavors')\n assert(os.path.exists(self.rootDir + '/etc/readline'))\n self._checkVersion(v2)\n\n # now set the system flavor to !readline. we should get v1, but trying\n # to switch to v2 will cause a \"no new versions\" message\n self.resetRoot()\n self._updateFlavor('use: !readline')\n self.updatePkg(self.rootDir, 'manyflavors', version = v1)\n assert(not os.path.exists(self.rootDir + '/etc/readline'))\n rc = self.logCheck(self.updatePkg, (self.rootDir, 'manyflavors'),\n 'error: no new troves were found')\n self._checkVersion(v1)\n assert(not os.path.exists(self.rootDir + '/etc/readline'))\n\n # if we don't specify ssl in our system flags, we should not get any\n # match at all (since everything built has ssl flavor)\n self.resetRoot()\n self.cfg.flavor = [ deps.parseFlavor('use: ~readline')]\n rc = self.logCheck(self.updatePkg, (self.rootDir, 'manyflavors'),\n 'error: manyflavors was not found on path localhost@rpl:linux (Closest alternate flavors found: [~ssl])')", "metadata": "root.FlavorTest.testSimpleUpdates", "header": "['class', 'FlavorTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 184 }, { "content": " def testDependencies(self):\n def _checkFlavor(targ):\n db = database.Database(self.rootDir, self.cfg.dbPath)\n l = db.getTroveVersionList('bash:runtime', withFlavors = True)\n assert(str(l[0][1]) == targ)\n\n self.overrideBuildFlavor('ssl')\n trove = self.build(recipes.bashMissingRecipe, \"Bash\")\n v = trove.getVersion()\n assert(str(trove.getFlavor()) == 'ssl')\n \n self.overrideBuildFlavor('!ssl')\n trove = self.build(recipes.bashMissingRecipe, \"Bash\")\n v = trove.getVersion()\n assert(str(trove.getFlavor()) == '~!ssl')\n \n self.overrideBuildFlavor('ssl')\n trove = self.build(recipes.bashRecipe, \"Bash\")\n v = trove.getVersion()\n assert(str(trove.getFlavor()) == 'ssl')\n \n self.overrideBuildFlavor('!ssl')\n trove = self.build(recipes.bashRecipe, \"Bash\")\n assert(trove.getVersion() == v)\n\n self.build(recipes.bashUserRecipe, 'BashUser')\n\n self.cfg.flavor = [ deps.parseFlavor('ssl') ]\n self.captureOutput(self.updatePkg, self.rootDir, 'bashuser', \n resolve = True)\n _checkFlavor('ssl')\n\n self.resetRoot()\n self.cfg.flavor = [ deps.parseFlavor('!ssl') ]\n self.captureOutput(self.updatePkg, self.rootDir, 'bashuser', \n resolve = True)\n _checkFlavor('~!ssl')\n\n self.resetRoot()\n self.cfg.flavor = [ deps.parseFlavor('ssl') ]\n self.updatePkg(self.rootDir, 'bash:runtime', '1-1-1')\n self.captureOutput(self.updatePkg, self.rootDir, 'bashuser', \n resolve = True)\n _checkFlavor('ssl')\n\n self.resetRoot()\n self.cfg.flavor = [ deps.parseFlavor('~!ssl') ]\n self.updatePkg(self.rootDir, 'bash:runtime', '1-1-1')\n self.captureOutput(self.updatePkg, self.rootDir, 'bashuser', \n resolve = True)\n _checkFlavor('~!ssl')\n\n self.resetRoot()\n self.cfg.flavor = [ deps.parseFlavor('ssl') ]\n self.updatePkg(self.rootDir, 'bash:runtime', '0-1-1')\n self.cfg.flavor = [ deps.parseFlavor('~!ssl') ]\n self.captureOutput(self.updatePkg, self.rootDir, 'bashuser', \n resolve = True)\n _checkFlavor('ssl')\n\n self.resetRoot()\n self.cfg.flavor = [ deps.parseFlavor('~!ssl') ]\n self.updatePkg(self.rootDir, 'bash:runtime', '0-1-1')\n self.cfg.flavor = [ deps.parseFlavor('ssl') ]\n self.captureOutput(self.updatePkg, self.rootDir, 'bashuser', \n resolve = True)\n _checkFlavor('~!ssl')", "metadata": "root.FlavorTest.testDependencies", "header": "['class', 'FlavorTest', '(', 'rephelp', '.', 'RepositoryHelper', ')', ':', '___EOS___']", "index": 361 } ]
[ { "span": "rc ", "start_line": 255, "start_column": 8, "end_line": 255, "end_column": 10 }, { "span": "v ", "start_line": 369, "start_column": 8, "end_line": 369, "end_column": 9 }, { "span": "v ", "start_line": 374, "start_column": 8, "end_line": 374, "end_column": 9 } ]
[ { "span": "rc ", "start_line": 264, "start_column": 8, "end_line": 264, "end_column": 10 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Fla", "vor", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Simple", "Update", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reset", "Repository_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "many", "Fla", "vor", "s_", ",_", "\"", "Many", "Fla", "vor", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v1_", "=_", "trove_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def", "Flavor_", "=_", "trove_", "._", "get", "Flavor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "str_", "(_", "def", "Flavor_", ")_", "==_", "'", "readline", ",", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "override", "Build", "Flavor_", "(_", "'", "~", "!", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "many", "Fla", "vor", "s_", ",_", "\"", "Many", "Fla", "vor", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "trove_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "Read", "Line_", "=_", "trove_", "._", "get", "Flavor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "str_", "(_", "no", "Read", "Line_", ")_", "==_", "'", "~", "!", "readline", ",", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "v1_", "==_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "override", "Build", "Flavor_", "(_", "'", "~", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "basic", " ", "test", " ", "w", "/", " ", "readline", " ", "in", " ", "the", " ", "flavor_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "use", ":", " ", "~", "readline", ",", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "test", " ", "w", "/", " ", "prefer", "ring", " ", "not", " ", "readline_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "update", "Flavor_", "(_", "'", "use", ":", " ", "~", "!", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "test", " ", "w", "/", " ", "prefer", "ring", " ", "not", " ", "readline", ",", " ", "but", " ", "an", " ", "override_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "update", "Flavor_", "(_", "'", "use", ":", " ", "~", "!", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ",_", "flavor_", "=_", "'", "use", ":", "readline", ",", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "test", " ", "w", "/", " ", "prefer", "ring", " ", "not", " ", "allow", "ing", " ", "readline_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "update", "Flavor_", "(_", "'", "use", ":", " ", "!", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "update", "Flavor_", "(_", "'", "use", ":", " ", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "many", "Fla", "vor", "s_", ",_", "\"", "Many", "Fla", "vor", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v2_", "=_", "trove_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "def", "Flavor_", "==_", "trove_", "._", "get", "Flavor_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "basic", " ", "test", " ", "w", "/", " ", "readline", " ", "in", " ", "the", " ", "flavor_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ",_", "version_", "=_", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Version_", "(_", "v2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", " ", "~", "!", "readline", ",", " ", "install", " ", "the", " ", "old", " ", "version", ",", " ", "and", " ", "then", " ", "update", " ", "to", " ", "what", "ever", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "avail", "ble", " ", "(", "whi", "ch", " ", "shou", "ld", " ", "give", " ", "us", " ", "the", " ", "new", " ", "version", ",", " ", "even", " ", "tho", "ugh", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "s", " ", "use", " ", "readline", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "update", "Flavor_", "(_", "'", "use", ":", " ", "~", "!", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ",_", "version_", "=_", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Version_", "(_", "v2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "set", " ", "the", " ", "system", " ", "flavor", " ", "to", " ", "!", "readline", ".", " ", "we", " ", "shou", "ld", " ", "get", " ", "v1", ",", " ", "but", " ", "try", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "switch", " ", "to", " ", "v2", " ", "will", " ", "caus", "e", " ", "a", " ", "\"", "no", " ", "new", " ", "version", "s", "\"", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "update", "Flavor_", "(_", "'", "use", ":", " ", "!", "readline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ",_", "version_", "=_", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rc_", "=_", "self_", "._", "log", "Check_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", ":", " ", "no", " ", "new", " ", "trove", "s", " ", "wer", "e", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "Version_", "(_", "v1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "root", "Dir_", "+_", "'/", "etc", "/", "readline", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "speci", "fy", " ", "ssl", " ", "in", " ", "our", " ", "system", " ", "flags", ",", " ", "we", " ", "shou", "ld", " ", "not", " ", "get", " ", "any_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "match", " ", "at", " ", "all", " ", "(", "sinc", "e", " ", "every", "thing", " ", "bui", "lt", " ", "has", " ", "ssl", " ", "flavor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "use", ":", " ", "~", "readline", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rc_", "=_", "self_", "._", "log", "Check_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "many", "flavor", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", ":", " ", "many", "flavor", "s", " ", "was", " ", "not", " ", "found", " ", "on", " ", "path", " ", "local", "host", "@", "rpl", ":", "linux", " ", "(", "Closes", "t", " ", "alternat", "e", " ", "flavor", "s", " ", "found", ":", " ", "[~", "ssl", "])'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fla", "vor", "Test_", "(_", "rep", "help_", "._", "Repos", "itor", "y", "Helper_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Dependenc", "ies_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u", "check", "Flavor_", "(_", "targ", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "database_", "._", "Database_", "(_", "self_", "._", "root", "Dir_", ",_", "self_", "._", "cfg_", "._", "db", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "db_", "._", "get", "Trove", "Version", "List_", "(_", "'", "bash", ":", "runt", "ime", "'_", ",_", "with", "Fla", "vor", "s_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "str_", "(_", "l_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", "==_", "targ", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "override", "Build", "Flavor_", "(_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "bash", "Missing", "Recipe_", ",_", "\"", "Bas", "h", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "trove_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "str_", "(_", "trove_", "._", "get", "Flavor_", "(_", ")_", ")_", "==_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "override", "Build", "Flavor_", "(_", "'!", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "bash", "Missing", "Recipe_", ",_", "\"", "Bas", "h", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "trove_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "str_", "(_", "trove_", "._", "get", "Flavor_", "(_", ")_", ")_", "==_", "'", "~", "!", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "override", "Build", "Flavor_", "(_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "bash", "Recipe_", ",_", "\"", "Bas", "h", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "trove_", "._", "get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "str_", "(_", "trove_", "._", "get", "Flavor_", "(_", ")_", ")_", "==_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "override", "Build", "Flavor_", "(_", "'!", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trove_", "=_", "self_", "._", "build_", "(_", "recipes_", "._", "bash", "Recipe_", ",_", "\"", "Bas", "h", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "trove_", "._", "get", "Version_", "(_", ")_", "==_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "build_", "(_", "recipes_", "._", "bash", "User", "Recipe_", ",_", "'", "Bas", "h", "User", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "captur", "e", "Output_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "self_", "._", "root", "Dir_", ",_", "'", "bash", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "Flavor_", "(_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'!", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "captur", "e", "Output_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "self_", "._", "root", "Dir_", ",_", "'", "bash", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "Flavor_", "(_", "'", "~", "!", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "bash", ":", "runt", "ime", "'_", ",_", "'", "1", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "captur", "e", "Output_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "self_", "._", "root", "Dir_", ",_", "'", "bash", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "Flavor_", "(_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "~", "!", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "bash", ":", "runt", "ime", "'_", ",_", "'", "1", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "captur", "e", "Output_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "self_", "._", "root", "Dir_", ",_", "'", "bash", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "Flavor_", "(_", "'", "~", "!", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "bash", ":", "runt", "ime", "'_", ",_", "'", "0", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "~", "!", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "captur", "e", "Output_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "self_", "._", "root", "Dir_", ",_", "'", "bash", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "Flavor_", "(_", "'", "ssl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "reset", "Root_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "~", "!", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "update", "Pk", "g_", "(_", "self_", "._", "root", "Dir_", ",_", "'", "bash", ":", "runt", "ime", "'_", ",_", "'", "0", "-1", "-1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cfg_", "._", "flavor_", "=_", "[_", "deps_", "._", "parse", "Flavor_", "(_", "'", "ssl", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "captur", "e", "Output_", "(_", "self_", "._", "update", "Pk", "g_", ",_", "self_", "._", "root", "Dir_", ",_", "'", "bash", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolve_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "Flavor_", "(_", "'", "~", "!", "ssl", "'_", ")_", "\\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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
HITGmbH/py-convergent-encryption/setup.py
[ { "content": "# Copyright (c) 2011, HIT Information-Control GmbH\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or\n# without modification, are permitted provided that the following\n# conditions are met:\n#\n# * Redistributions of source code must retain the above\n# copyright notice, this list of conditions and the following\n# disclaimer.\n#\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following\n# disclaimer in the documentation and/or other materials\n# provided with the distribution.\n#\n# * Neither the name of the HIT Information-Control GmbH nor the names of its\n# contributors may be used to endorse or promote products\n# derived from this software without specific prior written\n# permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n# CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n# DISCLAIMED. IN NO EVENT SHALL HIT Information-Control GmbH BE\n# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\n# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\n# OF SUCH DAMAGE.\n\n\nimport os\nfrom setuptools import setup, find_packages\n\n\nsetup(\n name = \"convergent\",\n description = \"Convergent encryption library, encrypts with AES 256 CTR using the SHA256d hash of the plain text as key.\",\n long_description = open('README.md').read(),\n version = \"0.2\",\n\n install_requires = ['setuptools'],\n\n package_dir = {'': '.'},\n packages = find_packages(),\n test_suite = \"tests\",\n\n url = 'https://github.com/HITGmbH/py-convergent-encryption',\n license = open(\"LICENSE.txt\").read(),\n author = 'Hinnerk Haardt, HIT Information-Control GmbH',\n author_email = 'haardt@information-control.de',\n\n classifiers = [\n 'Development Status :: 4 - Beta',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: BSD License',\n 'Operating System :: OS Independent',\n 'Programming Language :: Python',\n 'Topic :: Security :: Cryptography',\n ]\n)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "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_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2011", ",", " ", "HIT", " ", "Information", "-", "Control", " ", "Gm", "b", "H_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "with", "out", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "materials_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "HIT", " ", "Information", "-", "Control", " ", "Gm", "b", "H", " ", "nor", " ", "the", " ", "names", " ", "of", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "contributor", "s", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "written_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "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", " ", "HIT", " ", "Information", "-", "Control", " ", "Gm", "b", "H", " ", "BE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "setuptools_", "import_", "setup_", ",_", "find", "\\u", "packages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"", "converg", "ent", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Converge", "nt", " ", "encrypt", "ion", " ", "librar", "y", ",", " ", "encrypt", "s", " ", "with", " ", "AE", "S", " ", "256", " ", "CTR", " ", "usi", "ng", " ", "the", " ", "SHA", "256", "d", " ", "hash", " ", "of", " ", "the", " ", "plain", " ", "text", " ", "as", " ", "key", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "open_", "(_", "'", "READ", "ME", ".", "md", "'_", ")_", "._", "read_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "\"", "0.", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "install", "\\u", "requires_", "=_", "[_", "'", "setup", "tool", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "dir_", "=_", "{_", "''_", ":_", "'.'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "packages_", "=_", "find", "\\u", "packages_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "suite_", "=_", "\"", "tests", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "'", "https", "://", "git", "hub", ".", "com", "/", "HIT", "Gm", "b", "H", "/", "py", "-", "converg", "ent", "-", "encrypt", "ion", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "license_", "=_", "open_", "(_", "\"", "LICENSE", ".", "txt", "\"_", ")_", "._", "read_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", "=_", "'", "Hin", "ner", "k", " ", "Ha", "ard", "t", ",", " ", "HIT", " ", "Information", "-", "Control", " ", "Gm", "b", "H", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author", "\\u", "email_", "=_", "'", "haa", "rdt", "@", "informati", "on", "-", "control", ".", "de", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "'", "Inten", "ded", " ", "Audi", "ence", " ", "::", " ", "Dev", "elope", "rs", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "License", " ", "::", " ", "OSI", " ", "Appro", "ved", " ", "::", " ", "BS", "D", " ", "License", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Opera", "ting", " ", "System", " ", "::", " ", "OS", " ", "Inde", "pend", "ent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Programm", "ing", " ", "Lang", "ua", "ge", " ", "::", " ", "Pyth", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Topic", " ", "::", " ", "Secur", "it", "y", " ", "::", " ", "Crypto", "graph", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
AppScale/appscale/AppServer/lib/grizzled/grizzled/test/io/TestPushback.py
[ { "content": "#!/usr/bin/python2.4\n# $Id: 58917b33b42080b79747e553e2685ff5e3e2f84b $\n#\n# Nose program for testing grizzled.io classes/functions\n\n# ---------------------------------------------------------------------------\n# Imports\n# ---------------------------------------------------------------------------\n\nimport google3\nfrom grizzled.io import *\nfrom cStringIO import StringIO\nimport os\nimport tempfile\nimport atexit\n\n# ---------------------------------------------------------------------------\n# Globals\n# ---------------------------------------------------------------------------\n\n# ---------------------------------------------------------------------------\n# Classes\n# ---------------------------------------------------------------------------\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestPushback(object):\n", "metadata": "root.TestPushback", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def testPushback(self):\n inputString = \"\"\"abc\ndef\nghi\n\"\"\"\n f = StringIO(inputString)\n pb = PushbackFile(f)\n\n s = pb.readline()\n print s\n assert s == 'abc\\n'\n pb.pushback(s)\n s = pb.readline()\n print s\n assert s == 'abc\\n'\n s = pb.read(1)\n print s\n assert s == 'd'\n s = pb.readline()\n print s\n assert s == 'ef\\n'\n s = pb.read(-1)\n print s\n assert s == 'ghi\\n'\n s = pb.readline()\n assert s == ''\n pb.pushback('foobar')\n s = pb.readline()\n print s\n assert s == 'foobar'", "metadata": "root.TestPushback.testPushback", "header": "['class', 'TestPushback', '(', 'object', ')', ':', '___EOS___']", "index": 26 } ]
[ { "span": "import google3", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 14 }, { "span": "import os", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 9 }, { "span": "import tempfile", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 15 }, { "span": "import atexit", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python", "2.4", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "$", "Id", ":", " ", "589", "1", "7b", "3", "3b", "420", "80", "b7", "974", "7e", "553", "e2", "685", "ff", "5e", "3e", "2f", "84", "b", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "se", " ", "program", " ", "for", " ", "testi", "ng", " ", "gri", "zzle", "d", ".", "io", " ", "classe", "s", "/", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "google", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gri", "zzle", "d_", "._", "io_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "atexit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Globals_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Classes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "-----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Push", "back_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Push", "back_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Push", "back_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "String_", "=_", "\"\"\"", "abc", "\\", "10", ";", "def", "\\", "10", ";", "gh", "i", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "String", "IO_", "(_", "input", "String_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pb_", "=_", "Push", "back", "File_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "pb_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "'", "abc", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pb_", "._", "push", "back_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pb_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "'", "abc", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pb_", "._", "read_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "'", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pb_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "'", "ef", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pb_", "._", "read_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "'", "gh", "i", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pb_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pb_", "._", "push", "back_", "(_", "'", "fooba", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pb_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "s_", "==_", "'", "fooba", "r", "'_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
guillermooo/Vintageous/tests/vi/test_keys.py
[ { "content": "import unittest\nfrom collections import namedtuple\n\nimport sublime\n\nfrom Vintageous import state\nfrom Vintageous.vi.utils import modes\nfrom Vintageous.vi.utils import translate_char\nfrom Vintageous.tests import set_text\nfrom Vintageous.tests import add_sel\nfrom Vintageous.tests import make_region\nfrom Vintageous.tests import ViewTest\nfrom Vintageous.tests import ViewTest\nfrom Vintageous.vi.keys import to_bare_command_name\nfrom Vintageous.vi.keys import KeySequenceTokenizer\nfrom Vintageous.vi.keys import seqs\nfrom Vintageous.vi import variables\n\n\n_tests_tokenizer = (\n ('p', 'p', 'lower letter key'),\n ('P', 'P', 'upper case letter key'),\n ('<C-p>', '<C-p>', 'ctrl-modified lower case letter key'),\n ('<C-P>', '<C-P>', 'ctrl-modified upper case letter key'),\n ('<C-S-.>', '<C-S-.>', 'ctrl-shift modified period key'),\n ('<Esc>', '<esc>', 'esc key title case'),\n ('<esc>', '<esc>', 'esc key lowercase'),\n ('<eSc>', '<esc>', 'esc key mixed case'),\n ('<lt>', '<lt>', 'less than key'),\n ('<HOME>', '<home>', 'less than key'),\n ('<enD>', '<end>', 'less than key'),\n ('<uP>', '<up>', 'less than key'),\n ('<DoWn>', '<down>', 'less than key'),\n ('<left>', '<left>', 'less than key'),\n ('<RigHt>', '<right>', 'less than key'),\n ('<Space>', '<space>', 'space key'),\n ('<c-Space>', '<C-space>', 'ctrl-space key'),\n ('0', '0', 'zero key'),\n ('<c-m-.>', '<C-M-.>', 'ctrl-alt-period key'),\n ('<tab>', '<tab>', 'tab key'),\n ('<Leader>', '\\\\', 'leader key'),\n)\n\n\n\n\n_tests_iter_tokenize = (\n ('pp', ['p', 'p'], 'sequence'),\n ('<C-p>', ['<C-p>'], 'sequence'),\n ('<C-P>x', ['<C-P>', 'x'], 'sequence'),\n ('<C-S-.>', ['<C-S-.>'], 'sequence'),\n ('<Esc>ai', ['<esc>', 'a', 'i'], 'sequence'),\n ('<lt><lt>', ['<lt>', '<lt>'], 'sequence'),\n ('<DoWn>abc.', ['<down>', 'a', 'b', 'c', '.'], 'sequence'),\n ('0<down>', ['0', '<down>'], 'sequence'),\n ('<c-m-.>', ['<C-M-.>'], 'sequence'),\n)\n\n\n\n\n_command_name_tests = (\n ('daw', 'daw', ''),\n ('2daw', 'daw', ''),\n ('d2aw', 'daw', ''),\n ('2d2aw', 'daw', ''),\n ('\"a2d2aw', 'daw', ''),\n ('\"12d2aw', 'daw', ''),\n ('<f7>', '<f7>', ''),\n ('10<f7>', '<f7>', ''),\n ('\"a10<f7>', '<f7>', ''),\n ('\"a10<f7>', '<f7>', ''),\n ('\"210<f7>', '<f7>', ''),\n ('0', '0', ''),\n)\n\n\n\n\n_tranlation_tests = (\n ('<enter>', '\\n', ''),\n ('<cr>', '\\n', ''),\n ('<sp>', ' ', ''),\n ('<space>', ' ', ''),\n ('<lt>', '<', ''),\n ('a', 'a', ''),\n)\n\n\n\n\nseq_test = namedtuple('seq_test', 'actual expected')\n\n\nTESTS_KNOWN_SEQUENCES = (\n seq_test(actual=seqs.A, expected='a'),\n seq_test(actual=seqs.ALT_CTRL_P, expected='<C-M-p>'),\n seq_test(actual=seqs.AMPERSAND , expected='&'),\n seq_test(actual=seqs.AW, expected='aw'),\n seq_test(actual=seqs.B, expected='b'),\n seq_test(actual=seqs.BACKSPACE, expected='<bs>'),\n seq_test(actual=seqs.GE, expected='ge'),\n seq_test(actual=seqs.G_BIG_E, expected='gE'),\n seq_test(actual=seqs.UP, expected='<up>'),\n seq_test(actual=seqs.DOWN, expected='<down>'),\n seq_test(actual=seqs.LEFT, expected='<left>'),\n seq_test(actual=seqs.RIGHT, expected='<right>'),\n seq_test(actual=seqs.HOME, expected='<home>'),\n seq_test(actual=seqs.END, expected='<end>'),\n seq_test(actual=seqs.BACKTICK, expected='`'),\n seq_test(actual=seqs.BIG_A, expected='A'),\n seq_test(actual=seqs.SPACE, expected='<space>'),\n seq_test(actual=seqs.BIG_B, expected='B'),\n seq_test(actual=seqs.CTRL_E, expected='<C-e>'),\n seq_test(actual=seqs.CTRL_Y, expected='<C-y>'),\n seq_test(actual=seqs.BIG_C, expected='C'),\n seq_test(actual=seqs.BIG_D, expected='D'),\n seq_test(actual=seqs.GH, expected='gh'),\n seq_test(actual=seqs.G_BIG_H, expected='gH'),\n seq_test(actual=seqs.BIG_E, expected='E'),\n seq_test(actual=seqs.BIG_F, expected='F'),\n seq_test(actual=seqs.BIG_G, expected='G'),\n\n seq_test(actual=seqs.CTRL_0, expected='<C-0>'),\n seq_test(actual=seqs.CTRL_1, expected='<C-1>'),\n seq_test(actual=seqs.CTRL_2, expected='<C-2>'),\n seq_test(actual=seqs.CTRL_3, expected='<C-3>'),\n seq_test(actual=seqs.CTRL_4, expected='<C-4>'),\n seq_test(actual=seqs.CTRL_5, expected='<C-5>'),\n seq_test(actual=seqs.CTRL_6, expected='<C-6>'),\n seq_test(actual=seqs.CTRL_7, expected='<C-7>'),\n seq_test(actual=seqs.CTRL_8, expected='<C-8>'),\n seq_test(actual=seqs.CTRL_9, expected='<C-9>'),\n\n seq_test(actual=seqs.CTRL_C, expected='<C-c>'),\n seq_test(actual=seqs.CTRL_ENTER, expected='<C-cr>'),\n seq_test(actual=seqs.CTRL_SHIFT_B, expected='<C-S-b>'),\n seq_test(actual=seqs.CTRL_SHIFT_ENTER, expected='<C-S-cr>'),\n seq_test(actual=seqs.CTRL_DOT, expected='<C-.>'),\n seq_test(actual=seqs.CTRL_SHIFT_DOT, expected='<C-S-.>'),\n seq_test(actual=seqs.CTRL_LEFT_SQUARE_BRACKET, expected='<C-[>'),\n\n seq_test(actual=seqs.CTRL_W, expected='<C-w>'),\n seq_test(actual=seqs.CTRL_W_Q, expected='<C-w>q'),\n\n seq_test(actual=seqs.CTRL_W_V, expected='<C-w>v'),\n seq_test(actual=seqs.CTRL_W_L, expected='<C-w>l'),\n seq_test(actual=seqs.CTRL_W_BIG_L, expected='<C-w>L'),\n seq_test(actual=seqs.CTRL_K, expected='<C-k>'),\n seq_test(actual=seqs.CTRL_K_CTRL_B, expected='<C-k><C-b>'),\n seq_test(actual=seqs.CTRL_BIG_F, expected='<C-F>'),\n seq_test(actual=seqs.CTRL_BIG_P, expected='<C-P>'),\n seq_test(actual=seqs.CTRL_W_H, expected='<C-w>h'),\n seq_test(actual=seqs.Q, expected='q'),\n seq_test(actual=seqs.AT, expected='@'),\n seq_test(actual=seqs.CTRL_W_BIG_H, expected='<C-w>H'),\n seq_test(actual=seqs.BIG_H, expected='H'),\n\n seq_test(actual=seqs.G_BIG_J, expected='gJ'),\n seq_test(actual=seqs.CTRL_R, expected='<C-r>'),\n seq_test(actual=seqs.CTRL_R_EQUAL, expected='<C-r>='),\n seq_test(actual=seqs.CTRL_A, expected='<C-a>'),\n seq_test(actual=seqs.CTRL_I, expected='<C-i>'),\n seq_test(actual=seqs.CTRL_O, expected='<C-o>'),\n seq_test(actual=seqs.CTRL_X, expected='<C-x>'),\n seq_test(actual=seqs.CTRL_X_CTRL_L, expected='<C-x><C-l>'),\n seq_test(actual=seqs.Z, expected='z'),\n seq_test(actual=seqs.Z_ENTER, expected='z<cr>'),\n seq_test(actual=seqs.ZT, expected='zt'),\n seq_test(actual=seqs.ZZ, expected='zz'),\n seq_test(actual=seqs.Z_MINUS, expected='z-'),\n seq_test(actual=seqs.ZB, expected='zb'),\n\n seq_test(actual=seqs.BIG_I, expected='I'),\n seq_test(actual=seqs.BIG_Z_BIG_Z, expected='ZZ'),\n seq_test(actual=seqs.BIG_Z_BIG_Q, expected='ZQ'),\n seq_test(actual=seqs.GV, expected='gv'),\n seq_test(actual=seqs.BIG_J, expected='J'),\n seq_test(actual=seqs.BIG_K, expected='K'),\n seq_test(actual=seqs.BIG_L, expected='L'),\n seq_test(actual=seqs.BIG_M, expected='M'),\n seq_test(actual=seqs.BIG_N, expected='N'),\n seq_test(actual=seqs.BIG_O, expected='O'),\n seq_test(actual=seqs.BIG_P, expected='P'),\n seq_test(actual=seqs.BIG_Q, expected='Q'),\n seq_test(actual=seqs.BIG_R, expected='R'),\n seq_test(actual=seqs.BIG_S, expected='S'),\n seq_test(actual=seqs.BIG_T, expected='T'),\n seq_test(actual=seqs.BIG_U, expected='U'),\n seq_test(actual=seqs.BIG_V, expected='V'),\n seq_test(actual=seqs.BIG_W, expected='W'),\n seq_test(actual=seqs.BIG_X, expected='X'),\n seq_test(actual=seqs.BIG_Y, expected='Y'),\n seq_test(actual=seqs.BIG_Z, expected='Z'),\n seq_test(actual=seqs.C, expected= 'c'),\n seq_test(actual=seqs.CC, expected='cc'),\n seq_test(actual=seqs.COLON, expected=':'),\n seq_test(actual=seqs.COMMA, expected=','),\n seq_test(actual=seqs.CTRL_D, expected='<C-d>'),\n seq_test(actual=seqs.CTRL_F12, expected='<C-f12>'),\n seq_test(actual=seqs.CTRL_L, expected='<C-l>'),\n seq_test(actual=seqs.CTRL_B, expected='<C-b>'),\n seq_test(actual=seqs.CTRL_F, expected='<C-f>'),\n seq_test(actual=seqs.CTRL_G, expected='<C-g>'),\n seq_test(actual=seqs.CTRL_P, expected='<C-p>'),\n seq_test(actual=seqs.CTRL_U, expected='<C-u>'),\n seq_test(actual=seqs.CTRL_V, expected='<C-v>'),\n seq_test(actual=seqs.D, expected='d'),\n seq_test(actual=seqs.DD, expected='dd'),\n seq_test(actual=seqs.DOLLAR, expected='$'),\n seq_test(actual=seqs.DOT, expected='.'),\n seq_test(actual=seqs.DOUBLE_QUOTE, expected='\"'),\n seq_test(actual=seqs.E, expected='e'),\n seq_test(actual=seqs.ENTER, expected='<cr>'),\n seq_test(actual=seqs.SHIFT_ENTER, expected='<S-cr>'),\n seq_test(actual=seqs.EQUAL, expected='='),\n seq_test(actual=seqs.EQUAL_EQUAL, expected='=='),\n seq_test(actual=seqs.ESC, expected='<esc>'),\n seq_test(actual=seqs.F, expected='f'),\n seq_test(actual=seqs.F1, expected='<f1>'),\n seq_test(actual=seqs.F10, expected='<f10>'),\n seq_test(actual=seqs.F11, expected='<f11>'),\n seq_test(actual=seqs.F12, expected='<f12>'),\n seq_test(actual=seqs.F13, expected='<f13>'),\n seq_test(actual=seqs.F14, expected='<f14>'),\n seq_test(actual=seqs.F15, expected='<f15>'),\n seq_test(actual=seqs.F2, expected='<f2>'),\n seq_test(actual=seqs.F3, expected='<f3>'),\n seq_test(actual=seqs.SHIFT_F2, expected='<S-f2>'),\n seq_test(actual=seqs.SHIFT_F3, expected='<S-f3>'),\n seq_test(actual=seqs.SHIFT_F4, expected='<S-f4>'),\n seq_test(actual=seqs.F4, expected='<f4>'),\n seq_test(actual=seqs.F5, expected='<f5>'),\n seq_test(actual=seqs.F6, expected='<f6>'),\n seq_test(actual=seqs.F7, expected='<f7>'),\n seq_test(actual=seqs.F8, expected='<f8>'),\n seq_test(actual=seqs.F9, expected='<f9>'),\n seq_test(actual=seqs.CTRL_F2, expected='<C-f2>'),\n seq_test(actual=seqs.CTRL_SHIFT_F2, expected='<C-S-f2>'),\n seq_test(actual=seqs.G, expected='g'),\n seq_test(actual=seqs.G_BIG_C, expected='gC'),\n seq_test(actual=seqs.G_BIG_D, expected='gD'),\n seq_test(actual=seqs.G_BIG_U, expected='gU'),\n seq_test(actual=seqs.G_BIG_U_BIG_U, expected='gUU'),\n seq_test(actual=seqs.G_BIG_U_G_BIG_U, expected='gUgU'),\n seq_test(actual=seqs.G_TILDE, expected='g~'),\n seq_test(actual=seqs.G_TILDE_G_TILDE, expected='g~g~'),\n seq_test(actual=seqs.G_TILDE_TILDE, expected='g~~'),\n seq_test(actual=seqs.G_UNDERSCORE, expected='g_'),\n seq_test(actual=seqs.GC, expected='gc'),\n seq_test(actual=seqs.GCC, expected='gcc'),\n seq_test(actual=seqs.GD, expected='gd'),\n seq_test(actual=seqs.GG, expected='gg'),\n seq_test(actual=seqs.GJ, expected='gj'),\n seq_test(actual=seqs.GK, expected='gk'),\n seq_test(actual=seqs.GQ, expected='gq'),\n seq_test(actual=seqs.GT, expected='gt'),\n seq_test(actual=seqs.G_BIG_T, expected= 'gT'),\n seq_test(actual=seqs.GM, expected= 'gm'),\n seq_test(actual=seqs.GU, expected= 'gu'),\n seq_test(actual=seqs.GUGU, expected= 'gugu'),\n seq_test(actual=seqs.GUU, expected= 'guu'),\n seq_test(actual=seqs.GREATER_THAN, expected= '>'),\n seq_test(actual=seqs.GREATER_THAN_GREATER_THAN, expected= '>>'),\n seq_test(actual=seqs.H, expected= 'h'),\n seq_test(actual=seqs.HAT, expected= '^'),\n seq_test(actual=seqs.I, expected= 'i'),\n seq_test(actual=seqs.J, expected= 'j'),\n seq_test(actual=seqs.K, expected= 'k'),\n seq_test(actual=seqs.L, expected= 'l'),\n seq_test(actual=seqs.LEFT_BRACE, expected= '{'),\n seq_test(actual=seqs.LEFT_SQUARE_BRACKET, expected= '['),\n seq_test(actual=seqs.LEFT_PAREN, expected= '('),\n seq_test(actual=seqs.LESS_THAN, expected= '<lt>'),\n seq_test(actual=seqs.LESS_THAN_LESS_THAN, expected= '<lt><lt>'),\n seq_test(actual=seqs.MINUS, expected= '-'),\n seq_test(actual=seqs.M, expected= 'm'),\n seq_test(actual=seqs.N, expected= 'n'),\n seq_test(actual=seqs.O, expected= 'o'),\n seq_test(actual=seqs.P, expected= 'p'),\n seq_test(actual=seqs.PLUS, expected= '+'),\n seq_test(actual=seqs.OCTOTHORP, expected= '#'),\n seq_test(actual=seqs.PAGE_DOWN, expected= 'pagedown'),\n seq_test(actual=seqs.PAGE_UP, expected= 'pageup'),\n seq_test(actual=seqs.PERCENT, expected= '%'),\n seq_test(actual=seqs.PIPE, expected= '|'),\n seq_test(actual=seqs.QUESTION_MARK, expected= '?'),\n seq_test(actual=seqs.QUOTE, expected= \"'\"),\n seq_test(actual=seqs.QUOTE_QUOTE, expected= \"''\"),\n seq_test(actual=seqs.R, expected= 'r'),\n seq_test(actual=seqs.RIGHT_BRACE, expected= '}'),\n seq_test(actual=seqs.RIGHT_SQUARE_BRACKET, expected= ']'),\n seq_test(actual=seqs.RIGHT_PAREN, expected= ')'),\n seq_test(actual=seqs.S, expected= 's'),\n seq_test(actual=seqs.SEMICOLON, expected= ';'),\n seq_test(actual=seqs.SHIFT_CTRL_F12, expected= '<C-S-f12>'),\n seq_test(actual=seqs.SHIFT_F11, expected='<S-f11>'),\n seq_test(actual=seqs.SLASH, expected= '/'),\n seq_test(actual=seqs.STAR, expected= '*'),\n seq_test(actual=seqs.T, expected= 't'),\n seq_test(actual=seqs.TAB, expected= '<tab>'),\n seq_test(actual=seqs.TILDE, expected='~'),\n seq_test(actual=seqs.U, expected='u'),\n seq_test(actual=seqs.UNDERSCORE, expected='_'),\n seq_test(actual=seqs.V, expected='v'),\n seq_test(actual=seqs.W, expected='w'),\n seq_test(actual=seqs.X, expected='x'),\n seq_test(actual=seqs.Y, expected='y'),\n seq_test(actual=seqs.YY, expected='yy'),\n seq_test(actual=seqs.ZERO, expected='0'),\n)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Test_KeySequenceTokenizer_tokenize_one(ViewTest):\n\n\n", "metadata": "root.Test_KeySequenceTokenizer_tokenize_one", "header": "['module', '___EOS___']", "index": 44 }, { "content": " def setUp(self):\n super().setUp()\n self.old_vars = variables._VARIABLES\n variables._VARIABLES = {}", "metadata": "root.Test_KeySequenceTokenizer_tokenize_one.setUp", "header": "['class', 'Test_KeySequenceTokenizer_tokenize_one', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 45 }, { "content": " def parse(self, input_):\n tokenizer = KeySequenceTokenizer(input_)\n return tokenizer.tokenize_one()", "metadata": "root.Test_KeySequenceTokenizer_tokenize_one.parse", "header": "['class', 'Test_KeySequenceTokenizer_tokenize_one', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 50 }, { "content": " def testAll(self):\n for (i, t) in enumerate(_tests_tokenizer):\n input_, expected, msg = t\n self.assertEqual(self.parse(input_), expected, \"{0} - {1}\".format(i, msg))", "metadata": "root.Test_KeySequenceTokenizer_tokenize_one.testAll", "header": "['class', 'Test_KeySequenceTokenizer_tokenize_one', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 54 }, { "content": " def tearDown(self):\n super().tearDown()\n variables._VARIABLES = self.old_vars", "metadata": "root.Test_KeySequenceTokenizer_tokenize_one.tearDown", "header": "['class', 'Test_KeySequenceTokenizer_tokenize_one', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 59 }, { "content": "class Test_KeySequenceTokenizer_iter_tokenize(ViewTest):\n", "metadata": "root.Test_KeySequenceTokenizer_iter_tokenize", "header": "['module', '___EOS___']", "index": 77 }, { "content": " def parse(self, input_):\n tokenizer = KeySequenceTokenizer(input_)\n return list(tokenizer.iter_tokenize())", "metadata": "root.Test_KeySequenceTokenizer_iter_tokenize.parse", "header": "['class', 'Test_KeySequenceTokenizer_iter_tokenize', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 78 }, { "content": " def testAll(self):\n for (i, t) in enumerate(_tests_iter_tokenize):\n input_, expected, msg = t\n self.assertEqual(self.parse(input_), expected, \"{0} - {1}\".format(i, msg))", "metadata": "root.Test_KeySequenceTokenizer_iter_tokenize.testAll", "header": "['class', 'Test_KeySequenceTokenizer_iter_tokenize', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 82 }, { "content": "class Test_to_bare_command_name(ViewTest):\n", "metadata": "root.Test_to_bare_command_name", "header": "['module', '___EOS___']", "index": 104 }, { "content": " def transform(self, input_):\n return to_bare_command_name(input_)", "metadata": "root.Test_to_bare_command_name.transform", "header": "['class', 'Test_to_bare_command_name', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 105 }, { "content": " def testAll(self):\n for (i, t) in enumerate(_command_name_tests):\n input_, expected, msg = t\n self.assertEqual(self.transform(input_), expected, \"{0} - {1}\".format(i, msg))", "metadata": "root.Test_to_bare_command_name.testAll", "header": "['class', 'Test_to_bare_command_name', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 108 }, { "content": "class Test_translate_char(ViewTest):", "metadata": "root.Test_translate_char", "header": "['module', '___EOS___']", "index": 124 }, { "content": " def testAll(self):\n for (i, t) in enumerate(_tranlation_tests):\n input_, expected, msg = t\n self.assertEqual(translate_char(input_), expected, \"{0} - {1}\".format(i, msg))", "metadata": "root.Test_translate_char.testAll", "header": "['class', 'Test_translate_char', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 125 }, { "content": "class Test_KeySequenceNames(ViewTest):\n", "metadata": "root.Test_KeySequenceNames", "header": "['module', '___EOS___']", "index": 353 }, { "content": " def testAll(self):\n for (i, data) in enumerate(TESTS_KNOWN_SEQUENCES):\n self.assertEqual(data.actual, data.expected,\n \"failed at index {0}\".format(i))", "metadata": "root.Test_KeySequenceNames.testAll", "header": "['class', 'Test_KeySequenceNames', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 354 }, { "content": " def testAllKeySequenceNamesAreTested(self):\n tested_seqs = [k.actual for k in TESTS_KNOWN_SEQUENCES]\n self.assertEqual(sorted(tested_seqs),\n sorted([v for (k, v) in seqs.__dict__.items()\n if k.isupper()]))", "metadata": "root.Test_KeySequenceNames.testAllKeySequenceNamesAreTested", "header": "['class', 'Test_KeySequenceNames', '(', 'ViewTest', ')', ':', '___EOS___']", "index": 359 } ]
[ { "span": "import unittest", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 15 }, { "span": "import sublime", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "from Vintageous import state", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 28 }, { "span": "from Vintageous.vi.utils import modes", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 37 }, { "span": "from Vintageous.tests import set_text", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 37 }, { "span": "from Vintageous.tests import add_sel", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 36 }, { "span": "from Vintageous.tests import make_region", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 40 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sublime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "import_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "vi_", "._", "utils_", "import_", "modes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "vi_", "._", "utils_", "import_", "translat", "e\\u", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "tests_", "import_", "set\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "tests_", "import_", "add", "\\u", "sel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "tests_", "import_", "make", "\\u", "region_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "tests_", "import_", "View", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "tests_", "import_", "View", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "vi_", "._", "keys_", "import_", "to", "\\u", "bare", "\\u", "command", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "vi_", "._", "keys_", "import_", "Key", "Sequ", "ence", "Tokenizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "vi_", "._", "keys_", "import_", "seqs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Vin", "tage", "ous_", "._", "vi_", "import_", "variables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "tests", "\\u", "tokenizer_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "p", "'_", ",_", "'", "p", "'_", ",_", "'", "lower", " ", "letter", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "P", "'_", ",_", "'", "P", "'_", ",_", "'", "upper", " ", "case", " ", "letter", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "C", "-", "p", ">'_", ",_", "'<", "C", "-", "p", ">'_", ",_", "'", "ctrl", "-", "modifi", "ed", " ", "lower", " ", "case", " ", "letter", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "C", "-", "P", ">'_", ",_", "'<", "C", "-", "P", ">'_", ",_", "'", "ctrl", "-", "modifi", "ed", " ", "upper", " ", "case", " ", "letter", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "C", "-", "S", "-.", ">'_", ",_", "'<", "C", "-", "S", "-.", ">'_", ",_", "'", "ctrl", "-", "shift", " ", "modifi", "ed", " ", "period", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Esc", ">'_", ",_", "'<", "esc", ">'_", ",_", "'", "esc", " ", "key", " ", "title", " ", "case", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "esc", ">'_", ",_", "'<", "esc", ">'_", ",_", "'", "esc", " ", "key", " ", "lower", "case", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "e", "Sc", ">'_", ",_", "'<", "esc", ">'_", ",_", "'", "esc", " ", "key", " ", "mixed", " ", "case", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "lt", ">'_", ",_", "'<", "lt", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "HOM", "E", ">'_", ",_", "'<", "home", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "en", "D", ">'_", ",_", "'<", "end", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "u", "P", ">'_", ",_", "'<", "up", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Do", "Wn", ">'_", ",_", "'<", "down", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "left", ">'_", ",_", "'<", "left", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Rig", "Ht", ">'_", ",_", "'<", "right", ">'_", ",_", "'", "less", " ", "than", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Spac", "e", ">'_", ",_", "'<", "space", ">'_", ",_", "'", "space", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "c", "-", "Spac", "e", ">'_", ",_", "'<", "C", "-", "space", ">'_", ",_", "'", "ctrl", "-", "space", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "'", "zero", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "c", "-", "m", "-.", ">'_", ",_", "'<", "C", "-", "M", "-.", ">'_", ",_", "'", "ctrl", "-", "alt", "-", "period", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "tab", ">'_", ",_", "'<", "tab", ">'_", ",_", "'", "tab", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Leader", ">'_", ",_", "'\\\\\\\\'_", ",_", "'", "leader", " ", "key", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "tests", "\\u", "iter", "\\u", "tokenize_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "pp", "'_", ",_", "[_", "'", "p", "'_", ",_", "'", "p", "'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "C", "-", "p", ">'_", ",_", "[_", "'<", "C", "-", "p", ">'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "C", "-", "P", ">", "x", "'_", ",_", "[_", "'<", "C", "-", "P", ">'_", ",_", "'", "x", "'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "C", "-", "S", "-.", ">'_", ",_", "[_", "'<", "C", "-", "S", "-.", ">'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Esc", ">", "ai", "'_", ",_", "[_", "'<", "esc", ">'_", ",_", "'", "a", "'_", ",_", "'", "i", "'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "lt", "><", "lt", ">'_", ",_", "[_", "'<", "lt", ">'_", ",_", "'<", "lt", ">'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "Do", "Wn", ">", "abc", ".'_", ",_", "[_", "'<", "down", ">'_", ",_", "'", "a", "'_", ",_", "'", "b", "'_", ",_", "'", "c", "'_", ",_", "'.'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "0", "<", "down", ">'_", ",_", "[_", "'", "0", "'_", ",_", "'<", "down", ">'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "c", "-", "m", "-.", ">'_", ",_", "[_", "'<", "C", "-", "M", "-.", ">'_", "]_", ",_", "'", "sequence", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "command", "\\u", "name", "\\u", "tests_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "da", "w", "'_", ",_", "'", "da", "w", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "2d", "aw", "'_", ",_", "'", "da", "w", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "d2", "aw", "'_", ",_", "'", "da", "w", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "2d", "2a", "w", "'_", ",_", "'", "da", "w", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\"", "a2", "d2", "aw", "'_", ",_", "'", "da", "w", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\"", "1", "2d", "2a", "w", "'_", ",_", "'", "da", "w", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "f7", ">'_", ",_", "'<", "f7", ">'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "10", "<", "f7", ">'_", ",_", "'<", "f7", ">'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\"", "a1", "0", "<", "f7", ">'_", ",_", "'<", "f7", ">'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\"", "a1", "0", "<", "f7", ">'_", ",_", "'<", "f7", ">'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'\"", "210", "<", "f7", ">'_", ",_", "'<", "f7", ">'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "0", "'_", ",_", "'", "0", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "tran", "lation", "\\u", "tests_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "enter", ">'_", ",_", "'\\\\", "n", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "cr", ">'_", ",_", "'\\\\", "n", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "sp", ">'_", ",_", "'", " ", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "space", ">'_", ",_", "'", " ", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'<", "lt", ">'_", ",_", "'<'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "a", "'_", ",_", "'", "a", "'_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "seq", "\\u", "test_", "=_", "namedtuple_", "(_", "'", "seq", "\\u", "test", "'_", ",_", "'", "actual", " ", "expected", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "TESTS", "\\u", "KNOWN", "\\u", "SEQUENCE", "S_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "A_", ",_", "expected_", "=_", "'", "a", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ALT", "\\u", "CTR", "L", "\\u", "P_", ",_", "expected_", "=_", "'<", "C", "-", "M", "-", "p", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "AMP", "ERS", "AND_", ",_", "expected_", "=_", "'&'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "AW", "_", ",_", "expected_", "=_", "'", "aw", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "B_", ",_", "expected_", "=_", "'", "b", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BACK", "SPACE_", ",_", "expected_", "=_", "'<", "bs", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GE_", ",_", "expected_", "=_", "'", "ge", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "E_", ",_", "expected_", "=_", "'", "g", "E", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "UP_", ",_", "expected_", "=_", "'<", "up", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "DOWN_", ",_", "expected_", "=_", "'<", "down", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "LEFT_", ",_", "expected_", "=_", "'<", "left", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "RIGHT_", ",_", "expected_", "=_", "'<", "right", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "HOME_", ",_", "expected_", "=_", "'<", "home", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "END_", ",_", "expected_", "=_", "'<", "end", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BACK", "TICK", "_", ",_", "expected_", "=_", "'`", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "A_", ",_", "expected_", "=_", "'", "A", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SPACE_", ",_", "expected_", "=_", "'<", "space", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "B_", ",_", "expected_", "=_", "'", "B", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "E_", ",_", "expected_", "=_", "'<", "C", "-", "e", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "Y_", ",_", "expected_", "=_", "'<", "C", "-", "y", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "C_", ",_", "expected_", "=_", "'", "C", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "D_", ",_", "expected_", "=_", "'", "D", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GH", "_", ",_", "expected_", "=_", "'", "gh", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "H_", ",_", "expected_", "=_", "'", "g", "H", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "E_", ",_", "expected_", "=_", "'", "E", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "F_", ",_", "expected_", "=_", "'", "F", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "G_", ",_", "expected_", "=_", "'", "G", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "0_", ",_", "expected_", "=_", "'<", "C", "-0", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "1_", ",_", "expected_", "=_", "'<", "C", "-1", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "2_", ",_", "expected_", "=_", "'<", "C", "-", "2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "3_", ",_", "expected_", "=_", "'<", "C", "-", "3", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "4_", ",_", "expected_", "=_", "'<", "C", "-", "4", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "5_", ",_", "expected_", "=_", "'<", "C", "-", "5", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "6_", ",_", "expected_", "=_", "'<", "C", "-", "6", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "7_", ",_", "expected_", "=_", "'<", "C", "-", "7", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "8_", ",_", "expected_", "=_", "'<", "C", "-", "8", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "9_", ",_", "expected_", "=_", "'<", "C", "-", "9", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "C_", ",_", "expected_", "=_", "'<", "C", "-", "c", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "ENTER_", ",_", "expected_", "=_", "'<", "C", "-", "cr", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "SHIFT", "\\u", "B_", ",_", "expected_", "=_", "'<", "C", "-", "S", "-", "b", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "SHIFT", "\\u", "ENTER_", ",_", "expected_", "=_", "'<", "C", "-", "S", "-", "cr", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "DOT", "_", ",_", "expected_", "=_", "'<", "C", "-.", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "SHIFT", "\\u", "DOT", "_", ",_", "expected_", "=_", "'<", "C", "-", "S", "-.", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "LEF", "T", "\\u", "SQUARE", "\\u", "BRAC", "KET", "_", ",_", "expected_", "=_", "'<", "C", "-[", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W", "\\u", "Q_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">", "q", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W", "\\u", "V_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">", "v", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W", "\\u", "L_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">", "l", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W", "\\u", "BIG", "\\u", "L_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">", "L", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "K_", ",_", "expected_", "=_", "'<", "C", "-", "k", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "K", "\\u", "CTR", "L", "\\u", "B_", ",_", "expected_", "=_", "'<", "C", "-", "k", "><", "C", "-", "b", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "BIG", "\\u", "F_", ",_", "expected_", "=_", "'<", "C", "-", "F", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "BIG", "\\u", "P_", ",_", "expected_", "=_", "'<", "C", "-", "P", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W", "\\u", "H_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">", "h", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "Q_", ",_", "expected_", "=_", "'", "q", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "AT_", ",_", "expected_", "=_", "'@'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "W", "\\u", "BIG", "\\u", "H_", ",_", "expected_", "=_", "'<", "C", "-", "w", ">", "H", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "H_", ",_", "expected_", "=_", "'", "H", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "J_", ",_", "expected_", "=_", "'", "g", "J", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "R_", ",_", "expected_", "=_", "'<", "C", "-", "r", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "R", "\\u", "EQUAL", "_", ",_", "expected_", "=_", "'<", "C", "-", "r", ">=", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "A_", ",_", "expected_", "=_", "'<", "C", "-", "a", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "I_", ",_", "expected_", "=_", "'<", "C", "-", "i", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "O_", ",_", "expected_", "=_", "'<", "C", "-", "o", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "X_", ",_", "expected_", "=_", "'<", "C", "-", "x", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "X", "\\u", "CTR", "L", "\\u", "L_", ",_", "expected_", "=_", "'<", "C", "-", "x", "><", "C", "-", "l", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "Z_", ",_", "expected_", "=_", "'", "z", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "Z", "\\u", "ENTER_", ",_", "expected_", "=_", "'", "z", "<", "cr", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ZT", "_", ",_", "expected_", "=_", "'", "zt", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ZZ", "_", ",_", "expected_", "=_", "'", "zz", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "Z", "\\u", "MINUS", "_", ",_", "expected_", "=_", "'", "z", "-'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ZB", "_", ",_", "expected_", "=_", "'", "zb", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "I_", ",_", "expected_", "=_", "'", "I", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "Z", "\\u", "BIG", "\\u", "Z_", ",_", "expected_", "=_", "'", "ZZ", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "Z", "\\u", "BIG", "\\u", "Q_", ",_", "expected_", "=_", "'", "ZQ", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GV", "_", ",_", "expected_", "=_", "'", "gv", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "J_", ",_", "expected_", "=_", "'", "J", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "K_", ",_", "expected_", "=_", "'", "K", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "L_", ",_", "expected_", "=_", "'", "L", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "M_", ",_", "expected_", "=_", "'", "M", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "N_", ",_", "expected_", "=_", "'", "N", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "O_", ",_", "expected_", "=_", "'", "O", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "P_", ",_", "expected_", "=_", "'", "P", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "Q_", ",_", "expected_", "=_", "'", "Q", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "R_", ",_", "expected_", "=_", "'", "R", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "S_", ",_", "expected_", "=_", "'", "S", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "T_", ",_", "expected_", "=_", "'", "T", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "U_", ",_", "expected_", "=_", "'", "U", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "V_", ",_", "expected_", "=_", "'", "V", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "W_", ",_", "expected_", "=_", "'", "W", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "X_", ",_", "expected_", "=_", "'", "X", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "Y_", ",_", "expected_", "=_", "'", "Y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "BIG", "\\u", "Z_", ",_", "expected_", "=_", "'", "Z", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "C_", ",_", "expected_", "=_", "'", "c", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CC_", ",_", "expected_", "=_", "'", "cc", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "COLON", "_", ",_", "expected_", "=_", "':'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "COMMA", "_", ",_", "expected_", "=_", "','_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "D_", ",_", "expected_", "=_", "'<", "C", "-", "d", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "F1", "2_", ",_", "expected_", "=_", "'<", "C", "-", "f1", "2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "L_", ",_", "expected_", "=_", "'<", "C", "-", "l", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "B_", ",_", "expected_", "=_", "'<", "C", "-", "b", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "F_", ",_", "expected_", "=_", "'<", "C", "-", "f", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "G_", ",_", "expected_", "=_", "'<", "C", "-", "g", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "P_", ",_", "expected_", "=_", "'<", "C", "-", "p", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "U_", ",_", "expected_", "=_", "'<", "C", "-", "u", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "V_", ",_", "expected_", "=_", "'<", "C", "-", "v", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "D_", ",_", "expected_", "=_", "'", "d", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "DD", "_", ",_", "expected_", "=_", "'", "dd", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "DO", "LLA", "R_", ",_", "expected_", "=_", "'$'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "DOT", "_", ",_", "expected_", "=_", "'.'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "DOUBLE", "\\u", "QUOTE", "_", ",_", "expected_", "=_", "'\"'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "E_", ",_", "expected_", "=_", "'", "e", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ENTER_", ",_", "expected_", "=_", "'<", "cr", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SHIFT", "\\u", "ENTER_", ",_", "expected_", "=_", "'<", "S", "-", "cr", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "EQUAL", "_", ",_", "expected_", "=_", "'='_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "EQUAL", "\\u", "EQUAL", "_", ",_", "expected_", "=_", "'=='_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ESC", "_", ",_", "expected_", "=_", "'<", "esc", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F_", ",_", "expected_", "=_", "'", "f", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1_", ",_", "expected_", "=_", "'<", "f1", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1", "0_", ",_", "expected_", "=_", "'<", "f1", "0", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1", "1_", ",_", "expected_", "=_", "'<", "f1", "1", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1", "2_", ",_", "expected_", "=_", "'<", "f1", "2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1", "3_", ",_", "expected_", "=_", "'<", "f1", "3", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1", "4_", ",_", "expected_", "=_", "'<", "f1", "4", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F1", "5_", ",_", "expected_", "=_", "'<", "f1", "5", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F2_", ",_", "expected_", "=_", "'<", "f2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F3", "_", ",_", "expected_", "=_", "'<", "f3", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SHIFT", "\\u", "F2_", ",_", "expected_", "=_", "'<", "S", "-", "f2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SHIFT", "\\u", "F3", "_", ",_", "expected_", "=_", "'<", "S", "-", "f3", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SHIFT", "\\u", "F4_", ",_", "expected_", "=_", "'<", "S", "-", "f4", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F4_", ",_", "expected_", "=_", "'<", "f4", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F5", "_", ",_", "expected_", "=_", "'<", "f5", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F6", "_", ",_", "expected_", "=_", "'<", "f6", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F", "7_", ",_", "expected_", "=_", "'<", "f7", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F8_", ",_", "expected_", "=_", "'<", "f8", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "F", "9_", ",_", "expected_", "=_", "'<", "f9", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "F2_", ",_", "expected_", "=_", "'<", "C", "-", "f2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "CTR", "L", "\\u", "SHIFT", "\\u", "F2_", ",_", "expected_", "=_", "'<", "C", "-", "S", "-", "f2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G_", ",_", "expected_", "=_", "'", "g", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "C_", ",_", "expected_", "=_", "'", "g", "C", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "D_", ",_", "expected_", "=_", "'", "g", "D", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "U_", ",_", "expected_", "=_", "'", "g", "U", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "U", "\\u", "BIG", "\\u", "U_", ",_", "expected_", "=_", "'", "g", "UU", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "U", "\\u", "G", "\\u", "BIG", "\\u", "U_", ",_", "expected_", "=_", "'", "g", "Ug", "U", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "TI", "LD", "E_", ",_", "expected_", "=_", "'", "g", "~'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "TI", "LD", "E", "\\u", "G", "\\u", "TI", "LD", "E_", ",_", "expected_", "=_", "'", "g", "~", "g", "~'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "TI", "LD", "E", "\\u", "TI", "LD", "E_", ",_", "expected_", "=_", "'", "g", "~~", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "UNDER", "SCORE", "_", ",_", "expected_", "=_", "'", "g", "\\u'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GC", "_", ",_", "expected_", "=_", "'", "gc", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GCC", "_", ",_", "expected_", "=_", "'", "gcc", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GD", "_", ",_", "expected_", "=_", "'", "gd", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GG", "_", ",_", "expected_", "=_", "'", "gg", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GJ", "_", ",_", "expected_", "=_", "'", "gj", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GK", "_", ",_", "expected_", "=_", "'", "gk", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GQ", "_", ",_", "expected_", "=_", "'", "gq", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GT", "_", ",_", "expected_", "=_", "'", "gt", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "G", "\\u", "BIG", "\\u", "T_", ",_", "expected_", "=_", "'", "g", "T", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GM", "_", ",_", "expected_", "=_", "'", "gm", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GU", "_", ",_", "expected_", "=_", "'", "gu", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GU", "GU", "_", ",_", "expected_", "=_", "'", "gu", "gu", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GU", "U_", ",_", "expected_", "=_", "'", "gu", "u", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GRE", "ATE", "R", "\\u", "THA", "N_", ",_", "expected_", "=_", "'>'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "GRE", "ATE", "R", "\\u", "THA", "N", "\\u", "GRE", "ATE", "R", "\\u", "THA", "N_", ",_", "expected_", "=_", "'>>", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "H_", ",_", "expected_", "=_", "'", "h", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "HAT", "_", ",_", "expected_", "=_", "'", "^", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "I_", ",_", "expected_", "=_", "'", "i", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "J_", ",_", "expected_", "=_", "'", "j", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "K_", ",_", "expected_", "=_", "'", "k", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "L_", ",_", "expected_", "=_", "'", "l", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "LEF", "T", "\\u", "BRAC", "E_", ",_", "expected_", "=_", "'{'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "LEF", "T", "\\u", "SQUARE", "\\u", "BRAC", "KET", "_", ",_", "expected_", "=_", "'['_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "LEF", "T", "\\u", "PAR", "EN_", ",_", "expected_", "=_", "'('_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "LESS", "\\u", "THA", "N_", ",_", "expected_", "=_", "'<", "lt", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "LESS", "\\u", "THA", "N", "\\u", "LESS", "\\u", "THA", "N_", ",_", "expected_", "=_", "'<", "lt", "><", "lt", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "MINUS", "_", ",_", "expected_", "=_", "'-'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "M_", ",_", "expected_", "=_", "'", "m", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "N_", ",_", "expected_", "=_", "'", "n", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "O_", ",_", "expected_", "=_", "'", "o", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "P_", ",_", "expected_", "=_", "'", "p", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "PLUS", "_", ",_", "expected_", "=_", "'+'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "OCT", "OTH", "OR", "P_", ",_", "expected_", "=_", "'#'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "PAGE", "\\u", "DOWN_", ",_", "expected_", "=_", "'", "paged", "own", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "PAGE", "\\u", "UP_", ",_", "expected_", "=_", "'", "page", "up", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "PERCENT", "_", ",_", "expected_", "=_", "'%'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "PIPE_", ",_", "expected_", "=_", "'|'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "QUESTION", "\\u", "MARK", "_", ",_", "expected_", "=_", "'?'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "QUOTE", "_", ",_", "expected_", "=_", "\"'\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "QUOTE", "\\u", "QUOTE", "_", ",_", "expected_", "=_", "\"''\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "R_", ",_", "expected_", "=_", "'", "r", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "RIG", "HT", "\\u", "BRAC", "E_", ",_", "expected_", "=_", "'}'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "RIG", "HT", "\\u", "SQUARE", "\\u", "BRAC", "KET", "_", ",_", "expected_", "=_", "']'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "RIG", "HT", "\\u", "PAR", "EN_", ",_", "expected_", "=_", "')'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "S_", ",_", "expected_", "=_", "'", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SEMI", "COLON", "_", ",_", "expected_", "=_", "';'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SHIFT", "\\u", "CTR", "L", "\\u", "F1", "2_", ",_", "expected_", "=_", "'<", "C", "-", "S", "-", "f1", "2", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SHIFT", "\\u", "F1", "1_", ",_", "expected_", "=_", "'<", "S", "-", "f1", "1", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "SLA", "SH_", ",_", "expected_", "=_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "STAR", "_", ",_", "expected_", "=_", "'*'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "T_", ",_", "expected_", "=_", "'", "t", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "TAB", "_", ",_", "expected_", "=_", "'<", "tab", ">'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "TI", "LD", "E_", ",_", "expected_", "=_", "'~'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "U_", ",_", "expected_", "=_", "'", "u", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "UNDER", "SCORE", "_", ",_", "expected_", "=_", "'\\u'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "V_", ",_", "expected_", "=_", "'", "v", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "W_", ",_", "expected_", "=_", "'", "w", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "X_", ",_", "expected_", "=_", "'", "x", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "Y_", ",_", "expected_", "=_", "'", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "YY", "_", ",_", "expected_", "=_", "'", "yy", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seq", "\\u", "test_", "(_", "actual_", "=_", "seqs_", "._", "ZERO_", ",_", "expected_", "=_", "'", "0", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "tokenize", "\\u", "one_", "(_", "View", "Test_", ")_", ":_", "\\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", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "tokenize", "\\u", "one_", "(_", "View", "Test_", ")_", ":_", "\\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_", "(_", ")_", "._", "set", "Up_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "old", "\\u", "vars_", "=_", "variables_", "._", "\\u", "VARIABLES", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "._", "\\u", "VARIABLES", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "tokenize", "\\u", "one_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "input\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tokenizer_", "=_", "Key", "Sequ", "ence", "Tokenizer_", "(_", "input\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tokenizer_", "._", "tokenize", "\\u", "one_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "tokenize", "\\u", "one_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "i_", ",_", "t_", ")_", "in_", "enumerate_", "(_", "\\u", "tests", "\\u", "tokenizer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input\\u_", ",_", "expected_", ",_", "msg_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "parse_", "(_", "input\\u_", ")_", ",_", "expected_", ",_", "\"{", "0", "}", " ", "-", " ", "{", "1", "}\"_", "._", "format_", "(_", "i_", ",_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "tokenize", "\\u", "one_", "(_", "View", "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_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", ")_", "._", "tear", "Down_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "._", "\\u", "VARIABLES", "_", "=_", "self_", "._", "old", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "iter", "\\u", "tokenize_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "iter", "\\u", "tokenize_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "parse_", "(_", "self_", ",_", "input\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tokenizer_", "=_", "Key", "Sequ", "ence", "Tokenizer_", "(_", "input\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "list_", "(_", "tokenizer_", "._", "iter", "\\u", "tokenize_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Token", "ize", "r", "\\u", "iter", "\\u", "tokenize_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "i_", ",_", "t_", ")_", "in_", "enumerate_", "(_", "\\u", "tests", "\\u", "iter", "\\u", "tokenize_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input\\u_", ",_", "expected_", ",_", "msg_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "parse_", "(_", "input\\u_", ")_", ",_", "expected_", ",_", "\"{", "0", "}", " ", "-", " ", "{", "1", "}\"_", "._", "format_", "(_", "i_", ",_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "\\u", "to", "\\u", "bare", "\\u", "command", "\\u", "name_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "to", "\\u", "bare", "\\u", "command", "\\u", "name_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "transform_", "(_", "self_", ",_", "input\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "to", "\\u", "bare", "\\u", "command", "\\u", "name_", "(_", "input\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "to", "\\u", "bare", "\\u", "command", "\\u", "name_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "i_", ",_", "t_", ")_", "in_", "enumerate_", "(_", "\\u", "command", "\\u", "name", "\\u", "tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input\\u_", ",_", "expected_", ",_", "msg_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "transform_", "(_", "input\\u_", ")_", ",_", "expected_", ",_", "\"{", "0", "}", " ", "-", " ", "{", "1", "}\"_", "._", "format_", "(_", "i_", ",_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "\\u", "translat", "e\\u", "char_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "translat", "e\\u", "char_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "i_", ",_", "t_", ")_", "in_", "enumerate_", "(_", "\\u", "tran", "lation", "\\u", "tests_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input\\u_", ",_", "expected_", ",_", "msg_", "=_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "translat", "e\\u", "char_", "(_", "input\\u_", ")_", ",_", "expected_", ",_", "\"{", "0", "}", " ", "-", " ", "{", "1", "}\"_", "._", "format_", "(_", "i_", ",_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Names_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Names_", "(_", "View", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "All_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "i_", ",_", "data_", ")_", "in_", "enumerate_", "(_", "TESTS", "\\u", "KNOWN", "\\u", "SEQUENCE", "S_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "data_", "._", "actual_", ",_", "data_", "._", "expected_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fail", "ed", " ", "at", " ", "index", " ", "{", "0", "}\"_", "._", "format_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Key", "Sequ", "ence", "Names_", "(_", "View", "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", "All", "Key", "Sequ", "ence", "Names", "Are", "Test", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tested", "\\u", "seqs_", "=_", "[_", "k_", "._", "actual_", "for_", "k_", "in_", "TESTS", "\\u", "KNOWN", "\\u", "SEQUENCE", "S_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sorted_", "(_", "tested", "\\u", "seqs_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sorted_", "(_", "[_", "v_", "for_", "(_", "k_", ",_", "v_", ")_", "in_", "seqs_", "._", "\\u\\u", "dict\\u\\u_", "._", "items_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "k_", "._", "isupper", "_", "(_", ")_", "]_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
eoyilmaz/anima/tests/previs/test_sequencer_extension.py
[ { "content": "# -*- coding: utf-8 -*-\n# Copyright (c) 2012-2015, Anima Istanbul\n#\n# This module is part of anima-tools and is released under the BSD 2\n# License: http://www.opensource.org/licenses/BSD-2-Clause\n\nimport os\nimport unittest\n\n# prepare for test\nos.environ['ANIMA_TEST_SETUP'] = \"\"\n\nfrom anima.env import mayaEnv # to setup maya extensions\n\nimport pymel.core\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SequencerExtensionTestCase(unittest.TestCase):\n \"\"\"tests the anima.animation.SequencerExtension class\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.SequencerExtensionTestCase", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def setUp(self):\n \"\"\"set up the test\n \"\"\"\n pymel.core.newFile(force=True)", "metadata": "root.SequencerExtensionTestCase.setUp", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 21 }, { "content": " def test_set_shot_handles_method_is_working_properly(self):\n \"\"\"testing if the set_shot_handles method is working properly\n \"\"\"\n s = pymel.core.createNode('sequencer')\n shot1 = s.create_shot('shot1')\n shot2 = s.create_shot('shot2')\n shot3 = s.create_shot('shot3')\n\n self.assertEqual(\n [shot1, shot2, shot3],\n s.all_shots\n )\n\n self.assertNotEqual(shot1.handle.get(), 50)\n self.assertNotEqual(shot2.handle.get(), 50)\n self.assertNotEqual(shot3.handle.get(), 50)\n\n s.set_shot_handles(50)\n self.assertEqual(shot1.handle.get(), 50)\n self.assertEqual(shot2.handle.get(), 50)\n self.assertEqual(shot3.handle.get(), 50)", "metadata": "root.SequencerExtensionTestCase.test_set_shot_handles_method_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 26 }, { "content": " def test_create_shot_is_working_properly(self):\n \"\"\"testing if SequencerExtension.create_shot() is working properly\n \"\"\"\n s = pymel.core.createNode('sequencer')\n shot = s.create_shot(name='Test Shot', handle=14)\n self.assertIsInstance(shot, pymel.core.nt.Shot)\n\n self.assertEqual(\n 'shot1',\n shot.name()\n )\n\n self.assertEqual(\n 'Test Shot',\n shot.shotName.get()\n )\n\n self.assertEqual(\n 14,\n shot.handle.get()\n )\n\n self.assertEqual(\n s,\n shot.message.outputs()[0]\n )", "metadata": "root.SequencerExtensionTestCase.test_create_shot_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def test_all_shots_property_is_working_properly(self):\n \"\"\"testing if the all_shots property is working properly\n \"\"\"\n s = pymel.core.createNode('sequencer')\n s1 = s.create_shot('shot1')\n s2 = s.create_shot('shot2')\n s3 = s.create_shot('shot3')\n\n self.assertItemsEqual(\n [s1, s2, s3],\n s.all_shots\n )", "metadata": "root.SequencerExtensionTestCase.test_all_shots_property_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def test_add_shot_with_an_unconnected_shot(self):\n \"\"\"testing if the add_shot method is working properly for an\n unconnected shot\n \"\"\"\n s = pymel.core.createNode('sequencer')\n s1 = pymel.core.createNode('shot')\n s.add_shot(s1)\n\n self.assertEqual(\n [s1],\n s.all_shots,\n )", "metadata": "root.SequencerExtensionTestCase.test_add_shot_with_an_unconnected_shot", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 88 }, { "content": " def test_add_shot_will_add_handle_attributes_if_doesnt_exists(self):\n \"\"\"testing if add_shot method will add the handle attributes if the\n given shot doesn't have it\n \"\"\"\n s = pymel.core.createNode('sequencer')\n s1 = pymel.core.createNode('shot')\n self.assertFalse(\n s1.hasAttr('handle')\n )\n\n s.add_shot(s1)\n\n self.assertTrue(\n s1.hasAttr('handle')\n )\n\n self.assertTrue(\n 10,\n s1.handle.get()\n )", "metadata": "root.SequencerExtensionTestCase.test_add_shot_will_add_handle_attributes_if_doesnt_exists", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 101 }, { "content": " def test_add_shot_with_a_connected_shot(self):\n \"\"\"testing if the add_shot method is working properly for a shot which\n is already connected to another sequence\n \"\"\"\n s1 = pymel.core.createNode('sequencer')\n s2 = pymel.core.createNode('sequencer')\n\n shot1 = s1.create_shot('shot1')\n shot2 = s1.create_shot('shot2')\n\n shot3 = s2.create_shot('shot3')\n shot4 = s2.create_shot('shot4')\n\n self.assertEqual(\n [shot1, shot2],\n s1.all_shots\n )\n\n self.assertEqual(\n [shot3, shot4],\n s2.all_shots\n )\n\n s1.add_shot(shot3)\n self.assertEqual(\n [shot1, shot2, shot3],\n s1.all_shots\n )\n\n self.assertEqual(\n [shot4],\n s2.all_shots\n )\n\n s1.add_shot(shot4)\n self.assertEqual(\n [shot1, shot2, shot3, shot4],\n s1.all_shots\n )\n\n self.assertEqual(\n [],\n s2.all_shots\n )", "metadata": "root.SequencerExtensionTestCase.test_add_shot_with_a_connected_shot", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 122 }, { "content": " def test_set_sequence_name_is_working_properly(self):\n \"\"\"testing if the set_sequence_name is working properly\n \"\"\"\n s1 = pymel.core.createNode('sequencer')\n self.assertFalse(s1.hasAttr('sequence_name'))\n\n s1.set_sequence_name('Test Sequence')\n self.assertTrue(s1.hasAttr('sequence_name'))\n\n self.assertEqual(\n s1.sequence_name.get(),\n 'Test Sequence'\n )", "metadata": "root.SequencerExtensionTestCase.test_set_sequence_name_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 167 }, { "content": " def test_get_sequence_name_is_working_properly(self):\n \"\"\"testing if the get_sequence_name is working properly\n \"\"\"\n s1 = pymel.core.createNode('sequencer')\n self.assertFalse(s1.hasAttr('sequence_name'))\n\n s1.set_sequence_name('Test Sequence')\n self.assertTrue(s1.hasAttr('sequence_name'))\n\n self.assertEqual(\n s1.get_sequence_name(),\n 'Test Sequence'\n )", "metadata": "root.SequencerExtensionTestCase.test_get_sequence_name_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 181 }, { "content": " def test_get_sequence_name_will_create_sequence_name_attribute_if_missing(self):\n \"\"\"testing if the get_sequence_name will create the attribute if it is\n missing\n \"\"\"\n s1 = pymel.core.createNode('sequencer')\n self.assertFalse(s1.hasAttr('sequence_name'))\n\n result = s1.get_sequence_name()\n self.assertTrue(s1.hasAttr('sequence_name'))\n\n self.assertEqual(s1.get_sequence_name(), result)", "metadata": "root.SequencerExtensionTestCase.test_get_sequence_name_will_create_sequence_name_attribute_if_missing", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 195 }, { "content": " def test_mute_shots_is_working_properly(self):\n \"\"\"testing if mute shot is working properly\n \"\"\"\n sm = pymel.core.PyNode('sequenceManager1')\n seq1 = sm.create_sequence('sequence1')\n shot1 = seq1.create_shot('shot1')\n shot2 = seq1.create_shot('shot2')\n shot3 = seq1.create_shot('shot3')\n\n self.assertFalse(pymel.core.shot(shot1, q=1, mute=1))\n self.assertFalse(pymel.core.shot(shot2, q=1, mute=1))\n self.assertFalse(pymel.core.shot(shot3, q=1, mute=1))\n\n seq1.mute_shots()\n\n self.assertTrue(pymel.core.shot(shot1, q=1, mute=1))\n self.assertTrue(pymel.core.shot(shot2, q=1, mute=1))\n self.assertTrue(pymel.core.shot(shot3, q=1, mute=1))", "metadata": "root.SequencerExtensionTestCase.test_mute_shots_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 207 }, { "content": " def test_unmute_shots_is_working_properly(self):\n \"\"\"testing if mute shot is working properly\n \"\"\"\n sm = pymel.core.PyNode('sequenceManager1')\n seq1 = sm.create_sequence('sequence1')\n shot1 = seq1.create_shot('shot1')\n shot2 = seq1.create_shot('shot2')\n shot3 = seq1.create_shot('shot3')\n\n self.assertFalse(pymel.core.shot(shot1, q=1, mute=1))\n self.assertFalse(pymel.core.shot(shot2, q=1, mute=1))\n self.assertFalse(pymel.core.shot(shot3, q=1, mute=1))\n\n seq1.mute_shots()\n self.assertTrue(pymel.core.shot(shot1, q=1, mute=1))\n self.assertTrue(pymel.core.shot(shot2, q=1, mute=1))\n self.assertTrue(pymel.core.shot(shot3, q=1, mute=1))\n\n seq1.unmute_shots()\n self.assertFalse(pymel.core.shot(shot1, q=1, mute=1))\n self.assertFalse(pymel.core.shot(shot2, q=1, mute=1))\n self.assertFalse(pymel.core.shot(shot3, q=1, mute=1))", "metadata": "root.SequencerExtensionTestCase.test_unmute_shots_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 226 }, { "content": " def test_duration_property_is_working_properly(self):\n \"\"\"testing if the duration property is working properly\n \"\"\"\n sm = pymel.core.PyNode('sequenceManager1')\n seq1 = sm.create_sequence('sequence1')\n\n shot1 = seq1.create_shot('shot1')\n shot1.startFrame.set(10)\n shot1.endFrame.set(20)\n shot1.sequenceStartFrame.set(10)\n shot1.sequenceEndFrame.set(20)\n\n shot2 = seq1.create_shot('shot2')\n shot2.startFrame.set(11)\n shot2.endFrame.set(21)\n shot2.sequenceStartFrame.set(31)\n shot2.sequenceEndFrame.set(41)\n\n shot3 = seq1.create_shot('shot3')\n shot3.startFrame.set(51)\n shot3.endFrame.set(61)\n shot3.sequenceStartFrame.set(71)\n shot3.sequenceEndFrame.set(81)\n\n self.assertEqual(seq1.duration, 72)", "metadata": "root.SequencerExtensionTestCase.test_duration_property_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 249 }, { "content": " def test_manager_property_is_working_properly(self):\n \"\"\"testing if manager property is working properly\n \"\"\"\n sm = pymel.core.PyNode('sequenceManager1')\n seq1 = sm.create_sequence('SEQ001_HSNI_003')\n self.assertEqual(sm, seq1.manager)", "metadata": "root.SequencerExtensionTestCase.test_manager_property_is_working_properly", "header": "['class', 'SequencerExtensionTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 275 } ]
[ { "span": "from anima.env import mayaEnv ", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", "-", "201", "5", ",", " ", "Anima", " ", "Is", "tan", "bul", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "module", " ", "is", " ", "part", " ", "of", " ", "anim", "a", "-", "tool", "s", " ", "and", " ", "is", " ", "released", " ", "under", " ", "the", " ", "BS", "D", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "http", "://", "www", ".", "opens", "ource", ".", "org", "/", "license", "s", "/", "BS", "D", "-", "2", "-", "Clause_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prepar", "e", " ", "for", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "ANIM", "A", "\\u", "TEST", "\\u", "SETUP", "'_", "]_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "anim", "a_", "._", "env_", "import_", "maya", "Env_", "#", " ", "to", " ", "setup", " ", "maya", " ", "extensions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pym", "el_", "._", "core_", "\\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_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "tests", " ", "the", " ", "anim", "a", ".", "animati", "on", ".", "Sequ", "ence", "r", "Ext", "ensi", "on", " ", "class", "\\", "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_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "set", " ", "up", " ", "the", " ", "test", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pym", "el_", "._", "core_", "._", "new", "File_", "(_", "force_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "set\\u", "sho", "t", "\\u", "handle", "s", "\\u", "method", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "set\\u", "sho", "t", "\\u", "handle", "s", " ", "method", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "sho", "t1_", ",_", "sho", "t2_", ",_", "sho", "t3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "sho", "t1_", "._", "handle_", "._", "get_", "(_", ")_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "sho", "t2_", "._", "handle_", "._", "get_", "(_", ")_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "sho", "t3_", "._", "handle_", "._", "get_", "(_", ")_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "set\\u", "sho", "t", "\\u", "handles_", "(_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sho", "t1_", "._", "handle_", "._", "get_", "(_", ")_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sho", "t2_", "._", "handle_", "._", "get_", "(_", ")_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sho", "t3_", "._", "handle_", "._", "get_", "(_", ")_", ",_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "sho", "t", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "Sequ", "ence", "r", "Ext", "ensi", "on", ".", "create", "\\u", "sho", "t", "()", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shot_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "name_", "=_", "'", "Test", " ", "Shot", "'_", ",_", "handle_", "=_", "14_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "shot_", ",_", "pym", "el_", "._", "core_", "._", "nt_", "._", "Shot", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sho", "t1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shot_", "._", "name_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Test", " ", "Shot", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shot_", "._", "sho", "t", "Name_", "._", "get_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "14_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shot_", "._", "handle_", "._", "get_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shot_", "._", "message_", "._", "outputs_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "all", "\\u", "shots", "\\u", "property", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "all", "\\u", "shots", " ", "property", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s3_", "=_", "s_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Item", "s", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "s1_", ",_", "s2_", ",_", "s3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "sho", "t", "\\u", "with", "\\u", "an", "\\u", "uncon", "nect", "ed", "\\u", "shot_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "add", "\\u", "sho", "t", " ", "method", " ", "is", " ", "working", " ", "proper", "ly", " ", "for", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "uncon", "nect", "ed", " ", "sho", "t", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sho", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "._", "add", "\\u", "shot_", "(_", "s1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "s1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "all", "\\u", "shots", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "sho", "t", "\\u", "will", "\\u", "add", "\\u", "handle", "\\u", "attribute", "s", "\\u", "if", "\\u", "doesnt", "\\u", "exists_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "add", "\\u", "sho", "t", " ", "method", " ", "will", " ", "add", " ", "the", " ", "handle", " ", "attribute", "s", " ", "if", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "give", "n", " ", "sho", "t", " ", "doe", "sn", "'", "t", " ", "have", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sho", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "has", "Attr_", "(_", "'", "handle", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "._", "add", "\\u", "shot_", "(_", "s1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "has", "Attr_", "(_", "'", "handle", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "handle_", "._", "get_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "sho", "t", "\\u", "with", "\\u", "a", "\\u", "connect", "ed", "\\u", "shot_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "add", "\\u", "sho", "t", " ", "method", " ", "is", " ", "working", " ", "proper", "ly", " ", "for", " ", "a", " ", "sho", "t", " ", "whi", "ch", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "alr", "ead", "y", " ", "connect", "ed", " ", "to", " ", "anot", "her", " ", "sequence", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sho", "t1_", "=_", "s1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "=_", "s1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sho", "t3_", "=_", "s2_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t4_", "=_", "s2_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t", "4", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "sho", "t1_", ",_", "sho", "t2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "sho", "t3_", ",_", "sho", "t4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s2_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "add", "\\u", "shot_", "(_", "sho", "t3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "sho", "t1_", ",_", "sho", "t2_", ",_", "sho", "t3_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "sho", "t4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s2_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "add", "\\u", "shot_", "(_", "sho", "t4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "sho", "t1_", ",_", "sho", "t2_", ",_", "sho", "t3_", ",_", "sho", "t4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s2_", "._", "all", "\\u", "shots", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "set\\u", "sequence", "\\u", "name", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "set\\u", "sequence", "\\u", "name", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "s1_", "._", "has", "Attr_", "(_", "'", "sequence", "\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "set\\u", "sequence", "\\u", "name_", "(_", "'", "Test", " ", "Sequ", "ence", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "s1_", "._", "has", "Attr_", "(_", "'", "sequence", "\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "sequence", "\\u", "name_", "._", "get_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Test", " ", "Sequ", "ence", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "sequence", "\\u", "name", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "get", "\\u", "sequence", "\\u", "name", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "s1_", "._", "has", "Attr_", "(_", "'", "sequence", "\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "set\\u", "sequence", "\\u", "name_", "(_", "'", "Test", " ", "Sequ", "ence", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "s1_", "._", "has", "Attr_", "(_", "'", "sequence", "\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "._", "get", "\\u", "sequence", "\\u", "name_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Test", " ", "Sequ", "ence", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "sequence", "\\u", "name", "\\u", "will", "\\u", "create", "\\u", "sequence", "\\u", "name", "\\u", "attribute", "\\u", "if", "\\u", "missing_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "get", "\\u", "sequence", "\\u", "name", " ", "will", " ", "create", " ", "the", " ", "attribute", " ", "if", " ", "it", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "missi", "ng", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "pym", "el_", "._", "core_", "._", "create", "Node_", "(_", "'", "sequence", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "s1_", "._", "has", "Attr_", "(_", "'", "sequence", "\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "s1_", "._", "get", "\\u", "sequence", "\\u", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "s1_", "._", "has", "Attr_", "(_", "'", "sequence", "\\u", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "s1_", "._", "get", "\\u", "sequence", "\\u", "name_", "(_", ")_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "mute", "\\u", "shots", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "mute", " ", "sho", "t", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sm_", "=_", "pym", "el_", "._", "core_", "._", "Py", "Node_", "(_", "'", "sequence", "Manager", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seq1_", "=_", "sm_", "._", "create", "\\u", "sequence_", "(_", "'", "sequence", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t1_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t2_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t3_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq1_", "._", "mute", "\\u", "shots", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t1_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t2_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t3_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "unm", "ute", "\\u", "shots", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "mute", " ", "sho", "t", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sm_", "=_", "pym", "el_", "._", "core_", "._", "Py", "Node_", "(_", "'", "sequence", "Manager", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seq1_", "=_", "sm_", "._", "create", "\\u", "sequence_", "(_", "'", "sequence", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t1_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t2_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t3_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq1_", "._", "mute", "\\u", "shots", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t1_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t2_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t3_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "seq1_", "._", "unm", "ute", "\\u", "shots", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t1_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t2_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "pym", "el_", "._", "core_", "._", "shot_", "(_", "sho", "t3_", ",_", "q_", "=_", "1_", ",_", "mute_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "duration", "\\u", "property", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "the", " ", "duration", " ", "property", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sm_", "=_", "pym", "el_", "._", "core_", "._", "Py", "Node_", "(_", "'", "sequence", "Manager", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seq1_", "=_", "sm_", "._", "create", "\\u", "sequence_", "(_", "'", "sequence", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sho", "t1_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "._", "start", "Frame_", "._", "set_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "._", "end", "Frame_", "._", "set_", "(_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "._", "sequence", "Start", "Frame_", "._", "set_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t1_", "._", "sequence", "End", "Frame_", "._", "set_", "(_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sho", "t2_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "._", "start", "Frame_", "._", "set_", "(_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "._", "end", "Frame_", "._", "set_", "(_", "21_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "._", "sequence", "Start", "Frame_", "._", "set_", "(_", "31_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t2_", "._", "sequence", "End", "Frame_", "._", "set_", "(_", "41_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sho", "t3_", "=_", "seq1_", "._", "create", "\\u", "shot_", "(_", "'", "sho", "t3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "._", "start", "Frame_", "._", "set_", "(_", "51_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "._", "end", "Frame_", "._", "set_", "(_", "61_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "._", "sequence", "Start", "Frame_", "._", "set_", "(_", "71_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sho", "t3_", "._", "sequence", "End", "Frame_", "._", "set_", "(_", "81_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "seq1_", "._", "duration_", ",_", "72_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sequ", "ence", "r", "Ext", "ensi", "on", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "manage", "r", "\\u", "property", "\\u", "is", "\\u", "working", "\\u", "proper", "ly_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "testi", "ng", " ", "if", " ", "manage", "r", " ", "property", " ", "is", " ", "working", " ", "proper", "ly", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sm_", "=_", "pym", "el_", "._", "core_", "._", "Py", "Node_", "(_", "'", "sequence", "Manager", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seq1_", "=_", "sm_", "._", "create", "\\u", "sequence_", "(_", "'", "SEQ", "001", "\\u", "HS", "NI", "\\u", "003", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "sm_", ",_", "seq1_", "._", "manager_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
crsmithdev/arrow/arrow/formatter.py
[ { "content": " def format(cls, dt, fmt):\n\n return cls._FORMAT_RE.sub(lambda m: cls._format_token(dt, m.group(0)), fmt)", "metadata": "root.DateTimeFormatter.format", "header": "['class', 'DateTimeFormatter', '(', 'object', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "def format(cls, dt, fmt):", "start_line": 17, "start_column": 4, "end_line": 17, "end_column": 29 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Date", "Time", "Formatter_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format_", "(_", "cls_", ",_", "dt_", ",_", "fmt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cls_", "._", "\\u", "FORMAT", "\\u", "RE_", "._", "sub_", "(_", "lambda_", "m_", ":_", "cls_", "._", "\\u", "format\\u", "token_", "(_", "dt_", ",_", "m_", "._", "group_", "(_", "0_", ")_", ")_", ",_", "fmt_", ")_", "\\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, 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 ]
Unused import
pydata/pandas/pandas/tseries/common.py
[ { "content": "\"\"\"\ndatetimelike delegation\n\"\"\"\n\nimport numpy as np\nfrom pandas.core.base import PandasDelegate, NoNewAttributesMixin\nfrom pandas.core import common as com\nfrom pandas.tseries.index import DatetimeIndex\nfrom pandas._period import IncompatibleFrequency # flake8: noqa\nfrom pandas.tseries.period import PeriodIndex\nfrom pandas.tseries.tdi import TimedeltaIndex\nfrom pandas import tslib\nfrom pandas.core.algorithms import take_1d\nfrom pandas.core.common import (_NS_DTYPE, _TD_DTYPE, is_period_arraylike,\n is_datetime_arraylike, is_integer_dtype,\n is_list_like,\n is_datetime64_dtype, is_datetime64tz_dtype,\n is_timedelta64_dtype, is_categorical_dtype)\n\n\n\n\n\n\n\n\n\nDatetimeProperties._add_delegate_accessors(\n delegate=DatetimeIndex,\n accessors=DatetimeIndex._datetimelike_ops,\n typ='property')\nDatetimeProperties._add_delegate_accessors(\n delegate=DatetimeIndex,\n accessors=[\"to_period\", \"tz_localize\", \"tz_convert\",\n \"normalize\", \"strftime\", \"round\", \"floor\", \"ceil\"],\n typ='method')\n\n\n\nTimedeltaProperties._add_delegate_accessors(\n delegate=TimedeltaIndex,\n accessors=TimedeltaIndex._datetimelike_ops,\n typ='property')\nTimedeltaProperties._add_delegate_accessors(\n delegate=TimedeltaIndex,\n accessors=[\"to_pytimedelta\", \"total_seconds\", \"round\", \"floor\", \"ceil\"],\n typ='method')\n\n\n\nPeriodProperties._add_delegate_accessors(\n delegate=PeriodIndex,\n accessors=PeriodIndex._datetimelike_ops,\n typ='property')\nPeriodProperties._add_delegate_accessors(delegate=PeriodIndex,\n accessors=[\"strftime\"],\n typ='method')\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def is_datetimelike(data):\n \"\"\"\n return a boolean if we can be successfully converted to a datetimelike\n \"\"\"\n try:\n maybe_to_datetimelike(data)\n return True\n except (Exception):\n pass\n return False", "metadata": "root.is_datetimelike", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def maybe_to_datetimelike(data, copy=False):\n \"\"\"\n return a DelegatedClass of a Series that is datetimelike\n (e.g. datetime64[ns],timedelta64[ns] dtype or a Series of Periods)\n raise TypeError if this is not possible.\n\n Parameters\n ----------\n data : Series\n copy : boolean, default False\n copy the input data\n\n Returns\n -------\n DelegatedClass\n\n \"\"\"\n from pandas import Series\n\n if not isinstance(data, Series):\n raise TypeError(\"cannot convert an object of type {0} to a \"\n \"datetimelike index\".format(type(data)))\n\n index = data.index\n name = data.name\n orig = data if is_categorical_dtype(data) else None\n if orig is not None:\n data = orig.values.categories\n\n if is_datetime64_dtype(data.dtype):\n return DatetimeProperties(DatetimeIndex(data, copy=copy, freq='infer'),\n index, name=name, orig=orig)\n elif is_datetime64tz_dtype(data.dtype):\n return DatetimeProperties(DatetimeIndex(data, copy=copy, freq='infer',\n ambiguous='infer'),\n index, data.name, orig=orig)\n elif is_timedelta64_dtype(data.dtype):\n return TimedeltaProperties(TimedeltaIndex(data, copy=copy,\n freq='infer'), index,\n name=name, orig=orig)\n else:\n if is_period_arraylike(data):\n return PeriodProperties(PeriodIndex(data, copy=copy), index,\n name=name, orig=orig)\n if is_datetime_arraylike(data):\n return DatetimeProperties(DatetimeIndex(data, copy=copy,\n freq='infer'), index,\n name=name, orig=orig)\n\n raise TypeError(\"cannot convert an object of type {0} to a \"\n \"datetimelike index\".format(type(data)))", "metadata": "root.maybe_to_datetimelike", "header": "['module', '___EOS___']", "index": 32 }, { "content": "class Properties(PandasDelegate, NoNewAttributesMixin):\n\n\n\n", "metadata": "root.Properties", "header": "['module', '___EOS___']", "index": 85 }, { "content": " def __init__(self, values, index, name, orig=None):\n self.values = values\n self.index = index\n self.name = name\n self.orig = orig\n self._freeze()", "metadata": "root.Properties.__init__", "header": "['class', 'Properties', '(', 'PandasDelegate', ',', 'NoNewAttributesMixin', ')', ':', '___EOS___']", "index": 87 }, { "content": " def _delegate_property_get(self, name):\n from pandas import Series\n\n result = getattr(self.values, name)\n\n # maybe need to upcast (ints)\n if isinstance(result, np.ndarray):\n if is_integer_dtype(result):\n result = result.astype('int64')\n elif not is_list_like(result):\n return result\n\n # blow up if we operate on categories\n if self.orig is not None:\n result = take_1d(result, self.orig.cat.codes)\n\n # return the result as a Series, which is by definition a copy\n result = Series(result, index=self.index, name=self.name)\n\n # setting this object will show a SettingWithCopyWarning/Error\n result.is_copy = (\"modifications to a property of a datetimelike \"\n \"object are not supported and are discarded. \"\n \"Change values on the original.\")\n\n return result", "metadata": "root.Properties._delegate_property_get", "header": "['class', 'Properties', '(', 'PandasDelegate', ',', 'NoNewAttributesMixin', ')', ':', '___EOS___']", "index": 94 }, { "content": " def _delegate_property_set(self, name, value, *args, **kwargs):\n raise ValueError(\"modifications to a property of a datetimelike \"\n \"object are not supported. Change values on the \"\n \"original.\")", "metadata": "root.Properties._delegate_property_set", "header": "['class', 'Properties', '(', 'PandasDelegate', ',', 'NoNewAttributesMixin', ')', ':', '___EOS___']", "index": 120 }, { "content": " def _delegate_method(self, name, *args, **kwargs):\n from pandas import Series\n\n method = getattr(self.values, name)\n result = method(*args, **kwargs)\n\n if not com.is_list_like(result):\n return result\n\n result = Series(result, index=self.index, name=self.name)\n\n # setting this object will show a SettingWithCopyWarning/Error\n result.is_copy = (\"modifications to a method of a datetimelike object \"\n \"are not supported and are discarded. Change \"\n \"values on the original.\")\n\n return result", "metadata": "root.Properties._delegate_method", "header": "['class', 'Properties', '(', 'PandasDelegate', ',', 'NoNewAttributesMixin', ')', ':', '___EOS___']", "index": 125 }, { "content": "class DatetimeProperties(Properties):\n \"\"\"\n Accessor object for datetimelike properties of the Series values.\n\n Examples\n --------\n >>> s.dt.hour\n >>> s.dt.second\n >>> s.dt.quarter\n\n Returns a Series indexed like the original Series.\n Raises TypeError if the Series does not contain datetimelike values.\n \"\"\"\n", "metadata": "root.DatetimeProperties", "header": "['module', '___EOS___']", "index": 144 }, { "content": " def to_pydatetime(self):\n return self.values.to_pydatetime()", "metadata": "root.DatetimeProperties.to_pydatetime", "header": "['class', 'DatetimeProperties', '(', 'Properties', ')', ':', '___EOS___']", "index": 158 }, { "content": "class TimedeltaProperties(Properties):\n \"\"\"\n Accessor object for datetimelike properties of the Series values.\n\n Examples\n --------\n >>> s.dt.hours\n >>> s.dt.seconds\n\n Returns a Series indexed like the original Series.\n Raises TypeError if the Series does not contain datetimelike values.\n \"\"\"\n\n", "metadata": "root.TimedeltaProperties", "header": "['module', '___EOS___']", "index": 172 }, { "content": " def to_pytimedelta(self):\n return self.values.to_pytimedelta()", "metadata": "root.TimedeltaProperties.to_pytimedelta", "header": "['class', 'TimedeltaProperties', '(', 'Properties', ')', ':', '___EOS___']", "index": 185 }, { "content": " @property\n def components(self):\n \"\"\"\n Return a dataframe of the components (days, hours, minutes,\n seconds, milliseconds, microseconds, nanoseconds) of the Timedeltas.\n\n Returns\n -------\n a DataFrame\n\n \"\"\"\n return self.values.components.set_index(self.index)", "metadata": "root.TimedeltaProperties.components", "header": "['class', 'TimedeltaProperties', '(', 'Properties', ')', ':', '___EOS___']", "index": 188 }, { "content": "class PeriodProperties(Properties):\n \"\"\"\n Accessor object for datetimelike properties of the Series values.\n\n Examples\n --------\n >>> s.dt.hour\n >>> s.dt.second\n >>> s.dt.quarter\n\n Returns a Series indexed like the original Series.\n Raises TypeError if the Series does not contain datetimelike values.\n \"\"\"", "metadata": "root.PeriodProperties", "header": "['module', '___EOS___']", "index": 211 }, { "content": "class CombinedDatetimelikeProperties(DatetimeProperties, TimedeltaProperties):\n # This class is never instantiated, and exists solely for the benefit of\n # the Series.dt class property. For Series objects, .dt will always be one\n # of the more specific classes above.\n __doc__ = DatetimeProperties.__doc__", "metadata": "root.CombinedDatetimelikeProperties", "header": "['module', '___EOS___']", "index": 234 } ]
[ { "span": "from pandas._period import IncompatibleFrequency ", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 48 }, { "span": "from pandas import tslib", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 24 }, { "span": "from pandas.core.common import (_NS_DTYPE, _TD_DTYPE, is_period_arraylike,\n is_datetime_arraylike, is_integer_dtype,\n is_list_like,\n is_datetime64_dtype, is_datetime64tz_dtype,\n is_timedelta64_dtype, is_categorical_dtype)", "start_line": 13, "start_column": 0, "end_line": 17, "end_column": 75 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "datetime", "like", " ", "delegat", "ion", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "core_", "._", "base_", "import_", "Pan", "das", "Delegate_", ",_", "No", "New", "Attribute", "s", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "core_", "import_", "common_", "as_", "com_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "tse", "ries_", "._", "index_", "import_", "Date", "time", "Index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "\\u", "period_", "import_", "Incomp", "atible", "Frequency_", "#", " ", "flake", "8", ":", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "tse", "ries_", "._", "period_", "import_", "Period", "Index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "tse", "ries_", "._", "tdi", "_", "import_", "Time", "delta", "Index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "import_", "ts", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "core_", "._", "algorithms_", "import_", "take", "\\u", "1d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "._", "core_", "._", "common_", "import_", "(_", "\\u", "NS", "\\u", "DTY", "PE_", ",_", "\\u", "TD", "\\u", "DTY", "PE_", ",_", "is", "\\u", "period", "\\u", "array", "like_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "datetime", "\\u", "array", "like_", ",_", "is", "\\u", "integ", "er", "\\u", "dtype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "list", "\\u", "like_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "datetime", "64", "\\u", "dtype_", ",_", "is", "\\u", "datetime", "64", "tz", "\\u", "dtype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "timedelta", "64", "\\u", "dtype_", ",_", "is", "\\u", "categor", "ical", "\\u", "dtype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Date", "time", "Properties_", "._", "\\u", "add", "\\u", "delegate", "\\u", "accessor", "s_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delegate_", "=_", "Date", "time", "Index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accessor", "s_", "=_", "Date", "time", "Index_", "._", "\\u", "datetime", "like", "\\u", "ops_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "typ_", "=_", "'", "property", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Date", "time", "Properties_", "._", "\\u", "add", "\\u", "delegate", "\\u", "accessor", "s_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delegate_", "=_", "Date", "time", "Index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accessor", "s_", "=_", "[_", "\"", "to", "\\u", "period", "\"_", ",_", "\"", "tz", "\\u", "localiz", "e", "\"_", ",_", "\"", "tz", "\\u", "convert", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "normali", "ze", "\"_", ",_", "\"", "strf", "time", "\"_", ",_", "\"", "round", "\"_", ",_", "\"", "floor", "\"_", ",_", "\"", "ceil", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "typ_", "=_", "'", "method", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Time", "delta", "Properties_", "._", "\\u", "add", "\\u", "delegate", "\\u", "accessor", "s_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delegate_", "=_", "Time", "delta", "Index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accessor", "s_", "=_", "Time", "delta", "Index_", "._", "\\u", "datetime", "like", "\\u", "ops_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "typ_", "=_", "'", "property", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Time", "delta", "Properties_", "._", "\\u", "add", "\\u", "delegate", "\\u", "accessor", "s_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delegate_", "=_", "Time", "delta", "Index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accessor", "s_", "=_", "[_", "\"", "to", "\\u", "pyt", "ime", "delta", "\"_", ",_", "\"", "total", "\\u", "second", "s", "\"_", ",_", "\"", "round", "\"_", ",_", "\"", "floor", "\"_", ",_", "\"", "ceil", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "typ_", "=_", "'", "method", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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_", "Period", "Properties_", "._", "\\u", "add", "\\u", "delegate", "\\u", "accessor", "s_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "delegate_", "=_", "Period", "Index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accessor", "s_", "=_", "Period", "Index_", "._", "\\u", "datetime", "like", "\\u", "ops_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "typ_", "=_", "'", "property", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Period", "Properties_", "._", "\\u", "add", "\\u", "delegate", "\\u", "accessor", "s_", "(_", "delegate_", "=_", "Period", "Index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "accessor", "s_", "=_", "[_", "\"", "strf", "time", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "typ_", "=_", "'", "method", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "is", "\\u", "datetime", "like_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "a", " ", "boolean", " ", "if", " ", "we", " ", "can", " ", "be", " ", "success", "full", "y", " ", "convert", "ed", " ", "to", " ", "a", " ", "datetime", "like", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "may", "be", "\\u", "to", "\\u", "datetime", "like_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "may", "be", "\\u", "to", "\\u", "datetime", "like_", "(_", "data_", ",_", "copy_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "a", " ", "Delegate", "d", "Class", " ", "of", " ", "a", " ", "Serie", "s", " ", "tha", "t", " ", "is", " ", "datetime", "like", "\\", "10", ";", " ", " ", "(", "e", ".", "g", ".", " ", "datetime", "64", "[", "ns", "],", "timedelta", "64", "[", "ns", "]", " ", "dt", "ype", " ", "or", " ", "a", " ", "Serie", "s", " ", "of", " ", "Period", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "raise", " ", "Type", "Error", " ", "if", " ", "this", " ", "is", " ", "not", " ", "possib", "le", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "data", " ", ":", " ", "Serie", "s", "\\", "10", ";", " ", " ", " ", " ", "copy", " ", ":", " ", "boolean", ",", " ", "default", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", "copy", " ", "the", " ", "input", " ", "data", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "Delegate", "d", "Class", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "import_", "Series_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "data_", ",_", "Series_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "cann", "ot", " ", "convert", " ", "an", " ", "object", " ", "of", " ", "type", " ", "{", "0", "}", " ", "to", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "datetime", "like", " ", "index", "\"_", "._", "format_", "(_", "type_", "(_", "data_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index_", "=_", "data_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "data_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig_", "=_", "data_", "if_", "is", "\\u", "categor", "ical", "\\u", "dtype_", "(_", "data_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "orig_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "orig_", "._", "values_", "._", "categories_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "datetime", "64", "\\u", "dtype_", "(_", "data_", "._", "dtype_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Date", "time", "Properties_", "(_", "Date", "time", "Index_", "(_", "data_", ",_", "copy_", "=_", "copy_", ",_", "freq_", "=_", "'", "infer", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", ",_", "name_", "=_", "name_", ",_", "orig_", "=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "datetime", "64", "tz", "\\u", "dtype_", "(_", "data_", "._", "dtype_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Date", "time", "Properties_", "(_", "Date", "time", "Index_", "(_", "data_", ",_", "copy_", "=_", "copy_", ",_", "freq_", "=_", "'", "infer", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ambiguous", "_", "=_", "'", "infer", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "index_", ",_", "data_", "._", "name_", ",_", "orig_", "=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "timedelta", "64", "\\u", "dtype_", "(_", "data_", "._", "dtype_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Time", "delta", "Properties_", "(_", "Time", "delta", "Index_", "(_", "data_", ",_", "copy_", "=_", "copy_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "freq_", "=_", "'", "infer", "'_", ")_", ",_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", ",_", "orig_", "=_", "orig_", ")_", "\\u\\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_", "is", "\\u", "period", "\\u", "array", "like_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Period", "Properties_", "(_", "Period", "Index_", "(_", "data_", ",_", "copy_", "=_", "copy_", ")_", ",_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", ",_", "orig_", "=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "datetime", "\\u", "array", "like_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Date", "time", "Properties_", "(_", "Date", "time", "Index_", "(_", "data_", ",_", "copy_", "=_", "copy_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "freq_", "=_", "'", "infer", "'_", ")_", ",_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", ",_", "orig_", "=_", "orig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Type", "Error_", "(_", "\"", "cann", "ot", " ", "convert", " ", "an", " ", "object", " ", "of", " ", "type", " ", "{", "0", "}", " ", "to", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "datetime", "like", " ", "index", "\"_", "._", "format_", "(_", "type_", "(_", "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_", "class_", "Properties_", "(_", "Pan", "das", "Delegate_", ",_", "No", "New", "Attribute", "s", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Properties_", "(_", "Pan", "das", "Delegate_", ",_", "No", "New", "Attribute", "s", "Mixin_", ")_", ":_", "\\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_", ",_", "values_", ",_", "index_", ",_", "name_", ",_", "orig_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "values_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "index_", "=_", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "orig_", "=_", "orig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "freeze_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Properties_", "(_", "Pan", "das", "Delegate_", ",_", "No", "New", "Attribute", "s", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "delegate", "\\u", "property", "\\u", "get_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pandas_", "import_", "Series_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "getattr_", "(_", "self_", "._", "values_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", "be", " ", "need", " ", "to", " ", "upc", "ast", " ", "(", "ints", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "result_", ",_", "np_", "._", "ndarray_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "integ", "er", "\\u", "dtype_", "(_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "result_", "._", "astype_", "(_", "'", "int", "64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "is", "\\u", "list", "\\u", "like_", "(_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "blow", " ", "up", " ", "if", " ", "we", " ", "operate", " ", "on", " ", "categories_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "orig_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "take", "\\u", "1d_", "(_", "result_", ",_", "self_", "._", "orig_", "._", "cat_", "._", "codes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "result", " ", "as", " ", "a", " ", "Serie", "s", ",", " ", "whi", "ch", " ", "is", " ", "by", " ", "definit", "ion", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Series_", "(_", "result_", ",_", "index_", "=_", "self_", "._", "index_", ",_", "name_", "=_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "setti", "ng", " ", "this", " ", "object", " ", "will", " ", "show", " ", "a", " ", "Sett", "ing", "With", "Copy", "Warn", "ing", "/", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "is", "\\u", "copy_", "=_", "(_", "\"", "modification", "s", " ", "to", " ", "a", " ", "property", " ", "of", " ", "a", " ", "datetime", "like", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object", " ", "are", " ", "not", " ", "support", "ed", " ", "and", " ", "are", " ", "discard", "ed", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Change", " ", "values", " ", "on", " ", "the", " ", "original", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Properties_", "(_", "Pan", "das", "Delegate_", ",_", "No", "New", "Attribute", "s", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "delegate", "\\u", "property", "\\u", "set_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "modification", "s", " ", "to", " ", "a", " ", "property", " ", "of", " ", "a", " ", "datetime", "like", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object", " ", "are", " ", "not", " ", "support", "ed", ".", " ", "Change", " ", "values", " ", "on", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "original", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Properties_", "(_", "Pan", "das", "Delegate_", ",_", "No", "New", "Attribute", "s", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "delegate", "\\u", "method_", "(_", "self_", ",_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pandas_", "import_", "Series_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "getattr_", "(_", "self_", "._", "values_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "method_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "com_", "._", "is", "\\u", "list", "\\u", "like_", "(_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "Series_", "(_", "result_", ",_", "index_", "=_", "self_", "._", "index_", ",_", "name_", "=_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "setti", "ng", " ", "this", " ", "object", " ", "will", " ", "show", " ", "a", " ", "Sett", "ing", "With", "Copy", "Warn", "ing", "/", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "is", "\\u", "copy_", "=_", "(_", "\"", "modification", "s", " ", "to", " ", "a", " ", "method", " ", "of", " ", "a", " ", "datetime", "like", " ", "object", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "are", " ", "not", " ", "support", "ed", " ", "and", " ", "are", " ", "discard", "ed", ".", " ", "Change", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "values", " ", "on", " ", "the", " ", "original", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Date", "time", "Properties_", "(_", "Properties_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Accessor", " ", "object", " ", "for", " ", "datetime", "like", " ", "proper", "ties", " ", "of", " ", "the", " ", "Serie", "s", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "hour", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "second", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "quarter", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "Serie", "s", " ", "indexe", "d", " ", "like", " ", "the", " ", "original", " ", "Serie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "Type", "Error", " ", "if", " ", "the", " ", "Serie", "s", " ", "doe", "s", " ", "not", " ", "contain", " ", "datetime", "like", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Date", "time", "Properties_", "(_", "Properties_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "to", "\\u", "pyda", "tet", "ime_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "values_", "._", "to", "\\u", "pyda", "tet", "ime_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Time", "delta", "Properties_", "(_", "Properties_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Accessor", " ", "object", " ", "for", " ", "datetime", "like", " ", "proper", "ties", " ", "of", " ", "the", " ", "Serie", "s", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "hour", "s", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "second", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "Serie", "s", " ", "indexe", "d", " ", "like", " ", "the", " ", "original", " ", "Serie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "Type", "Error", " ", "if", " ", "the", " ", "Serie", "s", " ", "doe", "s", " ", "not", " ", "contain", " ", "datetime", "like", " ", "values", ".", "\\", "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_", "Time", "delta", "Properties_", "(_", "Properties_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "to", "\\u", "pyt", "ime", "delta_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "values_", "._", "to", "\\u", "pyt", "ime", "delta_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Time", "delta", "Properties_", "(_", "Properties_", ")_", ":_", "\\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_", "components_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "dataframe", " ", "of", " ", "the", " ", "component", "s", " ", "(", "day", "s", ",", " ", "hour", "s", ",", " ", "minute", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "second", "s", ",", " ", "milliseconds", ",", " ", "microsecond", "s", ",", " ", "nanos", "econd", "s", ")", " ", "of", " ", "the", " ", "Time", "deltas", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "Data", "Frame", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "values_", "._", "components_", "._", "set\\u", "index_", "(_", "self_", "._", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Period", "Properties_", "(_", "Properties_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Accessor", " ", "object", " ", "for", " ", "datetime", "like", " ", "proper", "ties", " ", "of", " ", "the", " ", "Serie", "s", " ", "values", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "hour", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "second", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "s", ".", "dt", ".", "quarter", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "Serie", "s", " ", "indexe", "d", " ", "like", " ", "the", " ", "original", " ", "Serie", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", " ", "Type", "Error", " ", "if", " ", "the", " ", "Serie", "s", " ", "doe", "s", " ", "not", " ", "contain", " ", "datetime", "like", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Combine", "d", "Date", "timeli", "ke", "Properties_", "(_", "Date", "time", "Properties_", ",_", "Time", "delta", "Properties_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "class", " ", "is", " ", "neve", "r", " ", "instantiate", "d", ",", " ", "and", " ", "exist", "s", " ", "sole", "ly", " ", "for", " ", "the", " ", "benefit", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "Serie", "s", ".", "dt", " ", "class", " ", "property", ".", " ", "For", " ", "Serie", "s", " ", "object", "s", ",", " ", ".", "dt", " ", "will", " ", "alw", "ay", "s", " ", "be", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "more", " ", "specific", " ", "classe", "s", " ", "above", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "doc\\u\\u_", "=_", "Date", "time", "Properties_", "._", "\\u\\u", "doc\\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, 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,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": " def test_commands_can_be_run_without_project(self, tmpdir):\n tmpdir.chdir()\n\n assert not install()\n assert not update()\n assert not display()\n assert not delete()", "metadata": "root.TestCommands.test_commands_can_be_run_without_project", "header": "['class', 'TestCommands', ':', '___EOS___']", "index": 14 } ]
[ { "span": "assert not delete()", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "An", "_", "assert_", "statement_", "has_", "a_", "side_", "-_", "effect_", "[SEP]_", "class_", "Test", "Commands_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "command", "s", "\\u", "can", "\\u", "be", "\\u", "run", "\\u", "with", "out", "\\u", "project_", "(_", "self_", ",_", "tmpdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmpdir_", "._", "chdir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "not_", "install_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "update_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "display_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "delete_", "(_", ")_", "\\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, 0, 1, 1, 1, 1, 2 ]
Wrong number of arguments in a call
crossbario/autobahn-python/autobahn/twisted/wamp.py
[ { "content": " def onJoin(self, details):\n return self.on_join(details)", "metadata": "root.Session.onJoin", "header": "['class', 'Session', '(', 'ApplicationSession', ')', ':', '___EOS___']", "index": 608 }, { "content": " def on_join(self):\n pass", "metadata": "root.Session.on_join", "header": "['class', 'Session', '(', 'ApplicationSession', ')', ':', '___EOS___']", "index": 617 } ]
[ { "span": "self.on_join(details)", "start_line": 609, "start_column": 15, "end_line": 609, "end_column": 36 } ]
[ { "span": "def on_join(self):", "start_line": 617, "start_column": 4, "end_line": 617, "end_column": 22 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "class_", "Session_", "(_", "Applica", "tion", "Session_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "on", "Join_", "(_", "self_", ",_", "details_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "on", "\\u", "join_", "(_", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Session_", "(_", "Applica", "tion", "Session_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "join_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 ]
Unused import
Microsoft/ApplicationInsights-Python/tests/applicationinsights_tests/channel_tests/contracts_tests/TestData.py
[ { "content": "import unittest\nimport datetime\nimport uuid\nimport sys\nimport json\n\nimport sys, os, os.path\nroot_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', '..', '..')\nif root_directory not in sys.path:\n sys.path.append(root_directory)\n\nfrom applicationinsights.channel.contracts import *\nfrom .Utils import TestJsonEncoder\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestData(unittest.TestCase):\n \n \n ", "metadata": "root.TestData", "header": "['module', '___EOS___']", "index": 14 }, { "content": " def test_construct(self):\n item = Data()\n self.assertNotEqual(item, None)", "metadata": "root.TestData.test_construct", "header": "['class', 'TestData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 15 }, { "content": " def test_base_type_property_works_as_expected(self):\n expected = 'Test string'\n item = Data()\n item.base_type = expected\n actual = item.base_type\n self.assertEqual(expected, actual)\n expected = 'Other string'\n item.base_type = expected\n actual = item.base_type\n self.assertEqual(expected, actual)", "metadata": "root.TestData.test_base_type_property_works_as_expected", "header": "['class', 'TestData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 19 }, { "content": " def test_base_data_property_works_as_expected(self):\n expected = object()\n item = Data()\n item.base_data = expected\n actual = item.base_data\n self.assertEqual(expected, actual)\n expected = object()\n item.base_data = expected\n actual = item.base_data\n self.assertEqual(expected, actual)", "metadata": "root.TestData.test_base_data_property_works_as_expected", "header": "['class', 'TestData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 30 }, { "content": " def test_serialize_works_as_expected(self):\n item = Data()\n item.base_type = 'Test string'\n item.base_data = object()\n actual = json.dumps(item.write(), separators=(',', ':'), cls=TestJsonEncoder)\n expected = '{\"baseType\":\"Test string\",\"baseData\":{}}'\n self.assertEqual(expected, actual)", "metadata": "root.TestData.test_serialize_works_as_expected", "header": "['class', 'TestData', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 41 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "import uuid", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", ",_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "\\u", "directory_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", ",_", "'..'_", ",_", "'..'_", ",_", "'..'_", ",_", "'..'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "\\u", "directory_", "not_", "in_", "sys_", "._", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "path_", "._", "append_", "(_", "root", "\\u", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "applica", "tion", "insights", "_", "._", "channel_", "._", "contracts", "_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "Utils_", "import_", "Test", "Js", "on", "Encoder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Data_", "(_", "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", "Data_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "construct_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "item_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "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", "base", "\\u", "type", "\\u", "property", "\\u", "works", "\\u", "as", "\\u", "expected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "'", "Test", " ", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "=_", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "base", "\\u", "type_", "=_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "item_", "._", "base", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "'", "Ot", "her", " ", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "base", "\\u", "type_", "=_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "item_", "._", "base", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "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", "base", "\\u", "data\\u", "property", "\\u", "works", "\\u", "as", "\\u", "expected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "=_", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "base", "\\u", "data_", "=_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "item_", "._", "base", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "base", "\\u", "data_", "=_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "item_", "._", "base", "\\u", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "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", "serialize", "\\u", "works", "\\u", "as", "\\u", "expected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "base", "\\u", "type_", "=_", "'", "Test", " ", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "._", "base", "\\u", "data_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "json_", "._", "dumps_", "(_", "item_", "._", "write_", "(_", ")_", ",_", "separators_", "=_", "(_", "','_", ",_", "':'_", ")_", ",_", "cls_", "=_", "Test", "Js", "on", "Encoder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "'{", "\"", "base", "Type", "\":\"", "Test", " ", "string", "\",\"", "base", "Data", "\":{", "}}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "actual_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused local variable
google/simian/src/simian/mac/munki/handlers/reports.py
[ { "content": " def post(self):\n \"\"\"Reports get handler.\n\n Returns:\n A webapp.Response() response.\n \"\"\"\n session = gaeserver.DoMunkiAuth()\n uuid = main_common.SanitizeUUID(session.uuid)\n report_type = self.request.get('_report_type')\n report_feedback = {}\n message = None\n details = None\n client_id = None\n computer = None\n\n if report_type == 'preflight' or report_type == 'postflight':\n client_id_str = urllib.unquote(self.request.get('client_id'))\n client_id = common.ParseClientId(client_id_str, uuid=uuid)\n user_settings_str = self.request.get('user_settings')\n user_settings = None\n try:\n if user_settings_str:\n user_settings = util.Deserialize(\n urllib.unquote(str(user_settings_str)))\n except util.DeserializeError:\n logging.warning(\n 'Client %s sent broken user_settings: %s',\n client_id_str, user_settings_str)\n\n pkgs_to_install = self.request.get_all('pkgs_to_install')\n apple_updates_to_install = self.request.get_all(\n 'apple_updates_to_install')\n\n computer = models.Computer.get_by_key_name(uuid)\n ip_address = os.environ.get('REMOTE_ADDR', '')\n if report_type == 'preflight':\n # we want to get feedback now, before preflight_datetime changes.\n client_exit = self.request.get('client_exit', None)\n report_feedback = self.GetReportFeedback(\n uuid, report_type, computer=computer, ip_address=ip_address,\n client_exit=client_exit)\n\n if self.request.get('json') == '1':\n self.response.out.write(JSON_PREFIX + json.dumps(report_feedback))\n else:\n # For legacy clients that accept a single string, not JSON.\n feedback_to_send = 'OK'\n for feedback in LEGACY_FEEDBACK_LIST:\n if report_feedback.get(feedback.lower()):\n feedback_to_send = feedback\n self.response.out.write(feedback_to_send)\n\n # if report feedback calls for a client exit, log it.\n if report_feedback.get('exit'):\n if not client_exit:\n # client didn't ask for an exit, which means server decided.\n client_exit = 'Connection from defined exit IP address'\n common.WriteClientLog(\n models.PreflightExitLog, uuid, computer=computer,\n exit_reason=client_exit)\n\n common.LogClientConnection(\n report_type, client_id, user_settings, pkgs_to_install,\n apple_updates_to_install, computer=computer, ip_address=ip_address,\n report_feedback=report_feedback)\n\n\n elif report_type == 'install_report':\n computer = models.Computer.get_by_key_name(uuid)\n\n self._LogInstalls(self.request.get_all('installs'), computer)\n\n for removal in self.request.get_all('removals'):\n common.WriteClientLog(\n models.ClientLog, uuid, computer=computer, action='removal',\n details=removal)\n\n for problem in self.request.get_all('problem_installs'):\n common.WriteClientLog(\n models.ClientLog, uuid, computer=computer,\n action='install_problem', details=problem)\n elif report_type == 'broken_client':\n # Default reason of \"objc\" to support legacy clients, existing when objc\n # was the only broken state ever reported.\n reason = self.request.get('reason', 'objc')\n details = self.request.get('details')\n logging.warning('Broken Munki client (%s): %s', reason, details)\n common.WriteBrokenClient(uuid, reason, details)\n elif report_type == 'msu_log':\n details = {}\n for k in ['time', 'user', 'source', 'event', 'desc']:\n details[k] = self.request.get(k, None)\n common.WriteComputerMSULog(uuid, details)\n else:\n # unknown report type; log all post params.\n params = []\n for param in self.request.arguments():\n params.append('%s=%s' % (param, self.request.get_all(param)))\n common.WriteClientLog(\n models.ClientLog, uuid, action='unknown', details=str(params))", "metadata": "root.Reports.post", "header": "['class', 'Reports', '(', 'handlers', '.', 'AuthenticationHandler', ')', ':', '___EOS___']", "index": 223 } ]
[ { "span": "message ", "start_line": 233, "start_column": 4, "end_line": 233, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Report", "s_", "(_", "handlers_", "._", "Auth", "entica", "tion", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Report", "s", " ", "get", " ", "handler", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "A", " ", "weba", "pp", ".", "Respons", "e", "()", " ", "response", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "=_", "gae", "server_", "._", "Do", "Mun", "ki", "Auth_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid_", "=_", "main", "\\u", "common_", "._", "Sanit", "ize", "UUID_", "(_", "session_", "._", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "report", "\\u", "type_", "=_", "self_", "._", "request_", "._", "get_", "(_", "'\\u", "report", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "report", "\\u", "feedback_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "details_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client", "\\u", "id_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "computer_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "report", "\\u", "type_", "==_", "'", "pref", "light", "'_", "or_", "report", "\\u", "type_", "==_", "'", "post", "flight", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client", "\\u", "id", "\\u", "str_", "=_", "urllib_", "._", "unquote_", "(_", "self_", "._", "request_", "._", "get_", "(_", "'", "client", "\\u", "id", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client", "\\u", "id_", "=_", "common_", "._", "Pars", "e", "Client", "Id_", "(_", "client", "\\u", "id", "\\u", "str_", ",_", "uuid_", "=_", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "settings", "\\u", "str_", "=_", "self_", "._", "request_", "._", "get_", "(_", "'", "user", "\\u", "settings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "settings_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "user", "\\u", "settings", "\\u", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "settings_", "=_", "util_", "._", "Deserializ", "e_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "urllib_", "._", "unquote_", "(_", "str_", "(_", "user", "\\u", "settings", "\\u", "str_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "util_", "._", "Deserializ", "e", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Client", " ", "%", "s", " ", "sent", " ", "broken", " ", "user", "\\u", "settings", ":", " ", "%", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id", "\\u", "str_", ",_", "user", "\\u", "settings", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pkgs", "\\u", "to", "\\u", "install_", "=_", "self_", "._", "request_", "._", "get", "\\u", "all_", "(_", "'", "pkgs", "\\u", "to", "\\u", "install", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "apple", "\\u", "update", "s", "\\u", "to", "\\u", "install_", "=_", "self_", "._", "request_", "._", "get", "\\u", "all_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "apple", "\\u", "update", "s", "\\u", "to", "\\u", "install", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "computer_", "=_", "models_", "._", "Compute", "r_", "._", "get", "\\u", "by", "\\u", "key", "\\u", "name_", "(_", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "\\u", "address_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "REMO", "TE", "\\u", "ADDR", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "report", "\\u", "type_", "==_", "'", "pref", "light", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "want", " ", "to", " ", "get", " ", "feed", "back", " ", "now", ",", " ", "bef", "ore", " ", "pref", "light", "\\u", "datetime", " ", "change", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client", "\\u", "exit_", "=_", "self_", "._", "request_", "._", "get_", "(_", "'", "client", "\\u", "exit", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "report", "\\u", "feedback_", "=_", "self_", "._", "Get", "Report", "Feed", "back_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "uuid_", ",_", "report", "\\u", "type_", ",_", "computer_", "=_", "computer_", ",_", "ip", "\\u", "address_", "=_", "ip", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "exit_", "=_", "client", "\\u", "exit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "request_", "._", "get_", "(_", "'", "json", "'_", ")_", "==_", "'", "1", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "response_", "._", "out_", "._", "write_", "(_", "JSO", "N", "\\u", "PREFIX_", "+_", "json_", "._", "dumps_", "(_", "report", "\\u", "feedback_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "lega", "cy", " ", "clients", " ", "tha", "t", " ", "accept", " ", "a", " ", "single", " ", "string", ",", " ", "not", " ", "JSO", "N", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feed", "back", "\\u", "to", "\\u", "send_", "=_", "'", "OK", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "feedback_", "in_", "LEGA", "CY", "\\u", "FEED", "BACK", "\\u", "LIST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "report", "\\u", "feedback_", "._", "get_", "(_", "feedback_", "._", "lower_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "feed", "back", "\\u", "to", "\\u", "send_", "=_", "feedback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "response_", "._", "out_", "._", "write_", "(_", "feed", "back", "\\u", "to", "\\u", "send_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "report", " ", "feed", "back", " ", "calls", " ", "for", " ", "a", " ", "client", " ", "exit", ",", " ", "log", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "report", "\\u", "feedback_", "._", "get_", "(_", "'", "exit", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "client", "\\u", "exit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "client", " ", "did", "n", "'", "t", " ", "ask", " ", "for", " ", "an", " ", "exit", ",", " ", "whi", "ch", " ", "means", " ", "server", " ", "decide", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client", "\\u", "exit_", "=_", "'", "Connect", "ion", " ", "from", " ", "defin", "ed", " ", "exit", " ", "IP", " ", "address", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common_", "._", "Write", "Client", "Log_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "models_", "._", "Pref", "light", "Exi", "t", "Log_", ",_", "uuid_", ",_", "computer_", "=_", "computer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exit", "\\u", "reason_", "=_", "client", "\\u", "exit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common_", "._", "Log", "Client", "Connection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "report", "\\u", "type_", ",_", "client", "\\u", "id_", ",_", "user", "\\u", "settings_", ",_", "pkgs", "\\u", "to", "\\u", "install_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "apple", "\\u", "update", "s", "\\u", "to", "\\u", "install_", ",_", "computer_", "=_", "computer_", ",_", "ip", "\\u", "address_", "=_", "ip", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "report", "\\u", "feedback_", "=_", "report", "\\u", "feedback_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "report", "\\u", "type_", "==_", "'", "install", "\\u", "report", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "computer_", "=_", "models_", "._", "Compute", "r_", "._", "get", "\\u", "by", "\\u", "key", "\\u", "name_", "(_", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "Log", "Install", "s_", "(_", "self_", "._", "request_", "._", "get", "\\u", "all_", "(_", "'", "install", "s", "'_", ")_", ",_", "computer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "removal", "_", "in_", "self_", "._", "request_", "._", "get", "\\u", "all_", "(_", "'", "removal", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common_", "._", "Write", "Client", "Log_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "models_", "._", "Client", "Log_", ",_", "uuid_", ",_", "computer_", "=_", "computer_", ",_", "action_", "=_", "'", "removal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "details_", "=_", "removal", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "problem_", "in_", "self_", "._", "request_", "._", "get", "\\u", "all_", "(_", "'", "problem", "\\u", "install", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common_", "._", "Write", "Client", "Log_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "models_", "._", "Client", "Log_", ",_", "uuid_", ",_", "computer_", "=_", "computer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "'", "install", "\\u", "problem", "'_", ",_", "details_", "=_", "problem_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "report", "\\u", "type_", "==_", "'", "broken", "\\u", "client", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Default", " ", "reason", " ", "of", " ", "\"", "objc", "\"", " ", "to", " ", "support", " ", "lega", "cy", " ", "clients", ",", " ", "exist", "ing", " ", "whe", "n", " ", "objc_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "was", " ", "the", " ", "only", " ", "broken", " ", "state", " ", "ever", " ", "reporte", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reason_", "=_", "self_", "._", "request_", "._", "get_", "(_", "'", "reason", "'_", ",_", "'", "objc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "details_", "=_", "self_", "._", "request_", "._", "get_", "(_", "'", "deta", "il", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "warning_", "(_", "'", "Bro", "ken", " ", "Mun", "ki", " ", "client", " ", "(%", "s", "):", " ", "%", "s", "'_", ",_", "reason_", ",_", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common_", "._", "Write", "Bro", "ken", "Client_", "(_", "uuid_", ",_", "reason_", ",_", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "report", "\\u", "type_", "==_", "'", "ms", "u\\u", "log", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "[_", "'", "time", "'_", ",_", "'", "user", "'_", ",_", "'", "source", "'_", ",_", "'", "event", "'_", ",_", "'", "desc", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "details_", "[_", "k_", "]_", "=_", "self_", "._", "request_", "._", "get_", "(_", "k_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common_", "._", "Write", "Compute", "r", "MS", "UL", "og_", "(_", "uuid_", ",_", "details_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "unknown", " ", "report", " ", "type", ";", " ", "log", " ", "all", " ", "post", " ", "params", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "param_", "in_", "self_", "._", "request_", "._", "arguments_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "append_", "(_", "'%", "s", "=", "%", "s", "'_", "%_", "(_", "param_", ",_", "self_", "._", "request_", "._", "get", "\\u", "all_", "(_", "param_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common_", "._", "Write", "Client", "Log_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "models_", "._", "Client", "Log_", ",_", "uuid_", ",_", "action_", "=_", "'", "unknown", "'_", ",_", "details_", "=_", "str_", "(_", "params_", ")_", ")_" ]
[ 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,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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 ]
Imprecise assert
ganeti/ganeti/test/py/ganeti.storage.bdev_unittest.py
[ { "content": " def testGetStdPvSize(self):\n \"\"\"Test cases for bdev.LogicalVolume._GetStdPvSize()\"\"\"\n rnd = random.Random(9517)\n for _ in range(0, 50):\n # Identical volumes\n pvi = self._GenerateRandomPvInfo(rnd, \"disk\", \"myvg\")\n onesize = bdev.LogicalVolume._GetStdPvSize([pvi])\n self.assertTrue(onesize <= pvi.size)\n self.assertTrue(onesize > pvi.size * (1 - self._MARGIN))\n for length in range(2, 10):\n n_size = bdev.LogicalVolume._GetStdPvSize([pvi] * length)\n self.assertEqual(onesize, n_size)\n\n # Mixed volumes\n for length in range(1, 10):\n pvlist = [self._GenerateRandomPvInfo(rnd, \"disk\", \"myvg\")\n for _ in range(0, length)]\n std_size = bdev.LogicalVolume._GetStdPvSize(pvlist)\n self.assertTrue(compat.all(std_size <= pvi.size for pvi in pvlist))\n self.assertTrue(compat.any(std_size > pvi.size * (1 - self._MARGIN)\n for pvi in pvlist))\n pvlist.append(pvlist[0])\n p1_size = bdev.LogicalVolume._GetStdPvSize(pvlist)\n self.assertEqual(std_size, p1_size)", "metadata": "root.TestExclusiveStoragePvs.testGetStdPvSize", "header": "['class', 'TestExclusiveStoragePvs', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 178 }, { "content": " def testComputeNumPvs(self):\n \"\"\"Test cases for bdev.LogicalVolume._ComputeNumPvs()\"\"\"\n rnd = random.Random(8067)\n for _ in range(0, 1000):\n pvlist = [self._GenerateRandomPvInfo(rnd, \"disk\", \"myvg\")]\n lv_size = float(rnd.randint(10 * 100, 1024 * 1024 * 100)) / 100.0\n num_pv = bdev.LogicalVolume._ComputeNumPvs(lv_size, pvlist)\n std_size = bdev.LogicalVolume._GetStdPvSize(pvlist)\n self.assertTrue(num_pv >= 1)\n self.assertTrue(num_pv * std_size >= lv_size)\n self.assertTrue((num_pv - 1) * std_size < lv_size * (1 + self._EPS))", "metadata": "root.TestExclusiveStoragePvs.testComputeNumPvs", "header": "['class', 'TestExclusiveStoragePvs', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 203 } ]
[ { "span": "self.assertTrue(onesize <= pvi.size)", "start_line": 185, "start_column": 6, "end_line": 185, "end_column": 42 }, { "span": "self.assertTrue(onesize > pvi.size * (1 - self._MARGIN))", "start_line": 186, "start_column": 6, "end_line": 186, "end_column": 62 }, { "span": "self.assertTrue(num_pv >= 1)", "start_line": 211, "start_column": 6, "end_line": 211, "end_column": 34 }, { "span": "self.assertTrue(num_pv * std_size >= lv_size)", "start_line": 212, "start_column": 6, "end_line": 212, "end_column": 51 }, { "span": "self.assertTrue((num_pv - 1) * std_size < lv_size * (1 + self._EPS))", "start_line": 213, "start_column": 6, "end_line": 213, "end_column": 74 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Exclu", "sive", "Stor", "age", "Pv", "s_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Get", "Std", "Pv", "Size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "case", "s", " ", "for", " ", "bde", "v", ".", "Logi", "cal", "Volume", ".\\u", "Get", "Std", "Pv", "Size", "()\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rnd_", "=_", "random_", "._", "Random_", "(_", "951", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u_", "in_", "range_", "(_", "0_", ",_", "50_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Identical", " ", "volumes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pv", "i_", "=_", "self_", "._", "\\u", "Generate", "Random", "Pv", "Info_", "(_", "rnd_", ",_", "\"", "disk", "\"_", ",_", "\"", "myv", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ones", "ize_", "=_", "bde", "v_", "._", "Logi", "cal", "Volume_", "._", "\\u", "Get", "Std", "Pv", "Size_", "(_", "[_", "pv", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ones", "ize_", "<=_", "pv", "i_", "._", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "ones", "ize_", ">_", "pv", "i_", "._", "size_", "*_", "(_", "1_", "-_", "self_", "._", "\\u", "MARGIN", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "length_", "in_", "range_", "(_", "2_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n", "\\u", "size_", "=_", "bde", "v_", "._", "Logi", "cal", "Volume_", "._", "\\u", "Get", "Std", "Pv", "Size_", "(_", "[_", "pv", "i_", "]_", "*_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "ones", "ize_", ",_", "n", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mix", "ed", " ", "volumes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "length_", "in_", "range_", "(_", "1_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pv", "list_", "=_", "[_", "self_", "._", "\\u", "Generate", "Random", "Pv", "Info_", "(_", "rnd_", ",_", "\"", "disk", "\"_", ",_", "\"", "myv", "g", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "\\u_", "in_", "range_", "(_", "0_", ",_", "length_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "size_", "=_", "bde", "v_", "._", "Logi", "cal", "Volume_", "._", "\\u", "Get", "Std", "Pv", "Size_", "(_", "pv", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "compat_", "._", "all_", "(_", "std", "\\u", "size_", "<=_", "pv", "i_", "._", "size_", "for_", "pv", "i_", "in_", "pv", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "compat_", "._", "any_", "(_", "std", "\\u", "size_", ">_", "pv", "i_", "._", "size_", "*_", "(_", "1_", "-_", "self_", "._", "\\u", "MARGIN", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "pv", "i_", "in_", "pv", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pv", "list_", "._", "append_", "(_", "pv", "list_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p1", "\\u", "size_", "=_", "bde", "v_", "._", "Logi", "cal", "Volume_", "._", "\\u", "Get", "Std", "Pv", "Size_", "(_", "pv", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "std", "\\u", "size_", ",_", "p1", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Exclu", "sive", "Stor", "age", "Pv", "s_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Compute", "Num", "Pv", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "case", "s", " ", "for", " ", "bde", "v", ".", "Logi", "cal", "Volume", ".\\u", "Compute", "Num", "Pv", "s", "()\"", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rnd_", "=_", "random_", "._", "Random_", "(_", "806", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u_", "in_", "range_", "(_", "0_", ",_", "1000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pv", "list_", "=_", "[_", "self_", "._", "\\u", "Generate", "Random", "Pv", "Info_", "(_", "rnd_", ",_", "\"", "disk", "\"_", ",_", "\"", "myv", "g", "\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lv", "\\u", "size_", "=_", "float_", "(_", "rnd_", "._", "randint_", "(_", "10_", "*_", "100_", ",_", "1024_", "*_", "1024_", "*_", "100_", ")_", ")_", "/_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "pv_", "=_", "bde", "v_", "._", "Logi", "cal", "Volume_", "._", "\\u", "Compute", "Num", "Pv", "s_", "(_", "lv", "\\u", "size_", ",_", "pv", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "size_", "=_", "bde", "v_", "._", "Logi", "cal", "Volume_", "._", "\\u", "Get", "Std", "Pv", "Size_", "(_", "pv", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "num", "\\u", "pv_", ">=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "num", "\\u", "pv_", "*_", "std", "\\u", "size_", ">=_", "lv", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "num", "\\u", "pv_", "-_", "1_", ")_", "*_", "std", "\\u", "size_", "<_", "lv", "\\u", "size_", "*_", "(_", "1_", "+_", "self_", "._", "\\u", "EPS", "_", ")_", ")_", "\\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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Variable defined multiple times
paulgb/runipy/test_runipy.py
[ { "content": " def testUseCLI(self):\n notebook_dir = path.join('tests', 'expected')\n for notebook_path in glob(path.join(notebook_dir, '*.ipynb')):\n notebook_file = path.basename(notebook_path)\n print(notebook_file)\n expected = \"\"\n with open(notebook_path) as notebook_file:\n expected = notebook_file.read()\n try:\n # IPython 3\n expected = reads(expected, 3)\n except (TypeError, NBFormatError):\n # IPython 2\n expected = reads(expected, 'json')\n exit_code = 1\n argv = sys.argv\n stdout = sys.stdout\n stderr = sys.stderr\n try:\n with open(devnull, \"w\") as devnull_filehandle:\n sys.stdout = sys.stderr = devnull_filehandle\n sys.argv = [\n \"runipy\",\n \"-o\", notebook_path,\n \"--html\", notebook_path.replace(\".ipynb\", \".html\")\n ]\n main()\n except SystemExit as e:\n exit_code = e.code\n finally:\n sys.argv = argv\n sys.stdout = stdout\n sys.stderr = stderr\n notebook = \"\"\n with open(notebook_path) as notebook_file:\n notebook = notebook_file.read()\n try:\n # IPython 3\n notebook = reads(notebook, 3)\n except (TypeError, NBFormatError):\n # IPython 2\n notebook = reads(notebook, 'json')\n self.assert_notebooks_equal(expected, notebook)", "metadata": "root.TestRunipy.testUseCLI", "header": "['class', 'TestRunipy', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 111 } ]
[ { "span": "exit_code ", "start_line": 125, "start_column": 12, "end_line": 125, "end_column": 21 }, { "span": "exit_code ", "start_line": 139, "start_column": 16, "end_line": 139, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Run", "ipy", "_", "(_", "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", "Us", "e", "CLI_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook", "\\u", "dir_", "=_", "path_", "._", "join_", "(_", "'", "tests", "'_", ",_", "'", "expected", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "notebook", "\\u", "path_", "in_", "glob_", "(_", "path_", "._", "join_", "(_", "notebook", "\\u", "dir_", ",_", "'*", ".", "ipynb", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook", "\\u", "file_", "=_", "path_", "._", "basename_", "(_", "notebook", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "notebook", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "notebook", "\\u", "path_", ")_", "as_", "notebook", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "notebook", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "IP", "yth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "reads_", "(_", "expected_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "NB", "Format", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "IP", "yth", "on", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected_", "=_", "reads_", "(_", "expected_", ",_", "'", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exit", "\\u", "code_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "argv_", "=_", "sys_", "._", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "=_", "sys_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stderr_", "=_", "sys_", "._", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "devnull_", ",_", "\"", "w", "\"_", ")_", "as_", "devn", "ull", "\\u", "filehandle", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sys_", "._", "stdout_", "=_", "sys_", "._", "stderr_", "=_", "devn", "ull", "\\u", "filehandle", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "argv_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "runi", "py", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"-", "o", "\"_", ",_", "notebook", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "html", "\"_", ",_", "notebook", "\\u", "path_", "._", "replace_", "(_", "\".", "ipynb", "\"_", ",_", "\".", "html", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "System", "Exit_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exit", "\\u", "code_", "=_", "e_", "._", "code_", "\\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 ", " _", "sys_", "._", "argv_", "=_", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "=_", "stderr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "notebook_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "notebook", "\\u", "path_", ")_", "as_", "notebook", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook_", "=_", "notebook", "\\u", "file_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "IP", "yth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook_", "=_", "reads_", "(_", "notebook_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "NB", "Format", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "IP", "yth", "on", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook_", "=_", "reads_", "(_", "notebook_", ",_", "'", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "notebook", "s", "\\u", "equal_", "(_", "expected_", ",_", "notebook_", ")_", "\\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, 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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 ]
Unused local variable
snare/voltron/voltron/plugins/api/disassemble.py
[ { "content": " @server_side\n def dispatch(self):\n try:\n if self.address == None:\n pc_name, self.address = voltron.debugger.program_counter(target_id=self.target_id)\n if self.use_capstone:\n disasm = voltron.debugger.disassemble_capstone(target_id=self.target_id, address=self.address,\n count=self.count)\n else:\n disasm = voltron.debugger.disassemble(target_id=self.target_id, address=self.address, count=self.count)\n res = APIDisassembleResponse()\n res.disassembly = disasm\n try:\n res.flavor = voltron.debugger.disassembly_flavor()\n except:\n res.flavor = 'NA'\n res.host = voltron.debugger._plugin.host\n except NoSuchTargetException:\n res = APINoSuchTargetErrorResponse()\n except TargetBusyException:\n res = APITargetBusyErrorResponse()\n except Exception as e:\n msg = \"Unhandled exception {} disassembling: {}\".format(type(e), e)\n log.exception(msg)\n res = APIErrorResponse(code=0, message=msg)\n\n return res", "metadata": "root.APIDisassembleRequest.dispatch", "header": "['class', 'APIDisassembleRequest', '(', 'APIRequest', ')', ':', '___EOS___']", "index": 36 } ]
[ { "span": "pc_name,", "start_line": 40, "start_column": 16, "end_line": 40, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "API", "Disas", "sem", "ble", "Request_", "(_", "API", "Request_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "server", "\\u", "side_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "address_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pc", "\\u", "name_", ",_", "self_", "._", "address_", "=_", "volt", "ron", "_", "._", "debugger_", "._", "program", "\\u", "counter_", "(_", "target", "\\u", "id_", "=_", "self_", "._", "target", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "use", "\\u", "caps", "tone_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "disas", "m_", "=_", "volt", "ron", "_", "._", "debugger_", "._", "disassembl", "e\\u", "caps", "tone_", "(_", "target", "\\u", "id_", "=_", "self_", "._", "target", "\\u", "id_", ",_", "address_", "=_", "self_", "._", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "count_", "=_", "self_", "._", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "disas", "m_", "=_", "volt", "ron", "_", "._", "debugger_", "._", "disassembl", "e_", "(_", "target", "\\u", "id_", "=_", "self_", "._", "target", "\\u", "id_", ",_", "address_", "=_", "self_", "._", "address_", ",_", "count_", "=_", "self_", "._", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "API", "Disas", "sem", "ble", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "._", "disassembl", "y_", "=_", "disas", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "._", "flavor_", "=_", "volt", "ron", "_", "._", "debugger_", "._", "disassembl", "y", "\\u", "flavor_", "(_", ")_", "\\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 ", " _", "res_", "._", "flavor_", "=_", "'", "NA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "._", "host_", "=_", "volt", "ron", "_", "._", "debugger_", "._", "\\u", "plugin_", "._", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "No", "Suc", "h", "Target", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "API", "No", "Suc", "h", "Target", "Error", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Target", "Busy", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "API", "Target", "Busy", "Error", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Unh", "andle", "d", " ", "exception", " ", "{}", " ", "disassembl", "ing", ":", " ", "{}\"_", "._", "format_", "(_", "type_", "(_", "e_", ")_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "exception_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "API", "Error", "Response_", "(_", "code_", "=_", "0_", ",_", "message_", "=_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
An assert statement has a side-effect
schematics/schematics/tests/test_ordered_dict.py
[ { "content": "def test_popitem():\n pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]\n shuffle(pairs)\n od = OrderedDict(pairs)\n while pairs:\n assert od.popitem() == pairs.pop()\n with pytest.raises(KeyError):\n od.popitem()\n assert len(od) == 0", "metadata": "root.test_popitem", "header": "['module', '___EOS___']", "index": 159 }, { "content": "def test_pop():\n\n pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]\n shuffle(pairs)\n od = OrderedDict(pairs)\n shuffle(pairs)\n while pairs:\n k, v = pairs.pop()\n assert od.pop(k) == v\n with pytest.raises(KeyError):\n od.pop('xyz')\n assert len(od) == 0\n assert od.pop(k, 12345) == 12345\n\n # make sure pop still works when __missing__ is defined\n class Missing(OrderedDict):\n def __missing__(self, key):\n return 0\n m = Missing(a=1)\n assert m.pop('b', 5) == 5\n assert m.pop('a', 6) == 1\n assert m.pop('a', 6) == 6\n with pytest.raises(KeyError):\n m.pop('a')", "metadata": "root.test_pop", "header": "['module', '___EOS___']", "index": 170 } ]
[ { "span": "assert od.popitem() == pairs.pop()", "start_line": 164, "start_column": 8, "end_line": 164, "end_column": 42 }, { "span": "assert od.pop(k) == v", "start_line": 178, "start_column": 8, "end_line": 178, "end_column": 29 }, { "span": "assert od.pop(k, 12345) == 12345", "start_line": 182, "start_column": 4, "end_line": 182, "end_column": 36 }, { "span": "assert m.pop('b', 5) == 5", "start_line": 189, "start_column": 4, "end_line": 189, "end_column": 29 }, { "span": "assert m.pop('a', 6) == 1", "start_line": 190, "start_column": 4, "end_line": 190, "end_column": 29 }, { "span": "assert m.pop('a', 6) == 6", "start_line": 191, "start_column": 4, "end_line": 191, "end_column": 29 } ]
[]
1
true
[ "[CLS]_", "An", "_", "assert_", "statement_", "has_", "a_", "side_", "-_", "effect_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "popi", "tem_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pairs_", "=_", "[_", "(_", "'", "c", "'_", ",_", "1_", ")_", ",_", "(_", "'", "b", "'_", ",_", "2_", ")_", ",_", "(_", "'", "a", "'_", ",_", "3_", ")_", ",_", "(_", "'", "d", "'_", ",_", "4_", ")_", ",_", "(_", "'", "e", "'_", ",_", "5_", ")_", ",_", "(_", "'", "f", "'_", ",_", "6_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shuffle_", "(_", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "od_", "=_", "Order", "ed", "Dict_", "(_", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "od_", "._", "popi", "tem_", "(_", ")_", "==_", "pairs_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "od_", "._", "popi", "tem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "od_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "pop_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pairs_", "=_", "[_", "(_", "'", "c", "'_", ",_", "1_", ")_", ",_", "(_", "'", "b", "'_", ",_", "2_", ")_", ",_", "(_", "'", "a", "'_", ",_", "3_", ")_", ",_", "(_", "'", "d", "'_", ",_", "4_", ")_", ",_", "(_", "'", "e", "'_", ",_", "5_", ")_", ",_", "(_", "'", "f", "'_", ",_", "6_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shuffle_", "(_", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "od_", "=_", "Order", "ed", "Dict_", "(_", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shuffle_", "(_", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pairs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", ",_", "v_", "=_", "pairs_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "od_", "._", "pop_", "(_", "k_", ")_", "==_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "od_", "._", "pop_", "(_", "'", "xyz", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "od_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "od_", "._", "pop_", "(_", "k_", ",_", "12345_", ")_", "==_", "12345_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "pop", " ", "still", " ", "works", " ", "whe", "n", " ", "\\u\\u", "missi", "ng", "\\u\\u", " ", "is", " ", "defined_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Missing", "_", "(_", "Order", "ed", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "missi", "ng", "\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "Missing", "_", "(_", "a_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "pop_", "(_", "'", "b", "'_", ",_", "5_", ")_", "==_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "pop_", "(_", "'", "a", "'_", ",_", "6_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "m_", "._", "pop_", "(_", "'", "a", "'_", ",_", "6_", ")_", "==_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "._", "pop_", "(_", "'", "a", "'_", ")_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/learnalg/LearnAlg.py
[ { "content": "'''\nLearnAlg.py\nAbstract base class for learning algorithms for HModel models\n\nDefines some generic routines for\n * saving global parameters\n * assessing convergence\n * printing progress updates to stdout\n * recording run-time\n'''\nfrom bnpy.ioutil import ModelWriter\nfrom bnpy.util import closeAtMSigFigs, isEvenlyDivisibleFloat\nimport numpy as np\nimport time\nimport os\nimport logging\nimport scipy.io\n\nLog = logging.getLogger('bnpy')\nLog.setLevel(logging.DEBUG)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class LearnAlg(object):\n\n \n\n\n \n\n\n\n\n ##################################################### Fcns for birth/merges\n ##################################################### \n\n ##################################################### Verify evidence\n ##################################################### grows monotonically\n\n\n ######################################################### Save to file\n ######################################################### \n\n # Define temporary function that creates files in this alg's output dir\n\n \n ######################################################### Plot Results\n ######################################################### \n\n ######################################################### Print State\n ######################################################### \n \n\n #########################################################\n\n\n", "metadata": "root.LearnAlg", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def __init__(self, savedir=None, seed=0, \n algParams=dict(), outputParams=dict(),\n onLapCompleteFunc=lambda:None, onFinishFunc=lambda:None,\n ):\n ''' Constructs and returns a LearnAlg object\n ''' \n if type(savedir) == str:\n self.savedir = os.path.splitext(savedir)[0]\n else:\n self.savedir = None\n self.seed = int(seed)\n self.PRNG = np.random.RandomState(self.seed)\n self.algParams = algParams\n self.outputParams = outputParams\n self.TraceLaps = set()\n self.evTrace = list()\n self.SavedIters = set()\n self.PrintIters = set()\n self.nObsProcessed = 0\n self.algParamsLP = dict()\n for k,v in algParams.items():\n if k.count('LP') > 0:\n self.algParamsLP[k] = v", "metadata": "root.LearnAlg.__init__", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 23 }, { "content": " def fit(self, hmodel, Data):\n ''' Execute learning algorithm for hmodel on Data\n This method is extended by any subclass of LearnAlg\n\n Returns\n -------\n LP : local params dictionary of resulting model\n '''\n pass", "metadata": "root.LearnAlg.fit", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 47 }, { "content": " def set_random_seed_at_lap(self, lap):\n ''' Set internal random generator deterministically\n based on provided seed (unique to this run) and \n the number of passes thru the data,\n so we can reproduce runs without starting over\n '''\n if isEvenlyDivisibleFloat(lap, 1.0):\n self.PRNG = np.random.RandomState(self.seed + int(lap))", "metadata": "root.LearnAlg.set_random_seed_at_lap", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 58 }, { "content": " def set_start_time_now(self):\n ''' Record start time (in seconds since 1970)\n '''\n self.start_time = time.time() ", "metadata": "root.LearnAlg.set_start_time_now", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 67 }, { "content": " def add_nObs(self, nObs):\n ''' Update internal count of total number of data observations processed.\n Each lap thru dataset of size N, this should be updated by N\n '''\n self.nObsProcessed += nObs", "metadata": "root.LearnAlg.add_nObs", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 72 }, { "content": " def get_elapsed_time(self):\n ''' Returns float of elapsed time (in seconds) since this object's\n set_start_time_now() method was called\n '''\n return time.time() - self.start_time", "metadata": "root.LearnAlg.get_elapsed_time", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 78 }, { "content": " def buildRunInfo(self, evBound, status, nLap=None):\n ''' Create dict of information about the current run\n '''\n return dict(evBound=evBound, status=status, nLap=nLap,\n evTrace=self.evTrace, lapTrace=self.TraceLaps)", "metadata": "root.LearnAlg.buildRunInfo", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 84 }, { "content": " def hasMove(self, moveName):\n if moveName in self.algParams:\n return True\n return False", "metadata": "root.LearnAlg.hasMove", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 92 }, { "content": " def verify_evidence(self, evBound=0.00001, prevBound=0, lapFrac=None):\n ''' Compare current and previous evidence (ELBO) values,\n verify that (within numerical tolerance) increases monotonically\n '''\n if np.isnan(evBound):\n raise ValueError(\"Evidence should never be NaN\")\n if np.isinf(prevBound):\n return False\n isIncreasing = prevBound <= evBound\n M = self.algParams['convergeSigFig']\n isWithinTHR = closeAtMSigFigs(prevBound, evBound, M=M)\n mLPkey = 'doMemoizeLocalParams'\n if not isIncreasing and not isWithinTHR:\n serious = True\n if self.hasMove('birth') \\\n and (len(self.BirthCompIDs) > 0 or len(self.ModifiedCompIDs) > 0):\n warnMsg = 'ev decreased during a birth'\n warnMsg += ' (so monotonic increase not guaranteed)\\n'\n serious = False\n elif mLPkey in self.algParams and not self.algParams[mLPkey]:\n warnMsg = 'ev decreased when doMemoizeLocalParams=0'\n warnMsg += ' (so monotonic increase not guaranteed)\\n'\n serious = False\n else:\n warnMsg = 'evidence decreased!\\n'\n warnMsg += ' prev = % .15e\\n' % (prevBound)\n warnMsg += ' cur = % .15e\\n' % (evBound)\n if lapFrac is None:\n prefix = \"WARNING: \"\n else:\n prefix = \"WARNING @ %.3f: \" % (lapFrac)\n\n if serious or not self.algParams['doShowSeriousWarningsOnly']:\n Log.error(prefix + warnMsg)\n return isWithinTHR ", "metadata": "root.LearnAlg.verify_evidence", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 99 }, { "content": " def save_state(self, hmodel, iterid, lap, evBound, doFinal=False):\n ''' Save state of the hmodel's global parameters and evBound\n ''' \n traceEvery = self.outputParams['traceEvery']\n if traceEvery <= 0:\n traceEvery = -1\n doTrace = isEvenlyDivisibleFloat(lap, traceEvery) or iterid < 3\n \n if traceEvery > 0 and (doFinal or doTrace) and lap not in self.TraceLaps:\n # Record current evidence\n self.evTrace.append(evBound)\n self.TraceLaps.add(lap)\n\n # Exit here if we're not saving to disk\n if self.savedir is None:\n return\n \n # Record current state to plain-text files\n with open( self.mkfile('laps.txt'), 'a') as f: \n f.write('%.4f\\n' % (lap))\n with open( self.mkfile('evidence.txt'), 'a') as f: \n f.write('%.9e\\n' % (evBound))\n with open( self.mkfile('nObs.txt'), 'a') as f:\n f.write('%d\\n' % (self.nObsProcessed))\n with open( self.mkfile('times.txt'), 'a') as f:\n f.write('%.3f\\n' % (self.get_elapsed_time()))\n if self.hasMove('birth') or self.hasMove('merge'):\n with open( self.mkfile('K.txt'), 'a') as f:\n f.write('%d\\n' % (hmodel.obsModel.K))\n\n saveEvery = self.outputParams['saveEvery']\n if saveEvery <= 0 or self.savedir is None:\n return\n\n doSave = isEvenlyDivisibleFloat(lap, saveEvery) or iterid < 3\n if (doFinal or doSave) and iterid not in self.SavedIters:\n self.SavedIters.add(iterid)\n with open(self.mkfile('laps-saved-params.txt'), 'a') as f: \n f.write('%.4f\\n' % (lap))\n prefix = ModelWriter.makePrefixForLap(lap)\n ModelWriter.save_model(hmodel, self.savedir, prefix,\n doSavePriorInfo=(iterid<1), doLinkBest=True)", "metadata": "root.LearnAlg.save_state", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 138 }, { "content": " def mkfile(self, fname):\n return os.path.join(self.savedir, fname)", "metadata": "root.LearnAlg.mkfile", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 182 }, { "content": " def getFileWriteMode(self):\n if self.savedir is None:\n return None\n return 'a'", "metadata": "root.LearnAlg.getFileWriteMode", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 185 }, { "content": " def plot_results(self, hmodel, Data, LP):\n ''' Plot learned model parameters\n '''\n pass", "metadata": "root.LearnAlg.plot_results", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 192 }, { "content": " def print_state(self, hmodel, iterid, lap, evBound, doFinal=False, status='', rho=None):\n printEvery = self.outputParams['printEvery']\n if printEvery <= 0:\n return None\n doPrint = iterid < 3 or isEvenlyDivisibleFloat(lap, printEvery)\n \n if rho is None:\n rhoStr = ''\n else:\n rhoStr = '%.4f |' % (rho)\n\n if iterid == lap:\n lapStr = '%7d' % (lap)\n else:\n lapStr = '%7.3f' % (lap)\n\n maxLapStr = '%d' % (self.algParams['nLap'] + self.algParams['startLap'])\n \n logmsg = ' %s/%s after %6.0f sec. | K %4d | ev % .9e %s'\n # Print asterisk for early iterations of memoized,\n # before the method has made one full pass thru data\n if self.__class__.__name__.count('Memo') > 0:\n if lap < self.algParams['startLap'] + 1.0:\n logmsg = ' %s/%s after %6.0f sec. | K %4d |*ev % .9e %s'\n\n logmsg = logmsg % (lapStr, \n maxLapStr,\n self.get_elapsed_time(),\n hmodel.allocModel.K,\n evBound, \n rhoStr)\n\n if (doFinal or doPrint) and iterid not in self.PrintIters:\n self.PrintIters.add(iterid)\n Log.info(logmsg)\n if doFinal:\n Log.info('... done. %s' % (status))", "metadata": "root.LearnAlg.print_state", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 199 }, { "content": " def print_msg(self, msg):\n ''' Prints a string msg to stdout,\n without needing to import logging method into subclass. \n '''\n Log.info(msg)", "metadata": "root.LearnAlg.print_msg", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 237 }, { "content": " def isFirstBatch(self, lapFrac):\n ''' Returns True/False for whether given batch is last (for current lap)\n '''\n if self.lapFracInc == 1.0: # Special case, nBatch == 1\n isFirstBatch = True\n else:\n isFirstBatch = np.allclose(lapFrac - np.floor(lapFrac), self.lapFracInc)\n return isFirstBatch", "metadata": "root.LearnAlg.isFirstBatch", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 244 }, { "content": " def isLastBatch(self, lapFrac):\n ''' Returns True/False for whether given batch is last (for current lap)\n '''\n return lapFrac % 1 == 0", "metadata": "root.LearnAlg.isLastBatch", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 253 }, { "content": " def do_birth_at_lap(self, lapFrac):\n ''' Returns True/False for whether birth happens at given lap\n '''\n if 'birth' not in self.algParams:\n return False\n nLapTotal = self.algParams['nLap']\n frac = self.algParams['birth']['fracLapsBirth']\n if lapFrac > nLapTotal:\n return False\n return (nLapTotal <= 5) or (lapFrac <= np.ceil(frac * nLapTotal))", "metadata": "root.LearnAlg.do_birth_at_lap", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 258 }, { "content": " def eval_custom_func(self, hmodel, iterid, lapFrac):\n ''' Evaluates a custom hook function called customFunc.py in the path specified in algParams['customFuncPath']\n '''\n import ast\n customFuncPath = self.algParams['customFuncPath']\n customFuncArgs = self.algParams['customFuncArgs']\n nLapTotal = self.algParams['nLap']\n percentDone = lapFrac/nLapTotal\n if customFuncPath is not None and customFuncPath != 'None':\n import sys\n sys.path.append(customFuncPath)\n import customFunc\n if lapFrac % 1 != 0:\n customFunc.onBatchComplete(hmodel, percentDone , customFuncArgs)\n elif lapFrac % 1 == 0 and lapFrac < nLapTotal:\n customFunc.onLapComplete(hmodel, percentDone , customFuncArgs)\n else:\n customFunc.onAlgorithmComplete(hmodel, percentDone , customFuncArgs)", "metadata": "root.LearnAlg.eval_custom_func", "header": "['class', 'LearnAlg', '(', 'object', ')', ':', '___EOS___']", "index": 269 } ]
[ { "span": "import scipy.io", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Learn", "Alg", ".", "py", "\\", "10", ";", "Abstract", " ", "base", " ", "class", " ", "for", " ", "learn", "ing", " ", "algo", "rit", "hms", " ", "for", " ", "HM", "odel", " ", "model", "s", "\\", "10", ";", "\\", "10", ";", "Define", "s", " ", "some", " ", "gener", "ic", " ", "routin", "es", " ", "for", "\\", "10", ";", " ", " ", "*", " ", "saving", " ", "global", " ", "parameter", "s", "\\", "10", ";", " ", " ", "*", " ", "assess", "ing", " ", "convergence", "\\", "10", ";", " ", " ", "*", " ", "printin", "g", " ", "progress", " ", "update", "s", " ", "to", " ", "stdout", "\\", "10", ";", " ", " ", "*", " ", "record", "ing", " ", "run", "-", "time", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bn", "py_", "._", "iou", "til_", "import_", "Model", "Writer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bn", "py_", "._", "util_", "import_", "close", "At", "MS", "ig", "Fig", "s_", ",_", "is", "Even", "ly", "Divis", "ibl", "e", "Float_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "scipy_", "._", "io_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "bn", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Learn", "Alg", "_", "(_", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#########", " ", "Fc", "ns", " ", "for", " ", "birth", "/", "merges", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#########", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#########", " ", "Verify", " ", "evidence_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#########", " ", " ", "grow", "s", " ", "monotonic", "ally", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " ", " ", "Save", " ", "to", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Define", " ", "temporar", "y", " ", "function", " ", "tha", "t", " ", "create", "s", " ", "files", " ", "in", " ", "this", " ", "alg", "'", "s", " ", "output", " ", "dir_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " ", "Plot", " ", "Results_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " ", " ", "Print", " ", "State_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "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_", ",_", "saved", "ir_", "=_", "None_", ",_", "seed_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alg", "Params_", "=_", "dict_", "(_", ")_", ",_", "output", "Params_", "=_", "dict_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "Lap", "Complete", "Func_", "=_", "lambda_", ":_", "None_", ",_", "on", "Finish", "Func_", "=_", "lambda_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Construct", "s", " ", "and", " ", "return", "s", " ", "a", " ", "Learn", "Alg", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "saved", "ir_", ")_", "==_", "str_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "saved", "ir_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "saved", "ir_", ")_", "[_", "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 ", " _", "self_", "._", "saved", "ir_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "seed_", "=_", "int_", "(_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "PR", "NG_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "self_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "alg", "Params_", "=_", "alg", "Params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "output", "Params_", "=_", "output", "Params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Trace", "Lap", "s_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ev", "Trace_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Save", "d", "It", "ers_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Print", "It", "ers_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "Obs", "Processe", "d_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "alg", "Param", "s", "LP", "_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "alg", "Params_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "._", "count_", "(_", "'", "LP", "'_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "alg", "Param", "s", "LP", "_", "[_", "k_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "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_", "fit_", "(_", "self_", ",_", "hm", "odel_", ",_", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Execut", "e", " ", "learn", "ing", " ", "algo", "rit", "hm", " ", "for", " ", "hm", "odel", " ", "on", " ", "Data", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "is", " ", "extend", "ed", " ", "by", " ", "any", " ", "subclass", " ", "of", " ", "Learn", "Alg", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "LP", " ", ":", " ", "local", " ", "params", " ", "dictionar", "y", " ", "of", " ", "result", "ing", " ", "model", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "random", "\\u", "seed", "\\u", "at", "\\u", "lap", "_", "(_", "self_", ",_", "lap", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Set", " ", "internal", " ", "random", " ", "generat", "or", " ", "deterministic", "ally", "\\", "10", ";", " ", " ", "based", " ", "on", " ", "provided", " ", "seed", " ", "(", "unique", " ", "to", " ", "this", " ", "run", ")", " ", "and", " ", "\\", "10", ";", " ", " ", "the", " ", "number", " ", "of", " ", "pass", "es", " ", "thru", " ", "the", " ", "data", ",", "\\", "10", ";", " ", " ", "so", " ", "we", " ", "can", " ", "reproduce", " ", "runs", " ", "with", "out", " ", "startin", "g", " ", "over", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "Even", "ly", "Divis", "ibl", "e", "Float_", "(_", "lap", "_", ",_", "1.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "PR", "NG_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "self_", "._", "seed_", "+_", "int_", "(_", "lap", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "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_", "set\\u", "start", "\\u", "time", "\\u", "now_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Record", " ", "start", " ", "time", " ", "(", "in", " ", "second", "s", " ", "sinc", "e", " ", "197", "0", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "n", "Obs", "_", "(_", "self_", ",_", "n", "Obs", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Update", " ", "internal", " ", "count", " ", "of", " ", "total", " ", "number", " ", "of", " ", "data", " ", "observa", "tion", "s", " ", "process", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "lap", " ", "thru", " ", "dataset", " ", "of", " ", "size", " ", "N", ",", " ", "this", " ", "shou", "ld", " ", "be", " ", "update", "d", " ", "by", " ", "N", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "Obs", "Processe", "d_", "+=_", "n", "Obs", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "ela", "pse", "d\\u", "time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Return", "s", " ", "float", " ", "of", " ", "ela", "pse", "d", " ", "time", " ", "(", "in", " ", "second", "s", ")", " ", "sinc", "e", " ", "this", " ", "object", "'", "s", "\\", "10", ";", " ", " ", " ", " ", "set\\u", "start", "\\u", "time", "\\u", "now", "()", " ", "method", " ", "was", " ", "call", "ed", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "time_", "._", "time_", "(_", ")_", "-_", "self_", "._", "start", "\\u", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "Run", "Info_", "(_", "self_", ",_", "ev", "Bound_", ",_", "status_", ",_", "n", "Lap", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Creat", "e", " ", "dict", " ", "of", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "current", " ", "run", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dict_", "(_", "ev", "Bound_", "=_", "ev", "Bound_", ",_", "status_", "=_", "status_", ",_", "n", "Lap", "_", "=_", "n", "Lap", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ev", "Trace_", "=_", "self_", "._", "ev", "Trace_", ",_", "lap", "Trace_", "=_", "self_", "._", "Trace", "Lap", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "Move_", "(_", "self_", ",_", "move", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "move", "Name_", "in_", "self_", "._", "alg", "Params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "verify", "\\u", "evidence_", "(_", "self_", ",_", "ev", "Bound_", "=_", "0.00001", "_", ",_", "prev", "Bound_", "=_", "0_", ",_", "lap", "Frac", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Compare", " ", "current", " ", "and", " ", "previ", "ous", " ", "eviden", "ce", " ", "(", "EL", "BO", ")", " ", "values", ",", "\\", "10", ";", " ", " ", " ", " ", "verify", " ", "tha", "t", " ", "(", "within", " ", "numerical", " ", "tolera", "nce", ")", " ", "increase", "s", " ", "monotonic", "ally", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "np_", "._", "isnan_", "(_", "ev", "Bound_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Evi", "denc", "e", " ", "shou", "ld", " ", "neve", "r", " ", "be", " ", "Na", "N", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "np_", "._", "isinf", "_", "(_", "prev", "Bound_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "Inc", "rea", "sing", "_", "=_", "prev", "Bound_", "<=_", "ev", "Bound_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "M_", "=_", "self_", "._", "alg", "Params_", "[_", "'", "converg", "e", "Sig", "Fig", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "With", "in", "THR", "_", "=_", "close", "At", "MS", "ig", "Fig", "s_", "(_", "prev", "Bound_", ",_", "ev", "Bound_", ",_", "M_", "=_", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "LP", "key_", "=_", "'", "do", "Memo", "ize", "Local", "Param", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "is", "Inc", "rea", "sing", "_", "and_", "not_", "is", "With", "in", "THR", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "seri", "ous_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "has", "Move_", "(_", "'", "birth", "'_", ")_", "and_", "(_", "len_", "(_", "self_", "._", "Birth", "Comp", "ID", "s_", ")_", ">_", "0_", "or_", "len_", "(_", "self_", "._", "Modifie", "d", "Comp", "ID", "s_", ")_", ">_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warn", "Msg_", "=_", "'", "ev", " ", "decrease", "d", " ", "dur", "ing", " ", "a", " ", "birth", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn", "Msg_", "+=_", "'", " ", "(", "so", " ", "monotonic", " ", "increase", " ", "not", " ", "guaran", "tee", "d", ")\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seri", "ous_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "m", "LP", "key_", "in_", "self_", "._", "alg", "Params_", "and_", "not_", "self_", "._", "alg", "Params_", "[_", "m", "LP", "key_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warn", "Msg_", "=_", "'", "ev", " ", "decrease", "d", " ", "whe", "n", " ", "do", "Memo", "ize", "Local", "Param", "s", "=", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn", "Msg_", "+=_", "'", " ", "(", "so", " ", "monotonic", " ", "increase", " ", "not", " ", "guaran", "tee", "d", ")\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seri", "ous_", "=_", "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 ", " _", "warn", "Msg_", "=_", "'", "eviden", "ce", " ", "decrease", "d", "!\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "warn", "Msg_", "+=_", "'", " ", " ", " ", " ", "prev", " ", "=", " ", "%", " ", ".1", "5e", "\\\\", "n", "'_", "%_", "(_", "prev", "Bound_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn", "Msg_", "+=_", "'", " ", "cur", " ", "=", " ", "%", " ", ".1", "5e", "\\\\", "n", "'_", "%_", "(_", "ev", "Bound_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lap", "Frac", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "\"", "WARN", "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 ", " _", "prefix_", "=_", "\"", "WARN", "ING", " ", "@", " ", "%", ".3", "f", ":", " ", "\"_", "%_", "(_", "lap", "Frac", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "seri", "ous_", "or_", "not_", "self_", "._", "alg", "Params_", "[_", "'", "do", "Show", "Ser", "ious", "Warnings", "On", "ly", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log_", "._", "error_", "(_", "prefix_", "+_", "warn", "Msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "is", "With", "in", "THR", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "\\u", "state_", "(_", "self_", ",_", "hm", "odel_", ",_", "iter", "id_", ",_", "lap", "_", ",_", "ev", "Bound_", ",_", "do", "Final_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Save", " ", "state", " ", "of", " ", "the", " ", "hm", "odel", "'", "s", " ", "global", " ", "parameter", "s", " ", "and", " ", "ev", "Bound", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "trace", "Every", "_", "=_", "self_", "._", "output", "Params_", "[_", "'", "trace", "Every", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "trace", "Every", "_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "trace", "Every", "_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "do", "Trace_", "=_", "is", "Even", "ly", "Divis", "ibl", "e", "Float_", "(_", "lap", "_", ",_", "trace", "Every", "_", ")_", "or_", "iter", "id_", "<_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "trace", "Every", "_", ">_", "0_", "and_", "(_", "do", "Final_", "or_", "do", "Trace_", ")_", "and_", "lap", "_", "not_", "in_", "self_", "._", "Trace", "Lap", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Record", " ", "current", " ", "evidence_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ev", "Trace_", "._", "append_", "(_", "ev", "Bound_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Trace", "Lap", "s_", "._", "add_", "(_", "lap", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exi", "t", " ", "here", " ", "if", " ", "we", "'", "re", " ", "not", " ", "saving", " ", "to", " ", "disk_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "saved", "ir_", "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_", "#", " ", "Record", " ", "current", " ", "state", " ", "to", " ", "plain", "-", "text", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "mkf", "ile_", "(_", "'", "lap", "s", ".", "txt", "'_", ")_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "'%", ".4", "f", "\\\\", "n", "'_", "%_", "(_", "lap", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "mkf", "ile_", "(_", "'", "eviden", "ce", ".", "txt", "'_", ")_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "'%", ".9", "e", "\\\\", "n", "'_", "%_", "(_", "ev", "Bound_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "mkf", "ile_", "(_", "'", "n", "Obs", ".", "txt", "'_", ")_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "'%", "d", "\\\\", "n", "'_", "%_", "(_", "self_", "._", "n", "Obs", "Processe", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "mkf", "ile_", "(_", "'", "times", ".", "txt", "'_", ")_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "'%", ".3", "f", "\\\\", "n", "'_", "%_", "(_", "self_", "._", "get", "\\u", "ela", "pse", "d\\u", "time_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "has", "Move_", "(_", "'", "birth", "'_", ")_", "or_", "self_", "._", "has", "Move_", "(_", "'", "merge", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "self_", "._", "mkf", "ile_", "(_", "'", "K", ".", "txt", "'_", ")_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "'%", "d", "\\\\", "n", "'_", "%_", "(_", "hm", "odel_", "._", "obs", "Model_", "._", "K_", ")_", ")_", "\\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_", "save", "Every", "_", "=_", "self_", "._", "output", "Params_", "[_", "'", "save", "Every", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "save", "Every", "_", "<=_", "0_", "or_", "self_", "._", "saved", "ir_", "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_", "do", "Save_", "=_", "is", "Even", "ly", "Divis", "ibl", "e", "Float_", "(_", "lap", "_", ",_", "save", "Every", "_", ")_", "or_", "iter", "id_", "<_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "do", "Final_", "or_", "do", "Save_", ")_", "and_", "iter", "id_", "not_", "in_", "self_", "._", "Save", "d", "It", "ers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Save", "d", "It", "ers_", "._", "add_", "(_", "iter", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "mkf", "ile_", "(_", "'", "lap", "s", "-", "saved", "-", "params", ".", "txt", "'_", ")_", ",_", "'", "a", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "'%", ".4", "f", "\\\\", "n", "'_", "%_", "(_", "lap", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prefix_", "=_", "Model", "Writer_", "._", "make", "Pref", "ix", "For", "Lap", "_", "(_", "lap", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Model", "Writer_", "._", "save", "\\u", "model_", "(_", "hm", "odel_", ",_", "self_", "._", "saved", "ir_", ",_", "prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "do", "Save", "Prior", "Info_", "=_", "(_", "iter", "id_", "<_", "1_", ")_", ",_", "do", "Link", "Bes", "t_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "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_", "mkf", "ile_", "(_", "self_", ",_", "fname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "saved", "ir_", ",_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "File", "Write", "Mode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "saved", "ir_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'", "a", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "results_", "(_", "self_", ",_", "hm", "odel_", ",_", "Data_", ",_", "LP", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Plot", " ", "learned", " ", "model", " ", "parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "state_", "(_", "self_", ",_", "hm", "odel_", ",_", "iter", "id_", ",_", "lap", "_", ",_", "ev", "Bound_", ",_", "do", "Final_", "=_", "False_", ",_", "status_", "=_", "''_", ",_", "rho_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "Every", "_", "=_", "self_", "._", "output", "Params_", "[_", "'", "print", "Every", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "print", "Every", "_", "<=_", "0_", ":_", "\\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_", "do", "Print_", "=_", "iter", "id_", "<_", "3_", "or_", "is", "Even", "ly", "Divis", "ibl", "e", "Float_", "(_", "lap", "_", ",_", "print", "Every", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rho_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rho", "Str_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rho", "Str_", "=_", "'%", ".4", "f", " ", "|'_", "%_", "(_", "rho_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "iter", "id_", "==_", "lap", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lap", "Str_", "=_", "'%", "7d", "'_", "%_", "(_", "lap", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lap", "Str_", "=_", "'%", "7.3", "f", "'_", "%_", "(_", "lap", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "max", "Lap", "Str_", "=_", "'%", "d", "'_", "%_", "(_", "self_", "._", "alg", "Params_", "[_", "'", "n", "Lap", "'_", "]_", "+_", "self_", "._", "alg", "Params_", "[_", "'", "start", "Lap", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logm", "sg_", "=_", "'", " ", " ", "%", "s", "/", "%", "s", " ", "after", " ", "%", "6.0", "f", " ", "sec", ".", " ", "|", " ", "K", " ", "%", "4d", " ", "|", " ", "ev", " ", "%", " ", ".9", "e", " ", "%", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Print", " ", "aster", "isk", " ", "for", " ", "ear", "ly", " ", "iterati", "ons", " ", "of", " ", "memoized", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "bef", "ore", " ", "the", " ", "method", " ", "has", " ", "made", " ", "one", " ", "full", " ", "pass", " ", "thru", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "._", "count_", "(_", "'", "Memo", "'_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lap", "_", "<_", "self_", "._", "alg", "Params_", "[_", "'", "start", "Lap", "'_", "]_", "+_", "1.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logm", "sg_", "=_", "'", " ", " ", "%", "s", "/", "%", "s", " ", "after", " ", "%", "6.0", "f", " ", "sec", ".", " ", "|", " ", "K", " ", "%", "4d", " ", "|", "*", "ev", " ", "%", " ", ".9", "e", " ", "%", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logm", "sg_", "=_", "logm", "sg_", "%_", "(_", "lap", "Str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "Lap", "Str_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "get", "\\u", "ela", "pse", "d\\u", "time_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hm", "odel_", "._", "allo", "c", "Model_", "._", "K_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ev", "Bound_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rho", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "do", "Final_", "or_", "do", "Print_", ")_", "and_", "iter", "id_", "not_", "in_", "self_", "._", "Print", "It", "ers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Print", "It", "ers_", "._", "add_", "(_", "iter", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log_", "._", "info_", "(_", "logm", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "do", "Final_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Log_", "._", "info_", "(_", "'...", " ", "don", "e", ".", " ", "%", "s", "'_", "%_", "(_", "status_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "msg_", "(_", "self_", ",_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Print", "s", " ", "a", " ", "string", " ", "msg", " ", "to", " ", "stdout", ",", "\\", "10", ";", " ", " ", " ", " ", "with", "out", " ", "need", "ing", " ", "to", " ", "import", " ", "logg", "ing", " ", "method", " ", "int", "o", " ", "subclass", ".", " ", "\\", "10", ";", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Log_", "._", "info_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Fi", "rst", "Batch_", "(_", "self_", ",_", "lap", "Frac", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Return", "s", " ", "Tru", "e", "/", "Fal", "se", " ", "for", " ", "whe", "ther", " ", "give", "n", " ", "batch", " ", "is", " ", "last", " ", "(", "for", " ", "current", " ", "lap", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "lap", "Frac", "Inc", "_", "==_", "1.0_", ":_", "#", " ", "Special", " ", "case", ",", " ", "n", "Bat", "ch", " ", "==", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "Fi", "rst", "Batch_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "Fi", "rst", "Batch_", "=_", "np_", "._", "allclose_", "(_", "lap", "Frac", "_", "-_", "np_", "._", "floor_", "(_", "lap", "Frac", "_", ")_", ",_", "self_", "._", "lap", "Frac", "Inc", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "is", "Fi", "rst", "Batch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "Las", "t", "Batch_", "(_", "self_", ",_", "lap", "Frac", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Return", "s", " ", "Tru", "e", "/", "Fal", "se", " ", "for", " ", "whe", "ther", " ", "give", "n", " ", "batch", " ", "is", " ", "last", " ", "(", "for", " ", "current", " ", "lap", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "lap", "Frac", "_", "%_", "1_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "birth", "\\u", "at", "\\u", "lap", "_", "(_", "self_", ",_", "lap", "Frac", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Return", "s", " ", "Tru", "e", "/", "Fal", "se", " ", "for", " ", "whe", "ther", " ", "birth", " ", "happ", "ens", " ", "at", " ", "give", "n", " ", "lap", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "birth", "'_", "not_", "in_", "self_", "._", "alg", "Params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n", "Lap", "Total_", "=_", "self_", "._", "alg", "Params_", "[_", "'", "n", "Lap", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frac_", "=_", "self_", "._", "alg", "Params_", "[_", "'", "birth", "'_", "]_", "[_", "'", "frac", "Lap", "s", "Birth", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lap", "Frac", "_", ">_", "n", "Lap", "Total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "n", "Lap", "Total_", "<=_", "5_", ")_", "or_", "(_", "lap", "Frac", "_", "<=_", "np_", "._", "ceil_", "(_", "frac_", "*_", "n", "Lap", "Total_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Learn", "Alg", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "eval", "\\u", "custom", "\\u", "func_", "(_", "self_", ",_", "hm", "odel_", ",_", "iter", "id_", ",_", "lap", "Frac", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Evaluate", "s", " ", "a", " ", "custom", " ", "hook", " ", "function", " ", "call", "ed", " ", "custom", "Func", ".", "py", " ", "in", " ", "the", " ", "path", " ", "specified", " ", "in", " ", "alg", "Param", "s", "['", "custom", "Func", "Path", "']", "\\", "10", ";", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "Func", "Path_", "=_", "self_", "._", "alg", "Params_", "[_", "'", "custom", "Func", "Path", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "Func", "Args_", "=_", "self_", "._", "alg", "Params_", "[_", "'", "custom", "Func", "Arg", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "Lap", "Total_", "=_", "self_", "._", "alg", "Params_", "[_", "'", "n", "Lap", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percent", "Done_", "=_", "lap", "Frac", "_", "/_", "n", "Lap", "Total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "custom", "Func", "Path_", "is_", "not_", "None_", "and_", "custom", "Func", "Path_", "!=_", "'", "Non", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "custom", "Func", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "custom", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lap", "Frac", "_", "%_", "1_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "custom", "Func_", "._", "on", "Bat", "ch", "Complete_", "(_", "hm", "odel_", ",_", "percent", "Done_", ",_", "custom", "Func", "Args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "lap", "Frac", "_", "%_", "1_", "==_", "0_", "and_", "lap", "Frac", "_", "<_", "n", "Lap", "Total_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "custom", "Func_", "._", "on", "Lap", "Complete_", "(_", "hm", "odel_", ",_", "percent", "Done_", ",_", "custom", "Func", "Args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
open-cloud/xos/xos/tosca/resources/dashboardview.py
[ { "content": "import os\nimport pdb\nimport sys\nimport tempfile\nsys.path.append(\"/opt/tosca\")\nfrom translator.toscalib.tosca_template import ToscaTemplate\n\nfrom core.models import DashboardView, Site, Deployment, SiteDeployment\n\nfrom xosresource import XOSResource\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class XOSDashboardView(XOSResource):\n provides = \"tosca.nodes.DashboardView\"\n xos_model = DashboardView\n copyin_props = [\"url\",\"enabled\"]\n\n\n", "metadata": "root.XOSDashboardView", "header": "['module', '___EOS___']", "index": 11 }, { "content": " def get_xos_args(self):\n return super(XOSDashboardView, self).get_xos_args()", "metadata": "root.XOSDashboardView.get_xos_args", "header": "['class', 'XOSDashboardView', '(', 'XOSResource', ')', ':', '___EOS___']", "index": 16 }, { "content": " def postprocess(self, obj):\n for deployment_name in self.get_requirements(\"tosca.relationships.SupportsDeployment\"):\n deployment = self.get_xos_object(Deployment, deployment_name)\n if not deployment in obj.deployments.all():\n print \"attaching dashboardview %s to deployment %s\" % (obj, deployment)\n obj.deployments.add(deployment)\n obj.save()", "metadata": "root.XOSDashboardView.postprocess", "header": "['class', 'XOSDashboardView', '(', 'XOSResource', ')', ':', '___EOS___']", "index": 19 }, { "content": " def can_delete(self, obj):\n return super(XOSDashboardView, self).can_delete(obj)", "metadata": "root.XOSDashboardView.can_delete", "header": "['class', 'XOSDashboardView', '(', 'XOSResource', ')', ':', '___EOS___']", "index": 27 } ]
[ { "span": "import os", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 9 }, { "span": "import pdb", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 10 }, { "span": "import tempfile", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 15 }, { "span": "from translator.toscalib.tosca_template import ToscaTemplate", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 60 }, { "span": "from core.models import DashboardView, Site, Deployment, SiteDeployment", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 71 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pdb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "append_", "(_", "\"/", "opt", "/", "tosc", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "translator_", "._", "tosc", "ali", "b_", "._", "tosc", "a", "\\u", "template_", "import_", "Tos", "ca", "Template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "core_", "._", "models_", "import_", "Dash", "board", "View_", ",_", "Site_", ",_", "Deployment", "_", ",_", "Site", "Deployment", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "xo", "sre", "source_", "import_", "XO", "SR", "esource", "_", "\\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_", "XO", "SD", "ash", "board", "View_", "(_", "XO", "SR", "esource", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provides_", "=_", "\"", "tosc", "a", ".", "nodes", ".", "Dash", "board", "View", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xo", "s", "\\u", "model_", "=_", "Dash", "board", "View_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy", "in", "\\u", "props_", "=_", "[_", "\"", "url", "\"_", ",_", "\"", "enable", "d", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "XO", "SD", "ash", "board", "View_", "(_", "XO", "SR", "esource", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "xo", "s", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "XO", "SD", "ash", "board", "View_", ",_", "self_", ")_", "._", "get", "\\u", "xo", "s", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XO", "SD", "ash", "board", "View_", "(_", "XO", "SR", "esource", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "postprocess", "_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "deploy", "ment", "\\u", "name_", "in_", "self_", "._", "get", "\\u", "requirements_", "(_", "\"", "tosc", "a", ".", "relation", "ships", ".", "Supp", "orts", "Deployment", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deployment_", "=_", "self_", "._", "get", "\\u", "xo", "s", "\\u", "object_", "(_", "Deployment", "_", ",_", "deploy", "ment", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "deployment_", "in_", "obj_", "._", "deployments", "_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "attach", "ing", " ", "dash", "board", "view", " ", "%", "s", " ", "to", " ", "deploy", "ment", " ", "%", "s", "\"_", "%_", "(_", "obj_", ",_", "deployment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "deployments", "_", "._", "add_", "(_", "deployment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "XO", "SD", "ash", "board", "View_", "(_", "XO", "SR", "esource", "_", ")_", ":_", "\\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_", "can", "\\u", "delete_", "(_", "self_", ",_", "obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "XO", "SD", "ash", "board", "View_", ",_", "self_", ")_", "._", "can", "\\u", "delete_", "(_", "obj_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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